diff -Naur clinkc/bootstrap clinkc_patch/bootstrap --- clinkc/bootstrap 2010-02-24 00:26:21.000000000 +0800 +++ clinkc_patch/bootstrap 1970-01-01 08:00:00.000000000 +0800 @@ -1,12 +0,0 @@ -#!/bin/sh -if [ ! -d config ]; then - mkdir config -fi -if [ ! -d autom4te.cache ]; then - rm -rf autom4te.cache/* -fi -libtoolize --automake --force --copy -aclocal -autoheader -automake --foreign --add-missing --copy -autoconf diff -Naur clinkc/ChangeLog clinkc_patch/ChangeLog --- clinkc/ChangeLog 2011-09-16 01:40:15.000000000 +0800 +++ clinkc_patch/ChangeLog 2014-01-29 13:54:26.398322404 +0800 @@ -1,3 +1,15 @@ +2012-01-16 Satoshi Konno + * Improved cg_upnp_service_get*url() to return the absolute URL more correctly. + * Fixed cg_net_uri_setvalue() to parse correctly when the specified path is null. + +2011-12-01 Satoshi Konno + * Added a following control point sample for Objective-C on iOS. + sample/upnpbrowser/ios/upnpbrowser.xcodeproj + +2011-09-21 Satoshi Konno + * Fixed cupnp_function.c to compile normally on iOS platforms. + * Fixed some memory leaks for Objective-C. + 2011-09-16 Satoshi Konno * 2.4 diff -Naur clinkc/clinkc.pc.in clinkc_patch/clinkc.pc.in --- clinkc/clinkc.pc.in 2005-10-31 21:52:54.000000000 +0800 +++ clinkc_patch/clinkc.pc.in 1970-01-01 08:00:00.000000000 +0800 @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: clinkc -Description: CyberLink for C UPnP library -Version: @VERSION@ -Requires: -Libs: -L@libdir@ -lclinkc -Cflags: -I${includedir} diff -Naur clinkc/config/compile clinkc_patch/config/compile --- clinkc/config/compile 2010-08-17 20:17:14.000000000 +0800 +++ clinkc_patch/config/compile 1970-01-01 08:00:00.000000000 +0800 @@ -1,143 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2009-10-06.20; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 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 -# . - -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 $? - ;; -esac - -ofile= -cfile= -eat= - -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: diff -Naur clinkc/config/depcomp clinkc_patch/config/depcomp --- clinkc/config/depcomp 2010-02-03 04:25:14.000000000 +0800 +++ clinkc_patch/config/depcomp 1970-01-01 08:00:00.000000000 +0800 @@ -1,630 +0,0 @@ -#! /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: diff -Naur clinkc/config/install-sh clinkc_patch/config/install-sh --- clinkc/config/install-sh 2010-02-03 04:25:14.000000000 +0800 +++ clinkc_patch/config/install-sh 1970-01-01 08:00:00.000000000 +0800 @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.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 - 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 - 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 - trap '(exit $?); exit' 1 2 13 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 starting with `-'. - 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 - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $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 -z "$d" && 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: diff -Naur clinkc/config/ltmain.sh clinkc_patch/config/ltmain.sh --- clinkc/config/ltmain.sh 2010-02-03 04:25:14.000000000 +0800 +++ clinkc_patch/config/ltmain.sh 1970-01-01 08:00:00.000000000 +0800 @@ -1,8413 +0,0 @@ -# Generated from ltmain.m4sh. - -# ltmain.sh (GNU libtool) 2.2.6 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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 -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long 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. -# 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.2.6 Debian-2.2.6a-4 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION="2.2.6 Debian-2.2.6a-4" -TIMESTAMP="" -package_revision=1.3012 - -# 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 - -# NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -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 - -$lt_unset CDPATH - - - - - -: ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${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_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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` -} - -# Generated shell functions inserted here. - -# 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" - -# The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: -func_dirname_and_basename "$progpath" -progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac - -# 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=: - 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' - -# 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${mode+: }$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_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname${mode+: }$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 "X$my_directory_path" | $Xsed -e "$dirname"` - done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e '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 "X$my_tmpdir" | $Xsed -} - - -# 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 "X$1" | $Xsed -e "$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 "X$1" | $Xsed \ - -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_version -# Echo version message to standard output and exit. -func_version () -{ - $SED -n '/^# '$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 () -{ - $SED -n '/^# Usage:/,/# -h/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - $ECHO - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help -# Echo long help message to standard output and exit. -func_help () -{ - $SED -n '/^# Usage:/,/# Report bugs to/ { - 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 --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ - p - }' < "$progpath" - exit $? -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - func_error "missing argument for $1" - exit_cmd=exit -} - -exit_cmd=: - - - - - -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </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 -} - -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. -{ - - # 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 - - # Parse non-mode specific arguments: - while test "$#" -gt 0; do - opt="$1" - shift - - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" - func_echo "enabling shell trace mode" - opt_debug='set -x' - $opt_debug - ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift - ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 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 - - mode="$1" - shift - ;; - - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here - shift - ;; - - # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} - shift - ;; - - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break - ;; - esac - done - - - 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_duplicate_deps - ;; - esac - - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} - -# 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 -} - - -## ----------- ## -## Main. ## -## ----------- ## - -$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 - - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$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=$mode' for more information." -} - - -# 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_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi -} - -# 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_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_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - 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 "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; - # 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_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) - # 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 <?"'"'"' &()|`$[]' \ - && 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 "X$srcfile" | $Xsed -e 's%^.*/%%' -e '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 - removelist="$removelist $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - 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 - command="$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 - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$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 "$mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $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 building PIC objects only - -prefer-non-pic try to building 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 - -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 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 - -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 - -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 \`$mode'" - ;; - esac - - $ECHO - $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? -} - - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help - - -# 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 $execute_dlfiles; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - # 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 - dir="$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 - -*) ;; - *) - # 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_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" - 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 "$mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - 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" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - $ECHO "X----------------------------------------------------------------------" | $Xsed - $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 "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS -} - -test "$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. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; 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" - install_prog="$install_prog$func_quote_for_eval_result" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - install_prog="$install_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 -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. - staticlibs="$staticlibs $file" - ;; - - *.la) - # 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 "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -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 "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "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_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" && staticlibs="$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 "X$lib" | $Xsed -e '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 "X$relink_command" | $Xsed -e '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 "X$file$stripped_ext" | $Xsed -e "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_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $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 "$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 - -/* 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 "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $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" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - 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; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -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) ;; - *) symtab_cflags="$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 "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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. -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 - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | - $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_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' - 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 | $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 | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - - -# func_emit_wrapper_part1 [arg=no] -# -# Emit the first part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part1 () -{ - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 - fi - - $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. -Xsed='${SED} -e 1s/^X//' -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 - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $ECHO "\ - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done -" -} -# end: func_emit_wrapper_part1 - -# func_emit_wrapper_part2 [arg=no] -# -# Emit the second part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part2 () -{ - func_emit_wrapper_part2_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part2_arg1=$1 - fi - - $ECHO "\ - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_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 \"X\$thisdir\" | \$Xsed -e '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" - - # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 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\ -" -} -# end: func_emit_wrapper_part2 - - -# 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=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - # split this up so that func_emit_cwrapperexe_src - # can call each part independently. - func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" - func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" -} - - -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_path_tmp1=`( cmd //c echo "$1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_tmp1=`cygpath -w "$1"` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result="" - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path - -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# 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. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # 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_to_host_pathlist_tmp2="$1" - # Once set for this call, this variable should not be - # reassigned. It is used in tha fallback case. - func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e 's|^:*||' -e 's|:*$||'` - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" - fi - fi - fi - IFS=: - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result" ; then - func_error "Could not determine the host path(s) corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist - -# 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 -# define setmode _setmode -#else -# include -# include -# ifdef __CYGWIN__ -# include -# define HAVE_SETENV -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#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 - -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - -#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 */ - -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - -#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) - -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} -#else -# define LTWRAPPER_DEBUGPRINTF(args) -#endif - -const char *program_name = NULL; - -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_fatal (const char *message, ...); -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_opt_process_env_set (const char *arg); -void lt_opt_process_env_prepend (const char *arg); -void lt_opt_process_env_append (const char *arg); -int lt_split_name_value (const char *arg, char** name, char** value); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); - -static const char *script_text_part1 = -EOF - - func_emit_wrapper_part1 yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - cat <"))); - for (i = 0; i < newargc; i++) - { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); - } - -EOF - - case $host_os in - mingw*) - cat <<"EOF" - /* execv doesn't actually work on mingw as expected on unix */ - rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); - if (rval == -1) - { - /* failed to start process */ - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); - return 127; - } - return rval; -EOF - ;; - *) - cat <<"EOF" - execv (lt_argv_zero, newargz); - return rval; /* =127, but avoids unused variable warning */ -EOF - ;; - esac - - cat <<"EOF" -} - -void * -xmalloc (size_t num) -{ - void *p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), - string) : NULL; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char) name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable (const char *path) -{ - struct stat st; - - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 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; - - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); - 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; - - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); - - 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 ("getcwd failed"); - 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 ("getcwd failed"); - 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) - { - LTWRAPPER_DEBUGPRINTF (("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 - { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal ("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; -} - -static void -lt_error_core (int exit_status, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} - -void -lt_setenv (const char *name, const char *value) -{ - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", - (name ? name : ""), - (value ? 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; -} - -int -lt_split_name_value (const char *arg, char** name, char** value) -{ - const char *p; - int len; - if (!arg || !*arg) - return 1; - - p = strchr (arg, (int)'='); - - if (!p) - return 1; - - *value = xstrdup (++p); - - len = strlen (arg) - strlen (*value); - *name = XMALLOC (char, len); - strncpy (*name, arg, len-1); - (*name)[len - 1] = '\0'; - - return 0; -} - -void -lt_opt_process_env_set (const char *arg) -{ - char *name = NULL; - char *value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); - } - - lt_setenv (name, value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_prepend (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_append (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 1); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? 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) -{ - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? 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 -} -# end: func_emit_cwrapperexe_src - -# 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 - 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 - 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 - dlfiles="$dlfiles $arg" - else - dlprefiles="$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 "*) ;; - *) deplibs="$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 -# moreargs="$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 - dlfiles="$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. - dlprefiles="$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 "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - weak_libs="$weak_libs $arg" - prev= - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$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 - ;; - - -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" - dir=$func_stripname_result - if test -z "$dir"; 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 - # 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 "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$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*) - # 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 - deplibs="$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 - deplibs="$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) - compiler_flags="$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) - compiler_flags="$compiler_flags $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) new_inherited_linker_flags="$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_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$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" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$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" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$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" - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - objs="$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 - dlfiles="$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. - dlprefiles="$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. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - 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 \"X\${$shlibpath_var}\" \| \$Xsed -e \'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" - # 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_duplicate_deps ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$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 "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$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%" - test "X$link_all_deplibs" != Xno && libs="$libs $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= - case $lib in - *.la) func_source "$lib" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` - case " $weak_libs " in - *" $deplib_base "*) ;; - *) deplibs="$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) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) new_inherited_linker_flags="$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 "*) ;; - * ) new_inherited_linker_flags="$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" - newlib_search_path="$newlib_search_path $func_stripname_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" - newlib_search_path="$newlib_search_path $func_stripname_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - dir=$func_stripname_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$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 \"X$deplib\"" 2>/dev/null | $Xsed -e 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. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$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 "X$inherited_linker_flags" | $Xsed -e '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 "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e '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" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$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. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - 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. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$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 "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$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 - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$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 - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$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" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - 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 - newlib_search_path="$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" - newlib_search_path="$newlib_search_path $func_stripname_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_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$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:"*) ;; - *) temp_rpath="$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 "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$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 - notinst_deplibs="$notinst_deplibs $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - notinst_deplibs="$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 "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$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 "$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$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$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:"*) ;; - *) compile_shlibpath="$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:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$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:"*) ;; - *) finalize_shlibpath="$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 - [\\/]*) - add_dir="$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 "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$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" - if $opt_duplicate_deps ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - 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_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 - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$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 "X $new_inherited_linker_flags" | $Xsed -e '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 "*) ;; - *) lib_search_path="$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 "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$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 - tmp_libs="$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" - objs="$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!" - libobjs="$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 - 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|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 - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - 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) - 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. - verstring="$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" - libobjs="$libobjs $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$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 - removelist="$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 - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "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 - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$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 "*) ;; - *) dlfiles="$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 "*) ;; - *) dlprefiles="$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*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$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 - deplibs="$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` - 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 "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$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. - newdeplibs="$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 "*) - newdeplibs="$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 \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$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. - newdeplibs="$newdeplibs $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e '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 "X $tmp_deplibs" | $Xsed -e "s,$i,,"` - done - fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $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 - fi - ;; - 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 "X $newdeplibs" | $Xsed -e '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 "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e '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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$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 - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$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 - 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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$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" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$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 "$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 - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$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" - delfiles="$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 cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - func_show_eval "$cmd" 'exit $?' - 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 "X$include_expsyms" | $Xsed | $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 - delfiles="$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 "*) ;; - *) - tmp_deplibs="$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" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$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\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$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 - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` - - # 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 - $ECHO "$obj" >> $output - done - $ECHO ')' >> $output - delfiles="$delfiles $output" - 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 - $ECHO "$obj" >> $output - done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" - 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. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$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~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - delfiles="$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 "$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 "X$include_expsyms" | $Xsed | $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 - delfiles="$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" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - libobjs="$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 "$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 "$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 "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$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 "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$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 "*) ;; - *) finalize_rpath="$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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$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;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$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 "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$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 - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *cegcc) - # Disable wrappers for cegcc, we are cross compiling anyway. - wrappers_required=no - ;; - *) - 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 "X$compile_command" | $Xsed -e '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=$?' - - # 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 - rpath="$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 - rpath="$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 "X$link_command" | $Xsed -e '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 $?' - 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 "X$compile_var$compile_command$compile_rpath" | $Xsed -e '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 "X$link_command" | $Xsed -e '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 $?' - - # 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$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 - oldobjs="$oldobjs $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$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" - generated="$generated $gentop" - - func_extract_archives $gentop $dlprefiles - oldobjs="$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" - generated="$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" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - 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 - 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 "X$relink_command" | $Xsed -e "$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" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$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" - newdlfiles="$newdlfiles $libdir/$name" - ;; - *) newdlfiles="$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" - newdlprefiles="$newdlprefiles $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 - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - 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 "$mode" = link || test "$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) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - 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 - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${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 - rmfiles="$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 - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$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 - rmfiles="$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 - rmfiles="$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 - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - objdir="$origobjdir" - - # 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 "$mode" = uninstall || test "$mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$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 - diff -Naur clinkc/config/missing clinkc_patch/config/missing --- clinkc/config/missing 2010-02-03 04:25:14.000000000 +0800 +++ clinkc_patch/config/missing 1970-01-01 08:00:00.000000000 +0800 @@ -1,376 +0,0 @@ -#! /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: diff -Naur clinkc/config.h.in clinkc_patch/config.h.in --- clinkc/config.h.in 2010-08-17 20:15:44.000000000 +0800 +++ clinkc_patch/config.h.in 1970-01-01 08:00:00.000000000 +0800 @@ -1,181 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* LIBCURL */ -#undef CG_HTTP_CURL - -/* LIBXML2 */ -#undef CG_XMLPARSER_LIBXML2 - -/* 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_EXPAT_EXPAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_EXPAT_H - -/* Define to 1 if you have the `fopen' function. */ -#undef HAVE_FOPEN - -/* Define to 1 if you have the `getifaddrs' function. */ -#undef HAVE_GETIFADDRS - -/* Define to 1 if you have the `gmtime_r' function. */ -#undef HAVE_GMTIME_R - -/* Define to 1 if you have the `iconv' function. */ -#undef HAVE_ICONV - -/* Define to 1 if you have the header file. */ -#undef HAVE_ICONV_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IFADDRS_H - -/* Define to 1 if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* IP_PKTINFO */ -#undef HAVE_IP_PKTINFO - -/* Define to 1 if you have the `expat' library (-lexpat). */ -#undef HAVE_LIBEXPAT - -/* Define to 1 if you have the `iconv' library (-liconv). */ -#undef HAVE_LIBICONV - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - -/* Define to 1 if you have the `uuid' library (-luuid). */ -#undef HAVE_LIBUUID - -/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ -#undef HAVE_LIBWS2_32 - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* LONGLONG */ -#undef HAVE_LONGLONG - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* 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 header file. */ -#undef HAVE_PTHREAD_H - -/* Define to 1 if you have the `realpath' function. */ -#undef HAVE_REALPATH - -/* SIOCGIFHWADDR */ -#undef HAVE_SIOCGIFHWADDR - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - -/* SOCKADDR_DL */ -#undef HAVE_SOCKADDR_DL - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* SOCKLEN_T */ -#undef HAVE_SOCKLEN_T - -/* SO_NOSIGPIPES */ -#undef HAVE_SO_NOSIGPIPE - -/* 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 `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_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 `uname' function. */ -#undef HAVE_UNAME - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UUID_UUID_H - -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - -/* 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 - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif diff -Naur clinkc/configure clinkc_patch/configure --- clinkc/configure 2010-08-17 20:15:44.000000000 +0800 +++ clinkc_patch/configure 1970-01-01 08:00:00.000000000 +0800 @@ -1,7508 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65. -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. -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 \$(( 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. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$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 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_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 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=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi - $as_echo "$as_me: error: $1" >&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'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# 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= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="include/cybergarage/typedef.h" -# 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 -LIBOBJS -HTTP_LIBS -HTTP_CFLAGS -CLOG_DEBUG_FLAGS -XML_LIBS -XML_CFLAGS -EGREP -GREP -CXXCPP -HAVE_LIBTOOL_FALSE -HAVE_LIBTOOL_TRUE -am__fastdepCXX_FALSE -am__fastdepCXX_TRUE -CXXDEPMODE -ac_ct_CXX -CXXFLAGS -CXX -RANLIB -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 -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_libtool -with_timings -enable_libxml2 -enable_compiler_warnings -enable_clog_debug -enable_clog_debug_stack -enable_clog_debug_application -enable_coverage -with_thread_lock_trace -enable_persistent_connections -enable_optimized_cp -enable_anyaddr -enable_cfile -enable_libcurl -enable_mudflap_debug -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC -CXXCPP' - - -# 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}' -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=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 this package 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/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - - 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 - --enable-libxml2 enable Libxml2 support (default = no) - --enable-compiler-warnings - enable compiler warnings (default = yes) - --enable-clog-debug enable common clog debug messages (default = no) - --enable-clog-debug-stack - enable clog stack debug messages (default = no) - --enable-clog-debug-application - enable clog application debug messages (default = - no) - --enable-coverage enable coverage (default = no) - --enable-persistent-connections - enable persistent connections support (default = - yes) - --enable-optimized-cp enable optimized control point mode (default = no) - --enable-anyaddr enables the usage of IPV4_ADDRANY instead of - registering an explicit server for each interface - (default = yes) - --enable-cfile enable file functions (default = no) - --enable-openssl enable file functions (default = no) - --enable-libcurl enable Libcurl support (default = no) - --enable-mudflap-debug enable libmudflap debug (default = no) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-libtool use libtool to build the library (default = yes) - --with-timings show timings in debug-info (default = no) - --with-thread-lock-trace - Trace thread locking and fail fast on errors, errors - can be found also from /tmp/cg_td_* (default = no) - -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 - CXX C++ compiler command - CXXFLAGS C++ compiler flags - 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 -configure -generated by GNU Autoconf 2.65 - -Copyright (C) 2009 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# 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 || - $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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# 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; } >/dev/null && { - 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_cxx_try_run LINENO -# ------------------------ -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_cxx_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_run - -# ac_fn_cxx_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_cxx_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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_cxx_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_cxx_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err 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_cxx_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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_cxx_check_header_mongrel - -# ac_fn_cxx_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_cxx_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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_cxx_check_header_compile - -# ac_fn_cxx_check_func LINENO FUNC VAR -# ------------------------------------ -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_cxx_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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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_cxx_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_cxx_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.65. 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 - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - 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 - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - 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 - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - 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 - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - 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 - ac_site_file1=$CONFIG_SITE -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" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_aux_dir= -for ac_dir in config "$srcdir"/config; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done -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. - - - -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 test "${ac_cv_path_install+set}" = set; 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 test "${ac_cv_prog_STRIP+set}" = set; 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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; 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 test "${ac_cv_path_mkdir+set}" = set; 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 test "${ac_cv_prog_AWK+set}" = set; 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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; 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=clinkc - VERSION=2.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 -' - - - - - -ac_config_headers="$ac_config_headers config.h" - - -############################## -# Constants -############################## - -# Expat version. -EXPAT_VERSION=1.95 - -# Libxml2 version. -LIBXML2_VERSION=2.6.0 - -#Libcurl version -LIBCURL3_VERSION=7.13.0 - -############################## -# Checks for programs. -############################## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_CC+set}" = set; 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; 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_set_status 77 -as_fn_error "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 test "${ac_cv_objext+set}" = set; 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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; 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 test "${ac_cv_prog_cc_c89+set}" = set; 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 -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="$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 test "${am_cv_CC_dependencies_compiler_type+set}" = set; 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 - - - -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 test "${ac_cv_prog_AWK+set}" = set; 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 - -#AC_PROG_LIBTOOL -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 test "${ac_cv_prog_RANLIB+set}" = set; 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 test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; 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 - -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 "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { 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; } && - test -f conftest2.$ac_objext && { { 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 - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&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_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { 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; } && - test -f conftest2.$ac_objext && { { 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 - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; 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; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - - - -############################## -# Checks for Long Long -############################## - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports long long" >&5 -$as_echo_n "checking whether $CC supports long long... " >&6; } -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 test "${ac_cv_prog_CXX+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 test "${ac_cv_prog_ac_ct_CXX+set}" = set; 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 { 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_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 - -{ $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 test "${ac_cv_cxx_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cxx_g+set}" = set; 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=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 - -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 test "${am_cv_CXX_dependencies_compiler_type+set}" = set; 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 - - - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -typedef long long CgInt64; - -int -main () -{ - - ; - 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; } - -$as_echo "#define HAVE_LONGLONG 1" >>confdefs.h - -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 - -############################################################################# -# Checks for CYGWIN an MinGW -############################################################################# - -#AC_CYGWIN -#if [ test $CYGWIN = yes || test $MINGW = yes ]; then - #AC_LIBTOOL_WIN32_DLL - #AM_DISABLE_STATIC - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 -$as_echo_n "checking for main in -lws2_32... " >&6; } -if test "${ac_cv_lib_ws2_32_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lws2_32 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_ws2_32_main=yes -else - ac_cv_lib_ws2_32_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_ws2_32_main" >&5 -$as_echo "$ac_cv_lib_ws2_32_main" >&6; } -if test "x$ac_cv_lib_ws2_32_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBWS2_32 1 -_ACEOF - - LIBS="-lws2_32 $LIBS" - -fi - - #AC_CHECK_LIB([iphlpapi],[main]) -#fi - -############################################################################# -# Check whether libtool should be used -############################################################################# - -# Check whether --with-libtool was given. -if test "${with_libtool+set}" = set; then : - withval=$with_libtool; -else - with_libtool=yes -fi - - if test $with_libtool = yes; then - HAVE_LIBTOOL_TRUE= - HAVE_LIBTOOL_FALSE='#' -else - HAVE_LIBTOOL_TRUE='#' - HAVE_LIBTOOL_FALSE= -fi - - -############################################################################# -# Check whether timing info should be printed -############################################################################# - -# Check whether --with-timings was given. -if test "${with_timings+set}" = set; then : - withval=$with_timings; -else - with_timings=no -fi - -if test $with_timings = yes ; then - CFLAGS="$CFLAGS -DCG_SHOW_TIMINGS" -fi - -############################## -# Checks for header files. -############################## - -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 test "${ac_cv_prog_CXXCPP+set}" = set; 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.$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.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_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.$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.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $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=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 for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; 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 test "${ac_cv_path_EGREP+set}" = set; 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 ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; 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_cxx_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_cxx_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_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in arpa/inet.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -############################## -# Checks for libxml2 libraries. -############################## - -# Check whether --enable-libxml2 was given. -if test "${enable_libxml2+set}" = set; then : - enableval=$enable_libxml2; - if test $enableval = no; then - USE_LIBXML2=no - else - USE_LIBXML2=yes - fi - -else - - USE_LIBXML2=no - - -fi - - -if test $USE_LIBXML2 = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSAXUserParseMemory in -lxml2" >&5 -$as_echo_n "checking for xmlSAXUserParseMemory in -lxml2... " >&6; } -if test "${ac_cv_lib_xml2_xmlSAXUserParseMemory+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lxml2 $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 xmlSAXUserParseMemory (); -int -main () -{ -return xmlSAXUserParseMemory (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_xml2_xmlSAXUserParseMemory=yes -else - ac_cv_lib_xml2_xmlSAXUserParseMemory=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_xml2_xmlSAXUserParseMemory" >&5 -$as_echo "$ac_cv_lib_xml2_xmlSAXUserParseMemory" >&6; } -if test "x$ac_cv_lib_xml2_xmlSAXUserParseMemory" = x""yes; then : - - -$as_echo "#define CG_XMLPARSER_LIBXML2 1" >>confdefs.h - - - XML_CFLAGS=`pkg-config libxml-2.0 --cflags` - - - XML_LIBS=`pkg-config libxml-2.0 --libs` - - -else - - as_fn_error "CyberLink needs libxml2-dev >= $LIBXML2_VERSION" "$LINENO" 5 - -fi - -fi - -############################## -# Checks for Expat libraries. -############################## - -if test $USE_LIBXML2 != yes ; then - for ac_header in expat/expat.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "expat/expat.h" "ac_cv_header_expat_expat_h" "$ac_includes_default" -if test "x$ac_cv_header_expat_expat_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_EXPAT_EXPAT_H 1 -_ACEOF - -fi - -done - - for ac_header in expat.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default" -if test "x$ac_cv_header_expat_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_EXPAT_H 1 -_ACEOF - -fi - -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate in -lexpat" >&5 -$as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } -if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lexpat $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 XML_ParserCreate (); -int -main () -{ -return XML_ParserCreate (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_expat_XML_ParserCreate=yes -else - ac_cv_lib_expat_XML_ParserCreate=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_expat_XML_ParserCreate" >&5 -$as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } -if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBEXPAT 1 -_ACEOF - - LIBS="-lexpat $LIBS" - -else - as_fn_error "CyberLink needs Expat >= $EXPAT_VERSION" "$LINENO" 5 -fi - -fi - -############################## -# Enable compiler warnings -############################## - -# Check whether --enable-compiler_warnings was given. -if test "${enable_compiler_warnings+set}" = set; then : - enableval=$enable_compiler_warnings; - if test $enableval = no; then - USE_COMPILER_WARNINGS=no - else - USE_COMPILER_WARNINGS=yes - fi - -else - - USE_COMPILER_WARNINGS=yes - - -fi - - -if test $USE_COMPILER_WARNINGS = yes ; then - CFLAGS="$CFLAGS -Wall" -fi - -############################## -# Debug flag checks -############################## - -# Check whether --enable-clog_debug was given. -if test "${enable_clog_debug+set}" = set; then : - enableval=$enable_clog_debug; - if test $enableval = no; then - USE_CLOG_DEBUG=no; - else - USE_CLOG_DEBUG=yes; - fi - -else - - USE_CLOG_DEBUG=no; - - -fi - - -# Check whether --enable-clog_debug_stack was given. -if test "${enable_clog_debug_stack+set}" = set; then : - enableval=$enable_clog_debug_stack; - if test $enableval = no; then - USE_CLOG_DEBUG_STACK=no; - else - USE_CLOG_DEBUG_STACK=yes; - fi - -else - - USE_CLOG_DEBUG_STACK=no; - - -fi - - -# Check whether --enable-clog_debug_application was given. -if test "${enable_clog_debug_application+set}" = set; then : - enableval=$enable_clog_debug_application; - if test $enableval = no; then - USE_CLOG_DEBUG_APPLICATION=no; - else - USE_CLOG_DEBUG_APPLICATION=yes; - fi - -else - - USE_CLOG_DEBUG_APPLICATION=no; - - -fi - - -CLOG_DEBUG_FLAGS="" - -if test $USE_CLOG_DEBUG = yes ; then - CLOG_DEBUG_FLAGS="$CLOG_DEBUG_FLAGS -DCLOG_DEBUG" -fi - -if test $USE_CLOG_DEBUG_STACK = yes ; then - CLOG_DEBUG_FLAGS="$CLOG_DEBUG_FLAGS -DCLOG_DEBUG_STACK" -fi - -if test $USE_CLOG_DEBUG_APPLICATION = yes ; then - CLOG_DEBUG_FLAGS="$CLOG_DEBUG_FLAGS -DCLOG_DEBUG_APPLICATION" -fi - - - -# Check whether --enable-coverage was given. -if test "${enable_coverage+set}" = set; then : - enableval=$enable_coverage; - if test $enableval = no; then - USE_COVERAGE=no; - else - USE_COVERAGE=yes; - fi - -else - - USE_COVERAGE=no; - - -fi - - -if test $USE_COVERAGE = yes ; then - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage -O0" - LDFLAGS="$LDFLAGS -lgcov" -fi - -############################## -# Check whether thread locking should be traced -############################## - - -# Check whether --with-thread-lock-trace was given. -if test "${with_thread_lock_trace+set}" = set; then : - withval=$with_thread_lock_trace; -else - with_cp_lock_trace=no -fi - -if test "$with_thread_lock_trace" = yes; then - CFLAGS="$CFLAGS -DWITH_THREAD_LOCK_TRACE" -fi - -############################## -# Checks for persistent connections usage. -############################## - -# Check whether --enable-persistent-connections was given. -if test "${enable_persistent_connections+set}" = set; then : - enableval=$enable_persistent_connections; - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_HTTP_USE_PERSISTENT_CONNECTIONS" - fi - -else - - CFLAGS="$CFLAGS -DCG_HTTP_USE_PERSISTENT_CONNECTIONS" - - -fi - - - - -############################## -# Checks for fast mode. -############################## - -# Check whether --enable-optimized-cp was given. -if test "${enable_optimized_cp+set}" = set; then : - enableval=$enable_optimized_cp; - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_OPTIMIZED_CP_MODE" - fi - -fi - - -# Check whether --enable-anyaddr was given. -if test "${enable_anyaddr+set}" = set; then : - enableval=$enable_anyaddr; - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_NET_USE_ANYADDR" - fi - -fi - - -############################## -# Checks for file functions. -############################## - -# Check whether --enable-cfile was given. -if test "${enable_cfile+set}" = set; then : - enableval=$enable_cfile; - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_USE_CFILE" - fi - -fi - - -############################## -# Checks for SSL functions -############################## - -# Check whether --enable-cfile was given. -if test "${enable_cfile+set}" = set; then : - enableval=$enable_cfile; - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_USE_OPENSSL" - fi - -fi - - -############################## -# Checks for libcurl libraries. -############################## - -# Check whether --enable-libcurl was given. -if test "${enable_libcurl+set}" = set; then : - enableval=$enable_libcurl; - if test $enableval = no; then - USE_LIBCURL=no - else - USE_LIBCURL=yes - fi - -else - - USE_LIBCURL=no - - -fi - - -if test $USE_LIBCURL = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_perform in -lcurl" >&5 -$as_echo_n "checking for curl_easy_perform in -lcurl... " >&6; } -if test "${ac_cv_lib_curl_curl_easy_perform+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurl $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 curl_easy_perform (); -int -main () -{ -return curl_easy_perform (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_curl_curl_easy_perform=yes -else - ac_cv_lib_curl_curl_easy_perform=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_curl_curl_easy_perform" >&5 -$as_echo "$ac_cv_lib_curl_curl_easy_perform" >&6; } -if test "x$ac_cv_lib_curl_curl_easy_perform" = x""yes; then : - - -$as_echo "#define CG_HTTP_CURL 1" >>confdefs.h - - - HTTP_CFLAGS=`curl-config --cflags` - - - HTTP_LIBS=`curl-config --libs` - - -else - - as_fn_error "CyberLink needs libcurl3-dev >= $LIBCURL_VERSION" "$LINENO" 5 - -fi - -fi - -############################## -# Checks for iconv -############################## - -for ac_func in iconv -do : - ac_fn_cxx_check_func "$LINENO" "iconv" "ac_cv_func_iconv" -if test "x$ac_cv_func_iconv" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ICONV 1 -_ACEOF - -fi -done - -for ac_header in iconv.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ICONV_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -liconv" >&5 -$as_echo_n "checking for main in -liconv... " >&6; } -if test "${ac_cv_lib_iconv_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_iconv_main=yes -else - ac_cv_lib_iconv_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_iconv_main" >&5 -$as_echo "$ac_cv_lib_iconv_main" >&6; } -if test "x$ac_cv_lib_iconv_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBICONV 1 -_ACEOF - - LIBS="-liconv $LIBS" - -fi - - -############################## -# Checks for pthread -############################## - -for ac_header in pthread.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 -_ACEOF - -else - as_fn_error "CyberLink needs POSIX thread library" "$LINENO" 5 -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 -$as_echo_n "checking for main in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_pthread_main=yes -else - ac_cv_lib_pthread_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_pthread_main" >&5 -$as_echo "$ac_cv_lib_pthread_main" >&6; } -if test "x$ac_cv_lib_pthread_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -fi - - -############################## -# Checks for UUID -############################## - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -luuid" >&5 -$as_echo_n "checking for main in -luuid... " >&6; } -if test "${ac_cv_lib_uuid_main+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-luuid $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_uuid_main=yes -else - ac_cv_lib_uuid_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_uuid_main" >&5 -$as_echo "$ac_cv_lib_uuid_main" >&6; } -if test "x$ac_cv_lib_uuid_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUUID 1 -_ACEOF - - LIBS="-luuid $LIBS" - -fi - -for ac_header in uuid/uuid.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" -if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UUID_UUID_H 1 -_ACEOF - -fi - -done - - -############################## -# Checks for typedefs, structures, and compiler characteristics. -############################## - -#AC_HEADER_STDBOOL -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test "${ac_cv_struct_tm+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - - -############################## -# Checks for Network functions -############################## - -for ac_func in socket -do : - ac_fn_cxx_check_func "$LINENO" "socket" "ac_cv_func_socket" -if test "x$ac_cv_func_socket" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKET 1 -_ACEOF - -fi -done - -for ac_func in inet_ntoa -do : - ac_fn_cxx_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa" -if test "x$ac_cv_func_inet_ntoa" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_INET_NTOA 1 -_ACEOF - -fi -done - -for ac_header in ifaddrs.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" -if test "x$ac_cv_header_ifaddrs_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IFADDRS_H 1 -_ACEOF - -fi - -done - -for ac_func in getifaddrs -do : - ac_fn_cxx_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETIFADDRS 1 -_ACEOF - -fi -done - - -##### socklen_t #### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 -$as_echo_n "checking for socklen_t... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -socklen_t foosocket; - -int -main () -{ - - ; - 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; } - -$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h - -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 - -##### SIOCGIFHWADDR #### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIOCGIFHWADDR" >&5 -$as_echo_n "checking for SIOCGIFHWADDR... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -#include -#include -#include -#include -void func() -{ - int sock; - struct ifreq ifr; - sock = socket(AF_INET, SOCK_DGRAM, 0); - strncpy(ifr.ifr_name, "eth0", IFNAMSIZ-1); - ifr.ifr_addr.sa_family = AF_INET; - ioctl(sock, SIOCGIFHWADDR, &ifr); -} - -int -main () -{ - - ; - 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; } - -$as_echo "#define HAVE_SIOCGIFHWADDR 1" >>confdefs.h - -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 - -##### sockaddr_dl #### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_dl" >&5 -$as_echo_n "checking for sockaddr_dl... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -void func() -{ - struct ifaddrs *ifaddr; - struct ifaddrs *i; - struct sockaddr_dl *dl; - unsigned char *macaddr; - getifaddrs(&ifaddr); - dl = (struct sockaddr_dl *)(ifaddr->ifa_addr); - LLADDR(dl); - freeifaddrs(ifaddr); -} - -int -main () -{ - - ; - 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; } - -$as_echo "#define HAVE_SOCKADDR_DL 1" >>confdefs.h - -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 - -##### IP_PKTINFO #### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IP_PKTINFO" >&5 -$as_echo_n "checking for IP_PKTINFO... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -void func() -{ - int on=1; - setsockopt(0, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)); -} - -int -main () -{ - - ; - 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; } - -$as_echo "#define HAVE_IP_PKTINFO 1" >>confdefs.h - -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 - -##### SO_NOSIGPIPE #### -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SO_NOSIGPIPE" >&5 -$as_echo_n "checking for SO_NOSIGPIPE... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -void func() -{ - int on=1; - setsockopt(0, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)); -} - -int -main () -{ - - ; - 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; } - -$as_echo "#define HAVE_SO_NOSIGPIPE 1" >>confdefs.h - -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 - -############################## -# Checks for other headers. -############################## - -for ac_header in stdint.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDINT_H 1 -_ACEOF - -fi - -done - -for ac_header in pthread.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 -_ACEOF - -fi - -done - - -############################## -# Checks for other functions. -############################## - -for ac_func in fopen -do : - ac_fn_cxx_check_func "$LINENO" "fopen" "ac_cv_func_fopen" -if test "x$ac_cv_func_fopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FOPEN 1 -_ACEOF - -fi -done - -for ac_func in memset -do : - ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MEMSET 1 -_ACEOF - -fi -done - -for ac_func in realpath -do : - ac_fn_cxx_check_func "$LINENO" "realpath" "ac_cv_func_realpath" -if test "x$ac_cv_func_realpath" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_REALPATH 1 -_ACEOF - -fi -done - -for ac_func in localtime_r -do : - ac_fn_cxx_check_func "$LINENO" "localtime_r" "ac_cv_func_localtime_r" -if test "x$ac_cv_func_localtime_r" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LOCALTIME_R 1 -_ACEOF - -fi -done - -for ac_func in gmtime_r -do : - ac_fn_cxx_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" -if test "x$ac_cv_func_gmtime_r" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GMTIME_R 1 -_ACEOF - -fi -done - -for ac_func in snprintf -do : - ac_fn_cxx_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" -if test "x$ac_cv_func_snprintf" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SNPRINTF 1 -_ACEOF - -fi -done - -for ac_func in uname -do : - ac_fn_cxx_check_func "$LINENO" "uname" "ac_cv_func_uname" -if test "x$ac_cv_func_uname" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UNAME 1 -_ACEOF - -fi -done - -for ac_func in strdup -do : - ac_fn_cxx_check_func "$LINENO" "strdup" "ac_cv_func_strdup" -if test "x$ac_cv_func_strdup" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRDUP 1 -_ACEOF - -fi -done - - -# Check whether --enable-mudflap-debug was given. -if test "${enable_mudflap_debug+set}" = set; then : - enableval=$enable_mudflap_debug; - if test $enableval = no; then - USE_MUDFLAP_DEBUG=no; - else - USE_MUDFLAP_DEBUG=yes; - fi - -else - - USE_MUDFLAP_DEBUG=no; - - -fi - - -if test $USE_MUDFLAP_DEBUG = yes ; then - CFLAGS="$CFLAGS -fmudflap -fmudflapth -O0" - LDFLAGS="$LDFLAGS -lmudflapth" -fi - -############################## -# Makefiles -############################## - -ac_config_files="$ac_config_files clinkc.pc Makefile include/Makefile lib/Makefile lib/unix/Makefile testunit/Makefile testunit/unix/Makefile sample/Makefile sample/clock/Makefile sample/clock/unix/Makefile sample/upnpdump/Makefile sample/upnpdump/unix/Makefile sample/upnpavdump/Makefile sample/upnpavdump/unix/Makefile sample/upnpigddump/Makefile sample/upnpigddump/unix/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 - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - 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= -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 "${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 "${HAVE_LIBTOOL_TRUE}" && test -z "${HAVE_LIBTOOL_FALSE}"; then - as_fn_error "conditional \"HAVE_LIBTOOL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: ${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. -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 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=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi - $as_echo "$as_me: error: $1" >&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 $as_me, which was -generated by GNU Autoconf 2.65. 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="\\ -config.status -configured by $0, generated by GNU Autoconf 2.65, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2009 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=$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"` ;; - 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" - -_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" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "clinkc.pc") CONFIG_FILES="$CONFIG_FILES clinkc.pc" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "lib/unix/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unix/Makefile" ;; - "testunit/Makefile") CONFIG_FILES="$CONFIG_FILES testunit/Makefile" ;; - "testunit/unix/Makefile") CONFIG_FILES="$CONFIG_FILES testunit/unix/Makefile" ;; - "sample/Makefile") CONFIG_FILES="$CONFIG_FILES sample/Makefile" ;; - "sample/clock/Makefile") CONFIG_FILES="$CONFIG_FILES sample/clock/Makefile" ;; - "sample/clock/unix/Makefile") CONFIG_FILES="$CONFIG_FILES sample/clock/unix/Makefile" ;; - "sample/upnpdump/Makefile") CONFIG_FILES="$CONFIG_FILES sample/upnpdump/Makefile" ;; - "sample/upnpdump/unix/Makefile") CONFIG_FILES="$CONFIG_FILES sample/upnpdump/unix/Makefile" ;; - "sample/upnpavdump/Makefile") CONFIG_FILES="$CONFIG_FILES sample/upnpavdump/Makefile" ;; - "sample/upnpavdump/unix/Makefile") CONFIG_FILES="$CONFIG_FILES sample/upnpavdump/unix/Makefile" ;; - "sample/upnpigddump/Makefile") CONFIG_FILES="$CONFIG_FILES sample/upnpigddump/Makefile" ;; - "sample/upnpigddump/unix/Makefile") CONFIG_FILES="$CONFIG_FILES sample/upnpigddump/unix/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= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 - -# 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 {' >"$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 >>"\$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 >>"\$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 < "$tmp/subs1.awk" > "$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 $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -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 >"$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_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; 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="$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 "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 >"$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 "$tmp/subs.awk" >$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' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$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 "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$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 "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$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 "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$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 -} - ;; - - 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 $? -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 - diff -Naur clinkc/configure.in clinkc_patch/configure.in --- clinkc/configure.in 2010-08-17 20:15:44.000000000 +0800 +++ clinkc_patch/configure.in 1970-01-01 08:00:00.000000000 +0800 @@ -1,586 +0,0 @@ -############################################################################# -# -# CyberLink for C -# -# Copyright (C) Satoshi Konno 2005 -# -# 01/26/04 -# - first release. -# -# 09/11/05 -# - Thanks for Roland Moser -# - Changed the configure to run 'make install' normally. -# -# 10/31/05 -# - Added libtool stuff and debian package creation -# -# 01/03/06 Heikki Junnila -# - Added new option for CG_HTTP_SUPPORT_NO_CONTENTLENGTH_REQUEST -# - Set defaults: libcurl=yes, libxml2=yes, libtool=yes, -# nolength_http=yes -# - Changed option descriptions to use AS_HELP_STRING -# -# 01/04/06 Heikki Junnila -# - AC_ARG_WITH's option-if-enabled mustn't be set in -# our case. Otherwise --with-xxxx doesn't work. Fixed. -# -# 02/06/06 Mikael Saarenp -# - Added debug options -# -# 03/17/08 -# - Added to check IP_PKTINFO -# -# 02/02/10 -# - Disabled AC_PROG_LIBTOOL and HAVE_LIBTOOL -# - Added support for SO_NOSIGPIPES -# -############################################################################# - -AC_INIT(include/cybergarage/typedef.h) -AC_CONFIG_AUX_DIR(config) - -AM_INIT_AUTOMAKE(clinkc, 2.3) -AM_CONFIG_HEADER(config.h) - -############################## -# Constants -############################## - -# Expat version. -EXPAT_VERSION=1.95 - -# Libxml2 version. -LIBXML2_VERSION=2.6.0 - -#Libcurl version -LIBCURL3_VERSION=7.13.0 - -############################## -# Checks for programs. -############################## - -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_AWK -#AC_PROG_LIBTOOL -AC_PROG_RANLIB -AC_LANG_CPLUSPLUS -AM_PROG_CC_C_O - -############################## -# Checks for Long Long -############################## - -AC_MSG_CHECKING([whether $CC supports long long]) -AC_TRY_COMPILE([ -#include -typedef long long CgInt64; -], -[], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_LONGLONG],1,[LONGLONG])], -[AC_MSG_RESULT(no)] -) - -############################################################################# -# Checks for CYGWIN an MinGW -############################################################################# - -#AC_CYGWIN -#if [ test $CYGWIN = yes || test $MINGW = yes ]; then - #AC_LIBTOOL_WIN32_DLL - #AM_DISABLE_STATIC - AC_CHECK_LIB([ws2_32],[main]) - #AC_CHECK_LIB([iphlpapi],[main]) -#fi - -############################################################################# -# Check whether libtool should be used -############################################################################# -AC_ARG_WITH(libtool, - AS_HELP_STRING([--with-libtool], - [use libtool to build the library (default = yes)]), - [], - [with_libtool=yes]) -AM_CONDITIONAL(HAVE_LIBTOOL, test $with_libtool = yes) - -############################################################################# -# Check whether timing info should be printed -############################################################################# -AC_ARG_WITH(timings, - AS_HELP_STRING([--with-timings], - [show timings in debug-info (default = no)]), - [], - [with_timings=no]) -if [ test $with_timings = yes ]; then - CFLAGS="$CFLAGS -DCG_SHOW_TIMINGS" -fi - -############################## -# Checks for header files. -############################## - -AC_HEADER_STDC -AC_CHECK_HEADERS([arpa/inet.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h unistd.h]) - -############################## -# Checks for libxml2 libraries. -############################## - -AC_ARG_ENABLE(libxml2, - AS_HELP_STRING([--enable-libxml2], - [enable Libxml2 support (default = no)]), - [ - if test $enableval = no; then - USE_LIBXML2=no - else - USE_LIBXML2=yes - fi - ],[ - USE_LIBXML2=no - ] -) - -if [ test $USE_LIBXML2 = yes ]; then - AC_CHECK_LIB(xml2, xmlSAXUserParseMemory, - [ - AC_DEFINE([CG_XMLPARSER_LIBXML2],1,[LIBXML2]) - - XML_CFLAGS=`pkg-config libxml-2.0 --cflags` - AC_SUBST(XML_CFLAGS) - - XML_LIBS=`pkg-config libxml-2.0 --libs` - AC_SUBST(XML_LIBS) - ],[ - AC_MSG_ERROR(CyberLink needs libxml2-dev >= $LIBXML2_VERSION) - ]) -fi - -############################## -# Checks for Expat libraries. -############################## - -if [ test $USE_LIBXML2 != yes ]; then - AC_CHECK_HEADERS([expat/expat.h]) - AC_CHECK_HEADERS([expat.h]) - AC_CHECK_LIB([expat],[XML_ParserCreate],,[AC_MSG_ERROR(CyberLink needs Expat >= $EXPAT_VERSION)]) -fi - -############################## -# Enable compiler warnings -############################## - -AC_ARG_ENABLE(compiler_warnings, - AS_HELP_STRING([--enable-compiler-warnings], - [enable compiler warnings (default = yes)]), - [ - if test $enableval = no; then - USE_COMPILER_WARNINGS=no - else - USE_COMPILER_WARNINGS=yes - fi - ],[ - USE_COMPILER_WARNINGS=yes - ] -) - -if [ test $USE_COMPILER_WARNINGS = yes ]; then - CFLAGS="$CFLAGS -Wall" -fi - -############################## -# Debug flag checks -############################## - -AC_ARG_ENABLE(clog_debug, - AS_HELP_STRING([--enable-clog-debug], - [enable common clog debug messages (default = no)]), - [ - if test $enableval = no; then - USE_CLOG_DEBUG=no; - else - USE_CLOG_DEBUG=yes; - fi - ],[ - USE_CLOG_DEBUG=no; - ] -) - -AC_ARG_ENABLE(clog_debug_stack, - AS_HELP_STRING([--enable-clog-debug-stack], - [enable clog stack debug messages (default = no)]), - [ - if test $enableval = no; then - USE_CLOG_DEBUG_STACK=no; - else - USE_CLOG_DEBUG_STACK=yes; - fi - ],[ - USE_CLOG_DEBUG_STACK=no; - ] -) - -AC_ARG_ENABLE(clog_debug_application, - AS_HELP_STRING([--enable-clog-debug-application], - [enable clog application debug messages (default = no)]), - [ - if test $enableval = no; then - USE_CLOG_DEBUG_APPLICATION=no; - else - USE_CLOG_DEBUG_APPLICATION=yes; - fi - ],[ - USE_CLOG_DEBUG_APPLICATION=no; - ] -) - -CLOG_DEBUG_FLAGS="" - -if [ test $USE_CLOG_DEBUG = yes ]; then - CLOG_DEBUG_FLAGS="$CLOG_DEBUG_FLAGS -DCLOG_DEBUG" -fi - -if [ test $USE_CLOG_DEBUG_STACK = yes ]; then - CLOG_DEBUG_FLAGS="$CLOG_DEBUG_FLAGS -DCLOG_DEBUG_STACK" -fi - -if [ test $USE_CLOG_DEBUG_APPLICATION = yes ]; then - CLOG_DEBUG_FLAGS="$CLOG_DEBUG_FLAGS -DCLOG_DEBUG_APPLICATION" -fi - -AC_SUBST(CLOG_DEBUG_FLAGS) - -AC_ARG_ENABLE(coverage, - AS_HELP_STRING([--enable-coverage], - [enable coverage (default = no)]), - [ - if test $enableval = no; then - USE_COVERAGE=no; - else - USE_COVERAGE=yes; - fi - ],[ - USE_COVERAGE=no; - ] -) - -if [ test $USE_COVERAGE = yes ]; then - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage -O0" - LDFLAGS="$LDFLAGS -lgcov" -fi - -############################## -# Check whether thread locking should be traced -############################## - -AC_ARG_WITH(thread-lock-trace, - AS_HELP_STRING([--with-thread-lock-trace], - [Trace thread locking and fail fast on errors, errors can be found also from /tmp/cg_td_* (default = no)]), - [], - [with_cp_lock_trace=no]) -if [test "$with_thread_lock_trace" = yes]; then - CFLAGS="$CFLAGS -DWITH_THREAD_LOCK_TRACE" -fi - -############################## -# Checks for persistent connections usage. -############################## - -AC_ARG_ENABLE(persistent-connections, - AS_HELP_STRING([--enable-persistent-connections], - [enable persistent connections support (default = yes)]), - [ - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_HTTP_USE_PERSISTENT_CONNECTIONS" - fi - ],[ - CFLAGS="$CFLAGS -DCG_HTTP_USE_PERSISTENT_CONNECTIONS" - ] -) - - - -############################## -# Checks for fast mode. -############################## - -AC_ARG_ENABLE(optimized-cp, - AS_HELP_STRING([--enable-optimized-cp], - [enable optimized control point mode (default = no)]), - [ - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_OPTIMIZED_CP_MODE" - fi - ], -) - -AC_ARG_ENABLE(anyaddr, - AS_HELP_STRING([--enable-anyaddr], - [enables the usage of IPV4_ADDRANY instead of - registering an explicit server for each - interface (default = yes)]), - [ - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_NET_USE_ANYADDR" - fi - ], -) - -############################## -# Checks for file functions. -############################## - -AC_ARG_ENABLE(cfile, - AS_HELP_STRING([--enable-cfile], - [enable file functions (default = no)]), - [ - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_USE_CFILE" - fi - ], -) - -############################## -# Checks for SSL functions -############################## - -AC_ARG_ENABLE(cfile, - AS_HELP_STRING([--enable-openssl], - [enable file functions (default = no)]), - [ - if test $enableval = yes; then - CFLAGS="$CFLAGS -DCG_USE_OPENSSL" - fi - ], -) - -############################## -# Checks for libcurl libraries. -############################## - -AC_ARG_ENABLE(libcurl, - AS_HELP_STRING([--enable-libcurl], - [enable Libcurl support (default = no)]), - [ - if test $enableval = no; then - USE_LIBCURL=no - else - USE_LIBCURL=yes - fi - ],[ - USE_LIBCURL=no - ] -) - -if [ test $USE_LIBCURL = yes ]; then - AC_CHECK_LIB(curl, curl_easy_perform, - [ - AC_DEFINE([CG_HTTP_CURL],1,[LIBCURL]) - - HTTP_CFLAGS=`curl-config --cflags` - AC_SUBST(HTTP_CFLAGS) - - HTTP_LIBS=`curl-config --libs` - AC_SUBST(HTTP_LIBS) - ],[ - AC_MSG_ERROR(CyberLink needs libcurl3-dev >= $LIBCURL_VERSION) - ]) -fi - -############################## -# Checks for iconv -############################## - -AC_CHECK_FUNCS([iconv]) -AC_CHECK_HEADERS([iconv.h]) -AC_CHECK_LIB([iconv],[main]) - -############################## -# Checks for pthread -############################## - -AC_CHECK_HEADERS([pthread.h],,[AC_MSG_ERROR(CyberLink needs POSIX thread library)]) -AC_CHECK_LIB([pthread],[main]) - -############################## -# Checks for UUID -############################## - -AC_CHECK_LIB([uuid],[main]) -AC_CHECK_HEADERS([uuid/uuid.h]) - -############################## -# Checks for typedefs, structures, and compiler characteristics. -############################## - -#AC_HEADER_STDBOOL -AC_C_CONST -AC_C_INLINE -AC_STRUCT_TM - -############################## -# Checks for Network functions -############################## - -AC_CHECK_FUNCS([socket]) -AC_CHECK_FUNCS([inet_ntoa]) -AC_CHECK_HEADERS([ifaddrs.h]) -AC_CHECK_FUNCS([getifaddrs]) - -##### socklen_t #### -AC_MSG_CHECKING(for socklen_t) -AC_TRY_COMPILE([ -#include -#include -socklen_t foosocket; -], -[], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_SOCKLEN_T],1,[SOCKLEN_T])], -[AC_MSG_RESULT(no)] -) - -##### SIOCGIFHWADDR #### -AC_MSG_CHECKING(for SIOCGIFHWADDR) -AC_TRY_COMPILE([ -#include -#include -#include -#include -#include -#include -#include -void func() -{ - int sock; - struct ifreq ifr; - sock = socket(AF_INET, SOCK_DGRAM, 0); - strncpy(ifr.ifr_name, "eth0", IFNAMSIZ-1); - ifr.ifr_addr.sa_family = AF_INET; - ioctl(sock, SIOCGIFHWADDR, &ifr); -} -], -[], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_SIOCGIFHWADDR],1,[SIOCGIFHWADDR])], -[AC_MSG_RESULT(no)] -) - -##### sockaddr_dl #### -AC_MSG_CHECKING(for sockaddr_dl) -AC_TRY_COMPILE([ -#include -#include -void func() -{ - struct ifaddrs *ifaddr; - struct ifaddrs *i; - struct sockaddr_dl *dl; - unsigned char *macaddr; - getifaddrs(&ifaddr); - dl = (struct sockaddr_dl *)(ifaddr->ifa_addr); - LLADDR(dl); - freeifaddrs(ifaddr); -} -], -[], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_SOCKADDR_DL],1,[SOCKADDR_DL])], -[AC_MSG_RESULT(no)] -) - -##### IP_PKTINFO #### -AC_MSG_CHECKING(for IP_PKTINFO) -AC_TRY_COMPILE([ -#include -#include -void func() -{ - int on=1; - setsockopt(0, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)); -} -], -[], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_IP_PKTINFO],1,[IP_PKTINFO])], -[AC_MSG_RESULT(no)] -) - -##### SO_NOSIGPIPE #### -AC_MSG_CHECKING(for SO_NOSIGPIPE) -AC_TRY_COMPILE([ -#include -#include -void func() -{ - int on=1; - setsockopt(0, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)); -} -], -[], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_SO_NOSIGPIPE],1,[SO_NOSIGPIPES])], -[AC_MSG_RESULT(no)] -) - -############################## -# Checks for other headers. -############################## - -AC_CHECK_HEADERS([stdint.h]) -AC_CHECK_HEADERS([pthread.h]) - -############################## -# Checks for other functions. -############################## - -AC_CHECK_FUNCS([fopen]) -AC_CHECK_FUNCS([memset]) -AC_CHECK_FUNCS([realpath]) -AC_CHECK_FUNCS([localtime_r]) -AC_CHECK_FUNCS([gmtime_r]) -AC_CHECK_FUNCS([snprintf]) -AC_CHECK_FUNCS([uname]) -AC_CHECK_FUNCS([strdup]) - -AC_ARG_ENABLE(mudflap-debug, - AS_HELP_STRING([--enable-mudflap-debug], - [enable libmudflap debug (default = no)]), - [ - if test $enableval = no; then - USE_MUDFLAP_DEBUG=no; - else - USE_MUDFLAP_DEBUG=yes; - fi - ],[ - USE_MUDFLAP_DEBUG=no; - ] -) - -if [ test $USE_MUDFLAP_DEBUG = yes ]; then - CFLAGS="$CFLAGS -fmudflap -fmudflapth -O0" - LDFLAGS="$LDFLAGS -lmudflapth" -fi - -############################## -# Makefiles -############################## - -AC_OUTPUT([ -clinkc.pc -Makefile -include/Makefile -lib/Makefile -lib/unix/Makefile -testunit/Makefile -testunit/unix/Makefile -sample/Makefile -sample/clock/Makefile -sample/clock/unix/Makefile -sample/upnpdump/Makefile -sample/upnpdump/unix/Makefile -sample/upnpavdump/Makefile -sample/upnpavdump/unix/Makefile -sample/upnpigddump/Makefile -sample/upnpigddump/unix/Makefile -]) diff -Naur clinkc/debian/changelog clinkc_patch/debian/changelog --- clinkc/debian/changelog 2006-10-05 15:03:52.000000000 +0800 +++ clinkc_patch/debian/changelog 1970-01-01 08:00:00.000000000 +0800 @@ -1,625 +0,0 @@ -clinkc (2.0-0) unstable; urgency=low - - * Removed (debug) printfs from ip_changed routine. - * Fixed memory leak from cg_libxml2_parsewrapper - * Fixed memory leak from cg_net_selectaddr - * Fixed memory leak from cg_net_url_getupnpbasepath - * Fixed crash when using DUN IAP - * Added API calls to query and set user agent field in http - requests. - - -- Mikael Saarenpää Tue, 3 Oct 2006 13:48:41 +0300 - -clinkc (1.0-29) unstable; urgency=low - - * Applied a patch from Rafael to fix locking problem in - cg_upnp_device_unsubscriptionrecieved. Fixes: NB#38099 - * Fixed url base generation from location string. Fixes: NB#37017 - * Fixed curl delay issue when CP is shutting down. Fixes: NB#34454 - * Implemented fallback routine into XML parser for unknown - character errors. Fixes: NB#29846 - * Applied a patch from Rafael to fix list node initialization. - Fixes: NB#34144 - * Applied a patch from Rafael which adds missing free into new subscription - routine. Fixes: NB#34248 - * Applied a patch from Rafael which frees subscriber variable correctly - from cg_upnp_service_removesubscriber. Fixes: NB#34258 - * Fixed a case where service lock was not held when it should have - been, fix was based on a patch by Rafael. Fixes: NB#34259 - * Applied a patch from Aapo to change cg_upnp_controlpoint_search to - return false in case of clear failure situation instead of always - returning true. Fixes: NB#36225 - * Changed cg_file_load to don't do a fread past the end of the file - - -- Mikael Saarenpää Tue, 22 Aug 2006 09:14:18 +0300 - -clinkc (1.0-28) unstable; urgency=low - - * Applied a patch by Aapo Makela to fix some deadlocking problem - in controlpoint stop. - * Fixed a memory leak in cg_http_persistentconnection_put function - * Added cg_list_node_init() in cg_upnp_eventlistenerlist_add() - for list_node, fixing at least a memory leak, and probably some - other random behavior (otherwise headFlag would be uninitialized). - - -- Visa Smolander Wed, 28 Jun 2006 12:06:55 +0300 - -clinkc (1.0-27) unstable; urgency=low - - * Fixed from 2006-05-30 to 2006-06-16. - * Added Nokia legal text into modified files - * Re-enabled doxygen doc generation from makefile - * Added 309 doxygen comments. - * Moved SERVICE_DESCRIPTION to common.h - * Removed setstatevar.c - * Cleanup the tests by centralizing the device description - * Test bad xml by sending it to the control point instead of using - stand alone devices - - -- Mikael Saarenpää Fri, 16 Jun 2006 17:14:08 +0100 - -clinkc (1.0-26) unstable; urgency=low - - * Fixed from 2006-05-18 to 2006-05-26. - * Fixed the annoying thing that ctrl-c cannot be used to kill - the program using stack. - * Fixed bug 30399 During normal operation duplicate M-SEARCHES - are not sent correctly. - * Applied patch from Aapo to fix the remaining lintian warnings. - * Documented the http server in tests/regression/README - * Documented cp_add_device and msearch in tests/regression/README - * Removed the host and port parameters of mseach in - tests/regression/test.py - * Updated tests/regression/README - * Cleaned some tests - * Updated tests/regression/README - * [testing] SOAP action messages with wrong XML schema - * Applied patch from bug #26068 (Opening ports via UPnP does - not work with D-Link DI-824VUP+) - * Modified the http server to send a "valid" response to a post - method. - * Modified the tests to cover more of the API - * Fixed an endless loop in cg_socket_write() and changed the - whopping 0-1000msec random wait to 20msecs. - - -- Mikael Saarenpää Fri, 26 May 2006 12:30:08 +0100 - -clinkc (1.0-25) unstable; urgency=low - - * Fixes from 2006-05-16 to 2006-05-18. - * Fixed xml string escape routines to handle " correctly. - * Modified regression/mini_service.c and regression/mini_cp.c to - test more API functions - * Added more tests to tests/regression - * Added a test for valgrind availability in tests/regression/test.py - - -- Mikael Saarenpää Thu, 18 May 2006 15:48:32 +0300 - -clinkc (1.0-24) unstable; urgency=low - - * Fixes from 2006-05-08 to 2006-05-15. - * Changed 20ms wait to happen right after each _notifyfrom, not after - each _announcefrom. - * Fixed bug 26472 SSDP Response Server on Control Point loops forever - (Patch by Rosfran) - * Rolled back fix for bug 28806. - * Added cg_net_uri_isequivalent to check if a relative and an - absolute URLs are equivalent. - * Changed cg_upnp_service_isscpdurl. Now it is a function and uses - cg_net_uri_isequivalent instead of cg_strstr - * Fixed bug 26520 HTTP server doesn't respond to requests which - use chunked transfer encoding. - * Fix to cg_upnp_device_getservicebyscpdurl function, - used by HTTP Server (Device) to solve the case when the - service was unparsed, but device contains a valid - SCPDURL to the service description file (Bug 28806) - * Added more tests - * Removed unused include/cybergarage/upnp/callowedvalue.h - * Removed unused src/cybergarage/upnp/callowedvalue.c - * Removed unused src/cybergarage/upnp/callowedvalue_list.c - * Removed unused src/cybergarage/upnp/callowedvaluerange.c - * Replaced unused elements of the _CgUpnpStateVariable structure - with dummy ones with the same size. - * Removed commented code from src/cybergarage/upnp/cstatevariable.c - * Modified how a test gets the host address - * Added a README in tests/regression - * Added some tests - * Modified the regression tests to aways wait for the sync string - * Added a service to tests/regression/mini_dev.xml - * Fixed a problem with erroneous action responses and nonstandard namespaces - * Added an xml function to get childnode with or without the namespace prefix. - * Added some NULL checkings to string functions. TODO: Must do that forall... - * Fixed a bug in cg_strdup. Now it returns NULL, if input argument was NULL. - * Modified test_http.py to fetch a service description url - * Modified cp_subscribe.c to print service information - * Modified test.py to wait longer before killing a test - * Added some M-SEARCH tests - * Fixed a bug in cg_upnp_ssdp_packet_new. ssdpPkt->initialized was - not initialized. - - -- Mikael Saarenpää Mon, 15 May 2006 18:04:33 +0300 - -clinkc (1.0-23) unstable; urgency=low - - * Fixes from 2006-04-26 to 2006-05-08. - * Changed multiplecp to printout action invoke results when - generating action invoke bursts. - * Changed the usage of cg_strncpy to better match the underlying - strncpy. NOTE: This is an API change since now cg_strncpy do not - terminate strings automatically. - * Fixed a bug in chttp_request. When sending a request without body - it sometimes sent corrupted data from a previous transmission... - * Propagate some important Device advertisement data from the root - device, to its embedded sub-devices (such as description URIs and HTTP - port); NOTIFY were sent with wrong Location URIs - * Removed duplicated code from src/cybergarage/upnp/cservice.c and - src/cybergarage/upnp/cservice_ssdp_server.c - * Added a sample stress test case using --enable-coverage, which sends a lot of NOTIFY - datagrams to a clinkc's Control Point - * Modified cp_subscribe.c to cover a greater part of the API - * Modified utils.py and coverage.py so that they don't use the - subprocess module - * Added test_cp_readd_device2.py - * Modified Makefile.am to run test_cp_readd_device2.py - * Removed tests/regression/statever.c. Use mini_service.c instead. - * Modified Makefile.am to run test_dev_query.py and test_dev_query2.py - * Modified test.py to remove mini_service from used_ports - * Fixed missing imports in test_igd_dev_parsing.py and test_igd_dev_parsing_by_fd.py - * Modified mini_service.c to add an state variable - * Added test_dev_query.py test_dev_query2.py - * Modified test_unsubscribe.py to run an http server - * Modified http_server.py to accept NOTIFY methods - * Fixed bug 28592 using clinkc-test-tools and sending HTTP request to server causes - killing of application - * Fixed bug 28484 invalid memory access in clinkc's - cg_upnp_event_notify_request_getpropertylist (Patch by Rafael) - * Modified some device descriptions absolute paths, in the - tests/regression/ - * Added the SYNC_STRING in some tests that now threats with Control - Point's device discovery - * Modified tests/regression/test_cp_notify2.py to use a real - variable name - * Added tests/regression/test_cp_badrequest.py - * Modified tests/regression/cp_subscribe.c to include a device - listener - * Modified tests/regression/Makefile.am to run - tests/regression/test_cp_badrequest.py - * Fixed compiler warnings from stack code. - * Modified tests/regression/test_cp_notify2.py to send a dummy - property in the notify message - * Added some suppressions to tests/regression/suppressions - * Modified cg_upnp_usn_getudn to always initialize undBuf - (fixes bug #28087) - * Modified cg_socket_recv to zero ancillaryBuf before using it - (fixes bug #28086) - * Fixed a problem in debian/control --> now deb -packages - can be installed with S+ Application manager - * Modified tests/regression/test.py to don't use the subprocess - module - * Modified tests/regression/Makefile.am to disable http proxies - during test run - * Modified the regression tests to automate the waiting for port - availability - * Removed the duplicated - cg_upnp_controlpoint_geteventsubcallbackurl implementation from - ccontrolpoint_event.c - * Changes in the NOTIFY message manipulation for the python test - scripts (sending SSDP - multicast) - * More UPnP network stress tests python scripts added to the SVN, checking - them with the --enable-coverage - * Added some of the UPnP network stress tests python scripts, to be used with the - --enable-coverage, on tests/regression/stress - * Added a small http server in python to make it easier to write some tests - * Modified the device add, readd, and remove tests to use the http server - * Modified the regression tests to factor some common code - * Fixed thread synchronization problem in duplicate M-SEARCH - filtering code. - * Changed advertizer thread shutdown routine to not send alive - messages after thread termination has been started, advertizer - thread is now also shut down before byebye is sent. - * Reset action status code to 0 in case of success (caction_ctrl.c). - - -- Mikael Saarenpää Mon, 8 May 2006 14:42:00 +0300 - -clinkc (1.0-22) unstable; urgency=low - - * Fixes from 2006-04-10 to 2006-04-25. - * Added more subscription and notification tests - * Added some tests with invalid subscription requests - * Fixed bug 25169 Lease time value (on Cache-Control header) doesn't - propagate to child-devices (Patch by Rosfran Borges) - * Fixed bug 26058 cg_upnp_controlpoint_search() returns no value - * Applied patch which enables building object files into other than - source directory. - * Fixed HTTP client thread deletion routine (threads were deleted twice) - * Modified the regression tests synchronization process to be more robust - * Added tests/regression/test_subscribe.py - * Added tests/regression/test_bad_request.py - * Modified tests/regression/Makefile.am to run the new tests - * Fixed bug 24013 Memory leak by not freeing the data before the thread - is destroyed. - * Fixed bug 24014 Memory leak on cssdp_server.c:143 of clinkc. - * Removed obsoleted 8bit characters from debian/control. - * Added tests/regression/test_bad_action.py - * Fixed test data 21, 43 and 52. - * Fixed bug 25014 Absolute url handling is broken. - * Changed tests/regression/test.py and tests/regression/Makefile.am to - work inside scratchbox. - - -- Mikael Saarenpää Wed, 26 Apr 2006 10:15:56 +0300 - -clinkc (1.0-21) unstable; urgency=low - - * Fixes from 2006-03-27 to 2006-04-07. - * Added --enable-configure-warnings to configure script and - enabling them as default. - * Added some tests scripts for multiple embedded devices in tests/regression/ - * Added an action handler to tests/regression/mini_service.c - * Changed the request url in tests/regression/test_exec_action.py - * Changed tests/regression/coverage.py to work with cvs gcov - * Fixed bug 25456 cg_xml_nodelist_clear used instead of cg_xml_nodelist_delete - in clinkc. - * Fixed bug 24866 memory leak in cg_upnp_argumentlist_delete in clinkc - (patch by Rafael Espindola) - * Fixed bug 25296 buffer overflow in cg_net_uri_isescapedstring. - * Fixed bug 25193 HTTP server in device closes persistent connections - too early. - * Fixed test data 41 and 5. Added test data 1 - * Added the tests/regression directory - * Added query handlers for multipleembedded test application. - (This fixes issue found in testing "1. Multiple embedded devices - support ID 26144 - action invoke query fails on embedded devices") - * Changed clog to use strdup instead of cg_strdup. (cg_strdup uses - clog api...) - * Fixed bug 25324 Not all malloc return values are checked in clinkc code - * Fixed bug 25130 clinkc defines cg_strdup but uses strdup in some - places (patch by Rafael Espindola) - * Fixed bug 24865 memory leak in cg_socket_recv in clinkc (pathc - by Rafael Espindola) - * Fixed bug 24558 (30 second timeout to action responses) - * Modified the connection establishment timeout from 5 to 2 sec - * Fixed bug 24653 (Handling subscription expiration in devices) - * Fixed bug 24654 (Unsubscribe with SID, NT and CALLBACK) - * Fixed bug 24601 (Subscribe with SID, NT and CALLBACK) - * Fixed bug 24603 (Empty CALLBACK in subscribe) - * Fixed bug 24648 (SUBSCRIBE NT != upnp:event) - * Fixed bug 24651 (Resubscribe with SID, NT and CALLBACK and correct SID) - * Fixed test data 26/c - * Fixed bug 24665 (Unknown XML elements in action invokes) - * Fixed test data 46/a - * Added ipchanged feature to eventapp - * Fixed test data 50/a - * Added the --enable-mudflap-debug option to configure - * Fixed bug 24591 (Device doesn't filter duplicate M-SEARCH messages.) - * Fixed bug 24673 - persistent connection cache was not initialized - at device startup. - - -- Mikael Saarenpää Mon, 10 Apr 2006 08:31:37 +0300 - -clinkc (1.0-20) unstable; urgency=low - - * Fixes from 2006-03-22 to 2006-03-24 - * Fixed couple of while(true); errors from ipchanged - (low level) routines. - * Added the --enable-coverage option to configure - * Added ipchanged feature to multiplecp - * Fixed (Bugzilla) bugs: 24100, 24386, 24662, (24663), 24664 - * Fixed bug when device responded to M-SEARH, embedded - devices were not correctly looped through. - * Rolled back M-SEARCH response changes from 6240 revision. For some - reason this caused stack to loop forever when sending ssdp:all - M-SEARCH. - * Added/fixed test data for cases 24, 54 and 19. - * Added and corrected test data. - - -- Mikael Saarenpää Mon, 27 Mar 2006 09:10:52 +0300 - -clinkc (1.0-19) unstable; urgency=low - - * Fixes from 2006-03-13 to 2006-03-21 - * Changed cupnp.h to be generated from cupnp.h.in so that the file always - contains the latest version number from configure.in - * Removed CLOG_DEBUG_STACK from chttp.h which caused an error during compile. - * Created release 1.0-19 - * Included patch attached to Bugzilla. Fixes: NB#24202 - * M-SEARCH response delay changed to spread response packets more - evenly and to guarantee that all response packets leave before - time specified in MX record. - * Added missing description file for multipleroot test application. - * Fixes for test data (76a, 67a, 68a) - * Added general service description file. - * Exended multiplecp to allow controlling of embedded devices. - - -- Heikki Junnila Tue, 21 Mar 2006 09:18:35 +0200 - -clinkc (1.0-18) unstable; urgency=low - - * Fixes from 2006-02-13 to 2006-03-10 - * Fixed ancillary data parsing routine to check the message type - before fetching the data. - * Modified interface id -> ip address mapping routines to give - valid ip address if interface id can't be found from the interface - list. - * Fixed small memory leak according to patch by Rafaelo Espindola - * Bug fixes for tests 28884, 29625, 29629 - * Fixed eventapp to correctly set the cache value. - * Support for setting local address based on UDP packet incoming - interface finalized. - * Changed setting of socket id to use setter function instead of directly - manipulating the id value. - * Removed old command line parsing routines from eventapp. - * Removed unsubscribing in controlpoint_stop because of performance - problems (in case we don't have network access any more). - * Added more debug printouts to stack. - * Added commandline option parsing to eventapp. - * Experimental support for setting local address by using - ancillary data from udp packets. - * TTL fix for NOTIFY messages. - * HTTP response fix (now content length header is always included). - * Changed multiplecp application to install correctly into bin. - * Removed comments from doxygen rules in top Makefile.am - - -- Mikael Saarenpää Mon, 13 Mar 2006 09:47:01 +0200 - -clinkc (1.0-17) unstable; urgency=low - - * Fixes from 2006-02-13 to 2006-02-24 - * Removed comments from doxygen rules in top Makefile.am - * TTL bug fixed - * Two new log levels and debug prints for function entry - (and leaving) points. - * "--enable-clog-debug*" options default to "no" - * Fixed SOAP encoding definition to "encodingStyle" in csoap.h - * Fixed to send right URLBase as a device. - * Fixed action invoke to work with devices, which have path in URLBase. - * Fixed HTTP server client thread removal. - - -- Heikki Junnila Mon, 27 Feb 2006 08:31:01 +0200 - -clinkc (1.0-16) unstable; urgency=low - - * Fixes from 2006-01-30 to 2006-02-06 - * Added the CG_HTTP_USE_PERSISTENT_CONNECTIONS configure - option to configure.in and made it enabled by default - * Added some data for test cases under tests/test_data. - * Also included a script which concatenates all test data - + descriptions into one big document. - * Fixed a bug: NOTIFY messages were changed into post messages at - csoap_request.c:cg_soap_request_post(), I guess this is not needed - since the default http request type for soap message is POST. - * Fixed top Makefile.am to include all necessary files under debian - as well as Doxyfile. - * Fixed to compile stack by default in optimized CP and - use anyaddr modes (in debian/rules). - * Fixed compiling with optimized CP mode enabled. - * Fixed segmentation fault when stopping control point - * Corrected test data (76) - * Added test data for test 5 - * Added new log/debug interface and removed old cdebug interface. - * Changed stack and applications to use new debug interface. - * Added configure options for new debug interface. - * Added test data for tests 19, 50, 52, 67, 76 - - -- Heikki Junnila Fri, 10 Feb 2006 10:16:57 +0200 - -clinkc (1.0-15) unstable; urgency=low - - * Fixes from 2006-01-25 to 2006-01-27 - * Added new packages clinkcmaemo-tests and clinkc-tests - * Changed XMLdesrcription test app to use new API and to accept - file spesifications etc. from command line. It is not tested - yet so it could be broken. - * Fixed control point to remove cached devices when stopped and - notify also appropriate listeners. - * Added a test application which can load any XML device and - service description - * Changed cg_upnp_controlpoint_expirationhandler() to use - cg_upnp_controlpoint_removedevicebyssdppacket() instead of just - cg_upnp_device_remove() so that the control point's device listener - gets called. - * Added control point unlock before _removedevicebyssdppacket() and - lock after the call.o - * Changed cg_http_statuscode2reasonphrase() to use static const chars - instead of local variables. - * Extended multiplecp app to cover test cases 11. "Indication to user - about service/device unavailability ID 28790" and 12. "Indication to - user about subscription unavailability ID 28792". - * New test application (multiplecp). Initially creates two - controlpoints and later these control points can be used separately - from UI. - * Added searching for a service from device based on service ID. - * Added functionality for test 38. Search timing and duplicates ID 29311 - it can be done with command "'a' : Do all searches four times in a loop." - * Added command "'o' : Control (multiple actions)" to upnpdump, this ca$ - used when stress testing devices. (Sends action requests in a loop.) - * Modified eventapp to allow multiple events to be generated in busy loop. - * Added IP-changed notify functionality for control point. - * Many small fixes - * Extended multipleroot test program with one more rootdevice, it was - decided that this would then be enough to execute test 9. Responding - with random delay to a discovery request ID 28787. - * Extended eventapp test program to include three testcases: 45. GENA - event byte limit ID 29429, 44. SOAP response byte limit ID 29427 and - 43. SOAP request byte limit ID 29426 - * Fixed three bugs that were caused by the removal of CgString.freeFlag - in csoap_request.c csoap_response.c and chttp_packet.c. - -> Changed all of them to use cg_*_*_appendncontent(). - * Removed CG_HTTP_SUPPORT_NO_CONTENTLENGTH_REQUEST checking because it - is not an optional feature, but a necessary fix. - - -- Heikki Junnila Mon, 30 Jan 2006 10:35:34 +0200 - -clinkc (1.0-14) unstable; urgency=low - - * Changes from 2006-01-24 to 2006-01-24 - * Added commas between build dependencies in debian/control - * Changed cg_string_naddvalue to do a realloc every time. Otherwise it - will never free its memory unless cg_string_clear is called (and it - is called quite rarely unless the string is being deleted). - * Removed freeFlag from struct CgString and changed cg_string_replace - to use cg_string_setvalue instead of cg_string_setpointervalue - because it would consume huge amounts of memory over time. - - -- Heikki Junnila Tue, 24 Jan 2006 16:21:19 +0200 - -clinkc (1.0-13) unstable; urgency=low - - * Changes from 2006-01-20 to 2006-01-24 - * Changed libxml2 dependency to 2.6.0 and libcurl to 7.13.0 - * Changed the control point's device listener callback prototype - to use UDN instead of CgUpnpDevice* and also to pass a status - enum describing a bit more what will be done to the device. - * Changed to limit requested subscription time. - * Fixed device not to send more than 10 SSDPs in 200ms. - * When a device advertises from a new location, new device (and - service) description documents are reloaded from the new location. - * Changed to handle multiple devices on one machine. - * Fixed device HTTP server to answer 404 Invalid Var for invalid - query invokes. - * Fixed some macros. - * Added HTTP/1.1 request validity checking for HTTP server - * Added general socket timeout functionality (cg_socket_settimeout) - * Added Chunked Transfer Encoding support for reading HTTP packets - * Added asynchronous expiration handling for devices and - subscriptions - * Added HTTP HEAD-method support (required by HTTP/1.1 spec) - * Added devicelistener support - * Fixed control point to unsubscribe all subscribed services when - stopped. - * Fixed to handle escaped URIs when receiving HTTP requests - * Fixed not to crash when receiving malformed HTTP request - * Fixed to handle NOT FOUND case for GET-method - * Fixed to retry SOAP POST with M-POST (required by UPnP spec) - * Fixed to unsubscribe and subscribe when event is missed - - -- Heikki Junnila Tue, 24 Jan 2006 13:36:56 +0200 - -clinkc (1.0-12) unstable; urgency=low - - * Removed xml2-config from configure.in - * Changed libxml2 and libcurl presence checks to use AC_CHECK_LIB - - -- Heikki Junnila Fri, 20 Jan 2006 11:10:45 +0200 - -clinkc (1.0-11) unstable; urgency=low - - * Changed libxml2 dependency to libxml2-dev in debian/control - - -- Heikki Junnila Wed, 18 Jan 2006 12:25:53 +0200 - -clinkc (1.0-10) unstable; urgency=low - - * Added libxml2 to debian builddeps - - -- Heikki Junnila Tue, 17 Jan 2006 16:15:49 +0200 - -clinkc (1.0-9) unstable; urgency=low - - * Fixes from 2006-01-09 to 2006-01-16 - * Added HTTP-header parsing for curl - * Added state variable updating thru events - * Added NULL checks to cg_strcasecmp, cg_streq, cg_strcaseeq and cg_strtrim - * Changed event key to unsigned int instead of long to better fulfill - specifications - * Added API comments to csubscriber.[c|h] - * Added API comments to ceventlistener_list.c - * Fixed a typo: cg_http_request_isnotiryrequest -> - cg_http_request_isnotifyrequest - * Fixed a typo: cg_upnp_controlpoint_httprequestrecieved -> - cg_upnp_controlpoint_httprequestreceived - * Added device type parsing functions: - cg_upnp_devicetype_getidentifier, _geturn, _getdevice,_gettype and - _getversion - * Added cg_upnp_device_getdevicebytype(), - cg_upnp_device_getdevicebyexacttype(), - cg_upnp_controlpoint_getdevicebytype() and - cg_upnp_controlpoint_getdevicebyexacttype() - to enable searching for devices with/without version information. - * Removed *_getdevicebyname() and *_device_isname() functions because - UPnP specs don't specify UDN, type nor friendly name as being the - device's "name" attribute. - * Added cg_upnp_controlpoint_getdevicebyudn() and - cg_upnp_device_getdevicebyudn() functions to make up for the loss - of *_getdevicebyname() - * Removed *_getservicebyname() and *_service_isname() functions and - changed them to *_getservicebyexacttype in tests & samples. - * Removed the automatic search from cg_upnp_controlpoint_start(). - * Renamed cg_upnp_device_getservicebyname to - cg_upnp_device_getservicebyexacttype - * Added cg_upnp_servicetype_getschematype() - * Fixed existing cg_upnp_servicetype_ functions to accept - 1-character strings as well. - * Added service type parsing functions: - cg_upnp_servicetype_getidentifier, _geturn, _getservice,_gettype and - _getversion - * Added cg_upnp_device_getservicebytype() to enable searching for - services without version information. - - -- Heikki Junnila Tue, 17 Jan 2006 13:54:46 +0200 - -clinkc (1.0-8) unstable; urgency=low - - * Fixes from 28-Dec-2005 to 04-Jan-2006: - * Added configure option for CG_HTTP_SUPPORT_NO_CONTENTLENGTH_REQUEST - * Set configure defaults: libcurl=yes, libxml2=yes, libtool=yes, - nolength_http=yes - * Changed configure option descriptions to use AS_HELP_STRING - * Fixed chttp_request.c to add content to other than just POST requests - * Changed cg_http_response_issuccessful to accept all 2xx codes as successful - * chttp_request:c:334 had a newline after #ifdef without "\". Fixed. - * Added CACHE-CONTROL command line parameter to clock sample device - (for testing purposes). - * Fixed CURL transfer to timeout, if connection is disconnected. - * AC_ARG_WITH's option-if-set was used incorrectly in configure.in - * Added doxygen documentation to clinkc-dev package - - -- Heikki Junnila Thu, 5 Jan 2006 17:36:32 +0200 - -clinkc (1.0-7) unstable; urgency=low - - * Built new release for testing. Release includes patches created between - 07-Dec-2005 and 14-Dec-2005, see ChangeLog. - - -- Heikki Junnila Wed, 14 Dec 2005 21:57:51 +0200 - -clinkc (1.0-6) unstable; urgency=low - - * Built new release for testing. Release includes patches created between - 22-Nov-2005 and 02-Dec-2005, see ChangeLog. - - -- Heikki Junnila Wed, 14 Dec 2005 21:55:50 +0200 - -clinkc (1.0-5) unstable; urgency=low - - * Built new release for testing. Release includes patches created between - 09-Nov-2005 and 18-Nov-2005, see ChangeLog. - * - - -- Heikki Junnila Tue, 22 Nov 2005 10:02:39 +0200 - -clinkc (1.0-4) unstable; urgency=low - - * Added libcurl switch to configure scripts - * Built new release for testing - - -- Heikki Junnila Thu, 3 Nov 2005 09:56:28 +0200 - -clinkc (1.0-3) unstable; urgency=low - - * Added to sf.net CVS - * Created debian package - - -- Heikki Junnila Tue, 1 Nov 2005 16:04:24 +0200 - -clinkc (1.0-2) unstable; urgency=low - - * Fixed Debian building. - - -- Aapo Makela Wed, 5 Oct 2005 12:57:28 +0300 - -clinkc (1.0-1) unstable; urgency=low - - * Initial Release. - - -- Aapo Makela Mon, 22 Aug 2005 14:25:06 +0300 - diff -Naur clinkc/debian/clinkc0.install clinkc_patch/debian/clinkc0.install --- clinkc/debian/clinkc0.install 2006-09-22 19:06:10.000000000 +0800 +++ clinkc_patch/debian/clinkc0.install 1970-01-01 08:00:00.000000000 +0800 @@ -1,2 +0,0 @@ -usr/lib/*.so.* -usr/share/doc/clinkc0/* diff -Naur clinkc/debian/clinkc-dev.install clinkc_patch/debian/clinkc-dev.install --- clinkc/debian/clinkc-dev.install 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/debian/clinkc-dev.install 1970-01-01 08:00:00.000000000 +0800 @@ -1,6 +0,0 @@ -usr/include/* -usr/include/cybergarage/* -usr/lib/pkgconfig/* -usr/lib/lib*.a -usr/lib/lib*.so -usr/share/doc/clinkc-dev/* diff -Naur clinkc/debian/clinkcmaemo0.install clinkc_patch/debian/clinkcmaemo0.install --- clinkc/debian/clinkcmaemo0.install 2005-12-15 03:59:07.000000000 +0800 +++ clinkc_patch/debian/clinkcmaemo0.install 1970-01-01 08:00:00.000000000 +0800 @@ -1 +0,0 @@ -usr/lib/*.so.* diff -Naur clinkc/debian/compat clinkc_patch/debian/compat --- clinkc/debian/compat 2005-10-31 22:09:10.000000000 +0800 +++ clinkc_patch/debian/compat 1970-01-01 08:00:00.000000000 +0800 @@ -1 +0,0 @@ -4 diff -Naur clinkc/debian/control clinkc_patch/debian/control --- clinkc/debian/control 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/debian/control 1970-01-01 08:00:00.000000000 +0800 @@ -1,45 +0,0 @@ -Source: clinkc -Section: libs -Priority: optional -Maintainer: Mikael Saarenpää -Build-Depends: debhelper (>= 4.0.0), libcurl3-dev (>= 7.13.0), libxml2-dev (>= 2.6.0) -Standards-Version: 3.6.0 - -Package: clinkc-dev -Section: devel -Architecture: any -Depends: clinkc0, libcurl3-dev (>= 7.13.0), libxml2-dev (>= 2.6.0) -Description: Development files for CyberLink for C UPnP library - CyberLink for C is a toolkit for creating UPnP devices and control points. - Main features are automatic discovery, search, expiration handling and - different controlling methods for UPnP control points and advertizing and - eventing for UPnP devices. - . - This package contains header files and API documentation which are needed - for developing UPnP applications with CyberLink for C. - -Package: clinkc0 -Section: libs -Architecture: any -Depends: libcurl3 (>= 7.13.0), libxml2 (>= 2.6.0) -Description: CyberLink for C UPnP library - CyberLink for C is a toolkit for creating UPnP devices and control points. - Main features are automatic discovery, search, expiration handling and - different controlling methods for UPnP control points and advertizing and - eventing for UPnP devices. - . - This package contains the dynamically loadable library needed by - applications which use CyberLinkC for C. - -Package: clinkc0-dbg -Section: libs -Architecture: any -Depends: clinkc0 (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} -Description: CyberLink for C UPnP library - CyberLink for C is a toolkit for creating UPnP devices and control points. - Main features are automatic discovery, search, expiration handling and - different controlling methods for UPnP control points and advertizing and - eventing for UPnP devices. - . - This package contains the debug symbols for the actual library. - diff -Naur clinkc/debian/copyright clinkc_patch/debian/copyright --- clinkc/debian/copyright 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/debian/copyright 1970-01-01 08:00:00.000000000 +0800 @@ -1,37 +0,0 @@ -This package was debianized by Heikki Junnila on -Tue, 26 Jul 2005 09:53:06 +0300. - -It was downloaded from - -Upstream Author(s): - -Copyright: - -Copyright (C) 2002-2003 Satoshi Konno -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 name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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. - - -CyberLink for C has been supported from IPA, INFORMATION-TECHNOLOGY PROMOTION AGENCY, JAPAN, as a project of Exploratory Software Project. - -Copyright (c) 2005-2006, Nokia Corporation -All rights reserved. - -Subject to the below, redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the names of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 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. - -In addition to the disclaimer above and not limiting its generality, no assurances are provided by Nokia Corporation that the software does not infringe patents of either third parties or Nokia Corporation in any particular jurisdiction. As a condition to exercising the rights and licenses granted hereunder in any particular jurisdiction, each recipient hereby assumes sole responsibility to procure licenses under any relevant patents in that jurisdiction. For example, if a third party patent license is required to allow recipient to distribute the program in a particular country, it is recipient's responsibility to acquire that license before distributing the program. diff -Naur clinkc/debian/dirs clinkc_patch/debian/dirs --- clinkc/debian/dirs 2005-10-31 22:09:10.000000000 +0800 +++ clinkc_patch/debian/dirs 1970-01-01 08:00:00.000000000 +0800 @@ -1,2 +0,0 @@ -usr/bin -usr/sbin diff -Naur clinkc/debian/docs clinkc_patch/debian/docs --- clinkc/debian/docs 2006-09-22 19:06:10.000000000 +0800 +++ clinkc_patch/debian/docs 1970-01-01 08:00:00.000000000 +0800 @@ -1 +0,0 @@ -COPYING diff -Naur clinkc/debian/rules clinkc_patch/debian/rules --- clinkc/debian/rules 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/debian/rules 1970-01-01 08:00:00.000000000 +0800 @@ -1,103 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -# shared library versions, option 1 -#version=2.0.5 -#major=2 -# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -version=`ls lib/unix/.libs/lib*.so.* | \ - awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -major=`ls lib/unix/.libs/lib*.so.* | \ - awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` - -config.status: configure - dh_testdir - # Add here commands to configure the package. - CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-optimized-cp --enable-anyaddr --enable-libxml2 --enable-libcurl - -build: build-stamp -build-stamp: config.status - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) distclean -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - -rm -rf doxygen - - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/tmp - $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot -# dh_installchangelogs debian/changelog -# dh_installdocs -# dh_installexamples - dh_install -v --sourcedir=debian/tmp -# dh_installman - dh_link - dh_strip --dbg-package=clinkc0 - dh_compress - dh_fixperms - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install diff -Naur clinkc/Doxyfile clinkc_patch/Doxyfile --- clinkc/Doxyfile 2011-04-08 02:45:40.000000000 +0800 +++ clinkc_patch/Doxyfile 1970-01-01 08:00:00.000000000 +0800 @@ -1,223 +0,0 @@ -# Doxyfile 1.4.6 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "CyberLink for C" -PROJECT_NUMBER = -OUTPUT_DIRECTORY = ./doxygen -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = src include -FILE_PATTERNS = *.c *.h -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -USE_HTAGS = NO -VERBATIM_HEADERS = NO -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = DoxyFooterFile -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff -Naur clinkc/Doxyfile.objc clinkc_patch/Doxyfile.objc --- clinkc/Doxyfile.objc 2011-04-08 23:51:49.000000000 +0800 +++ clinkc_patch/Doxyfile.objc 1970-01-01 08:00:00.000000000 +0800 @@ -1,223 +0,0 @@ -# Doxyfile 1.4.6 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "CyberLink for Objective-C" -PROJECT_NUMBER = -OUTPUT_DIRECTORY = ./doxygen -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = wrapper std/upnpav/wrapper -FILE_PATTERNS = *.h *.m -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -USE_HTAGS = NO -VERBATIM_HEADERS = NO -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = DoxyFooterFile -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff -Naur clinkc/DoxyFooterFile clinkc_patch/DoxyFooterFile --- clinkc/DoxyFooterFile 2011-04-08 02:45:40.000000000 +0800 +++ clinkc_patch/DoxyFooterFile 1970-01-01 08:00:00.000000000 +0800 @@ -1,12 +0,0 @@ - - - diff -Naur clinkc/include/cybergarage/http/cb64.h clinkc_patch/include/cybergarage/http/cb64.h --- clinkc/include/cybergarage/http/cb64.h 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/include/cybergarage/http/cb64.h 2014-01-29 13:54:26.642322411 +0800 @@ -0,0 +1,479 @@ +/* ///////////////////////////////////////////////////////////////////////// + * File: b64/b64.h + * + * Purpose: Header file for the b64 library + * + * Created: 18th October 2004 + * Updated: 4th February 2012 + * + * Thanks: To Adam McLaurin, for ideas regarding the b64_decode2() and + * b64_encode2(). + * + * Home: http://synesis.com.au/software/ + * + * Copyright (c) 2004-2012, Matthew Wilson and Synesis Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of + * any contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 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. + * + * ////////////////////////////////////////////////////////////////////// */ + + +/** \file b64/b64.h + * + * \brief [C/C++] Header file for the b64 library. + */ + +#ifndef B64_INCL_B64_H_B64 +#define B64_INCL_B64_H_B64 + +/* ///////////////////////////////////////////////////////////////////////// + * Version information + */ + +#ifndef B64_DOCUMENTATION_SKIP_SECTION +# define B64_VER_B64_H_B64_MAJOR 1 +# define B64_VER_B64_H_B64_MINOR 6 +# define B64_VER_B64_H_B64_REVISION 3 +# define B64_VER_B64_H_B64_EDIT 35 +#endif /* !B64_DOCUMENTATION_SKIP_SECTION */ + +/** \def B64_VER_MAJOR + * The major version number of b64 + */ + +/** \def B64_VER_MINOR + * The minor version number of b64 + */ + +/** \def B64_VER_REVISION + * The revision version number of b64 + */ + +/** \def B64_VER + * The current composite version number of b64 + */ + +#ifndef B64_DOCUMENTATION_SKIP_SECTION +# define B64_VER_1_0_1 0x01000100 +# define B64_VER_1_0_2 0x01000200 +# define B64_VER_1_0_3 0x01000300 +# define B64_VER_1_1_1 0x01010100 +# define B64_VER_1_1_2 0x01010200 +# define B64_VER_1_1_3 0x01010300 +# define B64_VER_1_2_1 0x01020100 +# define B64_VER_1_2_2 0x01020200 +# define B64_VER_1_2_3 0x01020300 +# define B64_VER_1_2_4 0x01020400 +# define B64_VER_1_2_5 0x01020500 +# define B64_VER_1_2_6 0x01020600 +# define B64_VER_1_2_7 0x01020700 +# define B64_VER_1_3_1 0x010301ff +# define B64_VER_1_3_2 0x010302ff +# define B64_VER_1_3_3 0x010303ff +# define B64_VER_1_3_4 0x010304ff +# define B64_VER_1_4_1_ALPHA_1 0x01040101 +# define B64_VER_1_4_2 0x010402ff +#endif /* !B64_DOCUMENTATION_SKIP_SECTION */ + +#define B64_VER_MAJOR 1 +#define B64_VER_MINOR 4 +#define B64_VER_REVISION 2 +#define B64_VER 0x010402ff + +/* ///////////////////////////////////////////////////////////////////////// + * Includes + */ + +#include + +/* ///////////////////////////////////////////////////////////////////////// + * Features + */ + +/* If the Synesis preprocessor symbol SYNESIS_VARIANT_TEST is defined, then we + * automatically define B64_VARIANT_TEST, which requests a test build: i.e. + * debug information off, optimisations on, contract enforcements on + */ +#if defined(SYNESIS_VARIANT_TEST) +# if !defined(B64_VARIANT_TEST) +# define B64_VARIANT_TEST +# endif /* !B64_VARIANT_TEST */ +#endif /* SYNESIS_VARIANT_TEST */ + +/* ///////////////////////////////////////////////////////////////////////// + * Namespace + */ + +#if !defined(B64_NO_NAMESPACE) && \ + !defined(__cplusplus) +# define B64_NO_NAMESPACE +#endif /* !B64_NO_NAMESPACE && !__cplusplus */ + +#ifdef B64_NAMESPACE +# undef B64_NAMESPACE +#endif /* B64_NAMESPACE */ + +#ifdef B64_NAMESPACE_QUALIFIER +# undef B64_NAMESPACE_QUALIFIER +#endif /* B64_NAMESPACE_QUALIFIER */ + + +#ifndef B64_NO_NAMESPACE + +# ifdef B64_CUSTOM_NAMESPACE +# define B64_NAMESPACE B64_CUSTOM_NAMESPACE +# else /* ? B64_CUSTOM_NAMESPACE */ +# define B64_NAMESPACE b64 +# endif /* B64_CUSTOM_NAMESPACE */ + +# if defined(B64_CUSTOM_NAMESPACE) && \ + defined(B64_CUSTOM_NAMESPACE_QUALIFIER) +# define B64_NAMESPACE_QUALIFIER B64_CUSTOM_NAMESPACE_QUALIFIER +# else /* B64_CUSTOM_NAMESPACE && B64_CUSTOM_NAMESPACE_QUALIFIER */ +# define B64_NAMESPACE_QUALIFIER ::B64_NAMESPACE +# endif /* B64_CUSTOM_NAMESPACE && B64_CUSTOM_NAMESPACE_QUALIFIER */ + + +/** [C/C++] The b64 namespace, within which the core library types and functions + * reside in C++ compilation. In C compilation, they all reside in the global + * namespace. + * + * \htmlonly + *
+ * \endhtmlonly + */ +namespace B64_NAMESPACE +{ +#endif /* !B64_NO_NAMESPACE */ + +/* ///////////////////////////////////////////////////////////////////////// + * Typedefs + */ + +/** The ambient character type of the library + * + * \note Currently, this is always \c char, supporting only multibyte strings + */ +typedef char b64_char_t; + +/** Return codes (from b64_encode2() / b64_decode2()) + */ +enum B64_RC +{ + B64_RC_OK = 0 /*!< Operation was successful. */ + , B64_RC_INSUFFICIENT_BUFFER = 1 /*!< The given translation buffer was not of sufficient size. */ + , B64_RC_TRUNCATED_INPUT = 2 /*!< The input did not represent a fully formed stream of octet couplings. */ + , B64_RC_DATA_ERROR = 3 /*!< Invalid data. */ +#ifndef B64_DOCUMENTATION_SKIP_SECTION + , B64_max_RC_value +#endif /* !B64_DOCUMENTATION_SKIP_SECTION */ +}; + +#ifndef __cplusplus +typedef enum B64_RC B64_RC; +#endif /* !__cplusplus */ + +/** Coding behaviour modification flags (for b64_encode2() / b64_decode2()) + */ +enum B64_FLAGS +{ + B64_F_LINE_LEN_USE_PARAM = 0x0000 /*!< Uses the lineLen parameter to b64_encode2(). Ignored by b64_decode2(). */ + , B64_F_LINE_LEN_INFINITE = 0x0001 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is infinite. Ignored by b64_decode2(). */ + , B64_F_LINE_LEN_64 = 0x0002 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is 64. Ignored by b64_decode2(). */ + , B64_F_LINE_LEN_76 = 0x0003 /*!< Ignores the lineLen parameter to b64_encode2(). Line length is 76. Ignored by b64_decode2(). */ + , B64_F_LINE_LEN_MASK = 0x000f /*!< Mask for testing line length flags to b64_encode2(). Ignored by b64_encode2(). */ + , B64_F_STOP_ON_NOTHING = 0x0000 /*!< Decoding ignores all invalid characters in the input data. Ignored by b64_encode2(). */ + , B64_F_STOP_ON_UNKNOWN_CHAR = 0x0100 /*!< Causes decoding to break if any non-Base-64 [a-zA-Z0-9=+/], non-whitespace character is encountered. Ignored by b64_encode2(). */ + , B64_F_STOP_ON_UNEXPECTED_WS = 0x0200 /*!< Causes decoding to break if any unexpected whitespace is encountered. Ignored by b64_encode2(). */ + , B64_F_STOP_ON_BAD_CHAR = 0x0300 /*!< Causes decoding to break if any non-Base-64 [a-zA-Z0-9=+/] character is encountered. Ignored by b64_encode2(). */ +}; + +#ifndef __cplusplus +typedef enum B64_FLAGS B64_FLAGS; +#endif /* !__cplusplus */ + +/* ///////////////////////////////////////////////////////////////////////// + * Functions + */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** Encodes a block of binary data into Base-64 + * + * \param src Pointer to the block to be encoded. May not be NULL, except when + * \c dest is NULL, in which case it is ignored. + * \param srcSize Length of block to be encoded + * \param dest Pointer to the buffer into which the result is to be written. May + * be NULL, in which case the function returns the required length + * \param destLen Length of the buffer into which the result is to be written. Must + * be at least as large as that indicated by the return value from + * \link b64::b64_encode b64_encode(NULL, srcSize, NULL, 0)\endlink. + * + * \return 0 if the size of the buffer was insufficient, or the length of the + * converted buffer was longer than \c destLen + * + * \note The function returns the required length if \c dest is NULL + * + * \note The function returns the required length if \c dest is NULL. The returned size + * might be larger than the actual required size, but will never be smaller. + * + * \note Threading: The function is fully re-entrant. + * + * \see b64::encode() + */ +size_t b64_encode( + void const* src +, size_t srcSize +, b64_char_t* dest +, size_t destLen +); + +/** Encodes a block of binary data into Base-64 + * + * \param src Pointer to the block to be encoded. May not be NULL, except when + * \c dest is NULL, in which case it is ignored. + * \param srcSize Length of block to be encoded + * \param dest Pointer to the buffer into which the result is to be written. May + * be NULL, in which case the function returns the required length + * \param destLen Length of the buffer into which the result is to be written. Must + * be at least as large as that indicated by the return value from + * \link b64::b64_encode2 b64_encode2(NULL, srcSize, NULL, 0, flags, lineLen, rc)\endlink. + * \param flags A combination of the B64_FLAGS enumeration, that moderate the + * behaviour of the function + * \param lineLen If the flags parameter contains B64_F_LINE_LEN_USE_PARAM, then + * this parameter represents the length of the lines into which the encoded form is split, + * with a hard line break ('\\r\\n'). If this value is 0, then the line is not + * split. If it is <0, then the RFC-1113 recommended line length of 64 is used + * \param rc The return code representing the status of the operation. May be NULL. + * + * \return 0 if the size of the buffer was insufficient, or the length of the + * converted buffer was longer than \c destLen + * + * \note The function returns the required length if \c dest is NULL. The returned size + * might be larger than the actual required size, but will never be smaller. + * + * \note Threading: The function is fully re-entrant. + * + * \see b64::encode() + */ +size_t b64_encode2( + void const* src +, size_t srcSize +, b64_char_t* dest +, size_t destLen +, unsigned flags +, int lineLen /* = 0 */ +, B64_RC* rc /* = NULL */ +); + +/** Decodes a sequence of Base-64 into a block of binary data + * + * \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when + * \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is + * not NULL, then the returned value is calculated exactly, otherwise a value + * is returned that is guaranteed to be large enough to hold the decoded block. + * + * \param srcLen Length of block to be encoded. Must be an integral of 4, the Base-64 + * encoding quantum, otherwise the Base-64 block is assumed to be invalid + * \param dest Pointer to the buffer into which the result is to be written. May + * be NULL, in which case the function returns the required length + * \param destSize Length of the buffer into which the result is to be written. Must + * be at least as large as that indicated by the return value from + * \c b64_decode(src, srcSize, NULL, 0), even in the case where the encoded form + * contains a number of characters that will be ignored, resulting in a lower total + * length of converted form. + * + * \return 0 if the size of the buffer was insufficient, or the length of the + * converted buffer was longer than \c destSize + * + * \note The function returns the required length if \c dest is NULL. The returned size + * might be larger than the actual required size, but will never be smaller. + * + * \note \anchor anchor__4_characters The behaviour of both + * \link b64::b64_encode2 b64_encode2()\endlink + * and + * \link b64::b64_decode2 b64_decode2()\endlink + * are undefined if the line length is not a multiple of 4. + * + * \note Threading: The function is fully re-entrant. + * + * \see b64::decode() + */ +size_t b64_decode( + b64_char_t const* src +, size_t srcLen +, void* dest +, size_t destSize +); + +/** Decodes a sequence of Base-64 into a block of binary data + * + * \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when + * \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is + * not NULL, then the returned value is calculated exactly, otherwise a value + * is returned that is guaranteed to be large enough to hold the decoded block. + * + * \param srcLen Length of block to be encoded. Must be an integral of 4, the Base-64 + * encoding quantum, otherwise the Base-64 block is assumed to be invalid + * \param dest Pointer to the buffer into which the result is to be written. May + * be NULL, in which case the function returns the required length + * \param destSize Length of the buffer into which the result is to be written. Must + * be at least as large as that indicated by the return value from + * \c b64_decode(src, srcSize, NULL, 0), even in the case where the encoded form + * contains a number of characters that will be ignored, resulting in a lower total + * length of converted form. + * \param flags A combination of the B64_FLAGS enumeration, that moderate the + * behaviour of the function. + * \param rc The return code representing the status of the operation. May be NULL. + * \param badChar If the flags parameter does not contain B64_F_STOP_ON_NOTHING, this + * parameter specifies the address of a pointer that will be set to point to any + * character in the sequence that stops the parsing, as dictated by the flags + * parameter. May be NULL. + * + * \return 0 if the size of the buffer was insufficient, or the length of the + * converted buffer was longer than \c destSize, or a bad character stopped parsing. + * + * \note The function returns the required length if \c dest is NULL. The returned size + * might be larger than the actual required size, but will never be smaller. + * + * \note The behaviour of both + * \link b64::b64_encode2 b64_encode2()\endlink + * and + * \link b64::b64_decode2 b64_decode2()\endlink + * are undefined if the line length is not a multiple of 4. + * + * \note Threading: The function is fully re-entrant. + * + * \see b64::decode() + */ +size_t b64_decode2( + b64_char_t const* src +, size_t srcLen +, void* dest +, size_t destSize +, unsigned flags +, b64_char_t const** badChar /* = NULL */ +, B64_RC* rc /* = NULL */ +); + +/** Returns the textual description of the error + * + * \param code The \link b64::B64_RC error code\endlink + * + * \deprecated This function is deprecated and will be removed in a future + * release; instead use b64_getStatusCodeString(). + */ +char const* b64_getErrorString(B64_RC code); + +/** Returns the length of the textual description of the error + * + * \see b64_getErrorString() + * + * \param code The \link b64::B64_RC error code\endlink + * + * \deprecated This function is deprecated and will be removed in a future + * release; instead use b64_getStatusCodeStringLength(). + */ +size_t b64_getErrorStringLength(B64_RC code); + + +/** \def b64_getStatusCodeString(code) + * + * Returns the textual description of the error + * + * \param code The \link b64::B64_RC error code\endlink + * + * \see b64_getStatusCodeStringLength, b64_getErrorString, b64_getErrorStringLength + */ +#define b64_getStatusCodeString b64_getErrorString + +/** \def b64_getStatusCodeStringLength(code) + * + * Returns the length of the textual description of the error + * + * \param code The \link b64::B64_RC error code\endlink + * + * \see b64_getStatusCodeString, b64_getErrorString, b64_getErrorStringLength + */ +#define b64_getStatusCodeStringLength b64_getErrorStringLength + + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +/* ///////////////////////////////////////////////////////////////////////// + * Namespace + */ + +#ifndef B64_NO_NAMESPACE +} /* namespace B64_NAMESPACE */ + +# ifndef B64_DOCUMENTATION_SKIP_SECTION + +namespace stlsoft +{ + + inline char const *c_str_data_a( B64_NAMESPACE_QUALIFIER::B64_RC code) + { + return B64_NAMESPACE_QUALIFIER::b64_getStatusCodeString(code); + } + inline char const *c_str_data( B64_NAMESPACE_QUALIFIER::B64_RC code) + { + return B64_NAMESPACE_QUALIFIER::b64_getStatusCodeString(code); + } + + inline size_t c_str_len_a( B64_NAMESPACE_QUALIFIER::B64_RC code) + { + return B64_NAMESPACE_QUALIFIER::b64_getStatusCodeStringLength(code); + } + inline size_t c_str_len( B64_NAMESPACE_QUALIFIER::B64_RC code) + { + return B64_NAMESPACE_QUALIFIER::b64_getStatusCodeStringLength(code); + } + + inline char const *c_str_ptr_a( B64_NAMESPACE_QUALIFIER::B64_RC code) + { + return B64_NAMESPACE_QUALIFIER::b64_getStatusCodeString(code); + } + inline char const *c_str_ptr( B64_NAMESPACE_QUALIFIER::B64_RC code) + { + return B64_NAMESPACE_QUALIFIER::b64_getStatusCodeString(code); + } + +} /* namespace stlsoft */ + +# endif /* !B64_DOCUMENTATION_SKIP_SECTION */ + +#endif /* !B64_NO_NAMESPACE */ + +/* ////////////////////////////////////////////////////////////////////// */ + +#endif /* B64_INCL_B64_H_B64 */ + +/* ///////////////////////////// end of file //////////////////////////// */ diff -Naur clinkc/include/cybergarage/http/chttp_authentication.h clinkc_patch/include/cybergarage/http/chttp_authentication.h --- clinkc/include/cybergarage/http/chttp_authentication.h 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/include/cybergarage/http/chttp_authentication.h 2014-01-29 13:54:26.642322411 +0800 @@ -0,0 +1,104 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: chttp_authentication.h +* +* Revision: +* +* 05/31/12 +* - first release ZyXEL +* +******************************************************************/ +#ifndef _CG_HTTP_AUTHENTICATION_H_ +#define _CG_HTTP_AUTHENTICATION_H_ + +#include + +/**************************************** +* Define +****************************************/ +/*authentication status code*/ +#define CG_HTTP_STATUS_UNAUTHORIZED 401 +/*authentication header*/ +#define CG_HTTP_WWW_AUTHENTICATION "WWW-Authenticate" +#define CG_HTTP_AUTHENTICATION "Authorization" +#define CG_HTTP_REALM "realm" +#define CG_HTTP_NONCE "nonce" +#define CG_HTTP_QOP "qop" +#define CG_HTTP_URI "uri" +#define CG_HTTP_NONCE_COUNT "nc" +#define CG_HTTP_OPAQUE "opaque" +#define CG_HTTP_CNONCE "cnonce" +#define CG_HTTP_RESPONSE "response" +#define CG_HTTP_STALE "stale" +#define CG_HTTP_ALGORITHM "algorithm" +#define CG_HTTP_USERNAME "username" + +#define CG_HTTP_DEFAULT_OPAQUE "WnlYRUwuY29t" +#define CG_HTTP_DEFAULT_REALM "ZyXEL.com" +#define CG_HTTP_DEFAULT_QOP "auth" +#define CG_HTTP_DEFAULT_ALGORITHM "MD5" + +typedef enum +{ + HTTP_AUTH_ERROR = -1, + HTTP_AUTH_SUCCESS = 0, + HTTP_AUTH_INVALID_USERNAME, + HTTP_AUTH_INVALID_PASSWORD, + HTTP_AUTH_NOT_EXIST +} authRet_t; +/**************************************** +* Function +****************************************/ + +#define cg_http_response_getauth(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_WWW_AUTHENTICATION); +#define cg_http_response_getrealm(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_REALM); +#define cg_http_response_getnonce(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_NONCE); +#define cg_http_response_getqop(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_QOP); +#define cg_http_response_getopaque(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_OPAQUE); +#define cg_http_response_getstale(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_STALE); +#define cg_http_response_getalgorithm(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_ALGORITHM); + +#define cg_http_request_getauth(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_AUTHENTICATION); +#define cg_http_request_getresponse(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_RESPONSE); +#define cg_http_request_getrealm(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_REALM); +#define cg_http_request_getnonce(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_NONCE); +#define cg_http_request_getcnonce(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_CNONCE); +#define cg_http_request_getqop(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_QOP); +#define cg_http_request_getopaque(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_OPAQUE); +#define cg_http_request_getalgorithm(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_ALGORITHM); +#define cg_http_request_getnc(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_NONCE_COUNT); +#define cg_http_request_getusername(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_USERNAME); + + +CgHttpResponse *cg_http_request_post_with_auth(CgHttpRequest *httpReq, char *ipaddr, int port, char *user, char *passwd); +void cg_http_auth_header_parse(CgHttpPacket *httpPkt); + +/*basic authentication*/ +/*note: please free the return pointer after using*/ +char *cg_http_base64encode(char *user, char *passwd); +char *cg_http_base64decode(char *base64Str); +void sendBasicChallenge(CgHttpRequest *httpReq, char *realm); +authRet_t cg_http_request_check_basic_auth(CgHttpRequest *httpReq, char *user, char *passwd, BOOL cookieAuthentication); + +/*digest authentication*/ +void initDigestInfo(CgHttpAuth **digest); +char *generateCnonce(); +void generateNonce(char nonce[]); +void sendDigestChallenge(CgHttpRequest *httpReq, char *realm); +authRet_t cg_http_request_check_digest_auth(CgHttpRequest *httpReq, char *user, char *passwd); + +/*url encode and decode*/ +/*note: please free the return pointer after using*/ +char *cg_http_url_encode(char *str); +char *cg_http_url_decode(char *str); + +#endif /*_CG_HTTP_AUTHENTICATION_H_*/ diff -Naur clinkc/include/cybergarage/http/chttp_cookie.h clinkc_patch/include/cybergarage/http/chttp_cookie.h --- clinkc/include/cybergarage/http/chttp_cookie.h 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/include/cybergarage/http/chttp_cookie.h 2014-01-29 13:54:26.642322411 +0800 @@ -0,0 +1,81 @@ +/****************************************************************** +* +* File: chttp_cookie.h +* +* Revision: +* +* 07/19/12 +* - first release ZyXEL +* +******************************************************************/ + +#ifndef _CG_HTTP_COOKIE_H_ +#define _CG_HTTP_COOKIE_H_ + +#include + +/**************************************** +* Define +****************************************/ +#define CG_HTTP_SETCOOKIE "Set-Cookie" +#define CG_HTTP_SETCOOKIE2 "Set-Cookie2" +#define CG_HTTP_COOKIE "Cookie" + +/*set-cookie set-cookie2*/ +#define MAX_NUM_COOKIES 20 +#define SIZE_COOKIE 4096 /*RFC2965: at least 4096 bytes per cookie */ +#define SIZE_COOKIE_NAME 64 +#define SIZE_COOKIE_VALUE 512 +#define SIZE_COOKIE_COMMENT 512 +#define SIZE_COOKIE_URL 256 +#define SIZE_COOKIE_DOMAIN 256 +#define SIZE_COOKIE_MAXAGE 16 +#define SIZE_COOKIE_PATH 256 +#define SIZE_COOKIE_PORT 512 +#define SIZE_COOKIE_VERSION 16 +#define SIZE_COOKIE_EXPIRES 32 + +#define CG_HTTP_COOKIE_COMMENT "Comment" +#define CG_HTTP_COOKIE_URL "CommentURL" +#define CG_HTTP_COOKIE_DISCARD "Discard" +#define CG_HTTP_COOKIE_DOMAIN "Domain" +#define CG_HTTP_COOKIE_MAXAGE "Max-Age" +#define CG_HTTP_COOKIE_PATH "Path" +#define CG_HTTP_COOKIE_PORT "Port" +#define CG_HTTP_COOKIE_SECURE "Secure" +#define CG_HTTP_COOKIE_VERSION "Version" +/*set-cookie set-cookie2*/ + +typedef struct _CgHttpCookieData +{ + char name[SIZE_COOKIE_NAME+1]; + char value[SIZE_COOKIE_VALUE+1]; + /* <- RFC2965 set-cookie2 ->*/ + char comment[SIZE_COOKIE_COMMENT+1]; + char commentURL[SIZE_COOKIE_URL+1]; + BOOL discard; + char domain[SIZE_COOKIE_DOMAIN+1];/*Domain=.example.com*/ + char maxAge[SIZE_COOKIE_MAXAGE+1]; /*1*DIGIT*/ + char path[SIZE_COOKIE_PATH+1]; + char port[SIZE_COOKIE_PORT+1]; + BOOL secure; + char version[SIZE_COOKIE_VERSION+1]; + /* <-RFC2965 set-cookie2 ->*/ +} CgHttpCookieData; + +/**************************************** +* Function +****************************************/ +/**** Cookie ****/ +#define cg_http_request_setcookie(httpReq,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpReq,CG_HTTP_COOKIE,value) +#define cg_http_request_setcookie_multi(httpReq,value) cg_http_packet_setheadervalue_multi((CgHttpPacket*)httpReq,CG_HTTP_COOKIE,value) +#define cg_http_request_getcookie(httpReq) cg_http_packet_getheadervalue((CgHttpPacket*)httpReq,CG_HTTP_COOKIE) + +#define cg_http_response_setcookie(httpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_SETCOOKIE,value) +#define cg_http_response_setcookie2(httpRes,value) cg_http_packet_setheadervalue((CgHttpPacket*)httpRes,CG_HTTP_SETCOOKIE2,value) +#define cg_http_response_getcookie(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_SETCOOKIE) +#define cg_http_response_getcookie2(httpRes) cg_http_packet_getheadervalue((CgHttpPacket*)httpRes,CG_HTTP_SETCOOKIE2) + +void cg_http_cookie_header_parse(char * cookie,CgHttpCookieData * cookiedata); + +#endif /*_CG_HTTP_COOKIE_H_*/ diff -Naur clinkc/include/cybergarage/http/chttp.h clinkc_patch/include/cybergarage/http/chttp.h --- clinkc/include/cybergarage/http/chttp.h 2009-08-18 03:30:32.000000000 +0800 +++ clinkc_patch/include/cybergarage/http/chttp.h 2014-01-29 13:54:26.642322411 +0800 @@ -51,7 +51,7 @@ ****************************************/ -#define CG_HTTP_READLINE_BUFSIZE 512 +#define CG_HTTP_READLINE_BUFSIZE 1024 #define CG_HTTP_SEVERNAME_MAXLEN 64 #define CG_HTTP_DATE_MAXLEN 128 @@ -80,16 +80,22 @@ #define CG_HTTP_STATUS_CONTINUE 100 #define CG_HTTP_STATUS_OK 200 #define CG_HTTP_STATUS_PARTIAL_CONTENT 206 +#define CG_HTTP_STATUS_FOUND 302 +#define CG_HTTP_STATUS_TEMPORARY_REDIRECT 307 #define CG_HTTP_STATUS_BAD_REQUEST 400 +#define CG_HTTP_STATUS_FORBIDDEN 403 #define CG_HTTP_STATUS_NOT_FOUND 404 #define CG_HTTP_STATUS_METHOD_NOT_ALLOWED 405 #define CG_HTTP_STATUS_PRECONDITION_FAILED 412 #define CG_HTTP_STATUS_INVALID_RANGE 416 #define CG_HTTP_STATUS_INTERNAL_SERVER_ERROR 500 +#define CG_HTTP_STATUS_SERVICE_UNAVAILABLE 503 +#define CG_HTTP_STATUS_GATEWAY_TIMEOUT 504 #define CG_HTTP_POST "POST" #define CG_HTTP_GET "GET" #define CG_HTTP_HEAD "HEAD" +#define CG_HTTP_PUT "PUT" #define CG_HTTP_HOST "HOST" #define CG_HTTP_DATE "Date" @@ -188,6 +194,29 @@ /**************************************** * Data Type ****************************************/ +typedef enum { + AUTH_OK, + AUTH_STALE, + AUTH_WRONG_INPUT, + AUTH_UNSUPPORT_ALGORITHM, + AUTH_UNSUPPORT_AUTH +} errorCode; + +typedef struct _CgHttpAuth { + errorCode result; + char *realm; + char nonce[512]; + char *algorithm; + char *qop; + char *cnonce; + char *opaque; + char *username; + char *response; + unsigned int nc; + char clientHost[17]; + struct _CgHttpAuth *next; +} CgHttpAuth; + typedef struct _CgHttpHeader { BOOL headFlag; @@ -210,6 +239,9 @@ CgString *reasonPhrase; void *userData; int timeout; +#ifdef ZYXEL_PATCH + CgHttpAuth authData; /*for authentication, ZyXEL, 2012*/ +#endif } CgHttpResponse; typedef struct _CgHttpRequest { @@ -224,6 +256,10 @@ CgNetURL *postURL; void *userData; int timeout; +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + void *ctxdata; + CgHttpAuth authData; +#endif } CgHttpRequest; typedef void (*CG_HTTP_LISTENER)(CgHttpRequest *); @@ -239,6 +275,9 @@ void *userData; int timeout; CgMutex *mutex; +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + void *ctxdata; +#endif } CgHttpServer, CgHttpServerList; /**************************************** @@ -281,6 +320,9 @@ CgHttpHeader *cg_http_headerlist_get(CgHttpHeaderList *headerList, char *name); void cg_http_headerlist_set(CgHttpHeaderList *headerList, char *name, char *value); +#ifdef ZYXEL_PATCH /*support multiple header value, ZyXEL 2013*/ +void cg_http_headerlist_set_multi(CgHttpHeaderList *headerList, char *name, char *value); +#endif char *cg_http_headerlist_getvalue(CgHttpHeaderList *headerList, char *name); /**************************************** @@ -305,6 +347,9 @@ #define cg_http_packet_addheader(httpPkt, header) cg_http_headerlist_add(httpPkt->headerList, header) void cg_http_packet_setheadervalue(CgHttpPacket *httpPkt, char* name, char *value); +#ifdef ZYXEL_PATCH /*support multiple header value, ZyXEL 2013*/ +void cg_http_packet_setheadervalue_multi(CgHttpPacket *httpPkt, char* name, char *value); +#endif void cg_http_packet_setheaderinteger(CgHttpPacket *httpPkt, char* name, int value); void cg_http_packet_setheaderlong(CgHttpPacket *httpPkt, char* name, long value); char *cg_http_packet_getheadervalue(CgHttpPacket *httpPkt, char* name); @@ -404,7 +449,7 @@ #define cg_http_request_issoapaction(httpReq) (cg_http_packet_hasheader(((CgHttpPacket*)httpReq), CG_HTTP_SOAP_ACTION) || cg_streq(cg_http_request_getmethod(httpReq), CG_HTTP_MPOST)) #define cg_http_request_setcontent(httpReq,value) cg_http_packet_setcontent(((CgHttpPacket*)httpReq),value) -#define cg_http_request_setncontent(httpReq,value,len) cg_http_packet_setcontent(((CgHttpPacket*)httpReq),value,len) +#define cg_http_request_setncontent(httpReq,value,len) cg_http_packet_setncontent(((CgHttpPacket*)httpReq),value,len) #define cg_http_request_appendncontent(httpPkt, value, len) cg_http_packet_appendncontent(httpPkt, value, len) #define cg_http_request_setcontentpointer(httpReq,value, len) cg_http_packet_setcontentpointer(((CgHttpPacket*)httpReq),value, len) #define cg_http_request_getcontent(httpReq) cg_http_packet_getcontent(((CgHttpPacket*)httpReq)) @@ -424,6 +469,12 @@ #define cg_http_request_getlocaladdress(httpReq) cg_socket_getaddress(httpReq->sock) #define cg_http_request_getlocalport(httpReq) cg_socket_getport(httpReq->sock) +#ifdef ZYXEL_PATCH /*for session mgmt, ZyXEL 2013*/ +/**** Remote Address/Port ****/ +#define cg_http_request_getremoteaddress(httpReq) cg_socket_getremoteaddress(httpReq->sock) +#define cg_http_request_getremoteport(httpReq) cg_socket_getremoteport(httpReq->sock) +#endif + /**** Content-Length ****/ #define cg_http_request_setcontentlength(httpReq,value) cg_http_packet_setcontentlength((CgHttpPacket*)httpReq, value) #define cg_http_request_getcontentlength(httpReq) cg_http_packet_getcontentlength((CgHttpPacket*)httpReq) @@ -540,7 +591,11 @@ CgHttpServer *cg_http_server_new(); void cg_http_server_delete(CgHttpServer *httpServer); +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +BOOL cg_http_server_open(CgHttpServer * httpServer,int bindPort,char * bindAddr,BOOL isSecure,void * ctxdata); +#else BOOL cg_http_server_open(CgHttpServer *httpServer, int bindPort, char *bindAddr); +#endif BOOL cg_http_server_close(CgHttpServer *httpServer); BOOL cg_http_server_accept(CgHttpServer *httpServer); BOOL cg_http_server_start(CgHttpServer *httpServer); @@ -577,7 +632,11 @@ #define cg_http_serverlist_gets(httpServerList) (CgHttpServer *)cg_list_next((CgList *)httpServerList) #define cg_http_serverlist_add(httpServerList, httpServer) cg_list_add((CgList *)httpServerList, (CgList *)httpServer) +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013, charisse*/ +BOOL cg_http_serverlist_open(CgHttpServerList *httpServerList, int port, BOOL isSecure, void *ctxdata); +#else BOOL cg_http_serverlist_open(CgHttpServerList *httpServerList, int port); +#endif BOOL cg_http_serverlist_close(CgHttpServerList *httpServerList); BOOL cg_http_serverlist_start(CgHttpServerList *httpServerList); BOOL cg_http_serverlist_stop(CgHttpServerList *httpServerList); diff -Naur clinkc/include/cybergarage/http/cmd5.h clinkc_patch/include/cybergarage/http/cmd5.h --- clinkc/include/cybergarage/http/cmd5.h 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/include/cybergarage/http/cmd5.h 2014-01-29 13:54:26.642322411 +0800 @@ -0,0 +1,30 @@ +/************************************************************ +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* File: cmd5.h +* +* Revision: +* 05/11/05 +* - first release. +* +************************************************************/ + +#ifndef _CG_CLINKCAV_MD5_H_ +#define _CG_CLINKCAV_DIDL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define CG_MD5_STRING_BUF_SIZE ((16*2)+1) + +char *cg_str2md5(char *string, char *md5buf); + +#ifdef __cplusplus +} +#endif + +#endif diff -Naur clinkc/include/cybergarage/net/csocket.h clinkc_patch/include/cybergarage/net/csocket.h --- clinkc/include/cybergarage/net/csocket.h 2011-04-08 17:11:04.000000000 +0800 +++ clinkc_patch/include/cybergarage/net/csocket.h 2014-01-29 13:54:26.646322411 +0800 @@ -97,6 +97,10 @@ int direction; CgString *ipaddr; int port; +#ifdef ZYXEL_PATCH /* for session mgmt, ZyXEL, John */ + CgString *remoteIpAddr; + int remotePort; +#endif #if defined(ITRON) UH *sendWinBuf; UH *recvWinBuf; @@ -104,6 +108,9 @@ #if defined(CG_USE_OPENSSL) SSL_CTX* ctx; SSL* ssl; +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + void *ctxdata; +#endif #endif } CgSocket, CgSocketList; @@ -145,6 +152,19 @@ #define cg_socket_getaddress(socket) cg_string_getvalue(socket->ipaddr) #define cg_socket_getport(socket) (socket->port) +#ifdef ZYXEL_PATCH /* for session mgmt, ZyXEL, John */ +#define cg_socket_setremoteaddress(socket, value) cg_string_setvalue(socket->remoteIpAddr, value) +#define cg_socket_setremoteport(socket, value) (socket->remotePort = value) +#define cg_socket_getremoteaddress(socket) cg_string_getvalue(socket->remoteIpAddr) +#define cg_socket_getremoteport(socket) (socket->remotePort) +#endif + + +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#if defined(CG_USE_OPENSSL) +#define cg_socket_setctx(socket, value) (socket->ctxdata = value) +#endif +#endif BOOL cg_socket_isbound(CgSocket *socket); BOOL cg_socket_close(CgSocket *socket); @@ -158,7 +178,7 @@ int cg_socket_readline(CgSocket *sock, char *buffer, int bufferLen); long cg_socket_skip(CgSocket *sock, long skipLen); -int cg_socket_sendto(CgSocket *sock, char *addr, int port, char *data, int dataeLen); +int cg_socket_sendto(CgSocket *sock, char *addr, int port, char *data, int dataeLen, char *bindAddr); int cg_socket_recv(CgSocket *sock, CgDatagramPacket *dgmPkt); int cg_socket_getlasterror(); diff -Naur clinkc/include/cybergarage/net/curi.h clinkc_patch/include/cybergarage/net/curi.h --- clinkc/include/cybergarage/net/curi.h 2009-06-01 15:36:47.000000000 +0800 +++ clinkc_patch/include/cybergarage/net/curi.h 2014-01-29 13:54:26.646322411 +0800 @@ -93,6 +93,7 @@ #define cg_net_uri_sethost(urip, value) cg_string_setvalue(urip->host, value) #define cg_net_uri_setport(urip, value) (urip->port = value) #define cg_net_uri_setpath(urip, value) cg_string_setvalue(urip->path, value) +#define cg_net_uri_addpath(urip, value) cg_string_addvalue(urip->path, value) #define cg_net_uri_setquery(urip, value) cg_string_setvalue(urip->query, value) #define cg_net_uri_setfragment(urip, value) cg_string_setvalue(urip->fragment, value) diff -Naur clinkc/include/cybergarage/net/curl.h clinkc_patch/include/cybergarage/net/curl.h --- clinkc/include/cybergarage/net/curl.h 2009-06-01 15:36:47.000000000 +0800 +++ clinkc_patch/include/cybergarage/net/curl.h 2014-01-29 13:54:26.646322411 +0800 @@ -60,7 +60,7 @@ #define cg_net_url_sethost(urip, value) cg_string_setvalue(urip->host, value) #define cg_net_url_setport(urip, value) (urip->port = value) #define cg_net_url_setpath(urip, value) cg_string_setvalue(urip->path, value) -#define cg_net_url_addpath(urip, value) cg_string_addvalue(urip->path, value) +#define cg_net_url_addpath(urip, value) cg_net_uri_addpath(urip, value) #define cg_net_url_setquery(urip, value) cg_string_setvalue(urip->query, value) #define cg_net_url_setfragment(urip, value) cg_string_setvalue(urip->fragment, value) diff -Naur clinkc/include/cybergarage/soap/csoap.h clinkc_patch/include/cybergarage/soap/csoap.h --- clinkc/include/cybergarage/soap/csoap.h 2009-09-01 18:54:47.000000000 +0800 +++ clinkc_patch/include/cybergarage/soap/csoap.h 2014-01-29 13:54:26.670322411 +0800 @@ -39,6 +39,7 @@ #define CG_HTTP_SOAP_URN_DELIM ":" #define CG_SOAP_ENVELOPE "Envelope" +#define CG_SOAP_HEADER "Header" #define CG_SOAP_BODY "Body" #define CG_SOAP_RESPONSE "Response" #define CG_SOAP_FAULT "Fault" @@ -101,6 +102,7 @@ #define cg_soap_request_getrootnoode(soapReq) cg_xml_nodelist_gets(soapReq->rootNodeList) #define cg_soap_request_getenvelopenode(soapReq) cg_xml_nodelist_gets(soapReq->rootNodeList) CgXmlNode *cg_soap_request_getbodynode(CgSoapRequest *soapReq); +CgXmlNode *cg_soap_request_getheadernode(CgSoapRequest *soapReq); void cg_soap_request_setcontent(CgSoapRequest *soapReq, CgXmlNode *node); #define cg_soap_request_createcontent(soapReq) cg_soap_request_setcontent(soapReq, cg_soap_request_getenvelopenode(soapReq)) diff -Naur clinkc/include/cybergarage/ssl/cssl.h clinkc_patch/include/cybergarage/ssl/cssl.h --- clinkc/include/cybergarage/ssl/cssl.h 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/include/cybergarage/ssl/cssl.h 2014-01-29 13:54:26.642322411 +0800 @@ -0,0 +1,56 @@ +/******************************************************************************/ +/* +* Copyright (C) 2013 ZyXEL Communications, Corp. +* All Rights Reserved. +* +* ZyXEL Confidential; Need to Know only. +* Protected as an unpublished work. +* +* The computer program listings, specifications and documentation +* herein are the property of ZyXEL Communications, Corp. and +* shall not be reproduced, copied, disclosed, or used in whole or +* in part for any reason without the prior express written permission of +* ZyXEL Communications, Corp. +*/ +/******************************************************************************/ + +#ifndef _CG_SSL_CSSL_H_ +#define _CG_SSL_CSSL_H_ + +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#if defined(CG_USE_OPENSSL) +#include + +#include +#include + +/**************************************** +* Define +****************************************/ + +/**************************************** +* Data Type +****************************************/ +typedef int (*verify_callback_func)(int, X509_STORE_CTX *); + +typedef struct _Cgctx { + char *cert_file; + char *key_file; + char *CAfile; + char *CApath; + int verify_mode; + verify_callback_func verify_callback; + char *verify_cn; +} Cgctx; + +/**************************************** +* Function +****************************************/ +BOOL cg_ssl_set_ctx(CgSocket *sock, void *ctxdata); +BOOL cg_ssl_accept(CgSocket *serverSock, CgSocket *clientSock); +void cg_ssl_show_cert(CgSocket *sock); +BOOL cg_ssl_extra_verify(CgSocket * sock); + +#endif +#endif +#endif /*_CG_SSL_CSSL_H_*/ diff -Naur clinkc/include/cybergarage/upnp/cdevice.h clinkc_patch/include/cybergarage/upnp/cdevice.h --- clinkc/include/cybergarage/upnp/cdevice.h 2010-02-12 23:33:58.000000000 +0800 +++ clinkc_patch/include/cybergarage/upnp/cdevice.h 2014-01-29 13:54:26.750322413 +0800 @@ -58,6 +58,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -194,6 +195,11 @@ /* List of cached interfaces */ CgNetworkInterfaceList *ifCache; + +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013, charisse*/ + CG_UPNP_SERVICE_PERFORMLISTNER performListner; +#endif + } CgUpnpDevice, CgUpnpDeviceList; /**************************************** @@ -286,6 +292,11 @@ */ #define cg_upnp_device_getparentdevice(dev) (dev->parentDevice) + +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013, charisse*/ +#define cg_upnp_device_getperflistener(dev) (dev->performListner) +#endif + /** * Return the root (i.e. the topmost) device in the device structure * @@ -842,6 +853,9 @@ */ void cg_upnp_device_setquerylistener(CgUpnpDevice *dev, CG_UPNP_STATEVARIABLE_LISTNER queryListner); +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013, charisse*/ +void cg_upnp_device_setperflistener(CgUpnpDevice *dev, CG_UPNP_SERVICE_PERFORMLISTNER perfListner); +#endif /***************************************************************************** * User Data *****************************************************************************/ diff -Naur clinkc/include/cybergarage/upnp/control/ccontrol.h clinkc_patch/include/cybergarage/upnp/control/ccontrol.h --- clinkc/include/cybergarage/upnp/control/ccontrol.h 2007-12-26 22:19:12.000000000 +0800 +++ clinkc_patch/include/cybergarage/upnp/control/ccontrol.h 2014-01-29 13:54:26.726322413 +0800 @@ -212,6 +212,11 @@ CgUpnpQueryResponse *queryRes; } CgUpnpQueryRequest; +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013, charisse*/ +typedef BOOL (*CG_UPNP_SERVICE_PERFORMLISTNER)(CgUpnpAction *action, CgUpnpActionRequest *actionReq); +#endif + + /**************************************** * Function ****************************************/ diff -Naur clinkc/include/cybergarage/upnp/cupnp.h clinkc_patch/include/cybergarage/upnp/cupnp.h --- clinkc/include/cybergarage/upnp/cupnp.h 2009-04-23 12:41:56.000000000 +0800 +++ clinkc_patch/include/cybergarage/upnp/cupnp.h 2014-01-29 13:54:26.698322412 +0800 @@ -37,7 +37,7 @@ ****************************************/ #define CG_CLINK_NAME "CyberLinkC" -#define CG_CLINK_VER "2.3" +#define CG_CLINK_VER "2.4" #define CG_UPNP_VER "1.0" #define CG_DLNA_VER "1.50" diff -Naur clinkc/include/cybergarage/upnp/cupnp_status.h clinkc_patch/include/cybergarage/upnp/cupnp_status.h --- clinkc/include/cybergarage/upnp/cupnp_status.h 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/include/cybergarage/upnp/cupnp_status.h 2014-01-29 13:54:26.746322413 +0800 @@ -40,6 +40,51 @@ #define CG_UPNP_STATUS_OUT_OF_SYNC 403 #define CG_UPNP_STATUS_INVALID_VAR 404 #define CG_UPNP_STATUS_ACTION_FAILED 501 +#ifdef ZYXEL_PATCH /* ZyXEL 2013, charisse*/ +#define CG_UPNP_STATUS_ARG_VALUE_INVALID 600 +#define CG_UPNP_STATUS_ARG_VALUE_OUT_OF_RANGE 601 +#define CG_UPNP_STATUS_OPT_NOT_IMPLEMENT 602 +#define CG_UPNP_STATUS_OUT_OF_MEMORY 603 +#define CG_UPNP_STATUS_HUMAN_INTER_REQUIRED 604 +#define CG_UPNP_STATUS_STRING_ARG_TOO_LONG 605 +//TR-064 +#define CG_UPNP_STATUS_ACTION_NOT_AUTH 606 +#define CG_UPNP_STATUS_VALUE_ALREADY_SPE 701 +#define CG_UPNP_STATUS_VALUE_SPE_INVALID 702 +#define CG_UPNP_STATUS_INACT_CONN_REQUIRE 703 +#define CG_UPNP_STATUS_CONN_SETUP_FAIL 704 +#define CG_UPNP_STATUS_CONN_SETUP_INPROGRESS 705 +#define CG_UPNP_STATUS_CONN_NOT_CONFIG 706 +#define CG_UPNP_STATUS_DISCON_INPROGESS 707 +#define CG_UPNP_STATUS_INVALID_L2_ADDR 708 +#define CG_UPNP_STATUS_INTERNET_ACCESS_DISABLE 709 +#define CG_UPNP_STATUS_INVALID_CONN_TYPE 710 +#define CG_UPNP_STATUS_CONN_ALREADY_TERM 711 +#define CG_UPNP_STATUS_NULL_VALUE_SPE_ARRAY_IDX 712 +#define CG_UPNP_STATUS_SPE_ARRAY_IDX_INVALID 713 +#define CG_UPNP_STATUS_NO_SUCH_ENTRY_ARRAU 714 +#define CG_UPNP_STATUS_WILD_CARD_NOT_PER_IN_SRCIP 715 +#define CG_UPNP_STATUS_WILD_CARD_NOT_PER_IN_EXTPORT 716 +#define CG_UPNP_STATUS_CONFLIC_IN_MAPENTRY 718 +#define CG_UPNP_STATUS_ACTION_DISALLOW_WHEN_AUTO_CONFIG 719 +#define CG_UPNP_STATUS_INVALID_DEVICE_UUID 720 +#define CG_UPNP_STATUS_INVALID_SRVID 721 +#define CG_UPNP_STATUS_INVALID_CONSRV_SELECT 723 +#define CG_UPNP_STATUS_SAME_PORT_VALUE_REQUIRE 724 +#define CG_UPNP_STATUS_ONLY_PER_LEAS_SUPPORT 725 +#define CG_UPNP_STATUS_REMOTE_HOST_ONLY_SUPPORT_WILDCARD 726 +#define CG_UPNP_STATUS_EXTPORT_ONLY_SUPPORT_WILDCARD 727 +#define CG_UPNP_STATUS_INVALID_CHANNEL 728 +#define CG_UPNP_STATUS_INVALID_MAC_ADDR 729 +#define CG_UPNP_STATUS_INVALID_DATA_TRANS_RATE 730 +#define CG_UPNP_STATUS_INVALID_WEP_KEY 731 +#define CG_UPNP_STATUS_NO_WEP_KEY_SET 732 +#define CG_UPNP_STATUS_NO_PSK_KEY_SET 733 +#define CG_UPNP_STATUS_NO_EPA_SERVER 734 +#define CG_UPNP_STATUS_SET_MAC_NOT_PERMIT 897 +#define CG_UPNP_STATUS_WRITE_ACCESS_DISABLE 898 +#define CG_UPNP_STATUS_SESSION_ID_EXPIRE 899 +#endif /**************************************** * Data Type diff -Naur clinkc/include/cybergarage/util/cthread.h clinkc_patch/include/cybergarage/util/cthread.h --- clinkc/include/cybergarage/util/cthread.h 2008-08-22 20:40:48.000000000 +0800 +++ clinkc_patch/include/cybergarage/util/cthread.h 2014-01-29 13:54:26.750322413 +0800 @@ -63,7 +63,7 @@ #if defined (WINCE) #define CG_THREAD_SHUTDOWN_ATTEMPTS 10 -#define CG_THREAD_MIN_SLEEP 1000 +#define CG_THREAD_MIN_SLEEP 1 /* ADD Fabrice Fontaine Orange 24/04/2007 */ /* Bug correction : Variable used to wait for thread termination by sleeping */ /* instead of joining */ diff -Naur clinkc/include/Makefile.in clinkc_patch/include/Makefile.in --- clinkc/include/Makefile.in 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/include/Makefile.in 2014-01-29 13:54:26.750322413 +0800 @@ -0,0 +1,479 @@ +# 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@ + +######################################## +# CyberLinkC +######################################## + +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 = : +subdir = include +DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.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 = $(nobase_include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLOG_DEBUG_FLAGS = @CLOG_DEBUG_FLAGS@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +HTTP_CFLAGS = @HTTP_CFLAGS@ +HTTP_LIBS = @HTTP_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +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@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML_CFLAGS = @XML_CFLAGS@ +XML_LIBS = @XML_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +clinkc_header = \ + cybergarage/typedef.h \ + cybergarage/io/cfile.h \ + cybergarage/util/clist.h \ + cybergarage/util/cmutex.h \ + cybergarage/util/ccond.h \ + cybergarage/util/cdictionary.h \ + cybergarage/util/cstring.h \ + cybergarage/util/cthread.h \ + cybergarage/util/ctime.h \ + cybergarage/util/clog.h \ + cybergarage/net/csocket.h \ + cybergarage/net/cinterface.h \ + cybergarage/net/curi.h \ + cybergarage/net/curl.h \ + cybergarage/http/chttp.h \ + cybergarage/soap/csoap.h \ + cybergarage/upnp/caction.h \ + cybergarage/upnp/cargument.h \ + cybergarage/upnp/ccontrolpoint.h \ + cybergarage/upnp/cdevice.h \ + cybergarage/upnp/cicon.h \ + cybergarage/upnp/cservice.h \ + cybergarage/upnp/cstatevariable.h \ + cybergarage/upnp/cupnp.h \ + cybergarage/upnp/cupnp_function.h \ + cybergarage/upnp/cupnp_limit.h \ + cybergarage/upnp/cupnp_status.h \ + cybergarage/upnp/control/ccontrol.h \ + cybergarage/upnp/event/cevent.h \ + cybergarage/upnp/event/cnotify.h \ + cybergarage/upnp/event/cproperty.h \ + cybergarage/upnp/event/csubscriber.h \ + cybergarage/upnp/event/csubscription.h \ + cybergarage/upnp/ssdp/cssdp.h \ + cybergarage/upnp/ssdp/cssdp_server.h \ + cybergarage/xml/cxml.h + + +######################################## +# Library +######################################## +nobase_include_HEADERS = \ + $(clinkc_header) + +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) --foreign include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign 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): +install-nobase_includeHEADERS: $(nobase_include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + $(am__nobase_list) | while read dir files; do \ + xfiles=; for file in $$files; do \ + if test -f "$$file"; then xfiles="$$xfiles $$file"; \ + else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ + test -z "$$xfiles" || { \ + test "x$$dir" = x. || { \ + echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ + echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ + $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ + done + +uninstall-nobase_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ + 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 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-nobase_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 + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-nobase_includeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + ctags distclean distclean-generic 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-nobase_includeHEADERS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-nobase_includeHEADERS + + +cybergarage/upnp/cupnp.h: $(top_builddir)/config.h + mkdir -p cybergarage/upnp + sed -e 's/CG_CLINK_VER/CG_CLINK_VER \"$(VERSION)\"/' \ + $(srcdir)/cybergarage/upnp/cupnp.h.in > $(srcdir)/cybergarage/upnp/cupnp.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Naur clinkc/INSTALL clinkc_patch/INSTALL --- clinkc/INSTALL 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/INSTALL 1970-01-01 08:00:00.000000000 +0800 @@ -1,182 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff -Naur clinkc/Makefile clinkc_patch/Makefile --- clinkc/Makefile 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/Makefile 2014-01-29 13:54:26.398322404 +0800 @@ -0,0 +1,75 @@ + + + +LIB = libclinkc.so + +CYBER_SRC_PATH = ./src/cybergarage +IO_SRC_PATH = $(CYBER_SRC_PATH)/io +UTIL_SRC_PATH = $(CYBER_SRC_PATH)/util +NET_SRC_PATH = $(CYBER_SRC_PATH)/net +HTTP_SRC_PATH = $(CYBER_SRC_PATH)/http +SOAP_SRC_PATH = $(CYBER_SRC_PATH)/soap +UPNP_SRC_PATH = $(CYBER_SRC_PATH)/upnp +XML_SRC_PATH = $(CYBER_SRC_PATH)/xml +SSL_SRC_PATH = $(CYBER_SRC_PATH)/ssl + +SOURCES += $(wildcard $(IO_SRC_PATH)/*.c) +SOURCES += $(wildcard $(UTIL_SRC_PATH)/*.c) +SOURCES += $(wildcard $(NET_SRC_PATH)/*.c) +SOURCES += $(wildcard $(HTTP_SRC_PATH)/*.c) +SOURCES += $(wildcard $(SOAP_SRC_PATH)/*.c) +SOURCES += $(wildcard $(XML_SRC_PATH)/*.c) +SOURCES += $(wildcard $(UPNP_SRC_PATH)/*.c) +SOURCES += $(wildcard $(UPNP_SRC_PATH)/control/*.c) +SOURCES += $(wildcard $(UPNP_SRC_PATH)/event/*.c) +SOURCES += $(wildcard $(UPNP_SRC_PATH)/ssdp/*.c) +SOURCES += $(wildcard $(SSL_SRC_PATH)/*.c) + + +OBJS = $(patsubst %.c, %.o, $(SOURCES)) + + +all: $(LIB) + +clean: +#generic_oalclean generic_clean + rm -rf $(OBJS) + rm -rf $(INSTALL_DIR)/lib/public/$(LIB) +# rm $(LIB) + +# +# Set our CommEngine directory (by splitting the pwd into two words +# at /userspace and taking the first word only). +# Then include the common defines under CommEngine. +# You do not need to modify this part. +# +CURR_DIR := $(shell pwd) +BUILD_DIR:=$(subst /userspace, /userspace,$(CURR_DIR)) +BUILD_DIR:=$(word 1, $(BUILD_DIR)) + +CFLAGS += -DZYXEL_PATCH -DCG_USE_OPENSSL -DHAVE_LIBUUID -std=gnu99 + +# +# Public libs are only allowed to include header files from the +# public directory. +# +# WARNING: Do not modify this section unless you understand the +# license implications of what you are doing. +# +ALLOWED_INCLUDE_PATHS := -I.\ + -I$(BUILD_DIR)/userspace/public/include \ + -I$(BUILD_DIR)/userspace/public/include/$(OALDIR) \ + -I./include/ \ + -I../expat/include/ \ + -I../openssl/include \ + -I../libuuid + +# +# Implicit rule will make the .c into a .o +# Implicit rule is $(CC) -c $(CPPFLAGS) $(CFLAGS) +# See Section 10.2 of Gnu Make manual +# +$(LIB): $(OBJS) + $(CC) -shared -Wl,--whole-archive,-soname,$@ $(CFLAGS) -o $@ $(OBJS) $(CFLAGS) -Wl,--no-whole-archive + + diff -Naur clinkc/Makefile.am clinkc_patch/Makefile.am --- clinkc/Makefile.am 2010-02-24 00:26:21.000000000 +0800 +++ clinkc_patch/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1,45 +0,0 @@ -SUBDIRS = include lib sample -#SUBDIRS = include lib sample testunit - -devdocsdir = $(datadir)/doc/clinkc-dev -docsdir = $(datadir)/doc/clinkc0 - -EXTRA_DIST = debian/changelog \ - debian/clinkc0.install \ - debian/clinkc-dev.install \ - debian/compat \ - debian/control \ - debian/copyright \ - debian/rules \ - debian/docs \ - include/cybergarage/upnp/cupnp.h.in - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = clinkc.pc - -dist_docs_DATA = \ - COPYING - -dist_devdocs_DATA = \ - ChangeLog \ - COPYING \ - Doxyfile - -nobase_devdocs_DATA = \ - doxygen/html/* \ - doxygen-objc/html/* - -doxygen/html/*: - cd $(srcdir) && doxygen Doxyfile -# scp -r doxygen skonno,clinkc@frs.sourceforge.net:/home/groups/c/cl/clinkc/htdocs - -doxygen-objc/html/*: - cd $(srcdir) && doxygen Doxyfile.objc -# scp -r doxygen-objc skonno,clinkobjc@frs.sourceforge.net:/home/groups/c/cl/clinkobjc/htdocs - -deb: dist - -mkdir $(top_builddir)/debian-build - -cp $(top_builddir)/../$(PACKAGE)*.orig.tar.gz $(top_builddir)/debian-build/ - cd $(top_builddir)/debian-build && tar zxf ../$(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz - cd $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot -sa -D - -rm -rf $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) diff -Naur clinkc/sample/clock/clock.c clinkc_patch/sample/clock/clock.c --- clinkc/sample/clock/clock.c 2006-09-22 19:06:10.000000000 +0800 +++ clinkc_patch/sample/clock/clock.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,136 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* File: clock.c -* -* Revision: -* 06/07/05 -* - first release. -* -************************************************************/ - -#include "clock.h" - -#include -#include - -/**************************************** -* toMonthString -****************************************/ - -static char *MONTH_STRING[] = { - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", -}; - -static char *toMonthString(int value) -{ - if (0 <= value && value < 12) - return MONTH_STRING[value]; - return ""; -} - -/**************************************** -* toWeekString -****************************************/ - -static char *WEEK_STRING[] = { - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat", -}; - -static char *toWeekString(int value) -{ - if (0 <= value && value < 7) - return WEEK_STRING[value]; - return ""; -} - -/**************************************** -* GetSystemTimeString -****************************************/ - -char *GetSystemTimeString(CgSysTime currTime, char *buf) -{ - struct tm *localTime; - - localTime = localtime(&currTime); - sprintf(buf, "%s, %s %d, %02d, %02d:%02d:%02d", - toWeekString(localTime->tm_wday), - toMonthString(localTime->tm_mon), - localTime->tm_mday, - localTime->tm_year + 1900, - localTime->tm_hour, - localTime->tm_min, - localTime->tm_sec); - - return buf; -} - -/**************************************** -* GetDateString -****************************************/ - -char *GetDateString(CgSysTime currTime, char *buf) -{ - struct tm *localTime; - - localTime = localtime(&currTime); - - sprintf(buf, "%s, %s %d, %02d", - toWeekString(localTime->tm_wday), - toMonthString(localTime->tm_mon), - localTime->tm_mday, - localTime->tm_year + 1900); - - return buf; -} - -/**************************************** -* GetTimeString -****************************************/ - -char *GetTimeString(CgSysTime currTime, char *buf) -{ - struct tm *localTime; - - localTime = localtime(&currTime); - - sprintf(buf, "%02d%s%02d", - localTime->tm_hour, - ((localTime->tm_sec % 2) == 0) ? ":" : " ", - localTime->tm_min); - - return buf; -} - -/**************************************** -* GetSecond -****************************************/ - -int GetSecond(CgSysTime currTime) -{ - struct tm *localTime; - - localTime = localtime(&currTime); - - return localTime->tm_sec; -} diff -Naur clinkc/sample/clock/clock_device.c clinkc_patch/sample/clock/clock_device.c --- clinkc/sample/clock/clock_device.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/sample/clock/clock_device.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,314 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* Copyright (C) 2006 Nokia Corporation. All rights reserved. -* -* This is licensed under BSD-style license, -* see file COPYING. -* -* File: clock_device.c -* -* Revision: -* 05/11/05 -* - first release. -* -* 10/31/05 -* - Removed :schemas: from clock service description -* -* 11-Jan-06 Heikki Junnila -* - Renamed *_getservicebyname's to *_getservicebyexacttype -* -************************************************************/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "clock_device.h" -#include "clock.h" - -#include - -/**************************************** -* Descriptions -****************************************/ - -char *CLOCK_DEVICE_DESCRIPTION = -"\n" -"\n" -" \n" -" 1\n" -" 0\n" -" \n" -" \n" -" urn:schemas-upnp-org:device:clock:1\n" -" CyberGarage Clock Device\n" -" CyberGarage\n" -" http://www.cybergarage.org\n" -" CyberUPnP Clock Device\n" -" Clock\n" -" 1.0\n" -" http://www.cybergarage.org\n" -" 1234567890\n" -" uuid:cybergarageClockDevice\n" -" 123456789012\n" -" \n" -" \n" -" image/gif\n" -" 48\n" -" 32\n" -" 8\n" -" icon.gif\n" -" \n" -" \n" -" \n" -" \n" -" urn:schemas-upnp-org:service:timer:1\n" -" urn:upnp-org:serviceId:timer:1\n" -" /service/timer/description.xml\n" -" /service/timer/control\n" -" /service/timer/eventSub\n" -" \n" -" \n" -" /presentation\n" -" \n" -"\n"; - -char *CLOCK_SERVICE_DESCRIPTION = -"\n" -"\n" -" \n" -" 1\n" -" 0\n" -" \n" -" \n" -" \n" -" SetTime\n" -" \n" -" \n" -" NewTime\n" -" Time\n" -" in\n" -" \n" -" \n" -" Result\n" -" Result\n" -" out\n" -" \n" -" \n" -" \n" -" \n" -" GetTime\n" -" \n" -" \n" -" CurrentTime\n" -" Time\n" -" out\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" Time\n" -" string\n" -" \n" -" \n" -" Result\n" -" string\n" -" \n" -" \n" -"\n"; - -/**************************************** -* upnp_clock_actionreceived -****************************************/ - -BOOL upnp_clock_actionreceived(CgUpnpAction *action) -{ - CgSysTime currTime; - char *actionName; - CgUpnpArgument *currTimeArg; - char sysTimeStr[SYSTEM_TIME_BUF_LEN]; - CgUpnpArgument *newTimeArg, *resultArg; - - currTime = cg_getcurrentsystemtime(); - - actionName = cg_upnp_action_getname(action); - if (strcmp("GetTime", actionName) == 0) { - GetSystemTimeString(currTime, sysTimeStr); - currTimeArg = cg_upnp_action_getargumentbyname(action, "CurrentTime"); - cg_upnp_argument_setvalue(currTimeArg, sysTimeStr); - return TRUE; - } - if (strcmp(actionName, "SetTime") == 0) { - newTimeArg = cg_upnp_action_getargumentbyname(action, "NewTime"); - resultArg = cg_upnp_action_getargumentbyname(action, "Result"); - cg_upnp_argument_setvalue(resultArg, "Not implemented"); - return TRUE; - } - - return FALSE; -} - -/**************************************** -* upnp_clock_queryreceived -****************************************/ - -BOOL upnp_clock_queryreceived(CgUpnpStateVariable *statVar) -{ - char *varName; - CgSysTime currTime; - char sysTimeStr[SYSTEM_TIME_BUF_LEN]; - - varName = cg_upnp_statevariable_getname(statVar); - if (strcmp("Time", varName) == 0) { - currTime = cg_getcurrentsystemtime(); - GetSystemTimeString(currTime, sysTimeStr); - cg_upnp_statevariable_setvalue(statVar, sysTimeStr); - return TRUE; - } - - return FALSE; -} - -/**************************************** -* upnp_clock_device_httprequestrecieved -****************************************/ - -void upnp_clock_device_httprequestrecieved(CgHttpRequest *httpReq) -{ - CgSysTime currTime; - CgUpnpDevice *dev; - char *uri; - char content[2048]; - char sysTimeStr[SYSTEM_TIME_BUF_LEN]; - char serverName[CG_UPNP_SEVERNAME_MAXLEN]; - CgHttpResponse *httpRes; - BOOL postRet; - - dev = (CgUpnpDevice *)cg_http_request_getuserdata(httpReq); - - uri = cg_http_request_geturi(httpReq); - if (strcmp(uri, "/presentation") != 0) { - cg_upnp_device_httprequestrecieved(httpReq); - return; - } - - currTime = cg_getcurrentsystemtime(); - -#if defined(HAVE_SNPRINTF) - snprintf(content, sizeof(content), -#else - sprintf(content, -#endif - "" - "" - "UPnP Clock Sample" - "" - "" - "
" - "

UPnP Clock Sample

" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "

" - "%s" - "

" - "Server : %s" - "

" - "
" - "", - GetSystemTimeString(currTime, sysTimeStr), - cg_upnp_getservername(serverName, sizeof(serverName))); - - httpRes = cg_http_response_new(); - cg_http_response_setstatuscode(httpRes, CG_HTTP_STATUS_OK); - cg_http_response_setcontent(httpRes, content); - cg_http_response_setcontenttype(httpRes, "text/html"); - cg_http_response_setcontentlength(httpRes, strlen(content)); - postRet = cg_http_request_postresponse(httpReq, httpRes); - cg_http_response_delete(httpRes); -} - -/**************************************** -* upnp_clock_device_new -****************************************/ - -CgUpnpDevice *upnp_clock_device_new() -{ - CgUpnpDevice *clockDev; - CgUpnpService *timeService; - - clockDev = cg_upnp_device_new(); - - if (cg_upnp_device_parsedescription(clockDev, CLOCK_DEVICE_DESCRIPTION, strlen(CLOCK_DEVICE_DESCRIPTION)) == FALSE) { - cg_upnp_device_delete(clockDev); - return NULL; - } - - timeService = cg_upnp_device_getservicebyexacttype(clockDev, "urn:schemas-upnp-org:service:timer:1"); - if (timeService == NULL) { - cg_upnp_device_delete(clockDev); - return NULL; - } - - if (cg_upnp_service_parsedescription(timeService, CLOCK_SERVICE_DESCRIPTION, strlen(CLOCK_SERVICE_DESCRIPTION)) == FALSE) { - cg_upnp_device_delete(clockDev); - return NULL; - } - - cg_upnp_device_setactionlistener(clockDev, upnp_clock_actionreceived); - cg_upnp_device_setquerylistener(clockDev, upnp_clock_queryreceived); - cg_upnp_device_sethttplistener(clockDev, upnp_clock_device_httprequestrecieved); - - return clockDev; -} - -/**************************************** -* upnp_clock_device_update -****************************************/ - -void upnp_clock_device_update(CgUpnpDevice *clockDev) -{ - CgSysTime currTime; - CgUpnpService *timeService; - CgUpnpStateVariable *timeState; - char sysTimeStr[SYSTEM_TIME_BUF_LEN]; - - timeService = cg_upnp_device_getservicebyexacttype(clockDev, "urn:schemas-upnp-org:service:timer:1"); - if (timeService == NULL) - return; - - timeState = cg_upnp_service_getstatevariablebyname(timeService, "Time"); - if (timeState == NULL) - return; - - currTime = cg_getcurrentsystemtime(); - GetSystemTimeString(currTime, sysTimeStr); - cg_upnp_statevariable_setvalue(timeState, sysTimeStr); - - printf("%s\n", sysTimeStr); -} - diff -Naur clinkc/sample/clock/clock_device.h clinkc_patch/sample/clock/clock_device.h --- clinkc/sample/clock/clock_device.h 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/clock/clock_device.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,35 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* File: clock_device.h -* -* Revision: -* 05/11/05 -* - first release. -* -************************************************************/ - -#ifndef _CG_CLOCK_DEVICE_H_ -#define _CG_CLOCK_DEVICE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/**************************************** -* Function -****************************************/ - -CgUpnpDevice *upnp_clock_device_new(); -void upnp_clock_device_update(CgUpnpDevice *dev); - -#ifdef __cplusplus -} -#endif - -#endif diff -Naur clinkc/sample/clock/clock.h clinkc_patch/sample/clock/clock.h --- clinkc/sample/clock/clock.h 2006-09-22 19:06:10.000000000 +0800 +++ clinkc_patch/sample/clock/clock.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,43 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* File: clock.h -* -* Revision: -* 06/07/05 -* - first release. -* -************************************************************/ - -#ifndef _CG_CLOCK_H_ -#define _CG_CLOCK_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/**************************************** -* Define -****************************************/ - -#define SYSTEM_TIME_BUF_LEN 128 - -/**************************************** -* Function -****************************************/ - -char *GetSystemTimeString(CgSysTime currTime, char *buf); -char *GetDateString(CgSysTime currTime, char *buf); -char *GetTimeString(CgSysTime currTime, char *buf); -int GetSecond(CgSysTime currTime); - -#ifdef __cplusplus -} -#endif - -#endif diff -Naur clinkc/sample/clock/Makefile.am clinkc_patch/sample/clock/Makefile.am --- clinkc/sample/clock/Makefile.am 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/clock/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1 +0,0 @@ -SUBDIRS = unix diff -Naur clinkc/sample/clock/tengine/gnu/configure clinkc_patch/sample/clock/tengine/gnu/configure --- clinkc/sample/clock/tengine/gnu/configure 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/clock/tengine/gnu/configure 1970-01-01 08:00:00.000000000 +0800 @@ -1,5 +0,0 @@ -#!/bin/sh -cd src; rm -f upnpclock.c.lnk; ln -sf ../../../unix/clock_main.c upnpclock.c; cd .. -cd sh7727; rm -f Makefile.lnk; ln -fs ../src/Makefile Makefile; cd .. -cd sh7727.debug; rm -f Makefile.lnk; ln -fs ../src/Makefile Makefile; cd .. -cd sh7727.dl; rm -f Makefile.lnk; ln -fs ../src/Makefile Makefile; cd .. diff -Naur clinkc/sample/clock/tengine/gnu/src/Makefile clinkc_patch/sample/clock/tengine/gnu/src/Makefile --- clinkc/sample/clock/tengine/gnu/src/Makefile 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/clock/tengine/gnu/src/Makefile 1970-01-01 08:00:00.000000000 +0800 @@ -1,100 +0,0 @@ -# -# Makefile for CyberLink -# -# Copyright (C) Satoshi Konno 2005 -# - -DEPS = Dependencies -DEPENDENCIES_OUTPUT := $(DEPS) - -# for C++ -USE_CPP = 1 -REL_TYP=q - -include $(BD)/bappl/etc/makerules -include $(CLINKCROOT)/lib/tengine/gnu/Makefile.inc - -TARGET = upnpclock - -S = ../../../ ../src -VPATH = $S - -UPNPCLOCKSRC = \ - ../src/upnpclock.c \ - ../../../clock.c \ - ../../../clock_device.c - -unexport SRC = -SRC = $(UPNPCLOCKSRC) $(CLINKCSRC) - -OBJ = $(addsuffix .o, $(basename $(SRC))) - -CFLAGS += $(CFLAGS_WARNING) - -CFLAGS += -DPROCESS_BASE -ifeq ($(mode), debug) - LDLIBS += -ltm -endif - -CFLAGS += -I$(CLINKCHEADERROOT) -CFLAGS += -I$(CPPUNITROOT)/include -CFLAGS += -I$(EXPATROOT)/lib -CFLAGS += -I../../../ -CFLAGS += -DTENGINE -CFLAGS += -DCG_TENGINE_NET_KASAGO -#CFLAGS += -DCG_TENGINE_NET_PMC - -# for C++ -CPPFLAGS += -D__USE_THREADS -CPPFLAGS += -D__USE_IOSTREAMS -LOADLIBES += -lstlport - -# for KASAGO -ifeq ($(MACHINE), m32104) - START_ADR = -Wl,-Ttext,0x049B0000,-Tdata,0x049B8000 - CFLAGS += -DTM_BIG_ENDIAN - CFLAGS += -O0 -endif -ifeq ($(MACHINE), sh7727) - CFLAGS += -DTM_LITTLE_ENDIAN -endif -LOADLIBES += -lsvc_ka - -# ---------------------------------------------------------------------------- - -.PHONY: all install clean - -ifeq ($(mode), debug) - NOINST = $(TARGET).trg -endif -INST = $(TARGET) $(TARGET:%=%.map) -ALL = $(INST) $(NOINST) - -all: $(ALL) - -#$(TARGET): $(OBJ) -$(TARGET): $(addsuffix .o, $(basename $(SRC))) - -$(OBJ): - -$(TARGET).trg: $(TARGET) - cp $< $@ - $(STRIP) $@ - -clean: - $(RM) $(OBJ) $(ALL) $(DEPS) - -prenv: - set - -install: $(addprefix $(EXE_INSTALLDIR)/, $(INST)) - -$(TARGET:%=$(EXE_INSTALLDIR)/%): $(EXE_INSTALLDIR)/%: % - $(EXE_INSTALL_STRIP) - -ifdef DEPENDENCIES_OUTPUT - $(DEPS): ; touch $(DEPS) -else - $(DEPS): $(SRC) ; $(MAKEDEPS) $@ $? -endif -include $(DEPS) diff -Naur clinkc/sample/clock/unix/clock_main.c clinkc_patch/sample/clock/unix/clock_main.c --- clinkc/sample/clock/unix/clock_main.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/sample/clock/unix/clock_main.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,122 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* Copyright (C) 2006 Nokia Corporation. All rights reserved. -* -* This is licensed under BSD-style license, -* see file COPYING. -* -* File: clock_main.c -* -* Revision: -* 05/11/05 -* - first release. -* -************************************************************/ - -#include - -#include "clock_device.h" -#include "kb_util.h" - -#include -#if defined(TENGINE) -#if defined(PROCESS_BASE) /* Process based */ -#include -#define MBEG int main( W ac, TC *av[] ) -#define MEND 0 -#define DIR "/SYS/bin/" -#else /* T-Kernel based */ -#include -#include -#include -#define MBEG ER main( INT ac, UB *av[] ) -#define MEND E_SYS -#define DIR "/SYS/bin/" -#endif -#endif - -CgUpnpDevice *clockDev; - -////////////////////////////////////////////////////////// -// InitApp -////////////////////////////////////////////////////////// - -BOOL InitApp( int cacheControl ) -{ - clockDev = upnp_clock_device_new(); - cg_upnp_device_setleasetime( clockDev, cacheControl ); - cg_upnp_device_start(clockDev); - return TRUE; -} - -void ExitApp() -{ - cg_upnp_device_stop(clockDev); - cg_upnp_device_delete(clockDev); -} - -////////////////////////////////////////////////////////// -// main -////////////////////////////////////////////////////////// - -#if defined(TENGINE) -MBEG -#else -int main( int argc, char* argv[] ) -#endif -{ - int cacheControl = -1; - - if ( argc == 1 ) { - printf( "usage: clock [cache_control_in_sec]\n" ); - cacheControl = 1800; - } - else if ( argc > 2 ) { - printf( "usage: clock [cache_control_in_sec]\n" ); - exit( 0 ); - } - else if (sscanf(argv[1], "%i", &cacheControl) != 1) { - printf( "Invalid CACHE-CONTROL value.\n" ); - exit( 0 ); - } - - printf( "Using CACHE-CONTROL value: %d sec\n", cacheControl ); - - if (InitApp( cacheControl ) == FALSE) { - fprintf(stderr, "Couldn't create this clock device !!\n"); - exit(0); - } - -#if !defined(TENGINE) - kbinit(); -#endif - int ch = 0; - do - { -#if !defined(TENGINE) - if (0 < kbhit()) { - ch = getchar(); - ch = toupper( ch ); - } - else - cg_wait(1000); -#else - cg_wait(1000); -#endif - - upnp_clock_device_update(clockDev); - - } while( ch != 'Q'); - -#if !defined(TENGINE) - kbexit(); -#endif - - ExitApp(); - - return(0); -} diff -Naur clinkc/sample/clock/unix/Makefile.am clinkc_patch/sample/clock/unix/Makefile.am --- clinkc/sample/clock/unix/Makefile.am 2010-02-02 22:50:42.000000000 +0800 +++ clinkc_patch/sample/clock/unix/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1,22 +0,0 @@ -samplesdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/samples - -samples_PROGRAMS = upnpclock - -INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(srcdir)/../ -I$(srcdir)/../../common @XML_CFLAGS@ @CLOG_DEBUG_FLAGS@ - -noinst_HEADERS = \ - ../clock.h \ - ../clock_device.h \ - ../../common/kb_util.h - -upnpclock_SOURCES = \ - clock_main.c \ - ../clock.c \ - ../clock_device.c \ - ../../common/kb_util.c - -#if HAVE_LIBTOOL -#upnpclock_LDADD = ../../../lib/unix/libclinkc.la @XML_LIBS@ -#else -upnpclock_LDADD = ../../../lib/unix/libclinkc.a @XML_LIBS@ -#endif diff -Naur clinkc/sample/clock/win32/vc60/clock_main_win32.c clinkc_patch/sample/clock/win32/vc60/clock_main_win32.c --- clinkc/sample/clock/win32/vc60/clock_main_win32.c 2006-09-22 19:06:10.000000000 +0800 +++ clinkc_patch/sample/clock/win32/vc60/clock_main_win32.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,242 +0,0 @@ -/****************************************************************** -* -* CyberX3D for C++ -* -* Copyright (C) Satoshi Konno 1996-2003 -* -* File: ClockMain.cpp -* -******************************************************************/ -#include -#include -#include -//#include "resource.h" - -#include "clock.h" -#include "clock_device.h" - -static HINSTANCE gInstance; -static HBITMAP clockBitmap; - -const char panelFilename[] = "images/clock.bmp"; -const char szTitle[] = "CyberLink Clock Device"; - -LONG WINAPI WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); - -CgUpnpDevice *clockDev; - -////////////////////////////////////////////////////////// -// InitApp -////////////////////////////////////////////////////////// - -void InitApp() -{ - clockBitmap = (HBITMAP)LoadImage(gInstance, panelFilename, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); - - clockDev = upnp_clock_device_new(); - cg_upnp_device_start(clockDev); -} - -void ExitApp() -{ - cg_upnp_device_stop(clockDev); - cg_upnp_device_delete(clockDev); -} - -void CALLBACK ClockUpdate(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime) -{ - upnp_clock_device_update(clockDev); - InvalidateRect(hWnd, NULL, FALSE); -} - -////////////////////////////////////////////////////////// -// WinMain -////////////////////////////////////////////////////////// - -int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) -{ - static char szAppName[] = "CyberLink Clock Device"; - WNDCLASS wc; - MSG msg; - HWND hWnd; - int borderXSize, borderYSize; - - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = (WNDPROC)WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = NULL; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wc.lpszMenuName = ""/*MAKEINTRESOURCE(IDR_MENU)*/; - wc.lpszClassName = szAppName; - - RegisterClass( &wc ); - - gInstance = hInstance; - - borderXSize = GetSystemMetrics(SM_CXFIXEDFRAME); - borderYSize = GetSystemMetrics(SM_CXFIXEDFRAME); - - hWnd = CreateWindow( - szAppName, - szTitle, - //WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, - WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, - CW_USEDEFAULT, CW_USEDEFAULT, - 300 + borderXSize*2, - 200 + borderYSize *2 + GetSystemMetrics(SM_CYCAPTION), - NULL, - NULL, - hInstance, - NULL); - - ShowWindow( hWnd, nCmdShow ); - UpdateWindow( hWnd ); - - SetTimer(hWnd, 1, 1000, ClockUpdate); - - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage( &msg ); - DispatchMessage( &msg ); - } - - return( msg.wParam ); -} - -////////////////////////////////////////////////////////// -// OnPaint -////////////////////////////////////////////////////////// - -void OnPaint(HWND hWnd) -{ - int width = 300; - int height = 200; - PAINTSTRUCT ps; - HDC hdc; - HDC memDC; - HBITMAP memBitmap; - HDC bitmapDC; - HFONT hFont; - HFONT oldFont; - HBRUSH barBrush; - RECT rect; - CgSysTime currTime; - char textBuf[SYSTEM_TIME_BUF_LEN]; - int timeStrX = 60; - int timeStrY = 80; - int timeStrWidth = 180; - int timeStrOffset = 55; - int DEFAULT_SECOND_BLOCK_HEIGHT = 8; - int sec; - int secBarBlockSize = timeStrWidth / 60; - int secBarBlockY = timeStrY + timeStrOffset; - int n, x; - char secStr[8]; - - hdc = BeginPaint(hWnd,&ps); - - memDC = CreateCompatibleDC(hdc); - memBitmap = CreateCompatibleBitmap(hdc, width, height); - SelectObject(memDC, memBitmap); - - bitmapDC = CreateCompatibleDC(hdc); - SelectObject(bitmapDC, clockBitmap); - BitBlt(memDC, 0, 0, width, height, bitmapDC, 0, 0, SRCCOPY); - DeleteDC(bitmapDC); - - SetBkMode(memDC,TRANSPARENT); - SetTextColor(memDC,RGB(0, 0, 0)); - - currTime = cg_getcurrentsystemtime(); - - //// Date String //// - - GetDateString(currTime, textBuf); - hFont = CreateFont(20, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Lucida Console"); - oldFont = (HFONT)SelectObject(memDC, hFont); - TextOut(memDC, 45, 45, textBuf, strlen(textBuf)); - SelectObject(memDC, oldFont); - DeleteObject(hFont); - - //// Time String //// - - GetTimeString(currTime, textBuf); - hFont = CreateFont(60, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Lucida Console"); - oldFont = (HFONT)SelectObject(memDC, hFont); - TextOut(memDC, timeStrX, timeStrY, textBuf, strlen(textBuf)); - SelectObject(memDC, oldFont); - DeleteObject(hFont); - - //// Second Bar //// - - barBrush = CreateSolidBrush(RGB(0, 0, 0)); - sec = GetSecond(currTime); - for (n=0; n_lÿ¿$¥ñ¨ákâÑÆˆXßcíé|¾Óÿ~Z˜ÿgíéü½oûò MO Jšhôûmÿ§ÿ~W«/ųc`) ]?Ú’ŸÿÙ8BIM!Version compatibility infoUAdobe PhotoshopAdobe Photoshop 6.08BIM JPEG Qualityÿî!AdobedÿÛ„   - - - -    - -   ÿÂÈ,ÿÄÈ0@2P1A!"B#' p$%&3 - -!ÑÒ @ð’3ƒÓ”¤1q‘¡±2r²³4„56‚¢“0Qc£Ãdte"TAas´%u1Pp@!QÿÚ û­”#jÈÔ0^\¶x‚²’dTR“DÄ„éDPX\¤¬Á–—Œ ŸKž®EǕѸh`½l‚²aDJ‘3Ó8άã=3Œñ)+ 2ѱÁé~¿/@´£ªàÜ0·–†@"∘g™éœgVrg X˜©AQ—Êùõ©z%¬pn[C$¡qTLF3Ó8άã=3Ìñ+)’Âñ‘±Õ~4ªO]#pÐÂÜXIe"∠•" ˆˆR(ˆ˜ ­P”‚x"âõðÐù¢}:zé† ÖÛ „Š‚H¡!"¡¡‹ Šl€l€PjŽËoøöù h¯Ò%écÃ%ëi6 -EA5 )Ô$P  Ô Ð Ô Ð Ð¤X)ËcÑòœôÐ4Mú½zÜ7ÈÔ‘B‘BB -B -B6B -BB - - -\æ2ÏMEtc¼^ŽR. "¿^D„ŠŠjH°PjjhPhPhPl„ -„ÁççY颺ŒvËÐÊE¡*õäR(R(HA¨H¡AA¨A¨ÈA¡A¡A²h+Ÿ§‚ÏMѯ]ùH"@ב°R(HA¨A¨AA¨A¨@¨A¡A¡H°P**,Íæêâó×B4MêcmHJÈõà*,jjPj°PjhPhR, -„æêäóÛF4Uó£…’ -ŠÂ÷àjjjl€PhPjhPhPl„ ‹ )æêçqÛ@ÐWÍØÔX ©.÷à*jjlj*hPhPl„…=Í׋ŽÚ -øôl+à‹”£žüƒPƒP‚ƒPƒBƒPƒBƒB‘` T ÐØ4(6]ËÙ›ŽïÆš´RP*”zx®ÈA¨AA¨A¨ÈA¡A¡A²hjh,s—±Lw|vWÃDÊM3 "…¡¡¡……È@¡²A °PllÑäì z†Æ•²±DPN¨:-3®ÈAA¨A¨@¨A¡A¡A²hP*(l5ù;O‡!µ¼`PE¤JŽ«L«°A²hPjhPhPl„ -…ÁA­¾>Ö°èmY.,3“4J*;oy×ëÌ‘BE‚E‚ -E - -‚E‚ -‚ - -‚ƒBƒ`›|½Ža»Kq`f2eÒx‚T!H¢"b”¨ºTà‹KÆ•¨tty^‡ÇÕáѸdao-“ŸLz@ÎLêÎ3“<ϱAR‚¢–Ñ‘Áé^4 -Ñ4cDÐWÇ¡Á¥`¸#Ĝ؆zgµž™Æx€‰Š”‚IaxÐØì¯‰ º1¢h«ãÐèÚ°^àI9+08άã93ÄQ*TX¤C.‡Õó@Ñ]F4 -xz[Ë ¬#š³I¤ÑAQr‚+ÄÅ…Ã#Cjàì8::® -ÃC*Áqa'€+ ÿÚô¸0`Áƒ 0`Áƒ |ëð_¯Á~¾Ÿ&L™2dÉ“>~Ÿ§ÛðZ}¾Sõtû|§êèöùOÕÑíòŸ«£Ûå?W·öùOÕíý¾Sõ{o”ý^ÛÛå?ŸªÛ{|¦žpÌ3 ÒÍ,ÒÍ,ÒÍ,ÒÍ,ÒÍ,ÒÍ ÐÍ Ñ#D4HÑ#òä~\Ë‘ùr6ñj>fL™2dÉ“&L™2dÉ“?ÈL0`Áƒ†a˜f†a˜0`Áƒ 1æÿÿÚëüƒ­mzÕ\“®²¾»Ö$WÕú£+ê;öCy»d7†FÛX¥!6drd­’'¹±o·³ªnâ[Öú„KyU‰o*ëQ.æ\‚%¼ë“D·¸\²%½ÊæQ-î—7‰ovyìK;¿Ü$YÞ^ã"}êîR%ÞÞæ¡÷úýǺ"ï‡tH÷»º ‡z»žÈw›¹Œ¯¼Èe}Úî$þ¯È9,3×鬦²ªÊ W#/ÉHœË&[au…ö—Ú_i}¥ö—Ú_iu¥ÖØY2r%!±D"WªÊk)¨ÑûÈ!ž¹MeU•VW!+Á’däY2Û ¬.´ºÒûKí/´¾ÒûKí.´¶ÂÉ–Lœ†ü!¸@ª²šŠj4~Çõ¸g¬UYUep!"„¼$ÉȲe³.°ºÂûKí/´¾ÒûKí/´ºÂÛ l,™9~ Ep*Ue5”TQQ£öc«Ã=RªÊ W#%àòIHœl,®ö[Né–íw¬»eÔYwNꬻ¥u–]Ñzë.è<…—qÎJ˸Ç)eÜS–²Þ!Ìg æl³„ófOƒs‚\œs‘p.rGs‚›ð^hßëý6šk)¨¢¢Š´Jê5@®"Wµ·œ³S5HÕ#\r5ÌvLvLüËm‡æØ;­?:Ñßqù÷û‡¸¼{‹Ç¹ÜÔîºÜu¹ïr=Þè{ÍÑÞ Ùw¦¢ŠŠ*(¨ÑûS¾†wÕÀ„HDŠû_ͳ&Fdccc26666666666666666wUjáTQQEE?l·qÎ"OíoÁ³> -ø666666666666666666w5jáTTQQEE?n·Îâ#/ {˜ü‘±±±±±±±±±±±±±±±±±³¸‘ÕÃh¨¢¢ŠŠ*4¡ÛÝ‘^ûgîf|ØØÆÆÆÆÆÆÆÆ66666666s¸êáôTQQEE?Òæ¿R(C3÷§îðccccccfFÆÆÆÆÆÆÆÆÆÆÆÆÎe\JŠŠ)(¨¢£Oúœ—ßKÁ³Wߟ¹±±±±±±±±±±±±±±±±±±±±±±±±±³”ÇW¢¢ŠŠ*)¨Óþ¶×Ú6JB—êOÞØÆÆÆ66666666dlllllllllllläÕÅ訢¢šŠk4ÿ‚6ÉHœˆÏõ¬}³#26666666666666666666666uhêã4TSQME5šÄ2Lœ‹&W<î,#ØÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÍìuqÊ*)¬¦²¨ÇIý³‘dËfSfwv?Ôllllllllllllllllllllllllll²:¸õ5ÖUY\ gkÜ‹&[a·³;Ûôllllllllllllllllllllllllll®:º5VU1ý½òÄì™m…ÖK3Ô-¨Ù‘±›5«¡ÓYUep!¥»–-¶Âë ­6Vg©ÜÿU±±±±±±±±±±±±±±±±±±±±±±±±±³¦-]ªÊàB$Qø7óÅöØ]au§O·=ZÚ­v:n7›ÇEã£p=¾à{}ÀöÛ‘í·#ÚÝi»Óv=žð{=àö[Ñì·£Øï‡±ßa¿Ã~>ŸÔÓú€úwQNê#é½Hé[{êéÀ®b$~§Œ2¶Ùá´A•¾Ï ¢ ®6h]es³Bh‡lКç[,&„yÖË ¡u²ÂhCkšD\lк Úßg…ÑÖÛ<6ˆè?šÿ˜þ«êÝÿ[õ\Ì«Éÿ0Eú}šA\hw -þ`"O¡Ù¦à; ÃÏ¡ÔMÄv7AÜ7÷àøú=BµÜ´Ü1Í> v£ú 1ÊÏÙ9ƒ!ÞŸ°©ƒ!_mSA¿<Òæ €‰<Òæ%]y—”C*¸³Ì=¢TÆŸ‡{D2§Ž? úˆeI~õÊŠ°? -þ€eAXêèoÖZ›úÓÕž§@zv³Ôâ(NÖšœEéÚÓSˆ =;Yêq·«-N"€mAYj迬jȸ'*Q!/b}ã -Ò°pU†‚–D È÷C!>ñÕ È)s®©†@ËsL2¯ûç@ʶ\ü>2«ûøm eS´CiC*¢JSí0ºPÊ›i„Ò%Úa4ÃÉv¨M0ò]ªL<—i„ÓÔÛL&”6§Úat¡µFÑ ¥ -ªvˆm(mW&~HVÉŸ‡ÒÕÒgœi`>õÍ0Ø)3®©†ÂIœuH6OmÝ ×{h¤æOi3†»ãLá¨ã)ÃSÆCrÓpsxÈ`Éü7Ò?ÿÙ \ No newline at end of file diff -Naur clinkc/sample/clock/win32/vc60/upnpclock.dsp clinkc_patch/sample/clock/win32/vc60/upnpclock.dsp --- clinkc/sample/clock/win32/vc60/upnpclock.dsp 2006-11-21 02:03:29.000000000 +0800 +++ clinkc_patch/sample/clock/win32/vc60/upnpclock.dsp 1970-01-01 08:00:00.000000000 +0800 @@ -1,125 +0,0 @@ -# Microsoft Developer Studio Project File - Name="upnpclock" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** •ÒW‚µ‚È‚¢‚Å‚­‚¾‚³‚¢ ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=upnpclock - Win32 Debug -!MESSAGE ‚±‚ê‚Í—LŒø‚ÈÒ²¸Ì§²Ù‚ł͂ ‚è‚Ü‚¹‚ñB ‚±‚ÌÌßÛ¼Þª¸Ä‚ðËÞÙÄÞ‚·‚邽‚ß‚É‚Í NMAKE ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢B -!MESSAGE [Ò²¸Ì§²Ù‚Ì´¸½Îß°Ä] ºÏÝÄÞ‚ðŽg—p‚µ‚ÄŽÀs‚µ‚Ä‚­‚¾‚³‚¢ -!MESSAGE -!MESSAGE NMAKE /f "upnpclock.mak". -!MESSAGE -!MESSAGE NMAKE ‚ÌŽÀsŽž‚É\¬‚ðŽw’è‚Å‚«‚Ü‚· -!MESSAGE ºÏÝÄÞ ×²Ýã‚ÅϸۂÌÝ’è‚ð’è‹`‚µ‚Ü‚·B—á: -!MESSAGE -!MESSAGE NMAKE /f "upnpclock.mak" CFG="upnpclock - Win32 Debug" -!MESSAGE -!MESSAGE ‘I‘ð‰Â”\‚ÈËÞÙÄÞ Ó°ÄÞ: -!MESSAGE -!MESSAGE "upnpclock - Win32 Release" ("Win32 (x86) Application" —p) -!MESSAGE "upnpclock - Win32 Debug" ("Win32 (x86) Application" —p) -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "upnpclock - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../../include" /I "../../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "NDEBUG" -# ADD RSC /l 0x411 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libexpat.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "upnpclock - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "_DEBUG" -# ADD RSC /l 0x411 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libexpat.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "upnpclock - Win32 Release" -# Name "upnpclock - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\clock.c -# End Source File -# Begin Source File - -SOURCE=..\..\clock_device.c -# End Source File -# Begin Source File - -SOURCE=.\clock_main_win32.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\clock.h -# End Source File -# Begin Source File - -SOURCE=..\..\clock_device.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff -Naur clinkc/sample/clock/win32/vc60/upnpclock.dsw clinkc_patch/sample/clock/win32/vc60/upnpclock.dsw --- clinkc/sample/clock/win32/vc60/upnpclock.dsw 2006-11-21 02:03:29.000000000 +0800 +++ clinkc_patch/sample/clock/win32/vc60/upnpclock.dsw 1970-01-01 08:00:00.000000000 +0800 @@ -1,44 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# Œx: ‚±‚Ìܰ¸½Íß°½ ̧²Ù ‚ð•ÒW‚Ü‚½‚Í휂µ‚È‚¢‚Å‚­‚¾‚³‚¢! - -############################################################################### - -Project: "CyberLinkC"=..\..\..\..\lib\win32\vc60\CyberLinkC.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "upnpclock"=.\upnpclock.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name CyberLinkC - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Naur clinkc/sample/clock/win32/vs2005/clock_main_win32.c clinkc_patch/sample/clock/win32/vs2005/clock_main_win32.c --- clinkc/sample/clock/win32/vs2005/clock_main_win32.c 2006-06-27 18:49:22.000000000 +0800 +++ clinkc_patch/sample/clock/win32/vs2005/clock_main_win32.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,242 +0,0 @@ -/****************************************************************** -* -* CyberX3D for C++ -* -* Copyright (C) Satoshi Konno 1996-2003 -* -* File: ClockMain.cpp -* -******************************************************************/ -#include -#include -#include -//#include "resource.h" - -#include "clock.h" -#include "clock_device.h" - -static HINSTANCE gInstance; -static HBITMAP clockBitmap; - -const char panelFilename[] = "images/clock.bmp"; -const char szTitle[] = "CyberLink Clock Device"; - -LONG WINAPI WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); - -CgUpnpDevice *clockDev; - -////////////////////////////////////////////////////////// -// InitApp -////////////////////////////////////////////////////////// - -void InitApp() -{ - clockBitmap = (HBITMAP)LoadImage(gInstance, panelFilename, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE); - - clockDev = upnp_clock_device_new(); - cg_upnp_device_start(clockDev); -} - -void ExitApp() -{ - cg_upnp_device_stop(clockDev); - cg_upnp_device_delete(clockDev); -} - -void CALLBACK ClockUpdate(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime) -{ - upnp_clock_device_update(clockDev); - InvalidateRect(hWnd, NULL, FALSE); -} - -////////////////////////////////////////////////////////// -// WinMain -////////////////////////////////////////////////////////// - -int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) -{ - static char szAppName[] = "CyberLink Clock Device"; - WNDCLASS wc; - MSG msg; - HWND hWnd; - int borderXSize, borderYSize; - - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = (WNDPROC)WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = NULL; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wc.lpszMenuName = ""/*MAKEINTRESOURCE(IDR_MENU)*/; - wc.lpszClassName = szAppName; - - RegisterClass( &wc ); - - gInstance = hInstance; - - borderXSize = GetSystemMetrics(SM_CXFIXEDFRAME); - borderYSize = GetSystemMetrics(SM_CXFIXEDFRAME); - - hWnd = CreateWindow( - szAppName, - szTitle, - //WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, - WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, - CW_USEDEFAULT, CW_USEDEFAULT, - 300 + borderXSize*2, - 200 + borderYSize *2 + GetSystemMetrics(SM_CYCAPTION), - NULL, - NULL, - hInstance, - NULL); - - ShowWindow( hWnd, nCmdShow ); - UpdateWindow( hWnd ); - - SetTimer(hWnd, 1, 1000, ClockUpdate); - - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage( &msg ); - DispatchMessage( &msg ); - } - - return( msg.wParam ); -} - -////////////////////////////////////////////////////////// -// OnPaint -////////////////////////////////////////////////////////// - -void OnPaint(HWND hWnd) -{ - int width = 300; - int height = 200; - PAINTSTRUCT ps; - HDC hdc; - HDC memDC; - HBITMAP memBitmap; - HDC bitmapDC; - HFONT hFont; - HFONT oldFont; - HBRUSH barBrush; - RECT rect; - CgSysTime currTime; - char textBuf[SYSTEM_TIME_BUF_LEN]; - int timeStrX = 60; - int timeStrY = 80; - int timeStrWidth = 180; - int timeStrOffset = 55; - int DEFAULT_SECOND_BLOCK_HEIGHT = 8; - int sec; - int secBarBlockSize = timeStrWidth / 60; - int secBarBlockY = timeStrY + timeStrOffset; - int n, x; - char secStr[8]; - - hdc = BeginPaint(hWnd,&ps); - - memDC = CreateCompatibleDC(hdc); - memBitmap = CreateCompatibleBitmap(hdc, width, height); - SelectObject(memDC, memBitmap); - - bitmapDC = CreateCompatibleDC(hdc); - SelectObject(bitmapDC, clockBitmap); - BitBlt(memDC, 0, 0, width, height, bitmapDC, 0, 0, SRCCOPY); - DeleteDC(bitmapDC); - - SetBkMode(memDC,TRANSPARENT); - SetTextColor(memDC,RGB(0, 0, 0)); - - currTime = cg_getcurrentsystemtime(); - - //// Date String //// - - GetDateString(currTime, textBuf); - hFont = CreateFont(20, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Lucida Console"); - oldFont = (HFONT)SelectObject(memDC, hFont); - TextOut(memDC, 45, 45, textBuf, strlen(textBuf)); - SelectObject(memDC, oldFont); - DeleteObject(hFont); - - //// Time String //// - - GetTimeString(currTime, textBuf); - hFont = CreateFont(60, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Lucida Console"); - oldFont = (HFONT)SelectObject(memDC, hFont); - TextOut(memDC, timeStrX, timeStrY, textBuf, strlen(textBuf)); - SelectObject(memDC, oldFont); - DeleteObject(hFont); - - //// Second Bar //// - - barBrush = CreateSolidBrush(RGB(0, 0, 0)); - sec = GetSecond(currTime); - for (n=0; n_lÿ¿$¥ñ¨ákâÑÆˆXßcíé|¾Óÿ~Z˜ÿgíéü½oûò MO Jšhôûmÿ§ÿ~W«/ųc`) ]?Ú’ŸÿÙ8BIM!Version compatibility infoUAdobe PhotoshopAdobe Photoshop 6.08BIM JPEG Qualityÿî!AdobedÿÛ„   - - - -    - -   ÿÂÈ,ÿÄÈ0@2P1A!"B#' p$%&3 - -!ÑÒ @ð’3ƒÓ”¤1q‘¡±2r²³4„56‚¢“0Qc£Ãdte"TAas´%u1Pp@!QÿÚ û­”#jÈÔ0^\¶x‚²’dTR“DÄ„éDPX\¤¬Á–—Œ ŸKž®EǕѸh`½l‚²aDJ‘3Ó8άã=3Œñ)+ 2ѱÁé~¿/@´£ªàÜ0·–†@"∘g™éœgVrg X˜©AQ—Êùõ©z%¬pn[C$¡qTLF3Ó8άã=3Ìñ+)’Âñ‘±Õ~4ªO]#pÐÂÜXIe"∠•" ˆˆR(ˆ˜ ­P”‚x"âõðÐù¢}:zé† ÖÛ „Š‚H¡!"¡¡‹ Šl€l€PjŽËoøöù h¯Ò%écÃ%ëi6 -EA5 )Ô$P  Ô Ð Ô Ð Ð¤X)ËcÑòœôÐ4Mú½zÜ7ÈÔ‘B‘BB -B -B6B -BB - - -\æ2ÏMEtc¼^ŽR. "¿^D„ŠŠjH°PjjhPhPhPl„ -„ÁççY颺ŒvËÐÊE¡*õäR(R(HA¨H¡AA¨A¨ÈA¡A¡A²h+Ÿ§‚ÏMѯ]ùH"@ב°R(HA¨A¨AA¨A¨@¨A¡A¡H°P**,Íæêâó×B4MêcmHJÈõà*,jjPj°PjhPhR, -„æêäóÛF4Uó£…’ -ŠÂ÷àjjjl€PhPjhPhPl„ ‹ )æêçqÛ@ÐWÍØÔX ©.÷à*jjlj*hPhPl„…=Í׋ŽÚ -øôl+à‹”£žüƒPƒP‚ƒPƒBƒPƒBƒB‘` T ÐØ4(6]ËÙ›ŽïÆš´RP*”zx®ÈA¨AA¨A¨ÈA¡A¡A²hjh,s—±Lw|vWÃDÊM3 "…¡¡¡……È@¡²A °PllÑäì z†Æ•²±DPN¨:-3®ÈAA¨A¨@¨A¡A¡A²hP*(l5ù;O‡!µ¼`PE¤JŽ«L«°A²hPjhPhPl„ -…ÁA­¾>Ö°èmY.,3“4J*;oy×ëÌ‘BE‚E‚ -E - -‚E‚ -‚ - -‚ƒBƒ`›|½Ža»Kq`f2eÒx‚T!H¢"b”¨ºTà‹KÆ•¨tty^‡ÇÕáѸdao-“ŸLz@ÎLêÎ3“<ϱAR‚¢–Ñ‘Áé^4 -Ñ4cDÐWÇ¡Á¥`¸#Ĝ؆zgµž™Æx€‰Š”‚IaxÐØì¯‰ º1¢h«ãÐèÚ°^àI9+08άã93ÄQ*TX¤C.‡Õó@Ñ]F4 -xz[Ë ¬#š³I¤ÑAQr‚+ÄÅ…Ã#Cjàì8::® -ÃC*Áqa'€+ ÿÚô¸0`Áƒ 0`Áƒ |ëð_¯Á~¾Ÿ&L™2dÉ“>~Ÿ§ÛðZ}¾Sõtû|§êèöùOÕÑíòŸ«£Ûå?W·öùOÕíý¾Sõ{o”ý^ÛÛå?ŸªÛ{|¦žpÌ3 ÒÍ,ÒÍ,ÒÍ,ÒÍ,ÒÍ,ÒÍ ÐÍ Ñ#D4HÑ#òä~\Ë‘ùr6ñj>fL™2dÉ“&L™2dÉ“?ÈL0`Áƒ†a˜f†a˜0`Áƒ 1æÿÿÚëüƒ­mzÕ\“®²¾»Ö$WÕú£+ê;öCy»d7†FÛX¥!6drd­’'¹±o·³ªnâ[Öú„KyU‰o*ëQ.æ\‚%¼ë“D·¸\²%½ÊæQ-î—7‰ovyìK;¿Ü$YÞ^ã"}êîR%ÞÞæ¡÷úýǺ"ï‡tH÷»º ‡z»žÈw›¹Œ¯¼Èe}Úî$þ¯È9,3×鬦²ªÊ W#/ÉHœË&[au…ö—Ú_i}¥ö—Ú_iu¥ÖØY2r%!±D"WªÊk)¨ÑûÈ!ž¹MeU•VW!+Á’däY2Û ¬.´ºÒûKí/´¾ÒûKí.´¶ÂÉ–Lœ†ü!¸@ª²šŠj4~Çõ¸g¬UYUep!"„¼$ÉȲe³.°ºÂûKí/´¾ÒûKí/´ºÂÛ l,™9~ Ep*Ue5”TQQ£öc«Ã=RªÊ W#%àòIHœl,®ö[Né–íw¬»eÔYwNꬻ¥u–]Ñzë.è<…—qÎJ˸Ç)eÜS–²Þ!Ìg æl³„ófOƒs‚\œs‘p.rGs‚›ð^hßëý6šk)¨¢¢Š´Jê5@®"Wµ·œ³S5HÕ#\r5ÌvLvLüËm‡æØ;­?:Ñßqù÷û‡¸¼{‹Ç¹ÜÔîºÜu¹ïr=Þè{ÍÑÞ Ùw¦¢ŠŠ*(¨ÑûS¾†wÕÀ„HDŠû_ͳ&Fdccc26666666666666666wUjáTQQEE?l·qÎ"OíoÁ³> -ø666666666666666666w5jáTTQQEE?n·Îâ#/ {˜ü‘±±±±±±±±±±±±±±±±±³¸‘ÕÃh¨¢¢ŠŠ*4¡ÛÝ‘^ûgîf|ØØÆÆÆÆÆÆÆÆ66666666s¸êáôTQQEE?Òæ¿R(C3÷§îðccccccfFÆÆÆÆÆÆÆÆÆÆÆÆÎe\JŠŠ)(¨¢£Oúœ—ßKÁ³Wߟ¹±±±±±±±±±±±±±±±±±±±±±±±±±³”ÇW¢¢ŠŠ*)¨Óþ¶×Ú6JB—êOÞØÆÆÆ66666666dlllllllllllläÕÅ訢¢šŠk4ÿ‚6ÉHœˆÏõ¬}³#26666666666666666666666uhêã4TSQME5šÄ2Lœ‹&W<î,#ØÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÆÍìuqÊ*)¬¦²¨ÇIý³‘dËfSfwv?Ôllllllllllllllllllllllllll²:¸õ5ÖUY\ gkÜ‹&[a·³;Ûôllllllllllllllllllllllllll®:º5VU1ý½òÄì™m…ÖK3Ô-¨Ù‘±›5«¡ÓYUep!¥»–-¶Âë ­6Vg©ÜÿU±±±±±±±±±±±±±±±±±±±±±±±±±³¦-]ªÊàB$Qø7óÅöØ]au§O·=ZÚ­v:n7›ÇEã£p=¾à{}ÀöÛ‘í·#ÚÝi»Óv=žð{=àö[Ñì·£Øï‡±ßa¿Ã~>ŸÔÓú€úwQNê#é½Hé[{êéÀ®b$~§Œ2¶Ùá´A•¾Ï ¢ ®6h]es³Bh‡lКç[,&„yÖË ¡u²ÂhCkšD\lк Úßg…ÑÖÛ<6ˆè?šÿ˜þ«êÝÿ[õ\Ì«Éÿ0Eú}šA\hw -þ`"O¡Ù¦à; ÃÏ¡ÔMÄv7AÜ7÷àøú=BµÜ´Ü1Í> v£ú 1ÊÏÙ9ƒ!ÞŸ°©ƒ!_mSA¿<Òæ €‰<Òæ%]y—”C*¸³Ì=¢TÆŸ‡{D2§Ž? úˆeI~õÊŠ°? -þ€eAXêèoÖZ›úÓÕž§@zv³Ôâ(NÖšœEéÚÓSˆ =;Yêq·«-N"€mAYj迬jȸ'*Q!/b}ã -Ò°pU†‚–D È÷C!>ñÕ È)s®©†@ËsL2¯ûç@ʶ\ü>2«ûøm eS´CiC*¢JSí0ºPÊ›i„Ò%Úa4ÃÉv¨M0ò]ªL<—i„ÓÔÛL&”6§Úat¡µFÑ ¥ -ªvˆm(mW&~HVÉŸ‡ÒÕÒgœi`>õÍ0Ø)3®©†ÂIœuH6OmÝ ×{h¤æOi3†»ãLá¨ã)ÃSÆCrÓpsxÈ`Éü7Ò?ÿÙ \ No newline at end of file diff -Naur clinkc/sample/clock/win32/vs2005/upnpclock.sln clinkc_patch/sample/clock/win32/vs2005/upnpclock.sln --- clinkc/sample/clock/win32/vs2005/upnpclock.sln 2007-01-16 09:17:32.000000000 +0800 +++ clinkc_patch/sample/clock/win32/vs2005/upnpclock.sln 1970-01-01 08:00:00.000000000 +0800 @@ -1,28 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upnpclock", "upnpclock.vcproj", "{512DF6AA-55BF-4D55-82CB-1BB0A30880F6}" - ProjectSection(ProjectDependencies) = postProject - {D550D099-9F69-4F30-864C-504D02F72774} = {D550D099-9F69-4F30-864C-504D02F72774} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CyberLinkC", "..\..\..\..\lib\win32\vs2005\CyberLinkC.vcproj", "{D550D099-9F69-4F30-864C-504D02F72774}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {512DF6AA-55BF-4D55-82CB-1BB0A30880F6}.Debug|Win32.ActiveCfg = Debug|Win32 - {512DF6AA-55BF-4D55-82CB-1BB0A30880F6}.Debug|Win32.Build.0 = Debug|Win32 - {512DF6AA-55BF-4D55-82CB-1BB0A30880F6}.Release|Win32.ActiveCfg = Release|Win32 - {512DF6AA-55BF-4D55-82CB-1BB0A30880F6}.Release|Win32.Build.0 = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.ActiveCfg = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.Build.0 = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.ActiveCfg = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff -Naur clinkc/sample/clock/win32/vs2005/upnpclock.vcproj clinkc_patch/sample/clock/win32/vs2005/upnpclock.vcproj --- clinkc/sample/clock/win32/vs2005/upnpclock.vcproj 2007-02-20 16:28:09.000000000 +0800 +++ clinkc_patch/sample/clock/win32/vs2005/upnpclock.vcproj 1970-01-01 08:00:00.000000000 +0800 @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Naur clinkc/sample/common/kb_util.c clinkc_patch/sample/common/kb_util.c --- clinkc/sample/common/kb_util.c 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/common/kb_util.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,69 +0,0 @@ -/****************************************************************** -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* File: kb_util.h -* -* Revision: -* -* 05/11/05 -* - first revision -* -******************************************************************/ - -#if !defined(__MINGW32__) -#include -#include -#include -#include -#endif - -#if defined (__CYGWIN__) && !defined(FIONREAD) -#include -#include -#endif - -#if !defined(__MINGW32__) -static struct termios orgTermAttr; -#endif - -#include "kb_util.h" - -void kbinit() -{ -#if !defined(__MINGW32__) - struct termios termAttr; - tcgetattr(0, &orgTermAttr); - termAttr = orgTermAttr; - termAttr.c_lflag &= ~(ICANON | ECHO); - termAttr.c_cc[VTIME] = 0; - termAttr.c_cc[VMIN] = 1; - tcsetattr(0, TCSANOW, &termAttr); -#endif -} - -int kbhit() -{ -#if !defined(__MINGW32__) - int ret, n; - ret = ioctl(0, FIONREAD, &n); - if (ret != -1) - return n; -#endif - return 0; -} - -int kbkey() -{ - return 0; -} - -void kbexit() -{ -#if !defined(__MINGW32__) - tcsetattr(0, TCSANOW, &orgTermAttr); -#endif -} - diff -Naur clinkc/sample/common/kb_util.h clinkc_patch/sample/common/kb_util.h --- clinkc/sample/common/kb_util.h 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/common/kb_util.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,29 +0,0 @@ -/****************************************************************** -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* File: kb_util.h -* -* Revision: -* -* 05/11/05 -* - first revision -* -******************************************************************/ - -#ifndef _CG_KB_UTIL_H_ -#define _CG_KB_UTIL_H_ - - -void kbinit(); -int kbhit(); -int kbkey(); -void kbexit(); - -#ifdef __cplusplus -} -#endif - -#endif diff -Naur clinkc/sample/Makefile.am clinkc_patch/sample/Makefile.am --- clinkc/sample/Makefile.am 2008-06-04 00:07:44.000000000 +0800 +++ clinkc_patch/sample/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1 +0,0 @@ -SUBDIRS = clock upnpdump upnpavdump upnpigddump diff -Naur clinkc/sample/upnpavchk/upnpavchk.c clinkc_patch/sample/upnpavchk/upnpavchk.c --- clinkc/sample/upnpavchk/upnpavchk.c 2010-08-11 00:51:25.000000000 +0800 +++ clinkc_patch/sample/upnpavchk/upnpavchk.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,172 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2008 -* -* File: upnpavdump.c -* -* Revision: -* 08/05/24 -* - first release. -* -************************************************************/ - -#include - -#define UPNPAVDUMP_DMS_DEVICETYPE "urn:schemas-upnp-org:device:MediaServer:1" -#define UPNPAVDUMP_DMS_CONTENTDIR_SERVICETYPE "urn:schemas-upnp-org:service:ContentDirectory:1" -#define UPNPAVDUMP_DMS_BROWSE_ACTIONNAME "Browse" - -///////////////////////////////////////////////////////////////////////////////// -// PrintContentDirectory -///////////////////////////////////////////////////////////////////////////////// - -void PrintContentDirectory(CgUpnpAction *browseAction, int indent, char *objectId) -{ - int n; - char indentStr[128]; - char *resultXml; - CgXmlParser *xmlParser; - CgXmlNodeList *rootNode; - CgXmlNode *didlNode; - CgXmlNode *cnode; - char *id; - char *title; - char *url; - - for (n=0; n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Naur clinkc/sample/upnpavdump/macosx/xcode30/upnpavdump.1 clinkc_patch/sample/upnpavdump/macosx/xcode30/upnpavdump.1 --- clinkc/sample/upnpavdump/macosx/xcode30/upnpavdump.1 2008-05-20 22:32:17.000000000 +0800 +++ clinkc_patch/sample/upnpavdump/macosx/xcode30/upnpavdump.1 1970-01-01 08:00:00.000000000 +0800 @@ -1,79 +0,0 @@ -.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. -.\"See Also: -.\"man mdoc.samples for a complete listing of options -.\"man mdoc for the short list of editing options -.\"/usr/share/misc/mdoc.template -.Dd 08/05/20 \" DATE -.Dt upnpavdump 1 \" Program name and manual section number -.Os Darwin -.Sh NAME \" Section Header - required - don't modify -.Nm upnpavdump, -.\" The following lines are read in generating the apropos(man -k) database. Use only key -.\" words here as the database is built based on the words here and in the .ND line. -.Nm Other_name_for_same_program(), -.Nm Yet another name for the same program. -.\" Use .Nm macro to designate other names for the documented program. -.Nd This line parsed for whatis database. -.Sh SYNOPSIS \" Section Header - required - don't modify -.Nm -.Op Fl abcd \" [-abcd] -.Op Fl a Ar path \" [-a path] -.Op Ar file \" [file] -.Op Ar \" [file ...] -.Ar arg0 \" Underlined argument - use .Ar anywhere to underline -arg2 ... \" Arguments -.Sh DESCRIPTION \" Section Header - required - don't modify -Use the .Nm macro to refer to your program throughout the man page like such: -.Nm -Underlining is accomplished with the .Ar macro like this: -.Ar underlined text . -.Pp \" Inserts a space -A list of items with descriptions: -.Bl -tag -width -indent \" Begins a tagged list -.It item a \" Each item preceded by .It macro -Description of item a -.It item b -Description of item b -.El \" Ends the list -.Pp -A list of flags and their descriptions: -.Bl -tag -width -indent \" Differs from above in tag removed -.It Fl a \"-a flag as a list item -Description of -a flag -.It Fl b -Description of -b flag -.El \" Ends the list -.Pp -.\" .Sh ENVIRONMENT \" May not be needed -.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 -.\" .It Ev ENV_VAR_1 -.\" Description of ENV_VAR_1 -.\" .It Ev ENV_VAR_2 -.\" Description of ENV_VAR_2 -.\" .El -.Sh FILES \" File used or created by the topic of the man page -.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact -.It Pa /usr/share/file_name -FILE_1 description -.It Pa /Users/joeuser/Library/really_long_file_name -FILE_2 description -.El \" Ends the list -.\" .Sh DIAGNOSTICS \" May not be needed -.\" .Bl -diag -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .El -.Sh SEE ALSO -.\" List links in ascending order by section, alphabetically within a section. -.\" Please do not reference files that do not exist without filing a bug report -.Xr a 1 , -.Xr b 1 , -.Xr c 1 , -.Xr a 2 , -.Xr b 2 , -.Xr a 3 , -.Xr b 3 -.\" .Sh BUGS \" Document known, unremedied bugs -.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff -Naur clinkc/sample/upnpavdump/macosx/xcode30/upnpavdump.m clinkc_patch/sample/upnpavdump/macosx/xcode30/upnpavdump.m --- clinkc/sample/upnpavdump/macosx/xcode30/upnpavdump.m 2008-07-11 01:43:52.000000000 +0800 +++ clinkc_patch/sample/upnpavdump/macosx/xcode30/upnpavdump.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,109 +0,0 @@ -// -// upnpavdump.c -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -void PrintContentDirectory(CGUpnpAction *browseAction, int indent, NSString *objectId) -{ - int n; - - [browseAction setArgumentValue:objectId forName:@"ObjectID"]; - [browseAction setArgumentValue:@"BrowseDirectChildren" forName:@"BrowseFlag"]; - [browseAction setArgumentValue:@"*" forName:@"Filter"]; - [browseAction setArgumentValue:@"0" forName:@"StartingIndex"]; - [browseAction setArgumentValue:@"0" forName:@"RequestedCount"]; - [browseAction setArgumentValue:@"" forName:@"SortCriteria"]; - - if (![browseAction post]) - return; - - NSMutableString *indentStr = [NSMutableString string]; - for (n=0; n - -#define UPNPAVDUMP_DMS_DEVICETYPE "urn:schemas-upnp-org:device:MediaServer:1" -#define UPNPAVDUMP_DMS_CONTENTDIR_SERVICETYPE "urn:schemas-upnp-org:service:ContentDirectory:1" -#define UPNPAVDUMP_DMS_BROWSE_ACTIONNAME "Browse" - -///////////////////////////////////////////////////////////////////////////////// -// PrintContentDirectory -///////////////////////////////////////////////////////////////////////////////// - -void PrintContentDirectory(CgUpnpAction *browseAction, int indent, char *objectId) -{ - int n; - char indentStr[128]; - char *resultXml; - CgXmlParser *xmlParser; - CgXmlNodeList *rootNode; - CgXmlNode *didlNode; - CgXmlNode *cnode; - char *id; - char *title; - char *url; - - for (n=0; n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Naur clinkc/sample/upnpdump/macosx/xcode30/upnpdump.1 clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump.1 --- clinkc/sample/upnpdump/macosx/xcode30/upnpdump.1 2010-02-02 22:50:42.000000000 +0800 +++ clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump.1 1970-01-01 08:00:00.000000000 +0800 @@ -1,79 +0,0 @@ -.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. -.\"See Also: -.\"man mdoc.samples for a complete listing of options -.\"man mdoc for the short list of editing options -.\"/usr/share/misc/mdoc.template -.Dd 08/04/24 \" DATE -.Dt upnpdump 1 \" Program name and manual section number -.Os Darwin -.Sh NAME \" Section Header - required - don't modify -.Nm upnpdump, -.\" The following lines are read in generating the apropos(man -k) database. Use only key -.\" words here as the database is built based on the words here and in the .ND line. -.Nm Other_name_for_same_program(), -.Nm Yet another name for the same program. -.\" Use .Nm macro to designate other names for the documented program. -.Nd This line parsed for whatis database. -.Sh SYNOPSIS \" Section Header - required - don't modify -.Nm -.Op Fl abcd \" [-abcd] -.Op Fl a Ar path \" [-a path] -.Op Ar file \" [file] -.Op Ar \" [file ...] -.Ar arg0 \" Underlined argument - use .Ar anywhere to underline -arg2 ... \" Arguments -.Sh DESCRIPTION \" Section Header - required - don't modify -Use the .Nm macro to refer to your program throughout the man page like such: -.Nm -Underlining is accomplished with the .Ar macro like this: -.Ar underlined text . -.Pp \" Inserts a space -A list of items with descriptions: -.Bl -tag -width -indent \" Begins a tagged list -.It item a \" Each item preceded by .It macro -Description of item a -.It item b -Description of item b -.El \" Ends the list -.Pp -A list of flags and their descriptions: -.Bl -tag -width -indent \" Differs from above in tag removed -.It Fl a \"-a flag as a list item -Description of -a flag -.It Fl b -Description of -b flag -.El \" Ends the list -.Pp -.\" .Sh ENVIRONMENT \" May not be needed -.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 -.\" .It Ev ENV_VAR_1 -.\" Description of ENV_VAR_1 -.\" .It Ev ENV_VAR_2 -.\" Description of ENV_VAR_2 -.\" .El -.Sh FILES \" File used or created by the topic of the man page -.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact -.It Pa /usr/share/file_name -FILE_1 description -.It Pa /Users/joeuser/Library/really_long_file_name -FILE_2 description -.El \" Ends the list -.\" .Sh DIAGNOSTICS \" May not be needed -.\" .Bl -diag -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .El -.Sh SEE ALSO -.\" List links in ascending order by section, alphabetically within a section. -.\" Please do not reference files that do not exist without filing a bug report -.Xr a 1 , -.Xr b 1 , -.Xr c 1 , -.Xr a 2 , -.Xr b 2 , -.Xr a 3 , -.Xr b 3 -.\" .Sh BUGS \" Document known, unremedied bugs -.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff -Naur clinkc/sample/upnpdump/macosx/xcode30/upnpdump.m clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump.m --- clinkc/sample/upnpdump/macosx/xcode30/upnpdump.m 2008-05-31 00:19:24.000000000 +0800 +++ clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,58 +0,0 @@ -// -// upnpdump.c -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -void PrintDevice(CGUpnpDevice *dev) -{ - static int devNum = 0; - int serviceNum = 0; - int actionNum = 0; - int argNum = 0; - int statVarNum = 0; - - NSLog(@"[%d] %@", ++devNum, [dev friendlyName]); - NSLog(@" deviceType = %@", [dev deviceType]); - - NSArray *serviceArray = [dev services]; - for (CGUpnpService *service in serviceArray) { - NSLog(@" [%d] service = %@", ++serviceNum, [service serviceType]); - - NSArray *actionArray = [service actions]; - actionNum = 0; - for (CGUpnpAction *action in actionArray) { - //NSLog(@" [%d] action = %@", ++actionNum, [action name]); - NSDictionary *argDir = [action arguments]; - argNum = 0; - for (NSString *name in argDir) { - //NSLog(@" [%d] argument = %@", ++argNum, name); - } - } - - NSArray *statVarArray = [service stateVariables]; - statVarNum = 0; - for (CGUpnpStateVariable *statVar in statVarArray) { - //NSLog(@" [%d] stateVariable = %@", ++statVarNum, [statVar name]); - } - } -} - -int main (int argc, const char * argv[]) -{ - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - - CGUpnpControlPoint *ctrlPoint = [[CGUpnpControlPoint alloc] init]; - [ctrlPoint search]; - NSArray *devArray = [ctrlPoint devices]; - for (CGUpnpDevice *dev in devArray) - PrintDevice(dev); - - [pool drain]; - return 0; -} diff -Naur clinkc/sample/upnpdump/macosx/xcode30/upnpdump_Prefix.pch clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump_Prefix.pch --- clinkc/sample/upnpdump/macosx/xcode30/upnpdump_Prefix.pch 2008-04-24 04:15:19.000000000 +0800 +++ clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump_Prefix.pch 1970-01-01 08:00:00.000000000 +0800 @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'upnpdump' target in the 'upnpdump' project. -// - -#ifdef __OBJC__ - #import -#endif diff -Naur clinkc/sample/upnpdump/macosx/xcode30/upnpdump.xcodeproj/project.pbxproj clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump.xcodeproj/project.pbxproj --- clinkc/sample/upnpdump/macosx/xcode30/upnpdump.xcodeproj/project.pbxproj 2008-05-31 00:19:24.000000000 +0800 +++ clinkc_patch/sample/upnpdump/macosx/xcode30/upnpdump.xcodeproj/project.pbxproj 1970-01-01 08:00:00.000000000 +0800 @@ -1,242 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 44; - objects = { - -/* Begin PBXBuildFile section */ - 214464C40DF05E2B00A23CBB /* CyberLink.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 214464C30DF05E2B00A23CBB /* CyberLink.framework */; }; - 8DD76F9A0486AA7600D96B5E /* upnpdump.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* upnpdump.m */; settings = {ATTRIBUTES = (); }; }; - 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; }; - 8DD76F9F0486AA7600D96B5E /* upnpdump.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859EA3029092ED04C91782 /* upnpdump.1 */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - 8DD76F9F0486AA7600D96B5E /* upnpdump.1 in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 08FB7796FE84155DC02AAC07 /* upnpdump.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = upnpdump.m; sourceTree = ""; }; - 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 214464C30DF05E2B00A23CBB /* CyberLink.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CyberLink.framework; path = ../../../../lib/macosx/xcode30/build/Release/CyberLink.framework; sourceTree = SOURCE_ROOT; }; - 32A70AAB03705E1F00C91783 /* upnpdump_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = upnpdump_Prefix.pch; sourceTree = ""; }; - 8DD76FA10486AA7600D96B5E /* upnpdump */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = upnpdump; sourceTree = BUILT_PRODUCTS_DIR; }; - C6859EA3029092ED04C91782 /* upnpdump.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = upnpdump.1; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76F9B0486AA7600D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */, - 214464C40DF05E2B00A23CBB /* CyberLink.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* upnpdump */ = { - isa = PBXGroup; - children = ( - 08FB7795FE84155DC02AAC07 /* Source */, - C6859EA2029092E104C91782 /* Documentation */, - 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = upnpdump; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 32A70AAB03705E1F00C91783 /* upnpdump_Prefix.pch */, - 08FB7796FE84155DC02AAC07 /* upnpdump.m */, - ); - name = Source; - sourceTree = ""; - }; - 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - 214464C30DF05E2B00A23CBB /* CyberLink.framework */, - 08FB779EFE84155DC02AAC07 /* Foundation.framework */, - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76FA10486AA7600D96B5E /* upnpdump */, - ); - name = Products; - sourceTree = ""; - }; - C6859EA2029092E104C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - C6859EA3029092ED04C91782 /* upnpdump.1 */, - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76F960486AA7600D96B5E /* upnpdump */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "upnpdump" */; - buildPhases = ( - 8DD76F990486AA7600D96B5E /* Sources */, - 8DD76F9B0486AA7600D96B5E /* Frameworks */, - 8DD76F9E0486AA7600D96B5E /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = upnpdump; - productInstallPath = "$(HOME)/bin"; - productName = upnpdump; - productReference = 8DD76FA10486AA7600D96B5E /* upnpdump */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "upnpdump" */; - compatibilityVersion = "Xcode 3.0"; - hasScannedForEncodings = 1; - mainGroup = 08FB7794FE84155DC02AAC07 /* upnpdump */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8DD76F960486AA7600D96B5E /* upnpdump */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76F990486AA7600D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8DD76F9A0486AA7600D96B5E /* upnpdump.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB927508733DD40010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../lib/macosx/xcode30/build/Debug\"", - "\"$(SRCROOT)/../../../../lib/macosx/xcode30/build/Release\"", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = upnpdump_Prefix.pch; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = "-lexpat"; - PRODUCT_NAME = upnpdump; - ZERO_LINK = YES; - }; - name = Debug; - }; - 1DEB927608733DD40010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../lib/macosx/xcode30/build/Debug\"", - "\"$(SRCROOT)/../../../../lib/macosx/xcode30/build/Release\"", - ); - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = upnpdump_Prefix.pch; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = "-lexpat"; - PRODUCT_NAME = upnpdump; - }; - name = Release; - }; - 1DEB927908733DD40010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - ../../../../wrapper/objc, - ../../../../include, - ); - PREBINDING = NO; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; - }; - name = Debug; - }; - 1DEB927A08733DD40010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - ../../../../wrapper/objc, - ../../../../include, - ); - PREBINDING = NO; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "upnpdump" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB927508733DD40010E9CD /* Debug */, - 1DEB927608733DD40010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "upnpdump" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB927908733DD40010E9CD /* Debug */, - 1DEB927A08733DD40010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff -Naur clinkc/sample/upnpdump/Makefile.am clinkc_patch/sample/upnpdump/Makefile.am --- clinkc/sample/upnpdump/Makefile.am 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/upnpdump/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1 +0,0 @@ -SUBDIRS = unix diff -Naur clinkc/sample/upnpdump/tengine/gnu/configure clinkc_patch/sample/upnpdump/tengine/gnu/configure --- clinkc/sample/upnpdump/tengine/gnu/configure 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/upnpdump/tengine/gnu/configure 1970-01-01 08:00:00.000000000 +0800 @@ -1,4 +0,0 @@ -#!/bin/sh -cd sh7727; rm -f Makefile.lnk; ln -fs ../src/Makefile Makefile; cd .. -cd sh7727.debug; rm -f Makefile.lnk; ln -fs ../src/Makefile Makefile; cd .. -cd sh7727.dl; rm -f Makefile.lnk; ln -fs ../src/Makefile Makefile; cd .. diff -Naur clinkc/sample/upnpdump/tengine/gnu/src/Makefile clinkc_patch/sample/upnpdump/tengine/gnu/src/Makefile --- clinkc/sample/upnpdump/tengine/gnu/src/Makefile 2005-10-18 00:08:43.000000000 +0800 +++ clinkc_patch/sample/upnpdump/tengine/gnu/src/Makefile 1970-01-01 08:00:00.000000000 +0800 @@ -1,97 +0,0 @@ -# -# Makefile for CyberLink -# -# Copyright (C) Satoshi Konno 2005 -# - -DEPS = Dependencies -DEPENDENCIES_OUTPUT := $(DEPS) - -# for C++ -USE_CPP = 1 -REL_TYP=q - -include $(BD)/bappl/etc/makerules -include $(CLINKCROOT)/lib/tengine/gnu/Makefile.inc - -TARGET = upnpdump - -S = ../../../ -VPATH = $S - -UPNPCLOCKSRC = \ - ../../../upnpdump.c - -unexport SRC = -SRC = $(UPNPCLOCKSRC) $(CLINKCSRC) - -OBJ = $(addsuffix .o, $(basename $(SRC))) - -CFLAGS += $(CFLAGS_WARNING) - -CFLAGS += -DPROCESS_BASE -ifeq ($(mode), debug) - LDLIBS += -ltm -endif - -CFLAGS += -I$(CLINKCHEADERROOT) -CFLAGS += -I$(CPPUNITROOT)/include -CFLAGS += -I$(EXPATROOT)/lib -CFLAGS += -DTENGINE -CFLAGS += -DCG_TENGINE_NET_KASAGO -#CFLAGS += -DCG_TENGINE_NET_PMC - -# for C++ -CPPFLAGS += -D__USE_THREADS -CPPFLAGS += -D__USE_IOSTREAMS -LOADLIBES += -lstlport - -# for KASAGO -ifeq ($(MACHINE), m32104) - START_ADR = -Wl,-Ttext,0x049B0000,-Tdata,0x049B8000 - CFLAGS += -DTM_BIG_ENDIAN - CFLAGS += -O0 -endif -ifeq ($(MACHINE), sh7727) - CFLAGS += -DTM_LITTLE_ENDIAN -endif -LOADLIBES += -lsvc_ka - -# ---------------------------------------------------------------------------- - -.PHONY: all install clean - -ifeq ($(mode), debug) - NOINST = $(TARGET).trg -endif -INST = $(TARGET) $(TARGET:%=%.map) -ALL = $(INST) $(NOINST) - -all: $(ALL) - -#$(TARGET): $(OBJ) -$(TARGET): $(addsuffix .o, $(basename $(SRC))) - -$(OBJ): - -$(TARGET).trg: $(TARGET) - cp $< $@ - $(STRIP) $@ - -clean: - $(RM) $(OBJ) $(ALL) $(DEPS) - -prenv: - set - -install: $(addprefix $(EXE_INSTALLDIR)/, $(INST)) - -$(TARGET:%=$(EXE_INSTALLDIR)/%): $(EXE_INSTALLDIR)/%: % - $(EXE_INSTALL_STRIP) - -ifdef DEPENDENCIES_OUTPUT - $(DEPS): ; touch $(DEPS) -else - $(DEPS): $(SRC) ; $(MAKEDEPS) $@ $? -endif -include $(DEPS) diff -Naur clinkc/sample/upnpdump/unix/Makefile.am clinkc_patch/sample/upnpdump/unix/Makefile.am --- clinkc/sample/upnpdump/unix/Makefile.am 2010-02-02 22:50:42.000000000 +0800 +++ clinkc_patch/sample/upnpdump/unix/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1,18 +0,0 @@ -samplesdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/samples - -samples_PROGRAMS = upnpdump - -INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I../ -I../../common @XML_CFLAGS@ @CLOG_DEBUG_FLAGS@ - -noinst_HEADERS = \ - ../../common/kb_util.h - -upnpdump_SOURCES = \ - ../upnpdump.c \ - ../../common/kb_util.c - -#if HAVE_LIBTOOL -#upnpdump_LDADD = ../../../lib/unix/libclinkc.la @XML_LIBS@ -#else -upnpdump_LDADD = ../../../lib/unix/libclinkc.a @XML_LIBS@ -#endif diff -Naur clinkc/sample/upnpdump/upnpdump.c clinkc_patch/sample/upnpdump/upnpdump.c --- clinkc/sample/upnpdump/upnpdump.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/sample/upnpdump/upnpdump.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,642 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2005 -* -* Copyright (C) 2006 Nokia Corporation. All rights reserved. -* -* This is licensed under BSD-style license, -* see file COPYING. -* -* File: upnpdump.c -* -* Revision: -* 05/11/05 -* - first release. -* -* 10/31/05 -* - Added some M-SEARCH sending actions -* -************************************************************/ - -#include - -#include - -#if defined(WIN32) && !defined(__CYGWIN__) -#include -#endif - -#if defined(TENGINE) -#if defined(PROCESS_BASE) /* Process based */ -#include -#define MBEG int main( W ac, TC *av[] ) -#define MEND 0 -#define DIR "/SYS/bin/" -#else /* T-Kernel based */ -#include -#include -#include -#define MBEG ER main( INT ac, UB *av[] ) -#define MEND E_SYS -#define DIR "/SYS/bin/" -#endif -#endif - -#include "kb_util.h" - -#if defined(WIN32) && !defined(__CYGWIN__) -#define kbgetkey getch -#else -#define kbgetkey getchar -#endif - -/* Additional control commands */ - -#define CMD_NO_ALTERATIONS 1 -#define CMD_LOOP_ACTION_CALLS 2 - -void ControlDeviceAlter(CgUpnpControlPoint *ctrlPoint, int alteration_mask); - -///////////////////////////////////////////////////////////////////////////////// -// PrintKeyMessage -///////////////////////////////////////////////////////////////////////////////// - -void PrintKeyMessage() -{ - printf("'p' : Print\n"); -#if !defined(CG_UPNP_NOUSE_ACTIONCTRL) - printf("'c' : Control\n"); - printf("'o' : Control (multiple actions)\n"); -#endif -#if !defined(CG_UPNP_NOUSE_QUERYCTRL) - printf("'q' : Query\n"); -#endif -#if !defined(CG_UPNP_NOUSE_SUBSCRIPTION) - printf("'s' : Subscribe\n"); - printf("'u' : Unsubscribe\n"); -#endif - printf("'m' : Change MX value for M-Search\n"); - printf("'r' : M-Search (rootdevice)\n"); - printf("'h' : M-Search (ssdp:all)\n"); - printf("'v' : M-Search (urn:schemas-upnp-org:device:clock:1)\n"); - printf("'t' : M-Search (urn:schemas-upnp-org:service:timer:1)\n"); - printf("'a' : Do all searches four times in a loop.\n"); - printf("'x' : eXit\n"); -} - -///////////////////////////////////////////////////////////////////////////////// -// Notify Listener -///////////////////////////////////////////////////////////////////////////////// - -void SSDPNotifyListner(CgUpnpSSDPPacket *ssdpPkt) -{ - if (cg_upnp_ssdp_packet_isdiscover(ssdpPkt) == TRUE) { - printf("ssdp:discover : ST = %s\n", - cg_upnp_ssdp_packet_getst(ssdpPkt)); - } - else if (cg_upnp_ssdp_packet_isalive(ssdpPkt) == TRUE) { - printf("ssdp:alive : uuid = %s, NT = %s, location = %s\n", - cg_upnp_ssdp_packet_getusn(ssdpPkt), - cg_upnp_ssdp_packet_getnt(ssdpPkt), - cg_upnp_ssdp_packet_getlocation(ssdpPkt)); - } - else if (cg_upnp_ssdp_packet_isbyebye(ssdpPkt) == TRUE) { - printf("ssdp:byebye : uuid = %s, NT = %s\n", - cg_upnp_ssdp_packet_getusn(ssdpPkt), - cg_upnp_ssdp_packet_getnt(ssdpPkt)); - } - cg_upnp_ssdp_packet_print(ssdpPkt); -} - -///////////////////////////////////////////////////////////////////////////////// -// Print Device -///////////////////////////////////////////////////////////////////////////////// - -void PrintDeviceInfo(CgUpnpDevice *dev, int indent) -{ - char indentStr[128]; - int n; - CgUpnpService *service; - int serviceCnt; - CgUpnpAction *action; - int actionCnt; - CgUpnpArgumentList *arg; - int argCnt; - CgUpnpStateVariable *stateVar; - int stateVarCnt; - - for (n=0; n -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** •ÒW‚µ‚È‚¢‚Å‚­‚¾‚³‚¢ ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=upnpdump - Win32 Debug -!MESSAGE ‚±‚ê‚Í—LŒø‚ÈÒ²¸Ì§²Ù‚ł͂ ‚è‚Ü‚¹‚ñB ‚±‚ÌÌßÛ¼Þª¸Ä‚ðËÞÙÄÞ‚·‚邽‚ß‚É‚Í NMAKE ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢B -!MESSAGE [Ò²¸Ì§²Ù‚Ì´¸½Îß°Ä] ºÏÝÄÞ‚ðŽg—p‚µ‚ÄŽÀs‚µ‚Ä‚­‚¾‚³‚¢ -!MESSAGE -!MESSAGE NMAKE /f "upnpdump.mak". -!MESSAGE -!MESSAGE NMAKE ‚ÌŽÀsŽž‚É\¬‚ðŽw’è‚Å‚«‚Ü‚· -!MESSAGE ºÏÝÄÞ ×²Ýã‚ÅϸۂÌÝ’è‚ð’è‹`‚µ‚Ü‚·B—á: -!MESSAGE -!MESSAGE NMAKE /f "upnpdump.mak" CFG="upnpdump - Win32 Debug" -!MESSAGE -!MESSAGE ‘I‘ð‰Â”\‚ÈËÞÙÄÞ Ó°ÄÞ: -!MESSAGE -!MESSAGE "upnpdump - Win32 Release" ("Win32 (x86) Console Application" —p) -!MESSAGE "upnpdump - Win32 Debug" ("Win32 (x86) Console Application" —p) -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "upnpdump - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x411 /d "NDEBUG" -# ADD RSC /l 0x411 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 Iphlpapi.lib ws2_32.lib libexpat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "upnpdump - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x411 /d "_DEBUG" -# ADD RSC /l 0x411 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Iphlpapi.lib ws2_32.lib libexpat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "upnpdump - Win32 Release" -# Name "upnpdump - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\upnpdump.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff -Naur clinkc/sample/upnpdump/win32/vc60/upnpdump.dsw clinkc_patch/sample/upnpdump/win32/vc60/upnpdump.dsw --- clinkc/sample/upnpdump/win32/vc60/upnpdump.dsw 2006-11-21 02:03:29.000000000 +0800 +++ clinkc_patch/sample/upnpdump/win32/vc60/upnpdump.dsw 1970-01-01 08:00:00.000000000 +0800 @@ -1,44 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# Œx: ‚±‚Ìܰ¸½Íß°½ ̧²Ù ‚ð•ÒW‚Ü‚½‚Í휂µ‚È‚¢‚Å‚­‚¾‚³‚¢! - -############################################################################### - -Project: "CyberLinkC"=..\..\..\..\lib\win32\vc60\CyberLinkC.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "upnpdump"=.\upnpdump.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name CyberLinkC - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Naur clinkc/sample/upnpdump/win32/vs2005/upnpdump.sln clinkc_patch/sample/upnpdump/win32/vs2005/upnpdump.sln --- clinkc/sample/upnpdump/win32/vs2005/upnpdump.sln 2007-01-16 09:17:32.000000000 +0800 +++ clinkc_patch/sample/upnpdump/win32/vs2005/upnpdump.sln 1970-01-01 08:00:00.000000000 +0800 @@ -1,28 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upnpdump", "upnpdump.vcproj", "{43F876F0-AEB9-4F77-A3B7-E2171F6C2295}" - ProjectSection(ProjectDependencies) = postProject - {D550D099-9F69-4F30-864C-504D02F72774} = {D550D099-9F69-4F30-864C-504D02F72774} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CyberLinkC", "..\..\..\..\lib\win32\vs2005\CyberLinkC.vcproj", "{D550D099-9F69-4F30-864C-504D02F72774}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Debug|Win32.ActiveCfg = Debug|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Debug|Win32.Build.0 = Debug|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Release|Win32.ActiveCfg = Release|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Release|Win32.Build.0 = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.ActiveCfg = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.Build.0 = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.ActiveCfg = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff -Naur clinkc/sample/upnpdump/win32/vs2005/upnpdump.vcproj clinkc_patch/sample/upnpdump/win32/vs2005/upnpdump.vcproj --- clinkc/sample/upnpdump/win32/vs2005/upnpdump.vcproj 2008-05-15 11:57:45.000000000 +0800 +++ clinkc_patch/sample/upnpdump/win32/vs2005/upnpdump.vcproj 1970-01-01 08:00:00.000000000 +0800 @@ -1,207 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Naur clinkc/sample/upnpdump/win32/vs2008/upnpdump.sln clinkc_patch/sample/upnpdump/win32/vs2008/upnpdump.sln --- clinkc/sample/upnpdump/win32/vs2008/upnpdump.sln 2010-08-11 00:51:25.000000000 +0800 +++ clinkc_patch/sample/upnpdump/win32/vs2008/upnpdump.sln 1970-01-01 08:00:00.000000000 +0800 @@ -1,28 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upnpdump", "upnpdump.vcproj", "{43F876F0-AEB9-4F77-A3B7-E2171F6C2295}" - ProjectSection(ProjectDependencies) = postProject - {D550D099-9F69-4F30-864C-504D02F72774} = {D550D099-9F69-4F30-864C-504D02F72774} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CyberLinkC", "..\..\..\..\lib\win32\vs2005\CyberLinkC.vcproj", "{D550D099-9F69-4F30-864C-504D02F72774}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Debug|Win32.ActiveCfg = Debug|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Debug|Win32.Build.0 = Debug|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Release|Win32.ActiveCfg = Release|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Release|Win32.Build.0 = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.ActiveCfg = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.Build.0 = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.ActiveCfg = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff -Naur clinkc/sample/upnpdump/win32/vs2008/upnpdump.vcproj clinkc_patch/sample/upnpdump/win32/vs2008/upnpdump.vcproj --- clinkc/sample/upnpdump/win32/vs2008/upnpdump.vcproj 2010-08-11 00:51:25.000000000 +0800 +++ clinkc_patch/sample/upnpdump/win32/vs2008/upnpdump.vcproj 1970-01-01 08:00:00.000000000 +0800 @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Naur clinkc/sample/upnpigddump/macosx/xcode30/upnpigddump.1 clinkc_patch/sample/upnpigddump/macosx/xcode30/upnpigddump.1 --- clinkc/sample/upnpigddump/macosx/xcode30/upnpigddump.1 2008-06-03 23:29:15.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/macosx/xcode30/upnpigddump.1 1970-01-01 08:00:00.000000000 +0800 @@ -1,79 +0,0 @@ -.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. -.\"See Also: -.\"man mdoc.samples for a complete listing of options -.\"man mdoc for the short list of editing options -.\"/usr/share/misc/mdoc.template -.Dd 08/05/20 \" DATE -.Dt upnpavdump 1 \" Program name and manual section number -.Os Darwin -.Sh NAME \" Section Header - required - don't modify -.Nm upnpavdump, -.\" The following lines are read in generating the apropos(man -k) database. Use only key -.\" words here as the database is built based on the words here and in the .ND line. -.Nm Other_name_for_same_program(), -.Nm Yet another name for the same program. -.\" Use .Nm macro to designate other names for the documented program. -.Nd This line parsed for whatis database. -.Sh SYNOPSIS \" Section Header - required - don't modify -.Nm -.Op Fl abcd \" [-abcd] -.Op Fl a Ar path \" [-a path] -.Op Ar file \" [file] -.Op Ar \" [file ...] -.Ar arg0 \" Underlined argument - use .Ar anywhere to underline -arg2 ... \" Arguments -.Sh DESCRIPTION \" Section Header - required - don't modify -Use the .Nm macro to refer to your program throughout the man page like such: -.Nm -Underlining is accomplished with the .Ar macro like this: -.Ar underlined text . -.Pp \" Inserts a space -A list of items with descriptions: -.Bl -tag -width -indent \" Begins a tagged list -.It item a \" Each item preceded by .It macro -Description of item a -.It item b -Description of item b -.El \" Ends the list -.Pp -A list of flags and their descriptions: -.Bl -tag -width -indent \" Differs from above in tag removed -.It Fl a \"-a flag as a list item -Description of -a flag -.It Fl b -Description of -b flag -.El \" Ends the list -.Pp -.\" .Sh ENVIRONMENT \" May not be needed -.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 -.\" .It Ev ENV_VAR_1 -.\" Description of ENV_VAR_1 -.\" .It Ev ENV_VAR_2 -.\" Description of ENV_VAR_2 -.\" .El -.Sh FILES \" File used or created by the topic of the man page -.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact -.It Pa /usr/share/file_name -FILE_1 description -.It Pa /Users/joeuser/Library/really_long_file_name -FILE_2 description -.El \" Ends the list -.\" .Sh DIAGNOSTICS \" May not be needed -.\" .Bl -diag -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .It Diagnostic Tag -.\" Diagnostic informtion here. -.\" .El -.Sh SEE ALSO -.\" List links in ascending order by section, alphabetically within a section. -.\" Please do not reference files that do not exist without filing a bug report -.Xr a 1 , -.Xr b 1 , -.Xr c 1 , -.Xr a 2 , -.Xr b 2 , -.Xr a 3 , -.Xr b 3 -.\" .Sh BUGS \" Document known, unremedied bugs -.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file diff -Naur clinkc/sample/upnpigddump/macosx/xcode30/upnpigddump.m clinkc_patch/sample/upnpigddump/macosx/xcode30/upnpigddump.m --- clinkc/sample/upnpigddump/macosx/xcode30/upnpigddump.m 2008-06-05 05:13:56.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/macosx/xcode30/upnpigddump.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,61 +0,0 @@ -// -// upnpigddump.c -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -void PrintIGDInfo(CGUpnpDevice *dev, int igdNum) -{ - NSLog(@"[%d] %@", igdNum, [dev friendlyName]); - - CGUpnpService *ipConService = [dev getServiceForType:@"urn:schemas-upnp-org:service:WANIPConnection:1"]; - if (ipConService) { - CGUpnpAction *extIpAddrAction = [ipConService getActionForName:@"GetExternalIPAddress"]; - if (extIpAddrAction) { - if ([extIpAddrAction post]) - NSLog(@" GetExternalIPAddress = %@", [extIpAddrAction argumentValueForName:@"NewExternalIPAddress"]); - } - } - - CGUpnpService *wanComIfCfgService = [dev getServiceForType:@"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"]; - if (wanComIfCfgService) { - CGUpnpAction *totalBytesSentAction = [wanComIfCfgService getActionForName:@"GetTotalBytesSent"]; - if (totalBytesSentAction) { - if ([totalBytesSentAction post]) - NSLog(@" GetTotalBytesSent = %@", [totalBytesSentAction argumentValueForName:@"NewTotalBytesSent"]); - } - CGUpnpAction *totalBytesRecvAction = [wanComIfCfgService getActionForName:@"GetTotalBytesReceived"]; - if (totalBytesRecvAction) { - if ([totalBytesRecvAction post]) - NSLog(@" GetTotalBytesReceived = %@", [totalBytesRecvAction argumentValueForName:@"NewTotalBytesReceived"]); - } - } - -} - -int main (int argc, const char * argv[]) -{ - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - - CGUpnpControlPoint *ctrlPoint = [[CGUpnpControlPoint alloc] init]; - - [ctrlPoint search]; - - int igdNum = 0; - NSArray *devArray = [ctrlPoint devices]; - for (CGUpnpDevice *dev in devArray) { - if ([dev isDeviceType:@"urn:schemas-upnp-org:device:InternetGatewayDevice:1"]) - PrintIGDInfo(dev, ++igdNum); - } - - if (igdNum <= 0) - NSLog(@"IGD is not found !!\n"); - - [pool drain]; - return 0; -} diff -Naur clinkc/sample/upnpigddump/macosx/xcode30/upnpigddump.xcodeproj/project.pbxproj clinkc_patch/sample/upnpigddump/macosx/xcode30/upnpigddump.xcodeproj/project.pbxproj --- clinkc/sample/upnpigddump/macosx/xcode30/upnpigddump.xcodeproj/project.pbxproj 2008-06-03 23:29:15.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/macosx/xcode30/upnpigddump.xcodeproj/project.pbxproj 1970-01-01 08:00:00.000000000 +0800 @@ -1,234 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 44; - objects = { - -/* Begin PBXBuildFile section */ - 214464E60DF05F9A00A23CBB /* CyberLink.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 214464E50DF05F9A00A23CBB /* CyberLink.framework */; }; - 21C648100DE31FA60028FCF9 /* upnpigddump.m in Sources */ = {isa = PBXBuildFile; fileRef = 21C6480F0DE31FA60028FCF9 /* upnpigddump.m */; }; - 21C648A80DE322890028FCF9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21C648A70DE322890028FCF9 /* Foundation.framework */; }; - 8DD76F7C0486A8DE00D96B5E /* upnpigddump.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859E970290921104C91782 /* upnpigddump.1 */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 8DD76F7B0486A8DE00D96B5E /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - 8DD76F7C0486A8DE00D96B5E /* upnpigddump.1 in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 214464E50DF05F9A00A23CBB /* CyberLink.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CyberLink.framework; path = ../../../../lib/macosx/xcode30/build/Release/CyberLink.framework; sourceTree = SOURCE_ROOT; }; - 21C6480F0DE31FA60028FCF9 /* upnpigddump.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = upnpigddump.m; sourceTree = ""; }; - 21C648A70DE322890028FCF9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 8DD76F7E0486A8DE00D96B5E /* upnpigddump */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = upnpigddump; sourceTree = BUILT_PRODUCTS_DIR; }; - C6859E970290921104C91782 /* upnpigddump.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = upnpigddump.1; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76F780486A8DE00D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 21C648A80DE322890028FCF9 /* Foundation.framework in Frameworks */, - 214464E60DF05F9A00A23CBB /* CyberLink.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* upnpigddump */ = { - isa = PBXGroup; - children = ( - 08FB7795FE84155DC02AAC07 /* Source */, - C6859E96029091FE04C91782 /* Documentation */, - 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */, - 19C28FBDFE9D53C911CA2CBB /* Products */, - ); - name = upnpigddump; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 21C6480F0DE31FA60028FCF9 /* upnpigddump.m */, - ); - name = Source; - sourceTree = ""; - }; - 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - 214464E50DF05F9A00A23CBB /* CyberLink.framework */, - 21C648A70DE322890028FCF9 /* Foundation.framework */, - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - 19C28FBDFE9D53C911CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76F7E0486A8DE00D96B5E /* upnpigddump */, - ); - name = Products; - sourceTree = ""; - }; - C6859E96029091FE04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - C6859E970290921104C91782 /* upnpigddump.1 */, - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76F740486A8DE00D96B5E /* upnpigddump */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB924708733DCA0010E9CD /* Build configuration list for PBXNativeTarget "upnpigddump" */; - buildPhases = ( - 8DD76F760486A8DE00D96B5E /* Sources */, - 8DD76F780486A8DE00D96B5E /* Frameworks */, - 8DD76F7B0486A8DE00D96B5E /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = upnpigddump; - productInstallPath = "$(HOME)/bin"; - productName = upnpigddump; - productReference = 8DD76F7E0486A8DE00D96B5E /* upnpigddump */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 1DEB924B08733DCA0010E9CD /* Build configuration list for PBXProject "upnpigddump" */; - compatibilityVersion = "Xcode 3.0"; - hasScannedForEncodings = 1; - mainGroup = 08FB7794FE84155DC02AAC07 /* upnpigddump */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8DD76F740486A8DE00D96B5E /* upnpigddump */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76F760486A8DE00D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 21C648100DE31FA60028FCF9 /* upnpigddump.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB924808733DCA0010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../lib/macosx/xcode30/build/Release\"", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = "-lexpat"; - PRODUCT_NAME = upnpigddump; - ZERO_LINK = YES; - }; - name = Debug; - }; - 1DEB924908733DCA0010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/../../../../lib/macosx/xcode30/build/Release\"", - ); - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = "-lexpat"; - PRODUCT_NAME = upnpigddump; - }; - name = Release; - }; - 1DEB924C08733DCA0010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - ../../../../wrapper/objc, - ../../../../include, - ); - PREBINDING = NO; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; - }; - name = Debug; - }; - 1DEB924D08733DCA0010E9CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - ../../../../wrapper/objc, - ../../../../include, - ); - PREBINDING = NO; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB924708733DCA0010E9CD /* Build configuration list for PBXNativeTarget "upnpigddump" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB924808733DCA0010E9CD /* Debug */, - 1DEB924908733DCA0010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB924B08733DCA0010E9CD /* Build configuration list for PBXProject "upnpigddump" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB924C08733DCA0010E9CD /* Debug */, - 1DEB924D08733DCA0010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff -Naur clinkc/sample/upnpigddump/Makefile.am clinkc_patch/sample/upnpigddump/Makefile.am --- clinkc/sample/upnpigddump/Makefile.am 2008-06-03 23:29:15.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1 +0,0 @@ -SUBDIRS = unix diff -Naur clinkc/sample/upnpigddump/unix/Makefile.am clinkc_patch/sample/upnpigddump/unix/Makefile.am --- clinkc/sample/upnpigddump/unix/Makefile.am 2010-02-02 22:50:42.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/unix/Makefile.am 1970-01-01 08:00:00.000000000 +0800 @@ -1,18 +0,0 @@ -samplesdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/samples - -samples_PROGRAMS = upnpigddump - -INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I../ -I../../common @XML_CFLAGS@ @CLOG_DEBUG_FLAGS@ - -noinst_HEADERS = \ - ../../common/kb_util.h - -upnpigddump_SOURCES = \ - ../upnpigddump.c \ - ../../common/kb_util.c - -#if HAVE_LIBTOOL -#upnpigddump_LDADD = ../../../lib/unix/libclinkc.la @XML_LIBS@ -#else -upnpigddump_LDADD = ../../../lib/unix/libclinkc.a @XML_LIBS@ -#endif diff -Naur clinkc/sample/upnpigddump/upnpigddump.c clinkc_patch/sample/upnpigddump/upnpigddump.c --- clinkc/sample/upnpigddump/upnpigddump.c 2010-02-02 22:50:42.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/upnpigddump.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,110 +0,0 @@ -/************************************************************ -* -* CyberLink for C -* -* Copyright (C) Satoshi Konno 2008 -* -* File: upnpigddump.c -* -* Revision: -* 08/05/24 -* - first release. -* -************************************************************/ - -#include - -#define UPNPAVDUMP_IGD_DEVICETYPE "urn:schemas-upnp-org:device:InternetGatewayDevice:1" - -#define UPNPAVDUMP_IGD_WANIPCON_SERVICETYPE "urn:schemas-upnp-org:service:WANIPConnection:1" -#define UPNPAVDUMP_IGD_WANCOMIFCFG_SERVICETYPE "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" - -///////////////////////////////////////////////////////////////////////////////// -// PrintIGDInfo -///////////////////////////////////////////////////////////////////////////////// - -void PrintIGDInfo(CgUpnpDevice *dev, int igdNum) -{ - CgUpnpService *ipConService; - CgUpnpAction *extIpAddrAction; - CgUpnpService *wanComIfCfgService; - CgUpnpAction *totalBytesSentAction; - CgUpnpAction *totalBytesRecvAction; - - if (!cg_upnp_device_isdevicetype(dev, UPNPAVDUMP_IGD_DEVICETYPE)) - return; - - printf("[%d] : %s\n", igdNum, cg_upnp_device_getfriendlyname(dev)); - - ipConService = cg_upnp_device_getservicebytype(dev, UPNPAVDUMP_IGD_WANIPCON_SERVICETYPE); - if (ipConService) { - extIpAddrAction = cg_upnp_service_getactionbyname(ipConService, "GetExternalIPAddress"); - if (extIpAddrAction) { - if (cg_upnp_action_post(extIpAddrAction)) - printf(" GetExternalIPAddress = %s\n", cg_upnp_action_getargumentvaluebyname(extIpAddrAction, "NewExternalIPAddress")); - } - } - - wanComIfCfgService = cg_upnp_device_getservicebytype(dev, UPNPAVDUMP_IGD_WANCOMIFCFG_SERVICETYPE); - if (wanComIfCfgService) { - totalBytesSentAction = cg_upnp_service_getactionbyname(ipConService, "GetTotalBytesSent"); - if (totalBytesSentAction) { - if (cg_upnp_action_post(totalBytesSentAction)) - printf(" GetTotalBytesSent = %s\n", cg_upnp_action_getargumentvaluebyname(totalBytesSentAction, "NewTotalBytesSent")); - } - totalBytesRecvAction = cg_upnp_service_getactionbyname(ipConService, "GetTotalBytesReceived"); - if (totalBytesRecvAction) { - if (cg_upnp_action_post(totalBytesRecvAction)) - printf(" GetTotalBytesSent = %s\n", cg_upnp_action_getargumentvaluebyname(totalBytesRecvAction, "NewTotalBytesReceived")); - } - } -} - -///////////////////////////////////////////////////////////////////////////////// -// PrintIGDInfos -///////////////////////////////////////////////////////////////////////////////// - -void PrintIGDInfos(CgUpnpControlPoint *ctrlPoint) -{ - CgUpnpDevice *dev; - int igdNum; - - igdNum = 0; - for (dev = cg_upnp_controlpoint_getdevices(ctrlPoint); dev != NULL; dev = cg_upnp_device_next(dev)) { - if (cg_upnp_device_isdevicetype(dev, UPNPAVDUMP_IGD_DEVICETYPE)) - PrintIGDInfo(dev, ++igdNum); - } - - if (igdNum <= 0) - printf("IGD is not found !!\n"); -} - -///////////////////////////////////////////////////////////////////////////////// -// main -///////////////////////////////////////////////////////////////////////////////// - -#if defined(TENGINE) -MBEG -#else -int main( int argc, char* argv[] ) -#endif -{ - CgUpnpControlPoint *ctrlPoint; - - ctrlPoint = cg_upnp_controlpoint_new(); - if (cg_upnp_controlpoint_start(ctrlPoint) == FALSE) { - printf("Couldn't start this control point !!"); - exit(1); - } - - cg_upnp_controlpoint_search(ctrlPoint, CG_UPNP_ST_ROOT_DEVICE); - - cg_sleep(cg_upnp_controlpoint_getssdpsearchmx(ctrlPoint) * 1000); - - PrintIGDInfos(ctrlPoint); - - cg_upnp_controlpoint_stop(ctrlPoint); - cg_upnp_controlpoint_delete(ctrlPoint); - - return(0); -} diff -Naur clinkc/sample/upnpigddump/win32/vs2005/upnpigddump.sln clinkc_patch/sample/upnpigddump/win32/vs2005/upnpigddump.sln --- clinkc/sample/upnpigddump/win32/vs2005/upnpigddump.sln 2008-06-03 23:29:15.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/win32/vs2005/upnpigddump.sln 1970-01-01 08:00:00.000000000 +0800 @@ -1,28 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upnpigddump", "upnpigddump.vcproj", "{43F876F0-AEB9-4F77-A3B7-E2171F6C2295}" - ProjectSection(ProjectDependencies) = postProject - {D550D099-9F69-4F30-864C-504D02F72774} = {D550D099-9F69-4F30-864C-504D02F72774} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CyberLinkC", "..\..\..\..\lib\win32\vs2005\CyberLinkC.vcproj", "{D550D099-9F69-4F30-864C-504D02F72774}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Debug|Win32.ActiveCfg = Debug|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Debug|Win32.Build.0 = Debug|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Release|Win32.ActiveCfg = Release|Win32 - {43F876F0-AEB9-4F77-A3B7-E2171F6C2295}.Release|Win32.Build.0 = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.ActiveCfg = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Debug|Win32.Build.0 = Debug|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.ActiveCfg = Release|Win32 - {D550D099-9F69-4F30-864C-504D02F72774}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff -Naur clinkc/sample/upnpigddump/win32/vs2005/upnpigddump.vcproj clinkc_patch/sample/upnpigddump/win32/vs2005/upnpigddump.vcproj --- clinkc/sample/upnpigddump/win32/vs2005/upnpigddump.vcproj 2008-06-03 23:29:15.000000000 +0800 +++ clinkc_patch/sample/upnpigddump/win32/vs2005/upnpigddump.vcproj 1970-01-01 08:00:00.000000000 +0800 @@ -1,207 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Naur clinkc/src/cybergarage/http/chttp_authentication.c clinkc_patch/src/cybergarage/http/chttp_authentication.c --- clinkc/src/cybergarage/http/chttp_authentication.c 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_authentication.c 2014-01-29 13:54:26.410322405 +0800 @@ -0,0 +1,1029 @@ +/****************************************************************** +* +* CyberLink for C +* +* Copyright (C) Satoshi Konno 2005 +* +* Copyright (C) 2006 Nokia Corporation. All rights reserved. +* +* This is licensed under BSD-style license, +* see file COPYING. +* +* File: chttp_authentication.c +* +* Revision: +* +* 05/31/12 +* - first release +* +******************************************************************/ + + +#include +#include +#include +#include +#include +#include + +int nc = 0; +CgHttpAuth *digestHead = NULL; +CgHttpAuth *digestTail = NULL; + +/**************************************************************************** +* Function for linklist utility +*****************************************************************************/ +static BOOL cg_http_digest_del_entry(CgHttpAuth *delEntry) +{ + CgHttpAuth *now = digestHead; + + /*delete head entry*/ + if(delEntry == digestHead){ + /*also tail*/ + if(delEntry == digestTail){ + digestHead = NULL; + digestTail = NULL; + } + else + digestHead = delEntry->next; + + free(delEntry); + return TRUE; + } + + while(now != NULL){ + if(now->next == delEntry){ + /*delete tail entry*/ + if(delEntry == digestTail){ + now->next = NULL; + digestTail = now; + free(delEntry); + return TRUE; + }else{ //delete middle entry + now->next = delEntry->next; + free(delEntry); + return TRUE; + } + } + now = now->next; + } + + return TRUE; +} + +static BOOL cg_http_digest_replace_entry(CgHttpAuth *oldEntry, CgHttpAuth *newEntry) +{ + CgHttpAuth *now = digestHead; + + /*delete head entry*/ + if(oldEntry == digestHead){ + /*also tail*/ + if(oldEntry == digestTail) + digestTail = newEntry; + else + newEntry->next = digestHead->next; + + digestHead = newEntry; + free(oldEntry); + return TRUE; + } + + while(now != NULL){ + if(now->next == oldEntry){ + /*delete tail entry*/ + if(oldEntry == digestTail){ + now->next = newEntry; + digestTail = newEntry; + free(oldEntry); + return TRUE; + }else{ //delete middle entry + newEntry->next = oldEntry->next; + now->next = newEntry; + free(oldEntry); + return TRUE; + } + } + now = now->next; + } + + return TRUE; +} + +/**************************************************************************** +* Function for client request +*****************************************************************************/ + +CgHttpResponse *cg_http_request_post_with_auth(CgHttpRequest *httpReq, char *ipaddr, int port, char *user, char *passwd) +{ + CgHttpResponse *httpRes; + char *authHeader; + int basicHeaderLen; + CgHttpHeader *header = NULL; + char *basicHeader, *base64Encode; + char *staleFlag, *entityBody, digestHeader[1024]={0}, algorithmHeader[64]={0}, opaqueHeader[128]={0}; + char *method = NULL, *uripath = NULL; + CgHttpAuth *auth; + char md5Input[1024]={0}, ha1[CG_MD5_STRING_BUF_SIZE]={0}, ha2[CG_MD5_STRING_BUF_SIZE]={0}, digest[CG_MD5_STRING_BUF_SIZE]={0}, hEntity[CG_MD5_STRING_BUF_SIZE]={0}; + char *tmp = NULL; + char *nonce = NULL; + + /*post http request*/ + httpRes = cg_http_request_post(httpReq, ipaddr, port); + + /*check if the query web page needs authentication*/ + if ((cg_http_response_getstatuscode(httpRes)) != CG_HTTP_STATUS_UNAUTHORIZED) + return httpRes; + + /*get authentication header*/ + auth = &httpRes->authData; + cg_http_auth_header_parse((CgHttpPacket*)httpRes); + authHeader = cg_http_response_getauth(httpRes); + if (strcmp(authHeader, "Basic") == 0) /*basic authentication*/ + { + base64Encode = cg_http_base64encode(user, passwd); + basicHeaderLen = strlen(base64Encode)+strlen("Basic ")+1; + basicHeader = (char *)malloc((basicHeaderLen)*sizeof(char)); + memset( basicHeader, 0, (basicHeaderLen)*sizeof(char) ); + if(basicHeader == NULL) + printf("error: out of memory,%s,%d\n",__FUNCTION__,__LINE__); + + snprintf(basicHeader, basicHeaderLen, "Basic %s",base64Encode); + if(basicHeader == NULL) + printf("error: base64 encode fail\n"); + + /*add header to request*/ + header = cg_http_header_new(); + cg_http_header_setname(header, CG_HTTP_AUTHENTICATION); + cg_http_header_setvalue(header, basicHeader); + cg_http_packet_addheader((CgHttpPacket*)httpReq, header); + httpRes = cg_http_request_post(httpReq, ipaddr, port); + if(httpRes == NULL) + printf("error: http response fail\n"); + + /*clean up*/ + free(base64Encode); + free(basicHeader); + + /*authentication success*/ + if((cg_http_response_getstatuscode(httpRes)) == CG_HTTP_STATUS_OK) + auth->result = AUTH_OK; + + /*authentication fail if the 401 response is presented*/ + if((cg_http_response_getstatuscode(httpRes)) == CG_HTTP_STATUS_UNAUTHORIZED) + auth->result = AUTH_WRONG_INPUT; + + return httpRes; + } + else if (strcmp(authHeader, "Digest") == 0) /*digest authentication*/ + { + /*prepare value of digest headers*/ + auth->realm = cg_http_response_getrealm(httpRes); + if(!auth->realm){ + printf("error: can not get realm"); + return httpRes; + } + + nonce = cg_http_response_getnonce(httpRes); + if( nonce != NULL) + strcpy(auth->nonce, nonce); + else{ + printf("error: can not get nonce"); + return httpRes; + } + + tmp = cg_http_response_getqop(httpRes); + if(!tmp) + auth->qop = NULL; + else + auth->qop = tmp; + + tmp = cg_http_response_getalgorithm(httpRes); + if(!tmp) + auth->algorithm = NULL; + else + auth->algorithm = tmp; + + tmp = cg_http_response_getopaque(httpRes); + if(!tmp) + auth->opaque = NULL; + else + auth->opaque = tmp; + + method = cg_http_request_getmethod(httpReq); + uripath = cg_http_request_geturi(httpReq); + auth->cnonce = generateCnonce(); + nc++; + auth->nc = nc; + +/* + if the algorithm is "MD5" or unspecified + ha1 = MD5( username:realm:passwd ) + + if the qop is "auth" or unspecified + ha2 = MD5( Method:digest-uri ) +*/ + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", user, auth->realm, passwd); + cg_str2md5(md5Input,ha1); + snprintf(md5Input, sizeof(md5Input), "%s:%s", method, uripath); + cg_str2md5(md5Input,ha2); + +/* + here we dicuss the different formula of digest response based on qop value. + + if the qop is unspecified: + 1. the hash function in here must be "MD5" or unspecified, + otherwise we don't support other hash function. + + 2. digest response= MD5(ha1:nonce:ha2) + + + if the qop is "auth" or "auth-int": + 1.the hash function in here must be "MD5" or unspecified or "MD5-sess", + otherwise we don't support other hash function. + + 2.in particular, if the qop is "auth-int" + ha2 = MD5( Method:digest-uri:MD5(entity-body) ) + + 3.in particular, if the algorithm is "MD5-sess" + ha1 = MD5( MD5( username:realm:passwd):nonce:cnonce ) + + 4. digest response= MD5(ha1:nonce:nc:cnonce:qop:ha2) + +*/ + if (!(auth->qop)) { + if((auth->algorithm)&&(strcmp(auth->algorithm, "MD5") != 0)){ + auth->result = AUTH_UNSUPPORT_ALGORITHM; + return httpRes; + } + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", ha1, auth->nonce, ha2); + cg_str2md5(md5Input,digest); + snprintf(digestHeader, sizeof(digestHeader), "Digest username=\"%s\", " + "realm=\"%s\", " + "nonce=\"%s\", " + "uri=\"%s\", " + "response=\"%s\"", + user, + auth->realm, + auth->nonce, + uripath, + digest); + + if((auth->algorithm)){ + snprintf(algorithmHeader, sizeof(algorithmHeader), ", algorithm=%s", auth->algorithm); + strcat(digestHeader, algorithmHeader); + } + if(auth->opaque){ + snprintf(opaqueHeader, sizeof(opaqueHeader), ", opaque=%s", auth->opaque); + strcat(digestHeader, opaqueHeader); + } + } + else{ + if((auth->algorithm)&&(strcmp(auth->algorithm, "MD5") != 0)&&(strcmp(auth->algorithm,"MD5-sess") != 0)){ + auth->result = AUTH_UNSUPPORT_ALGORITHM; + return httpRes; + } + + if(strcmp(auth->qop, "auth-int") == 0){ + entityBody = cg_http_request_getcontent(httpReq); + cg_str2md5(entityBody, hEntity); + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", method, uripath, hEntity); + cg_str2md5(md5Input,ha2); + } + + if((auth->algorithm) && (strcmp(auth->algorithm, "MD5-sess") == 0)){ + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", ha1, auth->nonce, auth->cnonce); + cg_str2md5(md5Input,ha1); + } + + snprintf(md5Input, sizeof(md5Input), "%s:%s:%08x:%s:%s:%s", + ha1, + auth->nonce, + auth->nc, + auth->cnonce, + auth->qop, + ha2); + cg_str2md5(md5Input,digest); + snprintf(digestHeader, sizeof(digestHeader), "Digest username=\"%s\", " + "realm=\"%s\", " + "nonce=\"%s\", " + "uri=\"%s\", " + "response=\"%s\", " + "qop=\"%s\", " + "nc=%08x, " + "cnonce=\"%s\"", + user, + auth->realm, + auth->nonce, + uripath, + digest, + auth->qop, + auth->nc, + auth->cnonce); + + if(auth->algorithm){ + snprintf(algorithmHeader, sizeof(algorithmHeader), ", algorithm=%s", auth->algorithm); + strcat(digestHeader, algorithmHeader); + } + if(auth->opaque){ + snprintf(opaqueHeader, sizeof(opaqueHeader), ", opaque=\"%s\"", auth->opaque); + strcat(digestHeader, opaqueHeader); + } + } + + /*add header to digest request*/ + header = cg_http_header_new(); + cg_http_header_setname(header, CG_HTTP_AUTHENTICATION); + cg_http_header_setvalue(header, digestHeader); + cg_http_packet_addheader((CgHttpPacket*)httpReq, header); + httpRes = cg_http_request_post(httpReq, ipaddr, port); + if(httpRes == NULL) + printf("error: http response fail\n"); + + /*authentication success*/ + if((cg_http_response_getstatuscode(httpRes)) == CG_HTTP_STATUS_OK){ + auth->result = AUTH_OK; + return httpRes; + } + + /*authentication fail if the 401 response is presented: + it presents that the username and password is correct, + but the nonce value is old when the http response carries stale header, and the value is "TRUE". + + otherwise, the username or password is wrong. + */ + if((cg_http_response_getstatuscode(httpRes)) == CG_HTTP_STATUS_UNAUTHORIZED){ + cg_http_auth_header_parse((CgHttpPacket*)httpRes); + staleFlag = cg_http_response_getstale(httpRes); + if(staleFlag && strcasecmp(staleFlag, "TRUE") == 0){ + auth->result = AUTH_STALE; + return httpRes; + } + else{ + auth->result = AUTH_WRONG_INPUT; + return httpRes; + } + } + else + return httpRes; + } + /*the authentication way neither Basic nor Digest*/ + else{ + auth->result = AUTH_UNSUPPORT_AUTH; + return httpRes; + } +} + +char *generateCnonce() +{ + struct timeval now; + char cnonceBuf[10]; + char *cnonce; + int cnonceLen; + + /*get time*/ + gettimeofday(&now, NULL); + snprintf(cnonceBuf, sizeof(cnonceBuf), "%09ld", (long)now.tv_sec); + + /* Note: The value returned may be larger than the actual size + * required, but will never be smaller. + */ + cnonceLen = b64_encode(cnonceBuf, sizeof(cnonceBuf), NULL, 0) ; + + /* Using the length determined by the call to b64_encode(), create + * a buffer of sufficient size. + */ + cnonce = (char*)malloc(cnonceLen+1); + if (cnonce == NULL) + printf("error: out of memory,%s,%d\n",__FUNCTION__,__LINE__); + + memset( cnonce, 0, cnonceLen+1 ); + /* Perform base64 encoding*/ + b64_encode(cnonceBuf, sizeof(cnonceBuf), cnonce, cnonceLen); + return cnonce; +} + +void cg_http_auth_header_parse(CgHttpPacket *httpPkt) +{ + char headerArray[512]={0}; + char *headerPtr = NULL, *headerLine = NULL, *passphrase = NULL; + int statusCode = 0; + char *p[32]; + CgHttpHeader *subheader; + char *name, *value, *authMethod; + int i = 0, j = 0; + BOOL isReq = FALSE; + + /*ckeck whether the input is http request or response*/ + if(cg_http_request_isgetrequest((CgHttpRequest *)httpPkt) || cg_http_request_ispostrequest((CgHttpRequest *)httpPkt)) + isReq = TRUE; + + /*get authentication header line*/ + if(isReq == FALSE){// response from http server + headerLine = cg_http_response_getauth(httpPkt); + if (headerLine == NULL){ + printf("error: can not get authentication header line\n"); + return; + } + } + else{// request from http client + headerLine = cg_http_request_getauth(httpPkt); + if (headerLine == NULL){ + printf("error: can not get authentication header line\n"); + return; + } + } + + /*beacause strtok will modifies the string(char *header)we give it, + so convert the input pointer to array and set to header pointer*/ + strcpy(headerArray, headerLine); + headerPtr = headerArray; + + /*detach the authentication header as authentication method. + *it is noteworthy that "Basic" auth request header format is different below: + * Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ (encode response string) + */ + authMethod = strtok(headerPtr, " "); + if(authMethod != NULL){ + if(!isReq) + cg_http_packet_setheadervalue(httpPkt, CG_HTTP_WWW_AUTHENTICATION, authMethod); + else if(!strcmp(authMethod, "Basic")){ + cg_http_packet_setheadervalue(httpPkt, CG_HTTP_AUTHENTICATION, authMethod); + passphrase = strtok(NULL, " "); + cg_http_packet_setheadervalue(httpPkt, CG_HTTP_RESPONSE, passphrase); + return; + } + else + cg_http_packet_setheadervalue(httpPkt, CG_HTTP_AUTHENTICATION, authMethod); + } + + /*detach the authentication header to extract subheaders*/ + /*prepare header pair to array p[]*/ + while((p[i]= strtok(NULL, "=\", "))!=NULL) + i++; + + /*set header pair from retrieve p[] + for example, p[0]=name_#1 p[1]=value_#1, p[2]=name_#2 p[3]=value_#2 and so on */ + for(j=0;jrealm = NULL; + (*digest)->algorithm = NULL; + (*digest)->qop = NULL; + (*digest)->cnonce = NULL; + (*digest)->opaque = NULL; + (*digest)->username = NULL; + (*digest)->response = NULL; + (*digest)->nc = 0; + (*digest)->next = NULL; +} + +void generateNonce(char nonce[]) +{ + struct timeval now; + char nonceBuf[100]; + + /*get time*/ + gettimeofday(&now, NULL); + srand(now.tv_usec*17); + snprintf(nonceBuf, sizeof(nonceBuf), "%8x:%8x:%8x", + (unsigned)now.tv_usec*rand(), (unsigned)now.tv_usec*rand(), (unsigned)now.tv_usec*1551*rand()); + + cg_str2md5(nonceBuf, nonce); +} + +void sendDigestChallenge(CgHttpRequest *httpReq, char *realm) +{ + CgHttpResponse *httpRes; + char authHeader[1024]; + CgHttpAuth *newEntry = NULL; + CgHttpAuth *now = digestHead; + char nonce[CG_MD5_STRING_BUF_SIZE]={0}; + + initDigestInfo(&newEntry); + generateNonce(nonce); + strcpy(newEntry->nonce, nonce); + + if(realm == NULL) + newEntry->realm= CG_HTTP_DEFAULT_REALM; + else + newEntry->realm= realm; + + newEntry->opaque = CG_HTTP_DEFAULT_OPAQUE; + newEntry->qop = CG_HTTP_DEFAULT_QOP; + newEntry->algorithm = CG_HTTP_DEFAULT_ALGORITHM; + + strcpy(newEntry->clientHost, cg_http_request_getremoteaddress(httpReq)); + while(now != NULL){ + if(!strcmp(now->clientHost, newEntry->clientHost)) + break; + + now = now->next; + } + + /*add digest entry*/ + if(digestHead == NULL){ + digestHead = newEntry; + digestTail = newEntry; + } + else if(now != NULL){//replace the entry which same remote host + cg_http_digest_replace_entry(now, newEntry); + } + else{ + digestTail->next = newEntry; + digestTail = newEntry; + } + + /*response digest challenge*/ + httpRes = cg_http_response_new(); + cg_http_response_setstatuscode(httpRes, CG_HTTP_STATUS_UNAUTHORIZED); + cg_http_response_setcontentlength(httpRes, 0); + sprintf(authHeader, "Digest realm=\"%s\", nonce=\"%s\", qop=\"%s\", algorithm=\"%s\", opaque=\"%s\" ", + newEntry->realm, newEntry->nonce, newEntry->qop, newEntry->algorithm, newEntry->opaque); + cg_http_response_setheadervalue(httpRes, CG_HTTP_WWW_AUTHENTICATION, authHeader); + cg_http_request_postresponse( httpReq, httpRes ); + cg_http_response_delete( httpRes ); +} + +authRet_t cg_http_request_check_digest_auth(CgHttpRequest *httpReq, char *user, char *passwd) +{ + char *headerLine = NULL, *authMethod = NULL; + char *method = NULL, *uripath = NULL; + CgHttpAuth *auth = NULL; + char *tmp = NULL; + char md5Input[1024]={0}, ha1[CG_MD5_STRING_BUF_SIZE]={0}, ha2[CG_MD5_STRING_BUF_SIZE]={0}, digest[CG_MD5_STRING_BUF_SIZE]={0}, hEntity[CG_MD5_STRING_BUF_SIZE]={0}; + char *entityBody; + CgHttpAuth *now = digestHead; + BOOL stale = FALSE, found = FALSE; + + initDigestInfo(&auth); + strcpy(auth->clientHost, cg_http_request_getremoteaddress(httpReq)); + + /*get authentication header line*/ + headerLine = cg_http_request_getauth(httpReq); + if (headerLine == NULL){ + /*client request without authentication header, two reasons: + * 1. first request + * 2. client got Amnesia + */ + return HTTP_AUTH_NOT_EXIST; + } + + cg_http_auth_header_parse((CgHttpPacket*)httpReq); + authMethod = cg_http_request_getauth(httpReq); + if (strcmp(authMethod, "Digest") == 0){ /*digest authentication*/ + /*prepare value of digest headers*/ + auth->realm = cg_http_request_getrealm(httpReq); + if(!auth->realm){ + printf("error: can not get realm"); + return HTTP_AUTH_ERROR; + } + + tmp = cg_http_request_getnonce(httpReq); + strcpy(auth->nonce, tmp); + if(!auth->nonce){ + printf("error: can not get nonce"); + return HTTP_AUTH_ERROR; + } + + auth->response = cg_http_request_getresponse(httpReq); + if(!auth->response){ + printf("error: can not get response"); + return HTTP_AUTH_ERROR; + } + + auth->username = cg_http_request_getusername(httpReq); + if(!auth->username){ + printf("error: can not get username"); + return HTTP_AUTH_INVALID_USERNAME; + } + + if(strcmp(user, auth->username)) + return HTTP_AUTH_INVALID_USERNAME; + + while(now != NULL){ + if(!strcmp(now->clientHost, auth->clientHost)){ + found = TRUE; + + if(strcmp(now->realm, auth->realm)) + return HTTP_AUTH_NOT_EXIST; + if(strcmp(now->nonce, auth->nonce)) + stale = TRUE; + + break; + } + + now = now->next; + } + + if(!found) + return HTTP_AUTH_NOT_EXIST; + + if(now->qop){ + tmp = cg_http_request_getqop(httpReq); + if(!tmp){ + auth->qop = NULL; + return HTTP_AUTH_ERROR; + } + else{ + auth->qop = tmp; + if(strcmp(auth->qop, now->qop)) + return HTTP_AUTH_NOT_EXIST; + } + } + + if(now->algorithm){ + tmp = cg_http_request_getalgorithm(httpReq); + if(!tmp){ + auth->algorithm = NULL; + return HTTP_AUTH_ERROR; + } + else{ + auth->algorithm = tmp; + if(strcmp(auth->algorithm, now->algorithm)) + return HTTP_AUTH_NOT_EXIST; + } + } + + if(now->opaque){ + tmp = cg_http_request_getopaque(httpReq); + if(!tmp){ + auth->opaque = NULL; + return HTTP_AUTH_ERROR; + } + else{ + auth->opaque = tmp; + if(strcmp(auth->opaque, now->opaque)) + return HTTP_AUTH_NOT_EXIST; + } + } + + tmp = cg_http_request_getcnonce(httpReq); + if(!tmp) + auth->cnonce = NULL; + else + auth->cnonce = tmp; + + tmp = cg_http_request_getnc(httpReq); + if(!tmp) + auth->nc = 0; + else + auth->nc = tmp; + + method = cg_http_request_getmethod(httpReq); + uripath = cg_http_request_geturi(httpReq); + +/* + if the algorithm is "MD5" or unspecified + ha1 = MD5( username:realm:passwd ) + + if the qop is "auth" or unspecified + ha2 = MD5( Method:digest-uri ) +*/ + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", user, auth->realm, passwd); + cg_str2md5(md5Input,ha1); + snprintf(md5Input, sizeof(md5Input), "%s:%s", method, uripath); + cg_str2md5(md5Input,ha2); + +/* + here we dicuss the different formula of digest response based on qop value. + + if the qop is unspecified: + 1. the hash function in here must be "MD5" or unspecified, + otherwise we don't support other hash function. + + 2. digest response= MD5(ha1:nonce:ha2) + + + if the qop is "auth" or "auth-int": + 1.the hash function in here must be "MD5" or unspecified or "MD5-sess", + otherwise we don't support other hash function. + + 2.in particular, if the qop is "auth-int" + ha2 = MD5( Method:digest-uri:MD5(entity-body) ) + + 3.in particular, if the algorithm is "MD5-sess" + ha1 = MD5( MD5( username:realm:passwd):nonce:cnonce ) + + 4. digest response= MD5(ha1:nonce:nc:cnonce:qop:ha2) + +*/ + if (!(auth->qop)) { + if((auth->algorithm)&&(strcmp(auth->algorithm, "MD5") != 0)){ + auth->result = AUTH_UNSUPPORT_ALGORITHM; + return HTTP_AUTH_NOT_EXIST; + } + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", ha1, auth->nonce, ha2); + cg_str2md5(md5Input,digest); + } + else{ + if((auth->algorithm)&&(strcmp(auth->algorithm, "MD5") != 0)&&(strcmp(auth->algorithm,"MD5-sess") != 0)){ + auth->result = AUTH_UNSUPPORT_ALGORITHM; + return HTTP_AUTH_NOT_EXIST; + } + + if(strstr(auth->qop, "auth-int") != NULL){ + entityBody = cg_http_request_getcontent(httpReq); + cg_str2md5(entityBody, hEntity); + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", method, uripath, hEntity); + cg_str2md5(md5Input, ha2); + } + + if((auth->algorithm) && (strcmp(auth->algorithm, "MD5-sess") == 0)){ + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s", ha1, auth->nonce, auth->cnonce); + cg_str2md5(md5Input, ha1); + } + + snprintf(md5Input, sizeof(md5Input), "%s:%s:%s:%s:%s:%s", + ha1, + auth->nonce, + auth->nc, + auth->cnonce, + auth->qop, + ha2); + cg_str2md5(md5Input,digest); + } + + if(!strcmp(digest, auth->response)) + return HTTP_AUTH_SUCCESS; + else + return HTTP_AUTH_INVALID_PASSWORD; + } + else{ + printf("invalid authenticcation method\n"); + return HTTP_AUTH_NOT_EXIST; + } + + return HTTP_AUTH_NOT_EXIST; +} + + +/******Basic authentication******/ +void sendBasicChallenge(CgHttpRequest *httpReq, char *realm) +{ + CgHttpResponse *httpRes; + char authHeader[64]={0}; + + /*response basic challenge*/ + httpRes = cg_http_response_new(); + cg_http_response_setstatuscode(httpRes, CG_HTTP_STATUS_UNAUTHORIZED); + cg_http_response_setcontentlength(httpRes, 0); + sprintf(authHeader, "Basic realm=\"%s\"", realm); + cg_http_response_setheadervalue(httpRes, CG_HTTP_WWW_AUTHENTICATION, authHeader); + cg_http_request_postresponse( httpReq, httpRes ); + cg_http_response_delete( httpRes ); +} + +authRet_t cg_http_request_check_basic_auth(CgHttpRequest *httpReq, char *user, char *passwd, BOOL cookieAuthentication) +{ + char *headerLine, *authMethod, *passphrase = NULL; + char *base64Encode = NULL; + char *base64EncodeStr = NULL; + char *decodePhrase = NULL; + char *decodeUser = NULL; + char *decodePasswd = NULL; + char *cookie = NULL; + int cookieLen = 0; + char *ptr = NULL; + CgHttpAuth *auth; + + auth = &httpReq->authData; + if (!cookieAuthentication){ + /*get authentication header line*/ + headerLine = cg_http_request_getauth(httpReq); + if (headerLine == NULL) + return HTTP_AUTH_ERROR; + + cg_http_auth_header_parse((CgHttpPacket*)httpReq); + authMethod = cg_http_request_getauth(httpReq); + + if (strcmp(authMethod, "Basic") == 0){ /*basic authentication*/ + passphrase = cg_http_request_getresponse(httpReq); + base64Encode = cg_http_base64encode(user, passwd); + if(strcmp(base64Encode, passphrase) == 0){ + free(base64Encode); + return HTTP_AUTH_SUCCESS; + } + else + free(base64Encode); + } + else{ + printf("invalid authenticcation method\n"); + return HTTP_AUTH_NOT_EXIST; + } + } + else{ /*use cookie information to do web authentication*/ + if(cg_http_request_getcookie(httpReq) == NULL) + return HTTP_AUTH_NOT_EXIST; + + cookieLen = cg_strlen(cg_http_request_getcookie(httpReq)); + if(cookieLen != 0){ + cookie = (char *)malloc((cookieLen+1)*sizeof(char)); + if(cookie == NULL){ + printf("error: out of memory,%s,%d\n",__FUNCTION__,__LINE__); + return HTTP_AUTH_ERROR; + } + + /*the authentication cookie should be "Authentication=XXX", XXX means passphrase */ + strcpy(cookie, cg_http_request_getcookie(httpReq)); + if((ptr = strstr(cookie, "Authentication")) == NULL){ + return HTTP_AUTH_ERROR; + } + passphrase = ptr + strlen("Authentication="); + + if(passphrase){ + base64EncodeStr = cg_http_url_decode(passphrase); + decodePhrase = cg_http_base64decode(base64EncodeStr); + if(!strcmp(decodePhrase, ":")) + return HTTP_AUTH_NOT_EXIST; + decodeUser = strtok(decodePhrase, ":"); + decodePasswd= strtok(NULL, " "); + + if(strcmp(decodeUser, user) != 0){ + free(base64EncodeStr); + free(decodePhrase); + free(cookie); + return HTTP_AUTH_INVALID_USERNAME; + } + else if(!strcmp(decodePasswd, passwd) && (!strcmp(decodeUser,user))){ + free(base64EncodeStr); + free(decodePhrase); + free(cookie); + return HTTP_AUTH_SUCCESS; + } + else + return HTTP_AUTH_INVALID_PASSWORD; + } + + free(cookie); + } + } + + return HTTP_AUTH_INVALID_PASSWORD; +} + +/**************************************************************************** +* Base64 encode and url encode algorithm +*****************************************************************************/ + + /* Simple conversion using b64_encode */ +char *cg_http_base64encode(char *user, char *passwd) +{ + int srcLen, destLen; + char *dest, *destBuf, *srcBuf; + /* malloc srcBuf to fill in user and password*/ + srcLen = strlen(user)+strlen(passwd)+2; + if(srcLen == 0) + return NULL; + + if ((srcBuf = (char *)malloc((srcLen)*sizeof(char))) == NULL){ + printf("error: out of memory,%s,%d\n",__FUNCTION__,__LINE__); + return NULL; + } + + memset( srcBuf, 0, (srcLen)*sizeof(char) ); + snprintf(srcBuf, srcLen, "%s:%s", user, passwd); + if (srcBuf == NULL) + return NULL; + + /* Invoke b64_encode() to determine the maximum size of the encoded + * string, specifying the argument 0 for the destSize parameter. + * + * Note: The value returned may be larger than the actual size + * required, but will never be smaller. + */ + destLen = b64_encode(srcBuf, srcLen-1, NULL, 0); + + /* Using the length determined by the call to b64_encode(), create + * a buffer of sufficient size. + */ + dest = (char*)malloc(destLen); + if (dest == NULL){ + printf("error: out of memory,%s,%d\n",__FUNCTION__,__LINE__); + return NULL; + } + memset( dest, 0, destLen); + + /* + size_t i; + + printf("Converting %u bytes:\n", (unsigned)NUM_ELEMENTS(bytes)); + for(i = 0; i != NUM_ELEMENTS(bytes); ++i) + { + printf(" %d", bytes[i]); + } + puts(""); + */ + + /* Perform base64 encoding. */ + destLen = b64_encode(srcBuf, srcLen-1, dest, destLen); + + /*malloc destBuf for return*/ + destBuf= (char *)malloc((destLen+1)*sizeof(char)); + if(destBuf == NULL) + printf("error: out of memory,%s,%d\n",__FUNCTION__,__LINE__); + memset( destBuf, 0, (destLen+1)*sizeof(char) ); + + snprintf(destBuf, destLen+1, "%.*s",(int)destLen+1, dest); + if(destBuf == NULL){ + printf("error: base 64 encode fail\n"); + return NULL; + } + /*clean up*/ + free(srcBuf); + free(dest); + return destBuf; +} + + /* Simple conversion using b64_decode */ +char *cg_http_base64decode(char *base64Str) +{ + int destLen = 0; + char *dest = NULL; + + /* Invoke b64_decode() to determine the maximum size of the decoded + * string, specifying the argument 0 for the destSize parameter. + * + * Note: The value returned may be larger than the actual size + * required, but will never be smaller. + */ + destLen = b64_decode(base64Str, cg_strlen(base64Str), NULL, 0); + + /* Using the length determined by the call to b64_decode(), create + * a buffer of sufficient size. + */ + dest = (char*)malloc(destLen + 1); + if (dest == NULL){ + printf("error: out of memory,%s,%d\n",__FUNCTION__,__LINE__); + return NULL; + } + memset( dest, 0, destLen+1); + + /* Perform base64 decoding. */ + destLen = b64_decode(base64Str, cg_strlen(base64Str), dest, destLen); + return dest; +} + +/* Converts a hex character to its integer value */ +char from_hex(char ch) { + return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10; +} + +/* Converts an integer value to its hex character*/ +char to_hex(char code) { + static char hex[] = "0123456789ABCDEF"; + return hex[code & 15]; +} + +char *cg_http_url_encode(char *str) +{ + char *pstr = str, *buf = malloc(strlen(str) * 3 + 1), *pbuf = buf; + while (*pstr) { + if (isalnum(*pstr) || *pstr == '-' || *pstr == '_' || *pstr == '.' || *pstr == '~') + *pbuf++ = *pstr; + else if (*pstr == ' ') + *pbuf++ = '+'; + else + *pbuf++ = '%', *pbuf++ = to_hex(*pstr >> 4), *pbuf++ = to_hex(*pstr & 15); + pstr++; + } + *pbuf = '\0'; + return buf; +} + +/* Returns a url-decoded version of str */ +/* IMPORTANT: be sure to free() the returned string after use */ +char *cg_http_url_decode(char *str) +{ + char *pstr = str, *buf = malloc(strlen(str) + 1), *pbuf = buf; + while (*pstr) { + if (*pstr == '%') { + if (pstr[1] && pstr[2]) { + *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]); + pstr += 2; + } + } else if (*pstr == '+') { + *pbuf++ = ' '; + } else { + *pbuf++ = *pstr; + } + pstr++; + } + *pbuf = '\0'; + return buf; +} diff -Naur clinkc/src/cybergarage/http/chttp_b64.c clinkc_patch/src/cybergarage/http/chttp_b64.c --- clinkc/src/cybergarage/http/chttp_b64.c 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_b64.c 2014-01-29 13:54:26.410322405 +0800 @@ -0,0 +1,654 @@ +/* ///////////////////////////////////////////////////////////////////////// + * File: b64.c + * + * Purpose: Implementation file for the b64 library + * + * Created: 18th October 2004 + * Updated: 13th November 2011 + * + * Home: http://synesis.com.au/software/ + * + * Copyright (c) 2004-2011, Matthew Wilson and Synesis Software + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of + * any contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 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. + * + * ////////////////////////////////////////////////////////////////////// */ + + +/** \file b64.c Implementation file for the b64 library + */ + +/* ///////////////////////////////////////////////////////////////////////// + * Version information + */ + +#ifndef B64_DOCUMENTATION_SKIP_SECTION +# define B64_VER_C_B64_MAJOR 1 +# define B64_VER_C_B64_MINOR 3 +# define B64_VER_C_B64_REVISION 4 +# define B64_VER_C_B64_EDIT 21 +#endif /* !B64_DOCUMENTATION_SKIP_SECTION */ + +/* ///////////////////////////////////////////////////////////////////////// + * Includes + */ + +#include + +#if defined(B64_VARIANT_TEST) && \ + !defined(B64_NO_USE_XCONTRACT) +// # define B64_USING_XCONTRACT_ +#endif /* B64_VARIANT_TEST && !B64_NO_USE_XCONTRACT */ + +#ifdef B64_USING_XCONTRACT_ +# include +#else /* ? B64_USING_XCONTRACT_ */ +# include +#endif /* B64_USING_XCONTRACT_ */ +#include + +/* ///////////////////////////////////////////////////////////////////////// + * Contract Enforcements + */ + +#ifdef B64_USING_XCONTRACT_ +# define B64_ENFORCE_PRECONDITION(expr, msg) XCONTRACT_ENFORCE_PRECONDITION_PARAMETERS_2((expr), (msg)) +# define B64_ENFORCE_ASSUMPTION(expr) XCONTRACT_ENFORCE_ASSUMPTION_2((expr), "design invariant violated") +#else /* ? B64_USING_XCONTRACT_ */ +# define B64_ENFORCE_PRECONDITION(expr, msg) assert((expr)) +# define B64_ENFORCE_ASSUMPTION(expr) assert((expr)) +#endif /* B64_USING_XCONTRACT_ */ + +/* ///////////////////////////////////////////////////////////////////////// + * Constants and definitions + */ + +#ifndef B64_DOCUMENTATION_SKIP_SECTION +# define NUM_PLAIN_DATA_BYTES (3) +# define NUM_ENCODED_DATA_BYTES (4) +#endif /* !B64_DOCUMENTATION_SKIP_SECTION */ + +/* ///////////////////////////////////////////////////////////////////////// + * Macros + */ + +#ifndef NUM_ELEMENTS +# define NUM_ELEMENTS(x) (sizeof(x) / sizeof(x[0])) +#endif /* !NUM_ELEMENTS */ + +/* ///////////////////////////////////////////////////////////////////////// + * Warnings + */ + +#if defined(_MSC_VER) && \ + _MSC_VER < 1000 +# pragma warning(disable : 4705) +#endif /* _MSC_VER < 1000 */ + +/* ///////////////////////////////////////////////////////////////////////// + * Data + */ + +static const b64_char_t b64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static const signed char b64_indexes[] = +{ + /* 0 - 31 / 0x00 - 0x1f */ + -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 + /* 32 - 63 / 0x20 - 0x3f */ + , -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, 62, -1, -1, -1, 63 /* ... , '+', ... '/' */ + , 52, 53, 54, 55, 56, 57, 58, 59 /* '0' - '7' */ + , 60, 61, -1, -1, -1, -1, -1, -1 /* '8', '9', ... */ + /* 64 - 95 / 0x40 - 0x5f */ + , -1, 0, 1, 2, 3, 4, 5, 6 /* ..., 'A' - 'G' */ + , 7, 8, 9, 10, 11, 12, 13, 14 /* 'H' - 'O' */ + , 15, 16, 17, 18, 19, 20, 21, 22 /* 'P' - 'W' */ + , 23, 24, 25, -1, -1, -1, -1, -1 /* 'X', 'Y', 'Z', ... */ + /* 96 - 127 / 0x60 - 0x7f */ + , -1, 26, 27, 28, 29, 30, 31, 32 /* ..., 'a' - 'g' */ + , 33, 34, 35, 36, 37, 38, 39, 40 /* 'h' - 'o' */ + , 41, 42, 43, 44, 45, 46, 47, 48 /* 'p' - 'w' */ + , 49, 50, 51, -1, -1, -1, -1, -1 /* 'x', 'y', 'z', ... */ + + , -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 + + , -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 + + , -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 + + , -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 +}; + +/* ///////////////////////////////////////////////////////////////////////// + * Helper functions + */ + +#define b64_strchr_ strchr + +/** This function reads in 3 bytes at a time, and translates them into 4 + * characters. + */ +static size_t b64_encode_( + unsigned char const* src +, size_t srcSize +, b64_char_t* const dest +, size_t destLen +, unsigned lineLen +, B64_RC* rc +) +{ + size_t total = ((srcSize + (NUM_PLAIN_DATA_BYTES - 1)) / NUM_PLAIN_DATA_BYTES) * NUM_ENCODED_DATA_BYTES; + + B64_ENFORCE_PRECONDITION(NULL != rc, "pointer to return code may not be NULL"); + *rc = B64_RC_OK; + + if(lineLen > 0) + { + size_t numLines = (total + (lineLen - 1)) / lineLen; + + total += 2 * (0 == numLines ? 0u : (numLines - 1)); + } + + if(NULL == dest) + { + return total; + } + else if(destLen < total) + { + *rc = B64_RC_INSUFFICIENT_BUFFER; + + return 0; + } + else + { + b64_char_t* p = dest; + b64_char_t* end = dest + destLen; + size_t len = 0; + + for(; NUM_PLAIN_DATA_BYTES <= srcSize; srcSize -= NUM_PLAIN_DATA_BYTES) + { + b64_char_t characters[NUM_ENCODED_DATA_BYTES]; + + /* + * + * | 0 | 1 | 2 | + * + * | | | | + * | | | | | | | + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | | | | | | | | | + * + * | 0 | 1 | 2 | 3 | + * + */ + + /* characters[0] is the 6 left-most bits of src[0] */ + characters[0] = (b64_char_t)((src[0] & 0xfc) >> 2); + /* characters[0] is the right-most 2 bits of src[0] and the left-most 4 bits of src[1] */ + characters[1] = (b64_char_t)(((src[0] & 0x03) << 4) + ((src[1] & 0xf0) >> 4)); + /* characters[0] is the right-most 4 bits of src[1] and the 2 left-most bits of src[2] */ + characters[2] = (b64_char_t)(((src[1] & 0x0f) << 2) + ((src[2] & 0xc0) >> 6)); + /* characters[3] is the right-most 6 bits of src[2] */ + characters[3] = (b64_char_t)(src[2] & 0x3f); + +#ifndef __WATCOMC__ + B64_ENFORCE_ASSUMPTION(characters[0] >= 0 && characters[0] < 64); + B64_ENFORCE_ASSUMPTION(characters[1] >= 0 && characters[1] < 64); + B64_ENFORCE_ASSUMPTION(characters[2] >= 0 && characters[2] < 64); + B64_ENFORCE_ASSUMPTION(characters[3] >= 0 && characters[3] < 64); +#endif /* __WATCOMC__ */ + + src += NUM_PLAIN_DATA_BYTES; + *p++ = b64_chars[(unsigned char)characters[0]]; + B64_ENFORCE_ASSUMPTION(NULL != b64_strchr_(b64_chars, *(p-1))); + ++len; + B64_ENFORCE_ASSUMPTION(len != lineLen); + + *p++ = b64_chars[(unsigned char)characters[1]]; + B64_ENFORCE_ASSUMPTION(NULL != b64_strchr_(b64_chars, *(p-1))); + ++len; + B64_ENFORCE_ASSUMPTION(len != lineLen); + + *p++ = b64_chars[(unsigned char)characters[2]]; + B64_ENFORCE_ASSUMPTION(NULL != b64_strchr_(b64_chars, *(p-1))); + ++len; + B64_ENFORCE_ASSUMPTION(len != lineLen); + + *p++ = b64_chars[(unsigned char)characters[3]]; + B64_ENFORCE_ASSUMPTION(NULL != b64_strchr_(b64_chars, *(p-1))); + + if( ++len == lineLen && + p != end) + { + *p++ = '\r'; + *p++ = '\n'; + len = 0; + } + } + + if(0 != srcSize) + { + /* Deal with the overspill, by boosting it up to three bytes (using 0s) + * and then appending '=' for any missing characters. + * + * This is done into a temporary buffer, so we can call ourselves and + * have the output continue to be written direct to the destination. + */ + + unsigned char dummy[NUM_PLAIN_DATA_BYTES]; + size_t i; + + for(i = 0; i != srcSize; ++i) + { + dummy[i] = *src++; + } + + for(; i != NUM_PLAIN_DATA_BYTES; ++i) + { + dummy[i] = '\0'; + } + + b64_encode_(&dummy[0], NUM_PLAIN_DATA_BYTES, p, NUM_ENCODED_DATA_BYTES * (1 + 2), 0, rc); + + for(p += 1 + srcSize; srcSize++ != NUM_PLAIN_DATA_BYTES; ) + { + *p++ = '='; + } + } + + return total; + } +} + +/** This function reads in a character string in 4-character chunks, and writes + * out the converted form in 3-byte chunks to the destination. + */ +static size_t b64_decode_( + b64_char_t const* src +, size_t srcLen +, unsigned char* dest +, size_t destSize +, unsigned flags +, b64_char_t const** badChar +, B64_RC* rc +) +{ + const size_t wholeChunks = (srcLen / NUM_ENCODED_DATA_BYTES); + const size_t remainderBytes = (srcLen % NUM_ENCODED_DATA_BYTES); + size_t maxTotal = (wholeChunks + (0 != remainderBytes)) * NUM_PLAIN_DATA_BYTES; + unsigned char* const dest_ = dest; + + ((void)remainderBytes); /* Avoids warning with Borland */ + + B64_ENFORCE_PRECONDITION(NULL != badChar, "pointer to bad character may not be NULL"); + B64_ENFORCE_PRECONDITION(NULL != rc, "pointer to return code may not be NULL"); + + *badChar = NULL; + *rc = B64_RC_OK; + + if(NULL == dest) + { + return maxTotal; + } + else if(destSize < maxTotal) + { + *rc = B64_RC_INSUFFICIENT_BUFFER; + + return 0; + } + else + { + /* Now we iterate through the src, collecting together four characters + * at a time from the Base-64 alphabet, until the end-point is reached. + * + * + */ + + b64_char_t const* begin = src; + b64_char_t const* const end = begin + srcLen; + size_t currIndex = 0; + size_t numPads = 0; + signed char indexes[NUM_ENCODED_DATA_BYTES]; /* 4 */ + +#ifdef _DEBUG + { size_t i; for(i = 0; i != destSize; ++i) + { + dest[i] = '~'; + }} +#endif /* _DEBUG */ + + for(; begin != end; ++begin) + { + const b64_char_t ch = *begin; + + if('=' == ch) + { + B64_ENFORCE_ASSUMPTION(currIndex < NUM_ENCODED_DATA_BYTES); + + indexes[currIndex++] = '\0'; + + ++numPads; + } + else + { + /* NOTE: Had to rename 'index' to 'ix', due to name clash with GCC on 64-bit Linux. */ + signed char ix = b64_indexes[(unsigned char)ch]; + + if(-1 == ix) + { + switch(ch) + { + case ' ': + case '\t': + case '\b': + case '\v': + if(B64_F_STOP_ON_UNEXPECTED_WS & flags) + { + *rc = B64_RC_DATA_ERROR; + *badChar = begin; + return 0; + } + else + { + /* Fall through */ + } + case '\r': + case '\n': + continue; + default: + if(B64_F_STOP_ON_UNKNOWN_CHAR & flags) + { + *rc = B64_RC_DATA_ERROR; + *badChar = begin; + return 0; + } + else + { + continue; + } + } + } + else + { + numPads = 0; + + B64_ENFORCE_ASSUMPTION(currIndex < NUM_ENCODED_DATA_BYTES); + + indexes[currIndex++] = ix; + } + } + + if(NUM_ENCODED_DATA_BYTES == currIndex) + { + unsigned char bytes[NUM_PLAIN_DATA_BYTES]; /* 3 */ + + bytes[0] = (unsigned char)((indexes[0] << 2) + ((indexes[1] & 0x30) >> 4)); + + currIndex = 0; + + *dest++ = bytes[0]; + if(2 != numPads) + { + bytes[1] = (unsigned char)(((indexes[1] & 0xf) << 4) + ((indexes[2] & 0x3c) >> 2)); + + *dest++ = bytes[1]; + + if(1 != numPads) + { + bytes[2] = (unsigned char)(((indexes[2] & 0x3) << 6) + indexes[3]); + + *dest++ = bytes[2]; + } + } + if(0 != numPads) + { + break; + } + } + } + + return (size_t)(dest - dest_); + } +} + +/* ///////////////////////////////////////////////////////////////////////// + * API functions + */ + +size_t b64_encode( + void const* src +, size_t srcSize +, b64_char_t* dest +, size_t destLen +) +{ + /* Use Null Object (Variable) here for rc, so do not need to check + * elsewhere. + */ + B64_RC rc_; + + return b64_encode_((unsigned char const*)src, srcSize, dest, destLen, 0, &rc_); +} + +size_t b64_encode2( + void const* src +, size_t srcSize +, b64_char_t* dest +, size_t destLen +, unsigned flags +, int lineLen /* = -1 */ +, B64_RC* rc /* = NULL */ +) +{ + /* Use Null Object (Variable) here for rc, so do not need to check + * elsewhere + */ + B64_RC rc_; + if(NULL == rc) + { + rc = &rc_; + } + + switch(B64_F_LINE_LEN_MASK & flags) + { + case B64_F_LINE_LEN_USE_PARAM: + if(lineLen >= 0) + { + break; + } + /* Fall through to 64 */ + case B64_F_LINE_LEN_64: + lineLen = 64; + break; + case B64_F_LINE_LEN_76: + lineLen = 76; + break; + default: + B64_ENFORCE_PRECONDITION(0, "Bad line length flag specified to b64_encode2()"); + case B64_F_LINE_LEN_INFINITE: + lineLen = 0; + break; + } + + B64_ENFORCE_PRECONDITION(0 == (lineLen % 4), "Bad line length flag specified to b64_encode2()"); + + return b64_encode_((unsigned char const*)src, srcSize, dest, destLen, (unsigned)lineLen, rc); +} + +size_t b64_decode( + b64_char_t const* src +, size_t srcLen +, void* dest +, size_t destSize +) +{ + /* Use Null Object (Variable) here for rc and badChar, so do not need to + * check elsewhere. + */ + b64_char_t const* badChar_; + B64_RC rc_; + + return b64_decode_(src, srcLen, (unsigned char*)dest, destSize, B64_F_STOP_ON_NOTHING, &badChar_, &rc_); +} + +size_t b64_decode2( + b64_char_t const* src +, size_t srcLen +, void* dest +, size_t destSize +, unsigned flags +, b64_char_t const** badChar /* = NULL */ +, B64_RC* rc /* = NULL */ +) +{ + b64_char_t const* badChar_; + B64_RC rc_; + + /* Use Null Object (Variable) here for rc and badChar, so do not need to + * check elsewhere. + */ + if(NULL == badChar) + { + badChar = &badChar_; + } + if(NULL == rc) + { + rc = &rc_; + } + + return b64_decode_(src, srcLen, (unsigned char*)dest, destSize, flags, badChar, rc); +} + +/* ////////////////////////////////////////////////////////////////////// */ + +#ifdef B64_DOCUMENTATION_SKIP_SECTION +struct b64ErrorString_t_ +#else /* !B64_DOCUMENTATION_SKIP_SECTION */ +typedef struct b64ErrorString_t_ b64ErrorString_t_; +struct b64ErrorString_t_ +#endif /* !B64_DOCUMENTATION_SKIP_SECTION */ +{ + int code; /*!< The error code. */ + b64_char_t const* str; /*!< The string. */ + size_t len; /*!< The string length. */ +}; + + + +#define SEVERITY_STR_DECL(rc, desc) \ + \ + static const b64_char_t s_str##rc[] = desc; \ + static const b64ErrorString_t_ s_rct##rc = { rc, s_str##rc, NUM_ELEMENTS(s_str##rc) - 1 } + + +#define SEVERITY_STR_ENTRY(rc) \ + \ + &s_rct##rc + + +static b64_char_t const* b64_LookupCodeA_(int code, b64ErrorString_t_ const** mappings, size_t cMappings, size_t* len) +{ + /* Use Null Object (Variable) here for len, so do not need to check + * elsewhere. + */ + size_t len_; + + if(NULL == len) + { + len = &len_; + } + + /* Checked, indexed search. */ + if( code >= 0 && + code < B64_max_RC_value) + { + if(code == mappings[code]->code) + { + return (*len = mappings[code]->len, mappings[code]->str); + } + } + + /* Linear search. Should only be needed if order in + * b64_LookupErrorStringA_() messed up. + */ + { size_t i; for(i = 0; i != cMappings; ++i) + { + if(code == mappings[i]->code) + { + return (*len = mappings[i]->len, mappings[i]->str); + } + }} + + return (*len = 0, ""); +} + +static b64_char_t const* b64_LookupErrorStringA_(int error, size_t* len) +{ + SEVERITY_STR_DECL(B64_RC_OK , "Operation was successful" ); + SEVERITY_STR_DECL(B64_RC_INSUFFICIENT_BUFFER , "The given translation buffer was not of sufficient size" ); + SEVERITY_STR_DECL(B64_RC_TRUNCATED_INPUT , "The input did not represent a fully formed stream of octet couplings" ); + SEVERITY_STR_DECL(B64_RC_DATA_ERROR , "Invalid data" ); + + static const b64ErrorString_t_* s_strings[] = + { + SEVERITY_STR_ENTRY(B64_RC_OK), + SEVERITY_STR_ENTRY(B64_RC_INSUFFICIENT_BUFFER), + SEVERITY_STR_ENTRY(B64_RC_TRUNCATED_INPUT), + SEVERITY_STR_ENTRY(B64_RC_DATA_ERROR), + }; + + return b64_LookupCodeA_(error, s_strings, NUM_ELEMENTS(s_strings), len); +} + +b64_char_t const* b64_getErrorString(B64_RC code) +{ + return b64_LookupErrorStringA_((int)code, NULL); +} + +size_t b64_getErrorStringLength(B64_RC code) +{ + size_t len; + + return (b64_LookupErrorStringA_((int)code, &len), len); +} + +/* ///////////////////////////// end of file //////////////////////////// */ diff -Naur clinkc/src/cybergarage/http/chttp_cookie.c clinkc_patch/src/cybergarage/http/chttp_cookie.c --- clinkc/src/cybergarage/http/chttp_cookie.c 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_cookie.c 2014-01-29 13:54:26.398322404 +0800 @@ -0,0 +1,90 @@ +/****************************************************************** +* +* File: chttp_cookie.c +* +* Revision: +* +* 07/19/12 +* - first release ZyXEL +* +******************************************************************/ + + +#include +#include + +/************************* +* Function : cg_http_cookie_attribute_parse() +* Description : parse the cookie attribute +* Output : +*************************/ +static void cg_http_cookie_attribute_parse( char *attr, CgHttpCookieData *cookiedata ){ + char *ptr = NULL; + char name[SIZE_COOKIE_NAME+1] = {0}; + char value[SIZE_COOKIE_VALUE+1] = {0}; + + ptr = strchr( attr, '=' ); + if( ptr != NULL ){ + strncpy( name, attr, (ptr-attr)>SIZE_COOKIE_NAME?SIZE_COOKIE_NAME:(ptr-attr) ); + strncpy( value, ptr+1, SIZE_COOKIE_VALUE); + } + else{ + strncpy( name, attr, SIZE_COOKIE_NAME ); + } + + if(strcasecmp(name, CG_HTTP_COOKIE_COMMENT)==0 && strlen(value)>0 ){ + strncpy(cookiedata->comment, value, SIZE_COOKIE_COMMENT); + } + else if(strcasecmp(name, CG_HTTP_COOKIE_URL)==0 && strlen(value)>0 ){ + strncpy(cookiedata->commentURL, value, SIZE_COOKIE_URL); + } + else if(strcasecmp(name, CG_HTTP_COOKIE_DISCARD)==0){ + cookiedata->discard = TRUE; + } + else if(strcasecmp(name, CG_HTTP_COOKIE_DOMAIN)==0 && strlen(value)>0 ){ + strncpy(cookiedata->domain, value, SIZE_COOKIE_DOMAIN); + } + else if(strcasecmp(name, CG_HTTP_COOKIE_MAXAGE)==0 && strlen(value)>0 ){ + /*A value of zero means the cookie SHOULD be discarded immediately*/ + strncpy(cookiedata->maxAge, value, SIZE_COOKIE_MAXAGE); + } + else if(strcasecmp(name, CG_HTTP_COOKIE_PATH)==0 && strlen(value)>0 ){ + strncpy(cookiedata->path, value, SIZE_COOKIE_PATH); + } + else if(strcasecmp(name, CG_HTTP_COOKIE_PORT)==0 && strlen(value)>0 ){ + strncpy(cookiedata->port, value, SIZE_COOKIE_PORT); + } + else if(strcasecmp(name, CG_HTTP_COOKIE_SECURE)==0){ + cookiedata->secure = TRUE; + } + else if(strcasecmp(name, CG_HTTP_COOKIE_VERSION)==0 && strlen(value)>0 ){ + strncpy(cookiedata->version, value, SIZE_COOKIE_VERSION); + } + else{ + /*The NAME=VALUE attribute-value pair MUST come first in each cookie.*/ + if(strlen(value)>0 && strlen(cookiedata->name)==0){ + strncpy(cookiedata->name, name, SIZE_COOKIE_NAME); + strncpy(cookiedata->value, value, SIZE_COOKIE_VALUE); + } + } + +} + +/************************* +* Function : cg_http_cookie_header_parse() +* Description : parse the cookie +* Output : +*************************/ +void cg_http_cookie_header_parse( char *cookie, CgHttpCookieData *cookiedata ){ + char buf[SIZE_COOKIE+1]={0}; + char delim[]="; "; + char *token = NULL; + + strncpy(buf, cookie, SIZE_COOKIE); + token = strtok( buf, delim ); + while( token != NULL ){ + cg_http_cookie_attribute_parse(token, cookiedata); + token = strtok( NULL, delim ); + } +} + diff -Naur clinkc/src/cybergarage/http/chttp_header_list.c clinkc_patch/src/cybergarage/http/chttp_header_list.c --- clinkc/src/cybergarage/http/chttp_header_list.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_header_list.c 2014-01-29 13:54:26.410322405 +0800 @@ -108,6 +108,27 @@ cg_log_debug_l4("Leaving...\n"); } +#ifdef ZYXEL_PATCH /*support multiple header value, ZyXEL 2013*/ + +/**************************************** +* cg_http_headerlist_setheader +****************************************/ +void cg_http_headerlist_set_multi(CgHttpHeaderList *headerList, char *name, char *value) +{ + CgHttpHeader *header; + + cg_log_debug_l4("Entering...\n"); + + header = cg_http_header_new(); + cg_http_headerlist_add(headerList, header); + cg_http_header_setname(header, name); + + cg_http_header_setvalue(header, value); + + cg_log_debug_l4("Leaving...\n"); +} +#endif + /**************************************** * cg_http_headerlist_setheader ****************************************/ diff -Naur clinkc/src/cybergarage/http/chttp_md5.c clinkc_patch/src/cybergarage/http/chttp_md5.c --- clinkc/src/cybergarage/http/chttp_md5.c 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_md5.c 2014-01-29 13:54:26.410322405 +0800 @@ -0,0 +1,433 @@ +/* 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. + */ + +#include +#include +#include +#include + +#ifndef PROTOTYPES +#define PROTOTYPES 0 +#endif + +/* POINTER defines a generic pointer type */ +typedef unsigned char *POINTER; + +/* UINT2 defines a two byte word */ +typedef unsigned short int UINT2; + +/* UINT4 defines a four byte word */ +typedef unsigned long int UINT4; + +/* PROTO_LIST is defined depending on how PROTOTYPES is defined above. +If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it + returns an empty list. + */ +#if PROTOTYPES +#define PROTO_LIST(list) list +#else +#define PROTO_LIST(list) () +#endif + +typedef struct { + UINT4 state[4]; /* state (ABCD) */ + UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} MD5_CTX; + +static void MD5Init PROTO_LIST ((MD5_CTX *)); +static void MD5Update PROTO_LIST + ((MD5_CTX *, unsigned char *, unsigned int)); +static void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); + +/* 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. + */ + +/* +#include "global.h" +#include "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 PROTO_LIST ((UINT4 [4], unsigned char [64])); +static void Encode PROTO_LIST + ((unsigned char *, UINT4 *, unsigned int)); +static void Decode PROTO_LIST + ((UINT4 *, unsigned char *, unsigned int)); +static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); +static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); + +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. + */ +static void MD5Init (context) +MD5_CTX *context; /* 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. + */ +static void MD5Update (context, input, inputLen) +MD5_CTX *context; /* context */ +unsigned char *input; /* input block */ +unsigned int inputLen; /* length of input block */ +{ + unsigned int i, index, partLen; + + /* Compute number of bytes mod 64 */ + index = (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 - index; + + /* Transform as many times as possible. +*/ + if (inputLen >= partLen) { + MD5_memcpy + ((POINTER)&context->buffer[index], (POINTER)input, partLen); + MD5Transform (context->state, context->buffer); + + for (i = partLen; i + 63 < inputLen; i += 64) + MD5Transform (context->state, &input[i]); + + index = 0; + } + else + i = 0; + + /* Buffer remaining input */ + MD5_memcpy + ((POINTER)&context->buffer[index], (POINTER)&input[i], + inputLen-i); +} + +/* MD5 finalization. Ends an MD5 message-digest operation, writing the + the message digest and zeroizing the context. + */ +static void MD5Final (digest, context) +unsigned char digest[16]; /* message digest */ +MD5_CTX *context; /* context */ +{ + unsigned char bits[8]; + unsigned int index, padLen; + + /* Save number of bits */ + Encode (bits, context->count, 8); + + /* Pad out to 56 mod 64. +*/ + index = (unsigned int)((context->count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + MD5Update (context, PADDING, padLen); + + /* Append length (before padding) */ + MD5Update (context, bits, 8); + + /* Store state in digest */ + Encode (digest, context->state, 16); + + /* Zeroize sensitive information. +*/ + MD5_memset ((POINTER)context, 0, sizeof (*context)); +} + +/* MD5 basic transformation. Transforms state based on block. + */ +static void MD5Transform (state, block) +UINT4 state[4]; +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. +*/ + MD5_memset ((POINTER)x, 0, sizeof (x)); +} + +/* Encodes input (UINT4) into output (unsigned char). Assumes len is + a multiple of 4. + */ +static void Encode (output, input, len) +unsigned char *output; +UINT4 *input; +unsigned int len; +{ + unsigned int i, j; + + for (i = 0, j = 0; j < len; i++, j += 4) { + output[j] = (unsigned char)(input[i] & 0xff); + output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); + output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); + output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); + } +} + +/* Decodes input (unsigned char) into output (UINT4). Assumes len is + a multiple of 4. + */ +static void Decode (output, input, len) +UINT4 *output; +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); +} + +/* Note: Replace "for loop" with standard memcpy if possible. + */ + +static void MD5_memcpy (output, input, len) +POINTER output; +POINTER input; +unsigned int len; +{ + unsigned int i; + + for (i = 0; i < len; i++) + output[i] = input[i]; +} + +/* Note: Replace "for loop" with standard memset if possible. + */ +static void MD5_memset (output, value, len) +POINTER output; +int value; +unsigned int len; +{ + unsigned int i; + + for (i = 0; i < len; i++) + ((char *)output)[i] = (char)value; +} + +char *cg_str2md5( +char *string, +char *md5buf) +{ + MD5_CTX context; + unsigned char digest[16]; + unsigned int len; + + len = cg_strlen(string); + + MD5Init(&context); + MD5Update(&context, string,len); + MD5Final(digest, &context); + + sprintf(md5buf, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + digest[0], + digest[1], + digest[2], + digest[3], + digest[4], + digest[5], + digest[6], + digest[7], + digest[8], + digest[9], + digest[10], + digest[11], + digest[12], + digest[13], + digest[14], + digest[15]); + + return md5buf; +} + diff -Naur clinkc/src/cybergarage/http/chttp_packet.c clinkc_patch/src/cybergarage/http/chttp_packet.c --- clinkc/src/cybergarage/http/chttp_packet.c 2011-02-08 01:29:11.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_packet.c 2014-01-29 13:54:26.410322405 +0800 @@ -150,6 +150,21 @@ } /**************************************** +* cg_http_packet_setheader +****************************************/ +#ifdef ZYXEL_PATCH /*support multiple header value, ZyXEL 2013*/ + +void cg_http_packet_setheadervalue_multi(CgHttpPacket *httpPkt, char* name, char *value) +{ + cg_log_debug_l4("Entering...\n"); + + cg_http_headerlist_set_multi(httpPkt->headerList, name, value); + + cg_log_debug_l4("Leaving...\n"); +} +#endif + +/**************************************** * cg_http_packet_setheaderinteger ****************************************/ @@ -431,6 +446,10 @@ { /* Read CRLF bytes */ cg_socket_readline(sock, lineBuf, lineBufSize); + +#ifdef ZYXEL_PATCH /*fix the bug when chunk end line is double CRLF, the package parse will error, ZyXEL 2013*/ + cg_socket_readline(sock, lineBuf, lineBufSize); +#endif } cg_log_debug_l4("Leaving...\n"); diff -Naur clinkc/src/cybergarage/http/chttp_request.c clinkc_patch/src/cybergarage/http/chttp_request.c --- clinkc/src/cybergarage/http/chttp_request.c 2011-02-08 01:29:11.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_request.c 2014-01-29 13:54:26.410322405 +0800 @@ -86,7 +86,9 @@ httpReq->userAgent = cg_string_new(); httpReq->httpRes = cg_http_response_new(); httpReq->postURL = cg_net_url_new(); - +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + httpReq->ctxdata = NULL; +#endif cg_http_request_setversion(httpReq, CG_HTTP_VER11); cg_http_request_setuseragent(httpReq, CG_HTTP_USERAGENT_DEFAULT); @@ -314,8 +316,12 @@ #if defined(CG_USE_OPENSSL) if (isSecure == FALSE) sock = cg_socket_stream_new(); - else + else{ sock = cg_socket_ssl_new(); +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + cg_socket_setctx(sock, httpReq->ctxdata); +#endif + } #else sock = cg_socket_stream_new(); #endif diff -Naur clinkc/src/cybergarage/http/chttp_server.c clinkc_patch/src/cybergarage/http/chttp_server.c --- clinkc/src/cybergarage/http/chttp_server.c 2010-03-19 07:40:23.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_server.c 2014-01-29 13:54:26.410322405 +0800 @@ -20,7 +20,7 @@ * - Fixed a memory leak problem in the http client thread. * 16-Jan-06 Aapo Makela * - Changed to do a better keepalive check -* +* ******************************************************************/ #ifdef HAVE_CONFIG_H @@ -31,6 +31,10 @@ #include #include #include +#include +#include +#include +#include #if defined(HAVE_UNAME) || defined(TARGET_OS_MAC) || defined(TARGET_OS_IPHONE) #include @@ -47,14 +51,17 @@ cg_log_debug_l4("Entering...\n"); httpServer = (CgHttpServer *)malloc(sizeof(CgHttpServer)); - + if ( NULL != httpServer ) { cg_list_node_init((CgList *)httpServer); - + httpServer->sock = NULL; httpServer->acceptThread = NULL; httpServer->listener = NULL; +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + httpServer->ctxdata = NULL; +#endif /**** Thanks for Makela Aapo (10/31/05) ****/ httpServer->clientThreads = NULL; @@ -66,7 +73,7 @@ /* Mutex */ httpServer->mutex = cg_mutex_new(); } - + cg_log_debug_l4("Leaving...\n"); return httpServer; @@ -82,12 +89,12 @@ cg_http_server_stop(httpServer); cg_http_server_close(httpServer); - + if (httpServer->mutex) cg_mutex_delete(httpServer->mutex); cg_list_remove((CgList *)httpServer); - + free(httpServer); cg_log_debug_l4("Leaving...\n"); @@ -96,20 +103,45 @@ /**************************************** * cg_http_server_delete ****************************************/ - +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +BOOL cg_http_server_open(CgHttpServer *httpServer, int bindPort, char *bindAddr, BOOL isSecure, void *ctxdata) +#else BOOL cg_http_server_open(CgHttpServer *httpServer, int bindPort, char *bindAddr) +#endif { cg_log_debug_l4("Entering...\n"); if (cg_http_server_isopened(httpServer) == TRUE) return FALSE; - +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#if defined(CG_USE_OPENSSL) + if (isSecure == TRUE){ + httpServer->sock = cg_socket_ssl_new(); + httpServer->ctxdata = ctxdata; + } + else{ httpServer->sock = cg_socket_stream_new(); + } +#else + httpServer->sock = cg_socket_stream_new(); +#endif +#else + httpServer->sock = cg_socket_stream_new(); +#endif + if (cg_socket_bind(httpServer->sock, bindPort, bindAddr, TRUE, FALSE) == FALSE) { cg_socket_delete(httpServer->sock); httpServer->sock = NULL; return FALSE; } + + /*diable Nagle's algorithm, ZyXEL*/ + int res = 0; + int flag = 1; + res = setsockopt(httpServer->sock->id, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag)); + if(res == -1) + printf("Error setsockopt error=%s\n\n\n",strerror(errno)); + if (cg_socket_listen(httpServer->sock) == FALSE) { cg_socket_delete(httpServer->sock); httpServer->sock = NULL; @@ -130,13 +162,13 @@ cg_log_debug_l4("Entering...\n"); cg_http_server_stop(httpServer); - + if (httpServer->sock != NULL) { cg_socket_close(httpServer->sock); cg_socket_delete(httpServer->sock); httpServer->sock = NULL; } - + cg_log_debug_l4("Leaving...\n"); return TRUE; @@ -187,14 +219,14 @@ void *httpServerUserData; CgHttpRequest *httpReq; char *version = NULL; - + cg_log_debug_l4("Entering...\n"); clientData = (CgHttpServerClientData *)cg_thread_getuserdata(thread); httpServer = clientData->httpServer; clientSock = clientData->clientSock; httpServerUserData = cg_http_server_getuserdata(httpServer); - + httpReq = cg_http_request_new(); cg_http_request_setsocket(httpReq, clientSock); @@ -204,7 +236,7 @@ version = cg_http_request_getversion(httpReq); if (cg_strcmp(version, CG_HTTP_VER11) == 0) { - /* According to HTTP/1.1 spec, we must not tolerate + /* According to HTTP/1.1 spec, we must not tolerate HTTP/1.1 request without HOST-header */ if (cg_http_request_gethost(httpReq) == NULL) { @@ -212,26 +244,26 @@ continue; } } - + if (httpServer->listener != NULL) { - cg_http_request_setuserdata(httpReq, httpServerUserData); + cg_http_request_setuserdata(httpReq, httpServerUserData); httpServer->listener(httpReq); } - + /* Close connection according to HTTP version and headers */ if (cg_strcmp(version, CG_HTTP_VER10) == 0) { /* Terminate connection after HTTP/1.0 request */ break; } - + /* We are having HTTP/1.1 or better => terminate, if requested */ if (cg_http_request_iskeepaliveconnection(httpReq) == FALSE) { break; } } - + cg_log_debug_s("Dropping HTTP client\n"); cg_http_request_delete(httpReq); @@ -241,6 +273,7 @@ cg_http_server_clientdata_delete(clientData); cg_thread_setuserdata(thread, NULL); + // This code frequently crashes. mutex lock referencing free'd memory. cg_http_server_lock(httpServer); cg_thread_remove(thread); cg_http_server_unlock(httpServer); @@ -261,34 +294,48 @@ CgHttpServerClientData *clientData; CgSocket *serverSock; CgSocket *clientSock; - + cg_log_debug_l4("Entering...\n"); httpServer = (CgHttpServer *)cg_thread_getuserdata(thread); - + if (cg_http_server_isopened(httpServer) == FALSE) return; - + serverSock = httpServer->sock; while (cg_thread_isrunnable(thread) == TRUE) { +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#if defined(CG_USE_OPENSSL) + if (cg_socket_isssl(serverSock) == TRUE) { + clientSock = cg_socket_ssl_new(); + cg_socket_setctx(clientSock, httpServer->ctxdata); + } + else{ + clientSock = cg_socket_stream_new(); + } +#else + clientSock = cg_socket_stream_new(); +#endif +#else clientSock = cg_socket_stream_new(); +#endif if (cg_socket_accept(serverSock, clientSock) == FALSE) { cg_socket_delete(clientSock); - break; + continue; } - + cg_socket_settimeout(clientSock, cg_http_server_gettimeout(httpServer)); clientData = cg_http_server_clientdata_new(httpServer, clientSock); httpClientThread = cg_thread_new(); cg_thread_setaction(httpClientThread, cg_http_server_clientthread); cg_thread_setuserdata(httpClientThread, clientData); - + /**** Thanks for Makela Aapo (10/31/05) ****/ cg_http_server_lock(httpServer); cg_threadlist_add(httpServer->clientThreads, httpClientThread); cg_http_server_unlock(httpServer); - - cg_thread_start(httpClientThread); + + cg_thread_start(httpClientThread); } cg_log_debug_l4("Leaving...\n"); @@ -304,7 +351,7 @@ if (httpServer->acceptThread != NULL) return FALSE; - + httpServer->acceptThread = cg_thread_new(); cg_thread_setaction(httpServer->acceptThread, cg_http_server_thread); cg_thread_setuserdata(httpServer->acceptThread, httpServer); @@ -396,7 +443,7 @@ } #elif defined(ITRON) cg_strcpy(buf, "uITRON 4.0"); -#elif defined(TENGINE) +#elif defined(TENGINE) cg_strcpy(buf, "T-Engine 1.0"); #elif defined(HAVE_UNAME) || defined(TARGET_OS_MAC) || defined(TARGET_OS_IPHONE) struct utsname unameBuf; diff -Naur clinkc/src/cybergarage/http/chttp_server_list.c clinkc_patch/src/cybergarage/http/chttp_server_list.c --- clinkc/src/cybergarage/http/chttp_server_list.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/http/chttp_server_list.c 2014-01-29 13:54:26.410322405 +0800 @@ -69,8 +69,11 @@ /**************************************** * cg_http_serverlist_open ****************************************/ - +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013, charisse*/ +BOOL cg_http_serverlist_open(CgHttpServerList *httpServerList, int port, BOOL isSecure, void *ctxdata) +#else BOOL cg_http_serverlist_open(CgHttpServerList *httpServerList, int port) +#endif { CgNetworkInterfaceList *netIfList; CgNetworkInterface *netIf; @@ -93,7 +96,11 @@ continue; httpServer = cg_http_server_new(); +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013, charisse*/ + if (cg_http_server_open(httpServer, port, bindAddr, isSecure, ctxdata) == FALSE) { +#else if (cg_http_server_open(httpServer, port, bindAddr) == FALSE) { +#endif /* Theo Beisch - why break off, we may be running ok on at least some IF??? (at least WINCE does...) */ diff -Naur clinkc/src/cybergarage/net/cinterface_function.c clinkc_patch/src/cybergarage/net/cinterface_function.c --- clinkc/src/cybergarage/net/cinterface_function.c 2011-04-08 17:11:04.000000000 +0800 +++ clinkc_patch/src/cybergarage/net/cinterface_function.c 2014-01-29 13:54:26.410322405 +0800 @@ -402,7 +402,11 @@ for (i = ifaddr; i != NULL; i = i->ifa_next) { - if(i->ifa_addr == NULL || i->ifa_netmask == NULL) continue; + // Thanks for Ricardo Rivldo (04/10/12) + // - for some reason, vmware and virtualbox \"virtual\" interfaces does not return ifa_addr + if(i->ifa_addr == NULL || i->ifa_netmask == NULL) + continue; + // Thanks for Tobias.Gansen (01/15/06) if(i->ifa_addr->sa_family != AF_INET) continue; @@ -484,7 +488,7 @@ while (*ifname == ' ') ifname++; struct ifreq req; - strcpy(req.ifr_name, ifname); + strncpy(req.ifr_name, ifname, sizeof(req.ifr_name)-1); if (ioctl(s, SIOCGIFFLAGS, &req) < 0) continue; if (!(req.ifr_flags & IFF_UP)) diff -Naur clinkc/src/cybergarage/net/csocket.c clinkc_patch/src/cybergarage/net/csocket.c --- clinkc/src/cybergarage/net/csocket.c 2011-04-08 17:11:04.000000000 +0800 +++ clinkc_patch/src/cybergarage/net/csocket.c 2014-01-29 13:54:26.410322405 +0800 @@ -62,6 +62,9 @@ */ #include +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#include +#endif #include @@ -104,6 +107,14 @@ #endif #endif +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#if defined(CG_USE_OPENSSL) +#include +#endif +/*non-blocking mode connect, ZyXEL 2013*/ +#define NONBLOCK_CONNECT_TIMEOUT_S 10 //sec + +#endif /* #define SOCKET_DEBUG */ @@ -134,7 +145,11 @@ BOOL cg_socket_tosockaddrinfo(int sockType, char *addr, int port, struct addrinfo **addrInfo, BOOL isBindAddr); #endif +#ifdef ZYXEL_PATCH /*fix the bug of using addition type, ZyXEL, 2013*/ +#define cg_socket_getrawtype(socket) ((socket->type & CG_NET_SOCKET_STREAM) ? SOCK_STREAM : SOCK_DGRAM) +#else #define cg_socket_getrawtype(socket) ((socket->type == CG_NET_SOCKET_STREAM) ? SOCK_STREAM : SOCK_DGRAM) +#endif #if defined(TENGINE) && defined(CG_TENGINE_NET_KASAGO) #define cg_socket_getprototype(socket) ((socket->type == CG_NET_SOCKET_STREAM) ? IPPROTO_TCP : IPPROTO_UDP) @@ -276,6 +291,12 @@ cg_socket_setaddress(sock, ""); cg_socket_setport(sock, -1); +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + sock->remoteIpAddr = cg_string_new(); + cg_socket_setremoteaddress(sock, ""); + cg_socket_setremoteport(sock, -1); +#endif + #if defined(ITRON) sock->sendWinBuf = NULL; @@ -285,6 +306,9 @@ #if defined(CG_USE_OPENSSL) sock->ctx = NULL; sock->ssl = NULL; +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + sock->ctxdata = NULL; +#endif #endif } @@ -306,6 +330,15 @@ #if defined(ITRON) cg_socket_freewindowbuffer(sock); #endif +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#if defined(CG_USE_OPENSSL) + if (cg_socket_isssl(sock) == TRUE){ + //EVP_cleanup(); /* Clear memory allocated in SSL_library_init()*/ + } +#endif +#endif + + free(sock); cg_socket_cleanup(); @@ -368,8 +401,10 @@ if (cg_socket_isbound(sock) == FALSE) return TRUE; +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ #if defined(CG_USE_OPENSSL) if (cg_socket_isssl(sock) == TRUE) { + shutdown(cg_socket_getid(sock), SHUT_WR); if (sock->ctx) { SSL_shutdown(sock->ssl); SSL_free(sock->ssl); @@ -381,6 +416,7 @@ } } #endif +#endif #if (defined(WIN32) || defined(__CYGWIN__)) && !defined(ITRON) #if !defined(WINCE) @@ -427,11 +463,29 @@ udp_del_cep(sock->id); } #else +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#if defined(CG_USE_OPENSSL) + if (cg_socket_isssl(sock) == FALSE) { + int flag = fcntl(sock->id, F_GETFL, 0); + if (0 <= flag) + fcntl(sock->id, F_SETFL, flag | O_NONBLOCK); + shutdown(sock->id, 2); + close(sock->id); + } +#else int flag = fcntl(sock->id, F_GETFL, 0); if (0 <= flag) fcntl(sock->id, F_SETFL, flag | O_NONBLOCK); shutdown(sock->id, 2); close(sock->id); +#endif +#else + int flag = fcntl(sock->id, F_GETFL, 0); + if (0 <= flag) + fcntl(sock->id, F_SETFL, flag | O_NONBLOCK); + shutdown(sock->id, 2); + close(sock->id); +#endif #endif sock->id = -1; #endif @@ -569,6 +623,12 @@ return FALSE; } } +#ifdef ZYXEL_PATCH /*set socket option SO_REUSEADDR, ZyXEL, 2012*/ + int optval; + optval = 1; + setsockopt(sock->id, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)); +#endif + ret = bind(sock->id, addrInfo->ai_addr, addrInfo->ai_addrlen); freeaddrinfo(addrInfo); #endif @@ -629,7 +689,23 @@ if (clientSock->id < 0) return FALSE; #endif - +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + cg_socket_setdirection(clientSock, CG_NET_SOCKET_SERVER); + +#if defined(CG_USE_OPENSSL) + if (cg_socket_isssl(clientSock) == TRUE){ + cg_ssl_set_ctx(clientSock, clientSock->ctxdata); + if( cg_ssl_accept( serverSock, clientSock)!= TRUE){ + return FALSE; + } + } +#endif +#endif + +#ifdef ZYXEL_PATCH /* for session mgmt, ZyXEL, John */ + cg_socket_setremoteaddress(clientSock, inet_ntoa(((struct sockaddr_in *)&sockClientAddr)->sin_addr)); + cg_socket_setremoteport(clientSock, ((struct sockaddr_in *)&sockClientAddr)->sin_port); +#endif cg_socket_setaddress(clientSock, cg_socket_getaddress(serverSock)); cg_socket_setport(clientSock, cg_socket_getport(serverSock)); socklen = sizeof(struct sockaddr_in); @@ -701,11 +777,63 @@ #else struct addrinfo *toaddrInfo; int ret; + +#ifdef ZYXEL_PATCH /*non-blocking mode connect, ZyXEL 2013*/ + long flags; + fd_set myset; + struct timeval tv; + socklen_t lon; + int valopt; +#endif + if (cg_socket_tosockaddrinfo(cg_socket_getrawtype(sock), addr, port, &toaddrInfo, TRUE) == FALSE) return FALSE; if (cg_socket_isbound(sock) == FALSE) cg_socket_setid(sock, socket(toaddrInfo->ai_family, toaddrInfo->ai_socktype, 0)); + +#ifdef ZYXEL_PATCH /*non-blocking mode connect, ZyXEL 2013*/ + // Set non-blocking + flags = fcntl(sock->id, F_GETFL, NULL); + fcntl(sock->id, F_SETFL, flags | O_NONBLOCK); +#endif + ret = connect(sock->id, toaddrInfo->ai_addr, toaddrInfo->ai_addrlen); +#ifdef ZYXEL_PATCH /*non-blocking mode connect, ZyXEL 2013*/ + if (ret < 0) { + if (errno == EINPROGRESS) { + tv.tv_sec = NONBLOCK_CONNECT_TIMEOUT_S; + tv.tv_usec = 0; + FD_ZERO(&myset); + FD_SET(sock->id, &myset); + if (select(sock->id+1, NULL, &myset, NULL, &tv) > 0) { + lon = sizeof(int); + getsockopt(sock->id, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon); + if (valopt) { +#if defined DEBUG + printf( "Error in connection() %d - %s\n", valopt, strerror(valopt)); +#endif + } + else{ + ret = 0;//connect success + } + } + else { +#if defined DEBUG + printf( "Timeout or error() %d - %s\n", valopt, strerror(valopt)); +#endif + } + } + else { +#if defined DEBUG + printf( "Error connecting %d - %s\n", errno, strerror(errno)); +#endif + } + } + + // Set reback to original mode again... + fcntl(sock->id, F_SETFL, flags); +#endif + freeaddrinfo(toaddrInfo); #endif @@ -714,9 +842,13 @@ cg_socket_setdirection(sock, CG_NET_SOCKET_CLIENT); #if defined(CG_USE_OPENSSL) - if (cg_socket_isssl(sock) == TRUE) { + if (cg_socket_isssl(sock) == TRUE && ret == 0) { sock->ctx = SSL_CTX_new( SSLv23_client_method()); +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ + cg_ssl_set_ctx(sock, sock->ctxdata); +#endif sock->ssl = SSL_new(sock->ctx); + SSL_set_connect_state(sock->ssl); if (SSL_set_fd(sock->ssl, cg_socket_getid(sock)) == 0) { cg_socket_close(sock); return FALSE; @@ -725,6 +857,10 @@ cg_socket_close(sock); return FALSE; } + if(!cg_ssl_extra_verify(sock)){ + cg_socket_close(sock); + return FALSE; + } } #endif @@ -913,7 +1049,7 @@ * cg_socket_sendto ****************************************/ -int cg_socket_sendto(CgSocket *sock, char *addr, int port, char *data, int dataLen) +int cg_socket_sendto(CgSocket *sock, char *addr, int port, char *data, int dataLen, char *bindAddr) { #if defined(BTRON) || defined(TENGINE) struct sockaddr_in sockaddr; @@ -925,6 +1061,10 @@ #endif int sentLen; BOOL isBoundFlag; +#ifdef ZYXEL_PATCH /*we don't want the data we send to be looped back to our host, ZyXEL 2013, charisse*/ + int loopBack = 0; +#endif + struct in_addr bindaddress; cg_log_debug_l4("Entering...\n"); @@ -972,6 +1112,15 @@ /* Setting multicast time to live in any case to default */ cg_socket_setmulticastttl(sock, CG_NET_SOCKET_MULTICAST_DEFAULT_TTL); + + // restrict multicast messages sent on this socket + if (bindAddr != NULL){ + inet_pton(AF_INET, bindAddr, &bindaddress.s_addr); + setsockopt(sock->id, IPPROTO_IP, IP_MULTICAST_IF, (char*) &bindaddress, sizeof(bindaddress)); +#ifdef ZYXEL_PATCH /*we don't want the data we send to be looped back to our host, ZyXEL 2013, charisse*/ + setsockopt(sock->id, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&loopBack,sizeof(int)); +#endif + } if (0 <= sock->id) sentLen = sendto(sock->id, data, dataLen, 0, addrInfo->ai_addr, addrInfo->ai_addrlen); diff -Naur clinkc/src/cybergarage/net/curi.c clinkc_patch/src/cybergarage/net/curi.c --- clinkc/src/cybergarage/net/curi.c 2010-07-31 17:59:44.000000000 +0800 +++ clinkc_patch/src/cybergarage/net/curi.c 2014-01-29 13:54:26.410322405 +0800 @@ -195,10 +195,14 @@ /*** Host (Port) ****/ shashIdx = cg_strstr(value+currIdx, CG_NET_URI_SLASH_DELIM); - if (0 < shashIdx) - cg_string_setnvalue(uri->host, value+currIdx, shashIdx); - else if (cg_net_uri_isabsolute(uri) == TRUE) + if (0 < shashIdx) { + cg_string_setnvalue(uri->host, value+currIdx, shashIdx); + currIdx += shashIdx; + } + else if (cg_net_uri_isabsolute(uri) == TRUE) { cg_string_setnvalue(uri->host, value+currIdx, cg_strlen(value) - currIdx); + currIdx += cg_strlen(value) - currIdx; + } host = cg_net_uri_gethost(uri); colonIdx = cg_strrchr(host, CG_NET_URI_COLON_DELIM, 1); eblacketIdx = cg_strrchr(host, CG_NET_URI_EBLACET_DELIM, 1); @@ -229,8 +233,6 @@ uri->port = CG_NET_URI_DEFAULT_FTP_PORT; } - if (shashIdx > 0) currIdx += shashIdx; - /* Handle relative URL */ diff -Naur clinkc/src/cybergarage/soap/csoap_request.c clinkc_patch/src/cybergarage/soap/csoap_request.c --- clinkc/src/cybergarage/soap/csoap_request.c 2008-10-22 13:43:51.000000000 +0800 +++ clinkc_patch/src/cybergarage/soap/csoap_request.c 2014-01-29 13:54:26.418322405 +0800 @@ -177,6 +177,91 @@ return bodyNode; } +#ifdef ZYXEL_PATCH /* ZyXEL 2013, charisse*/ +/**************************************** +* cg_soap_request_getheadernode +****************************************/ + +CgXmlNode *cg_soap_request_getheadernode(CgSoapRequest *soapReq) +{ + CgXmlNode *envNode; + CgXmlNode *headerNode = NULL; + CgXmlAttribute *attr; + char *name; + CgStringTokenizer *tok; + char *nsPrefix; + int headerLen; + char *header; + + cg_log_debug_l4("Entering...\n"); + + envNode = cg_soap_request_getenvelopenode(soapReq); + if (envNode == NULL){ + return NULL; + } + if (cg_xml_node_haschildnodes(envNode) == FALSE){ + return NULL; + } + + /* We cannot assume the namespace prefix for Body is 's'. + According to spec, it could be anything... */ + for (attr = cg_xml_node_getattributes(envNode); attr != NULL; + attr = cg_xml_attribute_next(attr)) { + /* First, find the namespace declaration attribute. */ + /* Note: We must take a copy of the attr name. + Tokenizer doesn't do it (by default) */ + name = cg_strdup( cg_xml_attribute_getname(attr) ); + tok = cg_string_tokenizer_new(name, ":"); + + nsPrefix = cg_string_tokenizer_nexttoken(tok); + if ( -1 != cg_strstr(nsPrefix, "xmlns")) { + /* This attribute is a namespace declaration. Check is + it the one defined for SOAP. */ + if (cg_strcmp(cg_xml_attribute_getvalue(attr), CG_SOAP_XMLNS_URL) == 0) { + /* This namespace declaration is correct. + Use it to find the body node... */ + if (cg_string_tokenizer_hasmoretoken(tok)) { + /* There is a prefix */ + nsPrefix = cg_string_tokenizer_nexttoken(tok); + headerLen = cg_strlen(nsPrefix) + + cg_strlen(CG_SOAP_DELIM) + + cg_strlen(CG_SOAP_HEADER) + 1; /* +1 for trailing '\0'*/ + header = (char*)malloc(headerLen); + + if ( NULL == header ) + { + cg_log_debug_s("Memory allocation failure!\n"); + return NULL; + } +#if defined(HAVE_SNPRINTF) + snprintf(header, headerLen, "%s%s%s", nsPrefix, + CG_SOAP_DELIM, CG_SOAP_HEADER); +#else + sprintf(header, "%s%s%s", nsPrefix, CG_SOAP_DELIM, CG_SOAP_HEADER); +#endif + headerNode = cg_xml_node_getchildnode(envNode, header); + free(header); + } + else { + /* No prefix */ + headerNode = cg_xml_node_getchildnode(envNode, CG_SOAP_HEADER); + } + /* Free memory before leaving the loop */ + cg_string_tokenizer_delete(tok); + free(name); + break; + } + } + cg_string_tokenizer_delete(tok); + free(name); + } + + cg_log_debug_l4("Leaving...\n"); + + return headerNode; +} +#endif + /**************************************** * cg_soap_request_sethttprequest ****************************************/ diff -Naur clinkc/src/cybergarage/ssl/cssl.c clinkc_patch/src/cybergarage/ssl/cssl.c --- clinkc/src/cybergarage/ssl/cssl.c 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/src/cybergarage/ssl/cssl.c 2014-01-29 13:54:26.398322404 +0800 @@ -0,0 +1,258 @@ +/******************************************************************************/ +/* +* Copyright (C) 2013 ZyXEL Communications, Corp. +* All Rights Reserved. +* +* ZyXEL Confidential; Need to Know only. +* Protected as an unpublished work. +* +* The computer program listings, specifications and documentation +* herein are the property of ZyXEL Communications, Corp. and +* shall not be reproduced, copied, disclosed, or used in whole or +* in part for any reason without the prior express written permission of +* ZyXEL Communications, Corp. +*/ +/******************************************************************************/ + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013*/ +#include +#define CA_FILETYPE ".pem" + +#if defined(CG_USE_OPENSSL) +BOOL cg_ssl_set_verify(CgSocket *sock, Cgctx *ctxdata ); + +int cg_ssl_filter_cafile( + const struct dirent *fileName /* File Name Struct */ +){ + struct stat fileStat; + + if (0 == stat(fileName->d_name, &fileStat)) { + if (S_ISREG(fileStat.st_mode)) { + return 1; + } + return 0; + } + + return 0; + +} + +BOOL cg_ssl_set_cert(CgSocket *sock, Cgctx *ctxdata ){ + + if (cg_socket_isssl(sock) != TRUE) return TRUE; + + if(sock->ctx == NULL) + sock->ctx = SSL_CTX_new( cg_socket_isserver(sock)?SSLv23_server_method():SSLv23_client_method()); + if( ctxdata == NULL) return TRUE; + + if (ctxdata->cert_file != NULL){ + printf("SSL_CTX_use_certificate_file '%s'\n",ctxdata->cert_file); + if (SSL_CTX_use_certificate_file(sock->ctx,ctxdata->cert_file, SSL_FILETYPE_PEM) <= 0){ + printf("unable to get certificate from '%s'\n",ctxdata->cert_file); + return 0; + } + if (ctxdata->key_file == NULL) ctxdata->key_file=ctxdata->cert_file; + if (SSL_CTX_use_PrivateKey_file(sock->ctx,ctxdata->key_file,SSL_FILETYPE_PEM) <= 0){ + printf("unable to get private key from '%s'\n",ctxdata->key_file); + return 0; + } + + + /* Now we know that a key and cert have been set against + * the SSL context */ + if (!SSL_CTX_check_private_key(sock->ctx)){ + printf("Private key does not match the certificate public key\n"); + return 0; + } + } + return 1; +} + +BOOL cg_ssl_set_ca(CgSocket *sock, Cgctx *ctxdata ){ + char caname[256]={0}; + if (cg_socket_isssl(sock) != TRUE) return TRUE; + + if(sock->ctx == NULL) + sock->ctx = SSL_CTX_new( cg_socket_isserver(sock)?SSLv23_server_method():SSLv23_client_method()); + if( ctxdata == NULL) return TRUE; + + if (ctxdata->CAfile != NULL){ + if (! SSL_CTX_load_verify_locations(sock->ctx, ctxdata->CAfile, ctxdata->CApath)){ + printf( "Load Trust Certificate Authority File : [%s/%s] Fail\n", ctxdata->CApath, ctxdata->CAfile); + } + cg_ssl_set_verify(sock, ctxdata); + } + else if(ctxdata->CApath != NULL){//dir + int num = 0; + struct dirent **fileList; + + chdir(ctxdata->CApath); + num = scandir(ctxdata->CApath, &fileList, (void *)cg_ssl_filter_cafile, alphasort); + + if (-1 == num) { + printf( "scandir() failed\n"); + } + else { + if (0 == num){ + printf( "No Any Trust CA File List (PEM Format)\n"); + } else { + /* Load Trust CA File List */ + while (num--) { + snprintf(caname, sizeof(caname), "%s%s", ctxdata->CApath, fileList[num]->d_name); + if (! SSL_CTX_load_verify_locations(sock->ctx, caname, NULL)){ + printf( "Load Trust Certificate Authority File : [%s] Fail\n", caname); + } + + free(fileList[num]); + } + num = 1; + cg_ssl_set_verify(sock, ctxdata); + } + + if (NULL != fileList) { + free(fileList); + } + } + } + + return TRUE; +} + +BOOL cg_ssl_set_verify(CgSocket *sock, Cgctx *ctxdata ){ + + if (cg_socket_isssl(sock) != TRUE) return TRUE; + + if(sock->ctx == NULL) + sock->ctx = SSL_CTX_new( cg_socket_isserver(sock)?SSLv23_server_method():SSLv23_client_method()); + if(ctxdata->verify_callback || ctxdata->verify_mode){ + SSL_CTX_set_verify(sock->ctx, ctxdata->verify_mode, ctxdata->verify_callback); + } + return TRUE; +} + +BOOL cg_ssl_set_ctx(CgSocket *sock, void *ctxdata){ + + if (cg_socket_isssl(sock) != TRUE) return TRUE; + if(sock->ctx == NULL) + sock->ctx = SSL_CTX_new( cg_socket_isserver(sock)?SSLv23_server_method():SSLv23_client_method()); + + if( ctxdata == NULL) return TRUE; + + cg_ssl_set_cert( sock, (Cgctx *)ctxdata ); + cg_ssl_set_ca( sock, (Cgctx *)ctxdata ); + + return TRUE; +} + +void cg_ssl_show_cert(CgSocket *sock){ + X509* cert; + char* str; + + /* Get the cipher - opt */ + printf ("SSL connection using %s\n", SSL_get_cipher (sock->ssl)); + + /* Get client's certificate (note: beware of dynamic allocation) - opt */ + cert = SSL_get_peer_certificate (sock->ssl); + if (cert != NULL) { + printf ("Peer certificate:\n"); + + str = X509_NAME_oneline (X509_get_subject_name (cert), 0, 0); + printf ("\t subject: %s\n", str); + free (str); + + str = X509_NAME_oneline (X509_get_issuer_name (cert), 0, 0); + printf ("\t issuer: %s\n", str); + free (str); + + /* We could do all sorts of certificate verification stuff here before + deallocating the certificate. */ + + X509_free (cert); + } + else{ + printf("No peer certificate\n"); + } +} + +BOOL cg_ssl_accept(CgSocket *serverSock, CgSocket *clientSock){ + int ret_sslconnect = 0; + + printf("%s()\n", __func__); + if (cg_socket_isssl(clientSock) != TRUE) return TRUE; + + if(clientSock->ctx == NULL) + clientSock->ctx = SSL_CTX_new( SSLv23_server_method()); + + clientSock->ssl = SSL_new(clientSock->ctx); + SSL_set_accept_state(clientSock->ssl); + if (SSL_set_fd(clientSock->ssl, cg_socket_getid(clientSock)) == 0) { + return FALSE; + } + + if ( (ret_sslconnect=SSL_accept(clientSock->ssl)) < 1) { + printf("SSL_get_error =%d\n", SSL_get_error(clientSock->ssl, ret_sslconnect)); + printf("SSL_accept <1\n"); + return FALSE; + } + + + printf( "%s(): SSL Certificate Authority Verify Result = [%s]\n",__func__, X509_verify_cert_error_string(SSL_get_verify_result(clientSock->ssl))); + + cg_ssl_show_cert(clientSock); + return TRUE; +} + +BOOL cg_ssl_extra_verify(CgSocket *sock ){ + Cgctx *ctxdata = NULL; + int retverify; + X509 *cert = NULL; + X509_NAME *name = NULL; + char commonName[512]={0}; + char *ptr = NULL; + + ctxdata = (Cgctx *)sock->ctxdata; + cert = SSL_get_peer_certificate(sock->ssl); + if (cert != NULL && ctxdata != NULL) { + /*verify the Comman Name, must be same as the hostname*/ + if(ctxdata->verify_cn != NULL){ + name = X509_get_subject_name (cert); + + if(name){ + X509_NAME_get_text_by_NID(name, NID_commonName, commonName, sizeof(commonName)); + if(strcmp(commonName, ctxdata->verify_cn) != 0 )//common name may be "*.test.com.tw", Motive + { + /* [Motive] common name may be "*.test.com.tw" , charisse */ + if(strncmp(commonName, "*.", 2)==0 ){ + ptr = strstr(ctxdata->verify_cn, commonName+2 ); + if(ptr){ + if((ptr-ctxdata->verify_cn)+strlen(commonName)-2 == strlen(ctxdata->verify_cn) ) + return TRUE; + } + + } + /* Handle a suspect certificate here */ + printf("commonName=%s, ctxdata->verify_cn=%s\n", commonName, ctxdata->verify_cn); + printf("Common Name doesn't math host name"); + return FALSE; + } + } + } + + } + return TRUE; + +} +#endif +#endif diff -Naur clinkc/src/cybergarage/upnp/ccontrolpoint.c clinkc_patch/src/cybergarage/upnp/ccontrolpoint.c --- clinkc/src/cybergarage/upnp/ccontrolpoint.c 2011-02-14 21:09:31.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/ccontrolpoint.c 2014-01-29 13:54:26.418322405 +0800 @@ -218,7 +218,11 @@ httpEventPort = cg_upnp_controlpoint_geteventport(ctrlPoint); httpServerList = cg_upnp_controlpoint_gethttpserverlist(ctrlPoint); /* Opening HTTP server may fail, so try many ports */ +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013, charisse*/ + while(cg_http_serverlist_open(httpServerList, httpEventPort, 0, NULL) == FALSE) { +#else while(cg_http_serverlist_open(httpServerList, httpEventPort) == FALSE) { +#endif cg_upnp_controlpoint_seteventport(ctrlPoint, httpEventPort + 1); httpEventPort = cg_upnp_controlpoint_geteventport(ctrlPoint); } diff -Naur clinkc/src/cybergarage/upnp/cdevice.c clinkc_patch/src/cybergarage/upnp/cdevice.c --- clinkc/src/cybergarage/upnp/cdevice.c 2010-02-12 23:33:58.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/cdevice.c 2014-01-29 13:54:26.418322405 +0800 @@ -116,6 +116,10 @@ dev->ssdpPkt = cg_upnp_ssdp_packet_new(); dev->ifCache = NULL; + +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013*/ + dev->performListner = NULL; +#endif cg_upnp_device_setparentdevice(dev, NULL); cg_upnp_device_setdescriptionuri(dev, CG_UPNP_DEVICE_DEFAULT_DESCRIPTION_URI); @@ -1318,6 +1322,11 @@ netIfList = cg_net_interfacelist_new(); cg_net_gethostinterfaces(netIfList); for (netIf = cg_net_interfacelist_gets(netIfList); netIf; netIf = cg_net_interface_next(netIf)) { +#ifdef ZYXEL_PATCH /*improve the performance, the upnp and tr64 are only need implement at LAN interface , ZyXEL 2013, charisse*/ + if(strstr(cg_net_interface_getname(netIf), "br") == NULL){ + continue; + } +#endif bindAddr = cg_net_interface_getaddress(netIf); if (cg_strlen(bindAddr) <= 0) continue; @@ -1408,6 +1417,11 @@ netIfList = cg_net_interfacelist_new(); cg_net_gethostinterfaces(netIfList); for (netIf = cg_net_interfacelist_gets(netIfList); netIf; netIf = cg_net_interface_next(netIf)) { +#ifdef ZYXEL_PATCH /*improve the performance, the upnp and tr64 are only need implement at LAN interface , ZyXEL 2013, charisse*/ + if(strstr(cg_net_interface_getname(netIf), "br") == NULL){ + continue; + } +#endif bindAddr = cg_net_interface_getaddress(netIf); if (cg_strlen(bindAddr) <= 0) continue; @@ -1506,7 +1520,11 @@ /**** HTTP Server ****/ httpPort = cg_upnp_device_gethttpport(dev); /* Opening HTTP server may fail, so try many ports */ +#ifdef ZYXEL_PATCH /*support ssl, ZyXEL 2013, charisse*/ + while(cg_http_serverlist_open(dev->httpServerList, httpPort, 0, NULL) == FALSE) +#else while(cg_http_serverlist_open(dev->httpServerList, httpPort) == FALSE) +#endif { cg_upnp_device_sethttpport(dev, httpPort + 1); httpPort = cg_upnp_device_gethttpport(dev); @@ -1953,6 +1971,27 @@ cg_log_debug_l4("Leaving...\n"); } + +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013, charisse*/ +/**************************************** +* cg_upnp_device_setquerylistener +****************************************/ + +void cg_upnp_device_setperflistener(CgUpnpDevice *dev, CG_UPNP_SERVICE_PERFORMLISTNER perfListner) +{ + CgUpnpDevice *childDev; + + cg_log_debug_l4("Entering...\n"); + + dev->performListner = perfListner; + + for (childDev = cg_upnp_device_getdevices(dev); childDev != NULL; childDev = cg_upnp_device_next(childDev)){ + cg_upnp_device_setperflistener(childDev, perfListner); + } + + cg_log_debug_l4("Leaving...\n"); +} +#endif /**************************************** * cg_upnp_device_getservicebyeventsuburl ****************************************/ diff -Naur clinkc/src/cybergarage/upnp/cdevice_http_server.c clinkc_patch/src/cybergarage/upnp/cdevice_http_server.c --- clinkc/src/cybergarage/upnp/cdevice_http_server.c 2010-03-16 00:00:24.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/cdevice_http_server.c 2014-01-29 13:54:26.418322405 +0800 @@ -363,6 +363,10 @@ CgUpnpAction *action; CgUpnpArgumentList *actionArgList; CgUpnpArgumentList *actionReqArgList; +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013, charisse*/ + CG_UPNP_SERVICE_PERFORMLISTNER performlistener; + CgUpnpDevice *parentDev; +#endif cg_log_debug_l4("Entering...\n"); @@ -376,8 +380,20 @@ actionArgList = cg_upnp_action_getargumentlist(action); actionReqArgList = cg_upnp_control_action_request_getargumentlist(actionReq); cg_upnp_argumentlist_set(actionArgList, actionReqArgList); + +#ifdef ZYXEL_PATCH /*support ztr64, ZyXEL 2013, charisse*/ + parentDev = (CgUpnpDevice*)service->parentDevice; + performlistener = parentDev->performListner; + if ( performlistener != NULL){ + if(performlistener(action, actionReq) == FALSE) + cg_upnp_device_invalidactioncontrolrecieved(actionReq); + } + else +#endif + { if (cg_upnp_action_performlistner(action, actionReq) == FALSE) cg_upnp_device_invalidactioncontrolrecieved(actionReq); + } cg_log_debug_l4("Leaving...\n"); } diff -Naur clinkc/src/cybergarage/upnp/cdevice_ssdp_server.c clinkc_patch/src/cybergarage/upnp/cdevice_ssdp_server.c --- clinkc/src/cybergarage/upnp/cdevice_ssdp_server.c 2010-02-12 23:33:58.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/cdevice_ssdp_server.c 2014-01-29 13:54:26.418322405 +0800 @@ -63,6 +63,12 @@ ssdpMXString = cg_http_headerlist_getvalue(ssdpPkt->headerList, CG_HTTP_MX); ssdpST = cg_upnp_ssdp_packet_getst(ssdpPkt); +#ifdef ZYXEL_PATCH /* speed up, ZyXEL, charisse */ + /* return if the MX or ST value does not exist */ + if (ssdpMXString == NULL || ssdpST == NULL) + return; +#endif + /* Check if this ssdp packet has already been checked + filtered */ if (filter) { diff -Naur clinkc/src/cybergarage/upnp/cservice.c clinkc_patch/src/cybergarage/upnp/cservice.c --- clinkc/src/cybergarage/upnp/cservice.c 2011-02-26 07:07:08.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/cservice.c 2014-01-29 13:54:26.418322405 +0800 @@ -1147,7 +1147,7 @@ } /**************************************** -* ` +* cg_upnp_service_removesubscriber ****************************************/ BOOL cg_upnp_service_removesubscriber(CgUpnpService *service, CgUpnpSubscriber *sub) @@ -1194,109 +1194,116 @@ /* Private helper functions */ -static CgNetURL *cg_upnp_service_mangleurl(CgUpnpService *service, char *type) +CgNetURL *cg_upnp_service_mangleabsoluteurl(char *serviceURLStr, char *baseURLStr, char *locationURLStr) { - char *gen_url_str; - char *location_str; - CgNetURL *genURL; - CgUpnpDevice *rootDev; - CgNetURL *temp; - - gen_url_str = cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), type); - location_str = NULL; - genURL = cg_net_url_new(); + CgNetURL *absServiceURL; + CgNetURL *serviceURL; - if (cg_strlen(gen_url_str) <= 0) + if (cg_strlen(serviceURLStr) <= 0) return NULL; - cg_log_debug_s("URL string: %s type: %s\n", gen_url_str, type); - cg_net_url_set(genURL, gen_url_str); + absServiceURL = cg_net_url_new(); + + cg_net_url_set(absServiceURL, serviceURLStr); /* Absolute URL case */ - if (cg_net_url_isabsolute(genURL) == TRUE) - { - cg_log_debug_s("Mangled URL: %s\n", cg_net_url_getrequest(genURL)); - return genURL; + if (cg_net_url_isabsolute(absServiceURL) == TRUE) { + cg_log_debug_s("Mangled URL: %s\n", cg_net_url_getrequest(absServiceURL)); + return absServiceURL; } /* URL base + absolute/relative path */ - rootDev = cg_upnp_service_getrootdevice(service); - - if (rootDev != NULL) { - if (0 < cg_strlen(cg_upnp_device_geturlbase(rootDev))) { - CgNetURL *temp = cg_net_url_new(); - cg_net_url_set(temp, gen_url_str); - - cg_net_url_set(genURL, cg_upnp_device_geturlbase(rootDev)); - - - if ( cg_net_url_isabsolutepath(gen_url_str) ) { - cg_net_url_setpath(genURL, cg_net_url_getpath(temp)); - cg_net_url_setquery(genURL, cg_net_url_getquery(temp)); - } - else { - cg_net_url_addpath(genURL, cg_net_url_getpath(temp)); - cg_net_url_setquery(genURL, cg_net_url_getquery(temp)); - cg_net_url_rebuild(genURL); - } - - cg_net_url_delete(temp); - - cg_log_debug_s("Mangled URL: %s\n", cg_net_url_getrequest(genURL)); - return genURL; - } - /* URL base from location + absolute/relative path */ - location_str = cg_upnp_device_getlocationfromssdppacket(rootDev); - cg_log_debug_s("Location from SSDP packet: %s\n", location_str); - - if (cg_strlen(location_str) <= 0) { - cg_log_debug_s("Could not get location string from SSDP packet!\n"); - return genURL; + if (0 < cg_strlen(baseURLStr)) { + serviceURL = cg_net_url_new(); + cg_net_url_set(serviceURL, serviceURLStr); + + cg_net_url_set(absServiceURL, baseURLStr); + + if (cg_net_url_isabsolutepath(serviceURLStr) ) { + cg_net_url_setpath(absServiceURL, cg_net_url_getpath(serviceURL)); + cg_net_url_setquery(absServiceURL, cg_net_url_getquery(serviceURL)); + } + else { + cg_net_url_addpath(absServiceURL, cg_net_url_getpath(serviceURL)); + cg_net_url_setquery(absServiceURL, cg_net_url_getquery(serviceURL)); + cg_net_url_rebuild(absServiceURL); } - cg_net_url_set(genURL, location_str); - - cg_log_debug_s("URL from location: %s - %d -%s", - cg_net_url_gethost(genURL), - cg_net_url_getport(genURL), - cg_net_url_getpath(genURL)); - - /* UPnP spec says that path in location URL with last part removed should be - * considered as base path when getting service descriptions, if relative - * paths are used in description XML. - * - * So we convert location http://192.168.1.1/base/path/description - * into http://192.168.1.1/base/path/ - */ + cg_net_url_delete(serviceURL); - location_str = cg_net_url_getupnpbasepath(genURL); - - if (location_str) { - cg_net_url_setpath(genURL, location_str); - free(location_str); - location_str = NULL; - } + cg_log_debug_s("Mangled URL: %s\n", cg_net_url_getrequest(absServiceURL)); + return absServiceURL; + } + + /* URL base from location + absolute/relative path */ + cg_log_debug_s("Location from SSDP packet: %s\n", locationURLStr); + + if (cg_strlen(locationURLStr) <= 0) { + cg_log_debug_s("Could not get location string from SSDP packet!\n"); + return absServiceURL; + } + + cg_net_url_set(absServiceURL, locationURLStr); + + cg_log_debug_s("URL from location: %s - %d -%s", + cg_net_url_gethost(absServiceURL), + cg_net_url_getport(absServiceURL), + cg_net_url_getpath(absServiceURL)); + /* UPnP spec says that path in location URL with last part removed should be + * considered as base path when getting service descriptions, if relative + * paths are used in description XML. + * + * So we convert location http://192.168.1.1/base/path/description + * into http://192.168.1.1/base/path/ + */ + + locationURLStr = cg_net_url_getupnpbasepath(absServiceURL); + + if (locationURLStr) { + cg_net_url_setpath(absServiceURL, locationURLStr); + free(locationURLStr); + locationURLStr = NULL; + } + + serviceURL = cg_net_url_new(); + cg_net_url_set(serviceURL, serviceURLStr); + + if ( cg_net_url_isabsolutepath(serviceURLStr) ) { + cg_net_url_setpath(absServiceURL, cg_net_url_getpath(serviceURL)); + cg_net_url_setquery(absServiceURL, cg_net_url_getquery(serviceURL)); + } + else { + cg_net_url_addpath(absServiceURL, cg_net_url_getpath(serviceURL)); + cg_net_url_setquery(absServiceURL, cg_net_url_getquery(serviceURL)); + } - temp = cg_net_url_new(); - cg_net_url_set(temp, gen_url_str); - - if ( cg_net_url_isabsolutepath(gen_url_str) ) { - cg_net_url_setpath(genURL, cg_net_url_getpath(temp)); - cg_net_url_setquery(genURL, cg_net_url_getquery(temp)); - } - else { - cg_net_url_addpath(genURL, cg_net_url_getpath(temp)); - cg_net_url_setquery(genURL, cg_net_url_getquery(temp)); - } - - cg_net_url_delete(temp); + cg_net_url_delete(serviceURL); - cg_log_debug_s("Mangled URL: %s\n", cg_net_url_getrequest(genURL)); + cg_log_debug_s("Mangled URL: %s\n", cg_net_url_getrequest(absServiceURL)); - return genURL; - } + return absServiceURL; +} - return NULL; +static CgNetURL *cg_upnp_service_mangleurl(CgUpnpService *service, char *type) +{ + char *serviceURLStr; + char *baseURLStr; + char *locationURLStr; + CgUpnpDevice *rootDev; + + serviceURLStr = cg_xml_node_getchildnodevalue(cg_upnp_service_getservicenode(service), type); + + rootDev = cg_upnp_service_getrootdevice(service); + if (rootDev != NULL) { + baseURLStr = cg_upnp_device_geturlbase(rootDev); + locationURLStr = cg_upnp_device_getlocationfromssdppacket(rootDev); + } + else { + baseURLStr = NULL; + locationURLStr = NULL; + } + + return cg_upnp_service_mangleabsoluteurl(serviceURLStr, baseURLStr, locationURLStr); } #endif diff -Naur clinkc/src/cybergarage/upnp/cstatevariable.c clinkc_patch/src/cybergarage/upnp/cstatevariable.c --- clinkc/src/cybergarage/upnp/cstatevariable.c 2010-08-17 20:12:25.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/cstatevariable.c 2014-01-29 13:54:26.418322405 +0800 @@ -39,19 +39,19 @@ if ( NULL != statVar ) { cg_list_node_init((CgList *)statVar); - + statVar->parentService = NULL; statVar->stateVarNode = NULL; - + statVar->value = cg_string_new(); statVar->upnpStatus = cg_upnp_status_new(); statVar->allowedValueList = NULL; - - + + cg_upnp_statevariable_setlistener(statVar, NULL); cg_upnp_statevariable_setuserdata(statVar, NULL); } - + cg_log_debug_l4("Leaving...\n"); return statVar; @@ -66,14 +66,14 @@ cg_log_debug_l4("Entering...\n"); cg_list_remove((CgList *)statVar); - + cg_string_delete(statVar->value); cg_upnp_status_delete(statVar->upnpStatus); if (statVar->allowedValueList) { cg_list_remove((CgList *)statVar->allowedValueList); } - + free(statVar); cg_log_debug_l4("Leaving...\n"); @@ -154,16 +154,16 @@ CgUpnpAllowedValuesList* cg_upnp_allowedvaluelist_new() { CgUpnpAllowedValuesList* allowedValueList = (CgUpnpAllowedValuesList *)malloc(sizeof(CgUpnpAllowedValuesList)); - - + + if ( NULL != allowedValueList ) { cg_list_header_init((CgList *)allowedValueList); allowedValueList->value = cg_string_new(); return allowedValueList; } - - return NULL; + + return NULL; } @@ -175,7 +175,7 @@ if (!statVar->allowedValueList) { CgXmlNode* allowedValuesNode = cg_xml_node_getchildnodebyname(cg_upnp_statevariable_getstatevariablenode(statVar), CG_UPNP_STATEVARIABLE_ALLOWEDVALUELIST); - + if (allowedValuesNode) { CgXmlNode* cnode; for (cnode = cg_xml_node_getchildnodes(allowedValuesNode); cnode; cnode=cg_xml_node_next(cnode)) { @@ -194,7 +194,7 @@ cg_string_setvalue(allowed_value->value, cg_xml_node_getvalue(cnode)); cg_list_insert((CgList *)statVar->allowedValueList, (CgList *)allowed_value); } - } + } } } return statVar->allowedValueList; @@ -209,13 +209,13 @@ { cg_upnp_statevariable_getallowedvaluelist(statVar); } - + if (statVar->allowedValueList) - { + { CgUpnpAllowedValue *allowedValue; for (allowedValue = (CgUpnpAllowedValue*)cg_list_next((CgList*)statVar->allowedValueList); allowedValue != NULL; allowedValue = (CgUpnpAllowedValue*)cg_list_next((CgList*)allowedValue)) { - if (strcasecmp(value, cg_string_getvalue(allowedValue->value)) == 0) + if (cg_strcasecmp((char *)value, cg_string_getvalue(allowedValue->value)) == 0) { return 1; } diff -Naur clinkc/src/cybergarage/upnp/cupnp_function.c clinkc_patch/src/cybergarage/upnp/cupnp_function.c --- clinkc/src/cybergarage/upnp/cupnp_function.c 2011-09-10 08:37:44.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/cupnp_function.c 2014-01-29 13:54:26.418322405 +0800 @@ -17,7 +17,7 @@ * - first revision * 10/30/05 * - Thanks for Makela Aapo (aapo.makela@nokia.com) -* - Changed to cg_upnp_createuuid() create new UUIDs as they are specified in +* - Changed to cg_upnp_createuuid() create new UUIDs as they are specified in * UPnP DA specification (UUIDs have "uuid:"prefix). * ******************************************************************/ @@ -29,7 +29,7 @@ #include #if defined(HAVE_UUID_UUID_H) || defined(HAVE_LIBUUID) || defined(TARGET_OS_IPHONE) -#include +#include #endif #include @@ -55,13 +55,13 @@ char uuidStr[CG_UPNP_UUID_MAX_LEN]; #elif defined(WIN32) #pragma comment(lib, "Rpcrt4.lib") - UUID uuid; + UUID uuid; unsigned char* szUuid = NULL; #else time_t time1; time_t time2; #endif - + cg_log_debug_l4("Entering...\n"); #if defined(HAVE_LIBUUID) || defined(TARGET_OS_IPHONE) @@ -86,20 +86,41 @@ (int)(time2 & 0xFFFF), (int)(((time2 >> 31) | 0xE000) & 0xFFFF)); #endif - + cg_log_debug_l4("Leaving...\n"); return uuidBuf; } /**************************************** +* uuid_unparse_lower +****************************************/ + +/* Some systems (Solaris, CentOS?) come with libuuid, but does not feature + the uuid_unparse_lower() call. */ + +#if defined(HAVE_UUID_UUID_H) && !defined(HAVE_UUID_UNPARSE_LOWER) && !defined(TARGET_OS_IPHONE) +/* Older versions of libuuid don't have uuid_unparse_lower(), + only uuid_unparse() */ +void uuid_unparse_lower (uuid_t uu, char *out) +{ + int i; + uuid_unparse (uu, out); + /*Characters in out are either 0-9, a-z, '-', or A-Z. A-Z is mapped to + a-z by bitwise or with 0x20, and the others already have this bit set */ + for (i = 0; i < sizeof(uu); ++i) + out[i] |= 0x20; +} +#endif + +/**************************************** * cg_upnp_getservername ****************************************/ char *cg_upnp_getservername(char *buf, int bufSize) { int nameLen; - + cg_log_debug_l4("Entering...\n"); cg_http_getservername(buf, bufSize); @@ -112,7 +133,7 @@ #else sprintf((buf+nameLen), " %s/%s UPnP/%s DLNADOC/%s", CG_CLINK_NAME, CG_CLINK_VER, CG_UPNP_VER, CG_DLNA_VER); #endif - + cg_log_debug_l4("Leaving...\n"); return buf; diff -Naur clinkc/src/cybergarage/upnp/cupnp_status.c clinkc_patch/src/cybergarage/upnp/cupnp_status.c --- clinkc/src/cybergarage/upnp/cupnp_status.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/cupnp_status.c 2014-01-29 13:54:26.418322405 +0800 @@ -73,6 +73,51 @@ case CG_UPNP_STATUS_OUT_OF_SYNC: return "Out of Sync"; case CG_UPNP_STATUS_INVALID_VAR: return "Invalid Var"; case CG_UPNP_STATUS_ACTION_FAILED: return "Action Failed"; +#ifdef ZYXEL_PATCH /* ZyXEL 2013, charisse*/ + case CG_UPNP_STATUS_ARG_VALUE_INVALID: return "Argument Value Invalid"; + case CG_UPNP_STATUS_ARG_VALUE_OUT_OF_RANGE: return "Argument Value Out of Range"; + case CG_UPNP_STATUS_OPT_NOT_IMPLEMENT: return "Optional Action Not Implemented"; + case CG_UPNP_STATUS_OUT_OF_MEMORY: return "Out of Memory"; + case CG_UPNP_STATUS_HUMAN_INTER_REQUIRED: return "Human Intervention Required"; + case CG_UPNP_STATUS_STRING_ARG_TOO_LONG: return "String Argument Too Long"; + //TR-064 + case CG_UPNP_STATUS_ACTION_NOT_AUTH: return "Action Not Authorized"; + case CG_UPNP_STATUS_VALUE_ALREADY_SPE: return "ValueAlreadySpecified able"; + case CG_UPNP_STATUS_VALUE_SPE_INVALID: return "ValueSpecifiedIsInvalid"; + case CG_UPNP_STATUS_INACT_CONN_REQUIRE: return "InactiveConnectionStateRequired"; + case CG_UPNP_STATUS_CONN_SETUP_FAIL: return "ConnectionSetupFailed"; + case CG_UPNP_STATUS_CONN_SETUP_INPROGRESS: return "ConnectionSetupInProgress"; + case CG_UPNP_STATUS_CONN_NOT_CONFIG: return "ConnectionNotConfigured"; + case CG_UPNP_STATUS_DISCON_INPROGESS: return "DiscconectInProgress"; + case CG_UPNP_STATUS_INVALID_L2_ADDR: return "InvalidLayer2Address"; + case CG_UPNP_STATUS_INTERNET_ACCESS_DISABLE: return "InternetAccessDisabled"; + case CG_UPNP_STATUS_INVALID_CONN_TYPE: return "InvalidConnectionType"; + case CG_UPNP_STATUS_CONN_ALREADY_TERM: return "ConnectionAlreadyTerminated"; + case CG_UPNP_STATUS_NULL_VALUE_SPE_ARRAY_IDX: return "NullValueAtSpecifiedArrayIndex"; + case CG_UPNP_STATUS_SPE_ARRAY_IDX_INVALID: return "SpecifiedArrayIndexInvalid"; + case CG_UPNP_STATUS_NO_SUCH_ENTRY_ARRAU: return "NoSuchEntryInArray"; + case CG_UPNP_STATUS_WILD_CARD_NOT_PER_IN_SRCIP: return "WildCardNotPermittedInSrcIP"; + case CG_UPNP_STATUS_WILD_CARD_NOT_PER_IN_EXTPORT: return "WildCardNotPermittedInExtPort"; + case CG_UPNP_STATUS_CONFLIC_IN_MAPENTRY: return "ConflictInMappingEntry"; + case CG_UPNP_STATUS_ACTION_DISALLOW_WHEN_AUTO_CONFIG: return "ActionDisallowedWhenAutoConfigEnabled"; + case CG_UPNP_STATUS_INVALID_DEVICE_UUID: return "InvalidDeviceUUID"; + case CG_UPNP_STATUS_INVALID_SRVID: return "InvalidServiceID"; + case CG_UPNP_STATUS_INVALID_CONSRV_SELECT: return "InvalidConnServiceSelection"; + case CG_UPNP_STATUS_SAME_PORT_VALUE_REQUIRE: return "SamePortValuesRequired"; + case CG_UPNP_STATUS_ONLY_PER_LEAS_SUPPORT: return "OnlyPermanentLeasesSupported"; + case CG_UPNP_STATUS_REMOTE_HOST_ONLY_SUPPORT_WILDCARD: return "RemoteHostOnlySupportsWildcard"; + case CG_UPNP_STATUS_EXTPORT_ONLY_SUPPORT_WILDCARD: return "ExternalPortOnlySupportsWildcard"; + case CG_UPNP_STATUS_INVALID_CHANNEL: return "InvalidChannel"; + case CG_UPNP_STATUS_INVALID_MAC_ADDR: return "InvalidMACAddress"; + case CG_UPNP_STATUS_INVALID_DATA_TRANS_RATE: return "InvalidDataTransmissionRates"; + case CG_UPNP_STATUS_INVALID_WEP_KEY: return "InvalidWEPKey"; + case CG_UPNP_STATUS_NO_WEP_KEY_SET: return "NoWEPKeyIsSet"; + case CG_UPNP_STATUS_NO_PSK_KEY_SET: return "NoPSKKeyIsSet"; + case CG_UPNP_STATUS_NO_EPA_SERVER: return "NoEAPServer"; + case CG_UPNP_STATUS_SET_MAC_NOT_PERMIT: return "SetMACAddressNotPermitted"; + case CG_UPNP_STATUS_WRITE_ACCESS_DISABLE: return "WriteAccessDisabled"; + case CG_UPNP_STATUS_SESSION_ID_EXPIRE: return "SessionIDExpired"; +#endif } return ""; diff -Naur clinkc/src/cybergarage/upnp/event/cnotify_request.c clinkc_patch/src/cybergarage/upnp/event/cnotify_request.c --- clinkc/src/cybergarage/upnp/event/cnotify_request.c 2010-03-17 23:36:24.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/event/cnotify_request.c 2014-01-29 13:54:26.482322407 +0800 @@ -50,7 +50,7 @@ { CgUpnpNotifyRequest *notifyReq; CgUpnpPropertyList *propList; - + cg_log_debug_l4("Entering...\n"); notifyReq = cg_soap_request_new(); @@ -75,7 +75,7 @@ propList = cg_upnp_event_notify_request_getpropertylistonly(notifyReq); cg_upnp_propertylist_delete(propList); - + cg_soap_request_delete(notifyReq); cg_log_debug_l4("Leaving...\n"); @@ -93,7 +93,7 @@ propList = cg_upnp_event_notify_request_getpropertylistonly(notifyReq); cg_upnp_propertylist_clear(propList); - + cg_soap_request_clear(notifyReq); cg_log_debug_l4("Leaving...\n"); @@ -119,20 +119,25 @@ ****************************************/ BOOL cg_upnp_event_notify_request_setpropertysetnode(CgUpnpNotifyRequest *notifyReq, CgUpnpSubscriber *sub, /* CgUpnpService */void *pservice, CgUpnpStateVariable *statVar) { - CgHttpRequest *httpReq; + CgHttpRequest *httpReq; CgXmlNode *propSetNode; CgUpnpService* service; - + char *server[CG_UPNP_SEVERNAME_MAXLEN]; + cg_log_debug_l4("Entering...\n"); service = (CgUpnpService *)pservice; - + httpReq = cg_soap_request_gethttprequest(notifyReq); cg_http_request_setmethod(httpReq, CG_HTTP_NOTIFY); cg_http_request_setconnection(httpReq, CG_HTTP_CLOSE); cg_http_request_seturi(httpReq, cg_upnp_subscriber_getdeliverypath(sub)); cg_http_request_sethost(httpReq, cg_upnp_subscriber_getdeliveryhost(sub), cg_upnp_subscriber_getdeliveryport(sub)); + cg_upnp_getservername(server, sizeof(server)); + cg_http_packet_setheadervalue((CgHttpPacket*)httpReq, + CG_HTTP_SERVER, + server); cg_upnp_event_notify_request_setnt(notifyReq, CG_UPNP_NT_EVENT); cg_upnp_event_notify_request_setnts(notifyReq, CG_UPNP_NTS_PROPCHANGE); cg_upnp_event_notify_request_setsid(notifyReq, cg_upnp_subscriber_getsid(sub)); @@ -156,13 +161,13 @@ CgXmlNode *propSetNode; CgXmlNode *propNode; CgXmlNode *varNode; - + cg_log_debug_l4("Entering...\n"); propSetNode = cg_xml_node_new(); cg_xml_node_setname(propSetNode, CG_UPNP_NOTIFY_XMLNS CG_SOAP_DELIM CG_UPNP_NOTIFY_PROPERTYSET); cg_xml_node_setnamespace(propSetNode, CG_UPNP_NOTIFY_XMLNS, CG_UPNP_SUBSCRIPTION_XMLNS); - + if (service) { for (statVar = cg_upnp_service_getstatevariables(service); statVar != NULL; statVar = cg_upnp_statevariable_next(statVar)) { if (!cg_upnp_statevariable_issendevents(statVar)) @@ -228,26 +233,26 @@ cg_log_debug_l4("Leaving...\n"); - return cg_xml_node_getchildnodes(propNode); + return cg_xml_node_getchildnodes(propNode); } /**************************************** * cg_upnp_property_createfromnode ****************************************/ -static CgUpnpProperty *cg_upnp_property_createfromnode(CgXmlNode *varNode) +static CgUpnpProperty *cg_upnp_property_createfromnode(CgXmlNode *varNode) { CgUpnpProperty *prop; char *varName; char *varValue; int colonIdx; - + cg_log_debug_l4("Entering...\n"); prop = cg_upnp_property_new(); if (varNode == NULL) return prop; - + // remove the event namespace varName = cg_xml_node_getname(varNode); colonIdx = cg_strstr(varName, ":"); @@ -256,7 +261,7 @@ varValue = cg_xml_node_getvalue(varNode); cg_upnp_property_setname(prop, varName); cg_upnp_property_setvalue(prop, varValue); - + cg_log_debug_l4("Leaving...\n"); return prop; @@ -275,15 +280,15 @@ CgUpnpProperty *prop; char *sid; int seq; - + cg_log_debug_l4("Entering...\n"); sid = cg_upnp_event_notify_request_getsid(notifyReq); seq = cg_upnp_event_notify_request_getseq(notifyReq); - + propList = cg_upnp_event_notify_request_getpropertylistonly(notifyReq); cg_upnp_propertylist_clear(propList); - + propSetNode = cg_soap_request_getrootnoode(notifyReq); if (propSetNode == NULL) return propList; @@ -295,7 +300,7 @@ cg_upnp_property_setseq(prop, seq); cg_upnp_propertylist_add(propList, prop); } - + cg_log_debug_l4("Leaving...\n"); return propList; diff -Naur clinkc/src/cybergarage/upnp/event/csubscription_response.c clinkc_patch/src/cybergarage/upnp/event/csubscription_response.c --- clinkc/src/cybergarage/upnp/event/csubscription_response.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/event/csubscription_response.c 2014-01-29 13:54:26.474322406 +0800 @@ -34,9 +34,14 @@ void cg_upnp_event_subscription_subscriberesponse_setresponse(CgUpnpSubscriptionResponse *subRes, int code) { + char *server[CG_UPNP_SEVERNAME_MAXLEN]; cg_log_debug_l4("Entering...\n"); cg_http_response_setstatuscode(subRes, code); + cg_upnp_getservername(server, sizeof(server)); + cg_http_packet_setheadervalue(((CgHttpPacket*)subRes), + CG_HTTP_SERVER, + server); cg_http_response_setcontentlength(subRes, 0); cg_log_debug_l4("Leaving...\n"); @@ -50,7 +55,7 @@ { CgString *headerSID; int uuidIdx; - + cg_log_debug_l4("Entering...\n"); headerSID = cg_string_new(); @@ -59,7 +64,7 @@ if (uuidIdx < 0) cg_string_addvalue(headerSID, CG_UPNP_ST_UUID_DEVICE ":"); cg_string_addvalue(headerSID, sid); - + cg_http_packet_setheadervalue(((CgHttpPacket*)subRes), CG_HTTP_SID, cg_string_getvalue(headerSID)); cg_string_delete(headerSID); diff -Naur clinkc/src/cybergarage/upnp/ssdp/cssdp_response_server.c clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_response_server.c --- clinkc/src/cybergarage/upnp/ssdp/cssdp_response_server.c 2011-02-08 01:29:11.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_response_server.c 2014-01-29 13:54:26.418322405 +0800 @@ -239,7 +239,7 @@ ssdpMsg = cg_string_new(); cg_upnp_ssdprequest_tostring(ssdpReq, ssdpMsg); - sentLen = cg_socket_sendto(httpuSock, ssdpAddr, CG_UPNP_SSDP_PORT, cg_string_getvalue(ssdpMsg), cg_string_length(ssdpMsg)); + sentLen = cg_socket_sendto(httpuSock, ssdpAddr, CG_UPNP_SSDP_PORT, cg_string_getvalue(ssdpMsg), cg_string_length(ssdpMsg), NULL); cg_string_delete(ssdpMsg); cg_log_debug_l4("Leaving...\n"); diff -Naur clinkc/src/cybergarage/upnp/ssdp/cssdp_response_server_list.c clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_response_server_list.c --- clinkc/src/cybergarage/upnp/ssdp/cssdp_response_server_list.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_response_server_list.c 2014-01-29 13:54:26.418322405 +0800 @@ -101,6 +101,11 @@ cg_net_interfacelist_add(netIfList, netIf); #endif for (netIf = cg_net_interfacelist_gets(netIfList); netIf; netIf = cg_net_interface_next(netIf)) { +#ifdef ZYXEL_PATCH /*improve the performance, the upnp and tr64 are only need implement at LAN interface , ZyXEL 2013, charisse*/ + if(strstr(cg_net_interface_getname(netIf), "br") == NULL){ + continue; + } +#endif bindAddr = cg_net_interface_getaddress(netIf); if (cg_strlen(bindAddr) <= 0) continue; diff -Naur clinkc/src/cybergarage/upnp/ssdp/cssdp_server.c clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_server.c --- clinkc/src/cybergarage/upnp/ssdp/cssdp_server.c 2008-09-26 02:48:45.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_server.c 2014-01-29 13:54:26.418322405 +0800 @@ -165,7 +165,7 @@ cg_upnp_ssdp_packet_delete(ssdpPkt); - cg_log_debug_l4("Leaving...\n"); + cg_log_debug_l4("Leaving...\n"); } /**************************************** diff -Naur clinkc/src/cybergarage/upnp/ssdp/cssdp_server_list.c clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_server_list.c --- clinkc/src/cybergarage/upnp/ssdp/cssdp_server_list.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_server_list.c 2014-01-29 13:54:26.418322405 +0800 @@ -87,6 +87,11 @@ cg_net_interfacelist_add(netIfList, netIf); #endif for (netIf = cg_net_interfacelist_gets(netIfList); netIf; netIf = cg_net_interface_next(netIf)) { +#ifdef ZYXEL_PATCH /*improve the performance, the upnp and tr64 are only need implement at LAN interface , ZyXEL 2013, charisse*/ + if(strstr(cg_net_interface_getname(netIf), "br") == NULL){ + continue; + } +#endif bindAddr = cg_net_interface_getaddress(netIf); if (cg_strlen(bindAddr) <= 0) continue; diff -Naur clinkc/src/cybergarage/upnp/ssdp/cssdp_socket.c clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_socket.c --- clinkc/src/cybergarage/upnp/ssdp/cssdp_socket.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/upnp/ssdp/cssdp_socket.c 2014-01-29 13:54:26.418322405 +0800 @@ -29,7 +29,7 @@ * cg_upnp_ssdp_socket_notify ****************************************/ -static BOOL cg_upnp_ssdp_socket_notify(CgUpnpSSDPSocket *ssdpSock, CgUpnpSSDPRequest *ssdpReq, char *ssdpAddr) +static BOOL cg_upnp_ssdp_socket_notify(CgUpnpSSDPSocket *ssdpSock, CgUpnpSSDPRequest *ssdpReq, char *ssdpAddr, char *bindAddr) { CgString *ssdpMsg; int sentLen; @@ -41,7 +41,7 @@ ssdpMsg = cg_string_new(); cg_upnp_ssdprequest_tostring(ssdpReq, ssdpMsg); - sentLen = cg_socket_sendto(ssdpSock, ssdpAddr, CG_UPNP_SSDP_PORT, cg_string_getvalue(ssdpMsg), cg_string_length(ssdpMsg)); + sentLen = cg_socket_sendto(ssdpSock, ssdpAddr, CG_UPNP_SSDP_PORT, cg_string_getvalue(ssdpMsg), cg_string_length(ssdpMsg), bindAddr); cg_string_delete(ssdpMsg); cg_log_debug_l4("Leaving...\n"); @@ -61,7 +61,7 @@ ssdpAddr = cg_upnp_ssdp_gethostaddress(bindAddr); cg_upnp_ssdprequest_sethost(ssdpReq, ssdpAddr, CG_UPNP_SSDP_PORT); - return cg_upnp_ssdp_socket_notify(ssdpSock, ssdpReq, ssdpAddr); + return cg_upnp_ssdp_socket_notify(ssdpSock, ssdpReq, ssdpAddr, bindAddr); cg_log_debug_l4("Leaving...\n"); } @@ -79,7 +79,7 @@ ssdpMsg = cg_string_new(); cg_upnp_ssdpresponse_tostring(ssdpRes, ssdpMsg); - postSuccess = cg_socket_sendto(ssdpSock, host, port, cg_string_getvalue(ssdpMsg), cg_string_length(ssdpMsg)); + postSuccess = cg_socket_sendto(ssdpSock, host, port, cg_string_getvalue(ssdpMsg), cg_string_length(ssdpMsg),NULL); cg_string_delete(ssdpMsg); cg_log_debug_l4("Leaving...\n"); diff -Naur clinkc/src/cybergarage/util/cthread.c clinkc_patch/src/cybergarage/util/cthread.c --- clinkc/src/cybergarage/util/cthread.c 2009-10-03 08:46:25.000000000 +0800 +++ clinkc_patch/src/cybergarage/util/cthread.c 2014-01-29 13:54:26.514322407 +0800 @@ -437,7 +437,7 @@ return TRUE; } } - cg_wait(CG_THREAD_MIN_SLEEP); + cg_wait(CG_THREAD_MIN_SLEEP); //original } // ok - if everything up to here failed #if defined DEBUG @@ -473,7 +473,9 @@ pthread_join(thread->pThread, NULL); cg_log_debug_s("Thread %p joined.\n", thread); */ /* Now we wait one second for thread termination instead of using pthread_join */ - cg_sleep(CG_THREAD_MIN_SLEEP); + + cg_sleep(CG_THREAD_MIN_SLEEP); //original + /* MODIFICATION END Fabrice Fontaine Orange 24/04/2007 */ #endif } diff -Naur clinkc/src/cybergarage/util/cthread_list.c clinkc_patch/src/cybergarage/util/cthread_list.c --- clinkc/src/cybergarage/util/cthread_list.c 2007-10-22 18:25:53.000000000 +0800 +++ clinkc_patch/src/cybergarage/util/cthread_list.c 2014-01-29 13:54:26.514322407 +0800 @@ -88,8 +88,21 @@ cg_log_debug_l4("Entering...\n"); - for (thread = cg_threadlist_gets(threadList); thread != NULL; thread = cg_thread_next(thread)) +#ifdef ZYXEL_PATCH /*fix the bug of thread list never end, ZyXEL 2012*/ + thread = cg_threadlist_gets(threadList); + while( thread != NULL ){ cg_thread_stop(thread); + if( thread == thread->next ){ + break; + } + thread = thread->next; + } +#else + for (thread = cg_threadlist_gets(threadList); thread != NULL; thread = cg_thread_next(thread)){ + printf("%s,thread", __func__); + cg_thread_stop(thread); + } +#endif return TRUE; diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpAction.h clinkc_patch/wrapper/objc/CyberLink/CGUpnpAction.h --- clinkc/wrapper/objc/CyberLink/CGUpnpAction.h 2008-08-21 11:06:32.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpAction.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,72 +0,0 @@ -// -// CGUpnpAction.h -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -#if !defined(_CG_UPNP_CACTION_H_) -typedef void CgUpnpAction; -#endif - -/** - * The CGUpnpAction class is a wrapper class for CgUpnpAction of CyberLink for C. - */ -@interface CGUpnpAction : NSObject -{ - CgUpnpAction *cObject; -} -@property(readonly) CgUpnpAction *cObject; -- (id)initWithCObject:(CgUpnpAction *)cobj; -/** - * Get the name of the action. - * - * @return The name. - */ -- (NSString *)name; -/** - * Get all arguments in the action as a NSDictionary object. - * - * @return NSDictionary of the arguments. - */ -- (NSDictionary *)arguments; -/** - * Set a value of the specified argument from the action by the argument's name directly. - * - * @param value The value to set - * @param name The name of the argument to look for - * @return YES if successfull; otherwise NO - */ -- (BOOL)setArgumentValue:(NSString *)value forName:(NSString *)name; -/** - * Get a value of the specified argument from the action by the argument's name directly. - * - * @param name The name of the argument to look for - * @return The target value if successfull; otherwise NULL - */ -- (NSString *)argumentValueForName:(NSString *)name; -/** - * Send action - * - * @return YES if successfull; otherwise NO - */ -- (BOOL)post; -/** - * Send action - * - * @param arguments Arguments to set - * - * @return YES if successfull; otherwise NO - */ -- (BOOL)postWithArguments:(NSDictionary *)arguments; -/** - * Get a states code of the last post. - * - * @return The status code - */ -- (NSInteger)statusCode; -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpAction.m clinkc_patch/wrapper/objc/CyberLink/CGUpnpAction.m --- clinkc/wrapper/objc/CyberLink/CGUpnpAction.m 2010-07-31 20:26:16.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpAction.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,139 +0,0 @@ -// -// CGUpnpAction.m -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#include -#include -#import "CGUpnpAction.h" - -static BOOL CGUpnpActionListener(CgUpnpAction *cAction) -{ - if (!cAction) - return FALSE; - CGUpnpAction *objcAction = (CGUpnpAction *)cg_upnp_action_getuserdata(cAction); - if (!objcAction) - return FALSE; - SEL actionReceived = @selector(actionReceived); - if (!actionReceived) - return FALSE; - if (![objcAction respondsToSelector: actionReceived]) - return FALSE; - [objcAction performSelector:actionReceived]; - return TRUE; -} - -@implementation CGUpnpAction - -@synthesize cObject; - -- (id) initWithCObject:(CgUpnpAction *)cobj -{ - if ((self = [super init]) == nil) - return nil; - cObject = cobj; - cg_upnp_action_setuserdata(cObject, self); - cg_upnp_action_setlistener(cObject, CGUpnpActionListener); - return self; -} - -- (id) init -{ - [self initWithCObject:NULL]; - return self; -} - -- (void) dealloc -{ - [super dealloc]; -} - -- (void) finalize -{ - [super finalize]; -} - -- (NSString *)name -{ - if (!cObject) - return nil; - return [[[NSString alloc] initWithUTF8String:cg_upnp_action_getname(cObject)] autorelease]; -} - -- (NSDictionary *)arguments -{ - if (!cObject) - return [NSDictionary dictionary]; - NSMutableDictionary *argDir = [NSMutableDictionary dictionary]; - CgUpnpArgument *carg; - for (carg = cg_upnp_action_getarguments(cObject); carg; carg = cg_upnp_argument_next(carg)) { - char *name = cg_upnp_argument_getname(carg); - char *value = cg_upnp_argument_getvalue(carg); - NSString *obj = [[NSString alloc] initWithUTF8String:(value ? value : "")]; - NSString *key = [[NSString alloc] initWithUTF8String:name]; - [argDir setObject:obj forKey:key]; - [obj release]; - [key release]; - } - return argDir; -} - -- (BOOL)setArgumentValue:(NSString *)value forName:(NSString *)name -{ - CgUpnpArgument *cArg; - - if (!cObject) - return NO; - cArg = cg_upnp_action_getargumentbyname(cObject, (char *)[name UTF8String]); - if (!cArg) - return NO; - cg_upnp_argument_setvalue(cArg, (char *)[value UTF8String]); - return YES; -} - -- (NSString *)argumentValueForName:(NSString *)name -{ - char *cValue; - CgUpnpArgument *cArg; - - if (!cObject) - return nil; - cArg = cg_upnp_action_getargumentbyname(cObject, (char *)[name UTF8String]); - if (!cArg) - return nil; - cValue = cg_upnp_argument_getvalue(cArg); - if (cg_strlen(cValue) <= 0) - return nil; - return [NSString stringWithUTF8String:cValue]; -} - -- (BOOL)post -{ - if (!cObject) - return NO; - BOOL ret = cg_upnp_action_post(cObject); - return ret; -} - -- (BOOL)postWithArguments:(NSDictionary *)arguments -{ - NSString *name; - - for (name in arguments) { - NSString *value = [arguments valueForKey:name]; - [self setArgumentValue:value forName:name]; - } - return [self post]; -} - -- (NSInteger)statusCode -{ - if (!cObject) - return 0; - return cg_upnp_action_getstatuscode(cObject); -} - -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpControlPoint.h clinkc_patch/wrapper/objc/CyberLink/CGUpnpControlPoint.h --- clinkc/wrapper/objc/CyberLink/CGUpnpControlPoint.h 2011-02-24 14:13:21.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpControlPoint.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,99 +0,0 @@ -// -// CGUpnpControlPoint.h -// CyberLink for C -// -// Created by Satoshi Konno on 08/03/14. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -#if !defined(_CG_UPNP_CCONTROLPOINT_H_) -typedef void CgUpnpControlPoint; -#endif - -@class CGUpnpDevice; -@class CGUpnpControlPoint; - -@protocol CGUpnpControlPointDelegate -@optional -- (void)controlPoint:(CGUpnpControlPoint *)controlPoint deviceAdded:(NSString *)deviceUdn; -- (void)controlPoint:(CGUpnpControlPoint *)controlPoint deviceUpdated:(NSString *)deviceUdn; -- (void)controlPoint:(CGUpnpControlPoint *)controlPoint deviceRemoved:(NSString *)deviceUdn; -- (void)controlPoint:(CGUpnpControlPoint *)controlPoint deviceInvalid:(NSString *)deviceUdn; -@end - -/** - * The CGUpnpControlPoint class is a wrapper class for CgUpnpControlPoint of CyberLink for C to - * program using only Objective-C directly on MacOSX. - * Currently, the only basic methods are wrapped to control UPnP devices. - */ -@interface CGUpnpControlPoint : NSObject -{ - CgUpnpControlPoint *cObject; -} -@property(readonly) CgUpnpControlPoint *cObject; -@property(assign) id delegate; -- (CgUpnpControlPoint *)cObject; -/** - * Activate some background threads of the control point such as SSDP and - * HTTP servers to listen messages and events of UPnP. You must call this - * method before you can actually use a control point. - * - * @return TRUE if successful; otherwise FALSE - * - */ -- (BOOL)start; -/** - * Stop some background threads of the control point such as SSDP and - * HTTP servers to listen messages and events of UPnP. - * - * @return TRUE if successful; otherwise FALSE - * - */ -- (BOOL)stop; -/** - * Check if the controll point is running. - * - * @return YES if the device is started normally, otherwise NO. - */ -- (BOOL)isRunning; -/** - * Send a M-SEARCH request to find for the all UPnP devices of UPnP in the network. - * The method waits for the specified MX time. Use setSsdpSearchMX:(NSInteger)aMX to change the time. - * The method is same as searchWithST() when the ST parameter is "ssdp:all". - */ -- (void)search; -/** - * Send a M-SEARCH request to find for the specified UPnP devices by a ST parameter in the network. - * The method waits for the specified MX time. Use setSsdpSearchMX:(NSInteger)aMX to change the time. - * - * @param aST The Search Target parameter (ex. "ssdp:all") - */ -- (void)searchWithST:(NSString *)aST; -/** - * Set a MX parameter used for SSDP searches in seconds. - * The parameter is used to wait for M-SEARCH responses in search() and searchWithST:(NSString *)aST. - * - * @param aMX Time to wait - */ -- (void)setSsdpSearchMX:(NSInteger)aMX; -/** - * Get a MX parameter used for SSDP searches in seconds. - * The parameter is used to wait for M-SEARCH responses in search() and searchWithST:(NSString *)aST. - * - * @return Time to wait - */ -- (NSInteger)ssdpSearchMX; -/** - * Get all UPnP devices which the control point found as a NSArray object. The array has the devices as instances of CGUpnpDevice. - * @return NSArray of CGUpnpDevice. - */ -- (NSArray *)devices; -/** - * Get a specified UPnP devices by the UDN. - * @return CGUpnpDevice when the specified device is found, otherwise nil. - */ -- (CGUpnpDevice *)deviceForUDN:(NSString *)udn; -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpControlPoint.m clinkc_patch/wrapper/objc/CyberLink/CGUpnpControlPoint.m --- clinkc/wrapper/objc/CyberLink/CGUpnpControlPoint.m 2011-02-24 14:13:21.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpControlPoint.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,173 +0,0 @@ -// -// CGUpnpControlPoint.m -// CyberLink for C -// -// Created by Satoshi Konno on 08/03/14. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#include -#include -#import "CGUpnpControlPoint.h" -#import "CGUpnpDevice.h" - -static void CGUpnpControlPointDeviceListener(CgUpnpControlPoint *ctrlPoint, char* udn, CgUpnpDeviceStatus status); - -@implementation CGUpnpControlPoint - -@synthesize cObject; -@synthesize delegate; - -- (id)init -{ - if ((self = [super init]) == nil) - return nil; - cObject = cg_upnp_controlpoint_new(); - if (cObject) { - cg_upnp_controlpoint_setdevicelistener(cObject, CGUpnpControlPointDeviceListener); - cg_upnp_controlpoint_setuserdata(cObject, self); - if (![self start]) - self = nil; - } - else - self = nil; - return self; -} - -- (void)dealloc -{ - if (cObject) - cg_upnp_controlpoint_delete(cObject); - [super dealloc]; -} - -- (void)finalize -{ - if (cObject) - cg_upnp_controlpoint_delete(cObject); - [super finalize]; -} - -- (BOOL)start -{ - if (!cObject) - return NO; - return cg_upnp_controlpoint_start(cObject); -} - -- (BOOL)stop -{ - if (!cObject) - return NO; - return cg_upnp_controlpoint_stop(cObject); -} - --(BOOL)isRunning -{ - if (!cObject) - return NO; - return cg_upnp_controlpoint_isrunning(cObject); -} - -- (void)search -{ - [self searchWithST:[NSString stringWithUTF8String:CG_UPNP_NT_ROOTDEVICE]]; -} - -- (void)searchWithST:(NSString *)aST -{ - if (!cObject) - return; - cg_upnp_controlpoint_search(cObject, (char *)[aST UTF8String]); - -#if defined(CG_UPNPCONTROLPOINT_ENABLE_SEARCH_SLEEP) - int mx = cg_upnp_controlpoint_getssdpsearchmx(cObject); - if (0 < mx) - cg_sleep((mx * 1000)); -#endif -} - -- (NSInteger)ssdpSearchMX -{ - if (!cObject) - return 0; - return cg_upnp_controlpoint_getssdpsearchmx(cObject); -} - -- (void)setSsdpSearchMX:(NSInteger)mx; -{ - if (!cObject) - return; - cg_upnp_controlpoint_setssdpsearchmx(cObject, (int)mx); -} - -- (NSArray *)devices -{ - if (!cObject) - return [[[NSArray alloc] init] autorelease]; - NSMutableArray *devArray = [[[NSMutableArray alloc] init] autorelease]; - CgUpnpDevice *cDevice; - for (cDevice = cg_upnp_controlpoint_getdevices(cObject); cDevice; cDevice = cg_upnp_device_next(cDevice)) { - CGUpnpDevice *device = [[[CGUpnpDevice alloc] initWithCObject:cDevice] autorelease]; - [devArray addObject:device]; - } - return devArray; -} - -- (CGUpnpDevice *)deviceForUDN:(NSString *)udn -{ - if (!cObject) - return nil; - CgUpnpDevice *cDevice; - for (cDevice = cg_upnp_controlpoint_getdevices(cObject); cDevice; cDevice = cg_upnp_device_next(cDevice)) { - if (cg_strcmp(cg_upnp_device_getudn(cDevice), (char *)[udn UTF8String]) == 0) - return [[[CGUpnpDevice alloc] initWithCObject:cDevice] autorelease]; - } - return nil; -} - -@end - -static void CGUpnpControlPointDeviceListener(CgUpnpControlPoint *cCtrlPoint, char* udn, CgUpnpDeviceStatus status) -{ - CGUpnpControlPoint *ctrlPoint = cg_upnp_controlpoint_getuserdata(cCtrlPoint); - if (ctrlPoint == nil) - return; - - if ([ctrlPoint delegate] == nil) - return; - - NSString *deviceUdn = [[NSString alloc ] initWithUTF8String:udn]; - - switch (status) { - case CgUpnpDeviceStatusAdded: - { - if ([[ctrlPoint delegate] respondsToSelector:@selector(controlPoint:deviceAdded:)]) - [[ctrlPoint delegate] controlPoint:ctrlPoint deviceAdded:deviceUdn]; - } - break; - case CgUpnpDeviceStatusUpdated: - { - if ([[ctrlPoint delegate] respondsToSelector:@selector(controlPoint:deviceUpdated:)]) - [[ctrlPoint delegate] controlPoint:ctrlPoint deviceUpdated:deviceUdn]; - } - break; - case CgUpnpDeviceStatusRemoved: - { - if ([[ctrlPoint delegate] respondsToSelector:@selector(controlPoint:deviceRemoved:)]) - [[ctrlPoint delegate] controlPoint:ctrlPoint deviceRemoved:deviceUdn]; - } - break; - case CgUpnpDeviceStatusInvalid: - { - if ([[ctrlPoint delegate] respondsToSelector:@selector(controlPoint:deviceInvalid:)]) - [[ctrlPoint delegate] controlPoint:ctrlPoint deviceInvalid:deviceUdn]; - } - break; - default: - break; - } - - [deviceUdn release]; -} - diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpDevice.h clinkc_patch/wrapper/objc/CyberLink/CGUpnpDevice.h --- clinkc/wrapper/objc/CyberLink/CGUpnpDevice.h 2011-02-23 22:15:34.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpDevice.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,259 +0,0 @@ -// -// CGUpnpDevice.h -// CyberLink for C -// -// Created by Satoshi Konno on 08/03/14. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -#if !defined(_CG_UPNP_CDEVICE_H_) -typedef void CgUpnpDevice; -#endif - -@class CGUpnpDevice; -@class CGUpnpService; -@class CGUpnpAction; -@class CGUpnpIcon; - -/** - * The CGUpnpDevice class is a wrapper class for CgUpnpDevice of CyberLink for C. - */ -@protocol CGUpnpDeviceDelegate -@optional -- (BOOL)device:(CGUpnpDevice *)device service:(CGUpnpService *)service actionReceived:(CGUpnpAction *)action; -@end - -/** - * The CGUpnpDevice class is a wrapper class for CgUpnpDevice of CyberLink for C. - */ -@interface CGUpnpDevice : NSObject -{ - BOOL isCObjectCreated; -} -@property(assign) CgUpnpDevice *cObject; -@property(assign) id delegate; -/** - * Create a new UPnP device. - * - * @return New instance if successfull; otherwise nil. - */ -- (id) init; -/** - * Create a new UPnP device with the C instance. - * - * @return New instance if successfull; otherwise nil. - */ -- (id) initWithCObject:(CgUpnpDevice *)cobj; -/** - * Create a new UPnP device with the XML descriptioin. - * - * @return New instance if successfull; otherwise nil. - */ -- (id) initWithXMLDescription:(NSString *)xmlDesc; -/** - * Parse the specified XML description. - * - * @return YES if successfull; otherwise nui. - */ -- (BOOL) parseXMLDescription:(NSString *)xmlDesc; -/** - * Get the friendly name of the device. - * - * @return Friendly name. - */ -- (NSString *)friendlyName; -/** - * Get the device type of the device. - * - * @return Device Type. - */ -- (NSString *)deviceType; -/** - * Get the UDN of the device. - * - * @return UDN of the specified device. - */ -- (NSString *)udn; -/** - * Return a manufacture. - * - * @return Manufacture of the device. - */ -- (NSString *)manufacturer; - -/** - * Return a model number. - * - * @return Model number of the device. - */ -- (NSString *)modelNumber; - -/** - * Return a model name. - * - * @return Model name of the device. - */ -- (NSString *)modelName; - -/** - * Return a urlBase - * - * @return URLBase of the device. - */ -- (NSString *)urlBase; -/** - * Return a descrition URL - * - * @return Descripton URL of the device. - */ -- (NSString *)descriptionURL; -/** - * Return a location URL - * - * @return Location URL of the device. - */ -- (NSString *)locationURL; -/** - * Set a device type of the device. - * - * @param aType Device type to set. - */ --(void)setDeviceType:(NSString *)aType; -/** - * Set a friendly name of the device. - * - * @param aName Friendly name to set. - */ --(void)setFriendlyName:(NSString *)aName; -/** - * Set a udn of the device. - * - * @param aUdn UDN to set. - */ --(void)setUdn:(NSString *)aUdn; -/** - * Check whether the device type is the specified type. - * - * @param aType A type string of the device. - * - * @return YES if the specified type is same as the device type; otherwise NO. - */ -- (BOOL)isDeviceType:(NSString *)aType; -/** - * Check whether the device's UDN is the specified UDN. - * - * @param aUDN A UDN string of the device. - * - * @return YES if the specified UDN is same as the device' UDN; otherwise NO. - */ -- (BOOL)isUDN:(NSString *)aUDN; -/** - * Check whether the device's friendly name is the specified name. - * - * @param aFriendlyName A friendly name string of the device. - * - * @return YES if the specified friendly name is same as the device' friendly name; otherwise NO. - */ -- (BOOL)isFriendlyName:(NSString *)aFriendlyName; -/** - * Return a presentationURL - * - * @return presentationURL of the device. - */ -- (NSString *)presentationURL; -/** - * Get all services in the device as a NSArray object. The array has the services as instances of CGUpnpService. - * - * @return NSArray of CGUpnpService. - */ -- (NSArray *)services; -/** - * Get a service in the device by the specified service ID. - * - * @param serviceId A service ID string of the service. - * - * @return The CGUpnpService if the specified service is found; otherwise nil. - */ -- (CGUpnpService *)getServiceForID:(NSString *)serviceId; -/** - * Get a service in the device by the specified service type. - * - * @param serviceType A service type string of the service. - * - * @return The CGUpnpService if the specified service is found; otherwise nil. - */ -- (CGUpnpService *)getServiceForType:(NSString *)serviceType; -/** - * Get all icons in the device as a NSArray object. The array has the services as instances of CGUpnpIconIcon. - * - * @return NSArray of CGUpnpIcon. - */ -- (NSArray *)icons; -/** - * Start the device. - * - * @return YES if the device is started normally, otherwise NO. - */ -- (BOOL)start; -/** - * Stop the device. - * - * @return YES if the device is started normally, otherwise NO. - */ -- (BOOL)stop; -/** - * Check if the controll point is running. - * - * @return YES if the device is started normally, otherwise NO. - */ -- (BOOL)isRunning; -/** - * Announce the device. - * - * @return YES if the device is started normally, otherwise NO. - */ -- (BOOL)announce; -/** - * Set a user data. - * - * @param aUserData A user data to set. - * - * @return The CGUpnpService if the specified service is found; otherwise nil. - */ -- (void)setUserData:(void *)aUserData; -/** - * Get a stored user data. - * - * @return A stored user data. - */ -- (void *)userData; -/** - * Return a IP address. - * - * @return IP address of the device. - */ -- (NSString *)ipaddress; -/** - * Return a most smallest icon. - * - * @return Smallest Icon. - */ -- (CGUpnpIcon *)smallestIcon; -/** - * Return a most smallest icon with a specified mime type. - * - * @return Smallest Icon. - */ -- (CGUpnpIcon *)smallestIconWithMimeType:(NSString *)mimeType; -/** - * Return a absolute url of the specified icon. - * - * @param anIcon Icon. - * - * @return Absolute url of the specified icon. - */ -- (NSString *)absoluteIconUrl:(CGUpnpIcon *)anIcon; -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpDevice.m clinkc_patch/wrapper/objc/CyberLink/CGUpnpDevice.m --- clinkc/wrapper/objc/CyberLink/CGUpnpDevice.m 2011-08-10 20:55:38.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpDevice.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,409 +0,0 @@ -// -// CGUpnpDevice.m -// CyberLink for C -// -// Created by Satoshi Konno on 08/03/14. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#include -#include -#include - -#import "CGUpnpDevice.h" -#import "CGUpnpService.h" -#import "CGUpnpAction.h" -#import "CGUpnpIcon.h" - -static BOOL CGUpnpDeviceActionListener(CgUpnpAction *action); - -@implementation CGUpnpDevice - -@synthesize cObject; -@synthesize delegate; - -- (id) init -{ - if ((self = [super init]) == nil) - return nil; - cObject = cg_upnp_device_new(); - if (!cObject) - return nil; - isCObjectCreated = YES; - cg_upnp_device_setuserdata(cObject, self); - cg_upnp_device_setactionlistener(cObject, CGUpnpDeviceActionListener); - return self; -} - -- (id) initWithCObject:(CgUpnpDevice *)cobj -{ - if ((self = [super init]) == nil) - return nil; - cObject = cobj; - isCObjectCreated = NO; - return self; -} - -- (id) initWithXMLDescription:(NSString *)xmlDesc -{ - if ((self = [self init]) == nil) - return nil; - if (!cObject) - return nil; - if (![self parseXMLDescription:xmlDesc]) { - cg_upnp_device_delete(cObject); - return nil; - } - return self; -} - -- (BOOL) parseXMLDescription:(NSString *)xmlDesc; -{ - if (!cObject) - return NO; - return cg_upnp_device_parsedescription(cObject, (char *)[xmlDesc UTF8String], [xmlDesc length]); -} - -- (void) dealloc -{ - if (isCObjectCreated && cObject) { - cg_upnp_device_delete(cObject); - cObject = NULL; - } - [super dealloc]; -} - -- (void) finalize -{ - if (isCObjectCreated && cObject) { - cg_upnp_device_delete(cObject); - cObject = NULL; - } - [super finalize]; -} - -- (NSString *)friendlyName -{ - if (!cObject) - return nil; - const char* name = cg_upnp_device_getfriendlyname(cObject); - if (name) { - return [NSString stringWithUTF8String:name]; - } - return nil; -} - -- (NSString *)deviceType -{ - if (!cObject) - return nil; - const char* device_type_cstring = cg_upnp_device_getdevicetype(cObject); - if (device_type_cstring) - { - return [NSString stringWithUTF8String:device_type_cstring]; - } - return nil; -} - -- (NSString *)udn -{ - if (!cObject) - return nil; - const char* udn_cstring = cg_upnp_device_getudn(cObject); - if (udn_cstring) - { - return [NSString stringWithUTF8String:udn_cstring]; - } - return nil; -} - -- (NSString *)manufacturer -{ - if (!cObject) - return nil; - const char* manufacturer_cstring = cg_upnp_device_getmanufacturer(cObject); - if (manufacturer_cstring) - { - return [NSString stringWithUTF8String:manufacturer_cstring]; - } - return nil; -} - -- (NSString *)modelNumber -{ - if (!cObject) - return nil; - const char* model_number_cstring = cg_upnp_device_getmodelnumber(cObject); - if (model_number_cstring) - { - return [NSString stringWithUTF8String:model_number_cstring]; - } - return nil; -} - -- (NSString *)modelName -{ - if (!cObject) - return nil; - const char* model_name_cstring = cg_upnp_device_getmodelname(cObject); - if (model_name_cstring) - { - return [NSString stringWithUTF8String:model_name_cstring]; - } - return nil; -} - -- (NSString *)urlBase -{ - if (!cObject) - return nil; - const char *cUrlBase = cg_upnp_device_geturlbase(cObject); - if (!cUrlBase) - return [NSString string]; - return [[[NSString alloc] initWithUTF8String:cUrlBase] autorelease]; -} - -- (NSString *)descriptionURL; -{ - if (!cObject) - return nil; - const char *cDescrUrl = cg_upnp_device_getdescriptionuri(cObject); - if (!cDescrUrl) - return [NSString string]; - return [[[NSString alloc] initWithUTF8String:cDescrUrl] autorelease]; -} - -- (NSString *)locationURL; -{ - if (!cObject) - return nil; - const char *cLocationUrl = cg_upnp_device_getlocationfromssdppacket(cObject); - if (!cLocationUrl) - return [NSString string]; - return [[[NSString alloc] initWithUTF8String:cLocationUrl] autorelease]; -} - -- (NSString *)presentationURL; -{ - if (!cObject) - return nil; - const char *cPresentatilnURL = cg_upnp_device_getpresentationurl(cObject); - if (!cPresentatilnURL) - return [NSString string]; - return [[[NSString alloc] initWithUTF8String:cPresentatilnURL] autorelease]; -} - --(void)setDeviceType:(NSString *)aType -{ - if (!cObject) - return; - cg_upnp_device_setdevicetype(cObject, (char *)[aType UTF8String]); -} - --(void)setFriendlyName:(NSString *)aName -{ - if (!cObject) - return; - cg_upnp_device_setfriendlyname(cObject, (char *)[aName UTF8String]); -} - --(void)setUdn:(NSString *)aUdn -{ - if (!cObject) - return; - cg_upnp_device_setudn(cObject, (char *)[aUdn UTF8String]); -} - -- (BOOL)isDeviceType:(NSString *)aType -{ - return [aType isEqualToString:[self deviceType]]; -} - -- (BOOL)isUDN:(NSString *)aUDN -{ - return [aUDN isEqualToString:[self udn]]; -} - -- (BOOL)isFriendlyName:(NSString *)aFriendlyName -{ - return [aFriendlyName isEqualToString:[self friendlyName]]; -} - -- (NSArray *)services -{ - if (!cObject) - return [[[NSArray alloc] init] autorelease]; - NSMutableArray *serviceArray = [[[NSMutableArray alloc] init] autorelease]; - CgUpnpService *cService; - for (cService = cg_upnp_device_getservices(cObject); cService; cService = cg_upnp_service_next(cService)) { - CGUpnpService *service = [[[CGUpnpService alloc] initWithCObject:(void *)cService] autorelease]; - [serviceArray addObject:service]; - } - return serviceArray; -} - -- (CGUpnpService *)getServiceForID:(NSString *)serviceId -{ - if (!cObject) - return nil; - CgUpnpService *foundService = cg_upnp_device_getservicebyserviceid(cObject, (char *)[serviceId UTF8String]); - if (!foundService) - return nil; - return [[[CGUpnpService alloc] initWithCObject:(void *)foundService] autorelease]; -} - -- (CGUpnpService *)getServiceForType:(NSString *)serviceType -{ - if (!cObject) - return nil; - CgUpnpService *foundService = cg_upnp_device_getservicebytype(cObject, (char *)[serviceType UTF8String]); - if (!foundService) - return nil; - return [[[CGUpnpService alloc] initWithCObject:(void *)foundService] autorelease]; -} - -- (NSArray *)icons -{ - if (!cObject) - return [[[NSArray alloc] init] autorelease]; - NSMutableArray *iconArray = [[[NSMutableArray alloc] init] autorelease]; - CgUpnpIcon *cIcon; - for (cIcon = cg_upnp_device_geticons(cObject); cIcon; cIcon = cg_upnp_icon_next(cIcon)) { - CGUpnpIcon *icon = [[CGUpnpIcon alloc] initWithCObject:(void *)cIcon]; - [iconArray addObject:icon]; - [icon release]; - } - return iconArray; -} - --(BOOL)start -{ - if (!cObject) - return NO; - return cg_upnp_device_start(cObject); -} - --(BOOL)stop -{ - if (!cObject) - return NO; - return cg_upnp_device_stop(cObject); -} - --(BOOL)isRunning -{ - if (!cObject) - return NO; - return cg_upnp_device_isrunning(cObject); -} - -/** - * Announce the device. - * - * @return YES if the device is started normally, otherwise NO. - */ -- (BOOL)announce; -{ - if (!cObject) - return NO; - cg_upnp_device_announce(cObject); - return TRUE; -} - -- (void)setUserData:(void *)aUserData -{ - if (!cObject) - return; - cg_upnp_device_setuserdata(cObject, aUserData); -} - -- (void *)userData -{ - if (!cObject) - return NULL; - return cg_upnp_device_getuserdata(cObject); -} - -- (NSString *)ipaddress -{ - if (!cObject) - return nil; - - NSString *ipaddr = nil; - - char *location_str = cg_upnp_device_getlocationfromssdppacket(cObject); - if (0 < cg_strlen(location_str)) { - CgNetURL *url = cg_net_url_new(); - cg_net_url_set(url, location_str); - ipaddr = [[[NSString alloc] initWithUTF8String:cg_net_url_gethost(url)] autorelease]; - cg_net_url_delete(url); - } - - return ipaddr; -} - -- (CGUpnpIcon *)smallestIcon -{ - if (!cObject) - return nil; - CgUpnpIcon *cIcon = cg_upnp_device_getsmallesticon(cObject); - if (!cIcon) - return nil; - return [[[CGUpnpIcon alloc] initWithCObject:(void *)cIcon] autorelease]; -} - -- (CGUpnpIcon *)smallestIconWithMimeType:(NSString *)mimeType; -{ - if (!cObject) - return nil; - CgUpnpIcon *cIcon = cg_upnp_device_getsmallesticonbymimetype(cObject, (char *)[mimeType UTF8String]); - if (!cIcon) - return nil; - return [[[CGUpnpIcon alloc] initWithCObject:(void *)cIcon] autorelease]; -} - -- (NSString *)absoluteIconUrl:(CGUpnpIcon *)anIcon -{ - if (!cObject) - return nil; - CgString *url = cg_string_new(); - if (!cg_upnp_device_getabsoluteiconurl(cObject, [anIcon cObject], url)) { - cg_string_delete(url); - return nil; - } - NSString *urlStr = [NSString stringWithUTF8String:cg_string_getvalue(url)]; - cg_string_delete(url); - return urlStr; -} - -@end - -static BOOL CGUpnpDeviceActionListener(CgUpnpAction *cUpnpAction) -{ - if (!cUpnpAction) - return NO; - - CgUpnpService *cUpnpService = cg_upnp_action_getservice(cUpnpAction); - if (!cUpnpService) - return NO; - - CgUpnpDevice *cUpnpDevice = cg_upnp_service_getdevice(cUpnpService); - if (!cUpnpDevice) - return NO; - - CGUpnpDevice *upnpDevice = cg_upnp_device_getuserdata(cUpnpDevice); - if (upnpDevice == nil) - return NO; - - if ([[upnpDevice delegate] respondsToSelector:@selector(device:service:actionReceived:)]) { - CGUpnpService *upnpService = [[CGUpnpService alloc] initWithCObject:(void *)cUpnpService]; - CGUpnpAction *upnpAction = [[CGUpnpAction alloc] initWithCObject:(void *)upnpAction]; - BOOL doActionResult = [[upnpDevice delegate] device:upnpDevice service:upnpService actionReceived:upnpAction]; - [upnpAction release]; - [upnpService release]; - return doActionResult; - } - - return YES; -} - diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpIcon.h clinkc_patch/wrapper/objc/CyberLink/CGUpnpIcon.h --- clinkc/wrapper/objc/CyberLink/CGUpnpIcon.h 2008-12-02 01:00:15.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpIcon.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,59 +0,0 @@ -// -// CGUpnpIcon.h -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -#if !defined(_CG_UPNP_CICON_H_) -typedef void CgUpnpIcon; -#endif - -/** - * The CGUpnpIcon class is a wrapper class for CgUpnpIcon of CyberLink for C. - */ -@interface CGUpnpIcon : NSObject -{ - CgUpnpIcon *cObject; -#if defined(TARGET_OS_IPHONE) - NSString *resourceName; -#endif -} -@property(readonly) CgUpnpIcon *cObject; -#if defined(TARGET_OS_IPHONE) -@property(readonly) NSString *resourceName; -#endif -- (id)initWithCObject:(CgUpnpIcon *)cobj; -/** - * Get the url of the icon. - * - * @return The url. - */ -- (NSString *)url; -/** - * Get the url of the width. - * - * @return The width. - */ -- (NSInteger)width; -/** - * Get the height of the icon. - * - * @return The height. - */ -- (NSInteger)height; -/** - * Get the depth of the icon. - * - * @return The depth. - */ -- (NSInteger)depth; -#if defined(TARGET_OS_IPHONE) -- (void)setResourceName:(NSString *) aResourceName; -#endif -@end - diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpIcon.m clinkc_patch/wrapper/objc/CyberLink/CGUpnpIcon.m --- clinkc/wrapper/objc/CyberLink/CGUpnpIcon.m 2011-08-10 07:07:21.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpIcon.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,89 +0,0 @@ -// -// CGUpnpIcon.m -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#include -#import "CGUpnpIcon.h" - -@implementation CGUpnpIcon - -@synthesize cObject; -#if defined(TARGET_OS_IPHONE) -@synthesize resourceName; -#endif - -- (id) initWithCObject:(CgUpnpIcon *)cobj -{ - if ((self = [super init]) == nil) - return nil; - cObject = cobj; - return self; -} - -- (id) init -{ - if ((self = [self initWithCObject:NULL]) == nil) - return nil; - return self; -} - -- (void) dealloc -{ - self.resourceName = nil; - - [super dealloc]; -} - -- (void) finalize -{ - [super finalize]; -} - -- (NSString *)url -{ - if (!cObject) - return nil; - return [[[NSString alloc] initWithUTF8String:cg_upnp_icon_geturl(cObject)] autorelease]; -} - -- (NSString *)mimeType -{ - if (!cObject) - return nil; - return [[[NSString alloc] initWithUTF8String:cg_upnp_icon_getmimetype(cObject)] autorelease]; -} - -- (NSInteger)width -{ - if (!cObject) - return 0; - return cg_upnp_icon_getwidth(cObject); -} - -- (NSInteger)height -{ - if (!cObject) - return 0; - return cg_upnp_icon_getheight(cObject); -} - -- (NSInteger)depth -{ - if (!cObject) - return 0; - return cg_upnp_icon_getdepth(cObject); -} - -#if defined(TARGET_OS_IPHONE) -- (void)setResourceName:(NSString *) aResourceName -{ - //UIImage *image = [UIImage imageNamed:aResourceName]; - //CGSize imageSize = CGSizeMake(CGImageGetWidth([image CGImage]), CGImageGetHeight([image CGImage])); -} -#endif - -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpService.h clinkc_patch/wrapper/objc/CyberLink/CGUpnpService.h --- clinkc/wrapper/objc/CyberLink/CGUpnpService.h 2010-08-17 20:12:25.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpService.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,89 +0,0 @@ -// -// CGUpnpService.h -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import - -#if !defined(_CG_UPNP_CSERVICE_H_) -typedef void CgUpnpService; -#endif - -@class CGUpnpAction; -@class CGUpnpStateVariable; - -/** - * The CGUpnpService class is a wrapper class for CgUpnpService of CyberLink for C. - */ -@interface CGUpnpService : NSObject -{ - CgUpnpService *cObject; -} -@property(readonly) CgUpnpService *cObject; -/** - * Create a new UPnP service with the C instance. - * - * @return New instance if successfull; otherwise nil. - */ -- (id) initWithCObject:(CgUpnpService *)cobj; -/** - * Parse the specified XML description. - * - * @return YES if successfull; otherwise nui. - */ -- (BOOL) parseXMLDescription:(NSString *)xmlDesc; -/** - * Get the service ID of the service. - * - * @return The service ID. - */ -- (NSString *)serviceId; -/** - * Get the service type of the service. - * - * @return The service type. - */ -- (NSString *)serviceType; -/** - * Get all actions in the service as a NSArray object. The array has the actions as instances of CGUpnpAction. - * - * @return NSArray of CGUpnpAction. - */ -- (NSArray *)actions; -/** - * Get all state variables in the service as a NSArray object. The array has the state variables as instances of CGUpnpStateVariable. - * - * @return NSArray of CGUpnpStateVariable. - */ -- (NSArray *)stateVariables; -/** - * Get a action in the service by the specified name. - * - * @param name A name string of the action. - * - * @return The CGUpnpAction if the specified action is found; otherwise nil. - */ -- (CGUpnpAction *)getActionForName:(NSString *)name; -/** - * Get a state variables in the service by the specified name. - * - * @param name A name string of the state variable. - * - * @return The CGUpnpStateVariable if the specified state variable is found; otherwise nil. - */ -- (CGUpnpStateVariable *)getStateVariableForName:(NSString *)name; - -/** - * Checks whether state variable is implemented - * - * @param name A name string of the state variable. - * - * @return YES if implemented - */ -- (BOOL)isStateVariableImpemented:(NSString*)name; - -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpService.m clinkc_patch/wrapper/objc/CyberLink/CGUpnpService.m --- clinkc/wrapper/objc/CyberLink/CGUpnpService.m 2010-08-17 20:12:25.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpService.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,124 +0,0 @@ -// -// CGUpnpService.m -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#include -#include -#include -#import "CGUpnpService.h" -#import "CGUpnpAction.h" -#import "CGUpnpStateVariable.h" - -@implementation CGUpnpService - -@synthesize cObject; - -- (id) initWithCObject:(CgUpnpService *)cobj -{ - if ((self = [super init]) == nil) - return nil; - cObject = cobj; - cg_upnp_service_setuserdata(cObject, self); - return self; -} - -- (id) init -{ - [self initWithCObject:NULL]; - return self; -} - -- (void) dealloc -{ - [super dealloc]; -} - -- (void) finalize -{ - [super finalize]; -} - -- (BOOL) parseXMLDescription:(NSString *)xmlDesc; -{ - if (!cObject) - return NO; - return cg_upnp_service_parsedescription(cObject, (char *)[xmlDesc UTF8String], [xmlDesc length]); -} - -- (NSString *)serviceId -{ - if (!cObject) - return nil; - return [[[NSString alloc] initWithUTF8String:cg_upnp_service_getserviceid(cObject)] autorelease]; -} - -- (NSString *)serviceType -{ - if (!cObject) - return nil; - return [[[NSString alloc] initWithUTF8String:cg_upnp_service_getservicetype(cObject)] autorelease]; -} - -- (NSArray *)actions -{ - if (!cObject) - return [[[NSArray alloc] init] autorelease]; - NSMutableArray *actionArray = [[[NSMutableArray alloc] init] autorelease]; - CgUpnpAction *cAction; - for (cAction = cg_upnp_service_getactions(cObject); cAction; cAction = cg_upnp_action_next(cAction)) { - CGUpnpAction *action = [[[CGUpnpAction alloc] initWithCObject:(void *)cAction] autorelease]; - [actionArray addObject:action]; - } - return actionArray; -} - -- (NSArray *)stateVariables -{ - if (!cObject) - return [[[NSArray alloc] init] autorelease]; - NSMutableArray *statVarArray = [[[NSMutableArray alloc] init] autorelease]; - CgUpnpStateVariable *cStatVar; - for (cStatVar = cg_upnp_service_getstatevariables(cObject); cStatVar; cStatVar = cg_upnp_statevariable_next(cStatVar)) { - CGUpnpStateVariable *statVar = [[[CGUpnpStateVariable alloc] initWithCObject:(void *)cStatVar] autorelease]; - [statVarArray addObject:statVar]; - } - return statVarArray; -} - -- (CGUpnpAction *)getActionForName:(NSString *)name -{ - if (!cObject) - return nil; - CgUpnpAction *cAction = cg_upnp_service_getactionbyname(cObject, (char *)[name UTF8String]); - if (!cAction) - return nil; - return [[[CGUpnpAction alloc] initWithCObject:(void *)cAction] autorelease]; -} - -- (CGUpnpStateVariable *)getStateVariableForName:(NSString *)name -{ - if (!cObject) - return nil; - CgUpnpStateVariable *cStatVar = cg_upnp_service_getstatevariablebyname(cObject, (char *)[name UTF8String]); - if (!cStatVar) - return nil; - return [[[CGUpnpStateVariable alloc] initWithCObject:(void *)cStatVar] autorelease]; -} - -- (BOOL)isStateVariableImpemented:(NSString*)name; -{ - CGUpnpStateVariable* stateVariable = [self getStateVariableForName:name]; - - if (stateVariable) - { - return (![stateVariable isAllowedValue:@"NOT_IMPLEMENTED"]); - } - - return NO; -} - -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpStateVariable.h clinkc_patch/wrapper/objc/CyberLink/CGUpnpStateVariable.h --- clinkc/wrapper/objc/CyberLink/CGUpnpStateVariable.h 2010-08-17 20:12:25.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpStateVariable.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,66 +0,0 @@ -// -// CGUpnpStateVariable.h -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/12. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import - -#if !defined(_CG_UPNP_CSTATEVARIABLE_H_) -typedef void CgUpnpStateVariable; -#endif - -/** - * The CGUpnpStateVariable class is a wrapper class for CgUpnpStateVariable of CyberLink for C. - */ -@interface CGUpnpStateVariable : NSObject -{ - CgUpnpStateVariable *cObject; -} -@property(readonly) CgUpnpStateVariable *cObject; -- (id)initWithCObject:(CgUpnpStateVariable *)cobj; -/** - * Get the name of the state variable. - * - * @return The name. - */ -- (NSString *)name; -/** - * Get the value of the state variable. - * - * @return The value. - */ -- (NSString *)value; - -/** - * Get an array of the allowed values for the state variable - * - * @return The array. - */ -- (NSArray *)allowedValues; - -/** - * Checks whether value is allowed for this state variable - * - * @param value to be checked - * - * @return YES if true - */ -- (BOOL)isAllowedValue:(NSString*)value; - - -/** - * Send query - * - * @return YES if successfull; otherwise NO - */ -- (BOOL)query; -/** - * Get a states code of the last query. - * - * @return The status code - */ -- (NSInteger)statusCode; -@end diff -Naur clinkc/wrapper/objc/CyberLink/CGUpnpStateVariable.m clinkc_patch/wrapper/objc/CyberLink/CGUpnpStateVariable.m --- clinkc/wrapper/objc/CyberLink/CGUpnpStateVariable.m 2010-08-17 20:12:25.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/CGUpnpStateVariable.m 1970-01-01 08:00:00.000000000 +0800 @@ -1,92 +0,0 @@ -// -// CGUpnpStateVariable.m -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/28. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#include -#include -#import "CGUpnpStateVariable.h" - -@implementation CGUpnpStateVariable - -@synthesize cObject; - -- (id) initWithCObject:(CgUpnpStateVariable *)cobj -{ - if ((self = [super init]) == nil) - return nil; - cObject = cobj; - cg_upnp_statevariable_setuserdata(cObject, self); - return self; -} - -- (id) init -{ - [self initWithCObject:NULL]; - return self; -} - -- (void) dealloc -{ - [super dealloc]; -} - -- (void) finalize -{ - [super finalize]; -} - -- (NSString *)name -{ - if (!cObject) - return nil; - return [[[NSString alloc] initWithUTF8String:cg_upnp_statevariable_getname(cObject)] autorelease]; -} - -- (NSString *)value -{ - if (!cObject) - return nil; - return [[[NSString alloc] initWithUTF8String:cg_upnp_statevariable_getvalue(cObject)] autorelease]; -} - -- (NSArray *)allowedValues -{ - if (!cObject) - return [[[NSArray alloc] init] autorelease]; - NSMutableArray *valuesArray = [[[NSMutableArray alloc] init] autorelease]; - - CgUpnpAllowedValue *cAllowedValue; - for (cAllowedValue = cg_upnp_statevariable_getallowedvaluelist(cObject); cAllowedValue; cAllowedValue = (CgUpnpAllowedValue*)cg_list_next((CgList*)cAllowedValue)) { - NSString *value = [[[NSString alloc] initWithUTF8String:cg_string_getvalue(cAllowedValue->value)] autorelease]; - [valuesArray addObject:value]; - } - return valuesArray; -} - -- (BOOL)isAllowedValue:(NSString*)value -{ - return cg_upnp_statevariable_is_allowed_value(cObject, [value UTF8String]); -} - - - - -- (BOOL)query -{ - if (!cObject) - return NO; - return cg_upnp_statevariable_post(cObject); -} - -- (NSInteger)statusCode -{ - if (!cObject) - return 0; - return cg_upnp_statevariable_getstatuscode(cObject); -} - -@end diff -Naur clinkc/wrapper/objc/CyberLink/UPnP.h clinkc_patch/wrapper/objc/CyberLink/UPnP.h --- clinkc/wrapper/objc/CyberLink/UPnP.h 2010-08-20 01:40:21.000000000 +0800 +++ clinkc_patch/wrapper/objc/CyberLink/UPnP.h 1970-01-01 08:00:00.000000000 +0800 @@ -1,14 +0,0 @@ -// -// UPnP.h -// CyberLink for C -// -// Created by Satoshi Konno on 08/05/08. -// Copyright 2008 Satoshi Konno. All rights reserved. -// - -#import -#import -#import -#import -#import -#import diff -Naur clinkc/ztest_https/cert/cserver.org.crt clinkc_patch/ztest_https/cert/cserver.org.crt --- clinkc/ztest_https/cert/cserver.org.crt 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/ztest_https/cert/cserver.org.crt 2014-01-29 13:54:26.750322413 +0800 @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDrDCCApSgAwIBAgIJAPYqC1fZz8c5MA0GCSqGSIb3DQEBBQUAMIGAMQswCQYD +VQQGEwJUVzEPMA0GA1UECBMGVGFpd2FuMQ8wDQYDVQQHEwZUYWlwZWkxDjAMBgNV +BAoTBVp5WEVMMQ4wDAYDVQQLEwVaeVhFTDENMAsGA1UEAxMEY29yZTEgMB4GCSqG +SIb3DQEJARYRY29yZUB6eXhlbC5jb20udHcwHhcNMTMwMTEwMDE0NTA0WhcNMjMw +MTA4MDE0NTA0WjCBjTELMAkGA1UEBhMCVFcxDzANBgNVBAgTBlRhaXdhbjEPMA0G +A1UEBxMGVGFpcGVuMQ8wDQYDVQQKEwZaeVhFTHMxDDAKBgNVBAsTA0NUczERMA8G +A1UEAxMIY2hhcmlzc2UxKjAoBgkqhkiG9w0BCQEWG2NoYXJpc3NlLmNodW5nQHp5 +eGVsLmNvbS50dzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKKU9VT2 +oOuiyRXVI/wC9FJOxPCM5r+eeyscWCe6MnDVG8kHZT0y9tAxht3kZD7l2gPK24L6 +dC1mcJY9tzHwg3zzxTFFmlKfPcsAD0aXxq+s7+RXow1yrZ8lalMEOLls6dW9aj+I +tEE0CtsZpGgp2SiVWKqgPI+wQINxpGvsJSE8yMOD4WCNZkoVcLpFO+wn30v4ySts +tjmCobmppgdE2YiaMo1R3o/fhGWISzwxK4IKRoi+7otvVb9Tazb+Q+xHPU+7syIF +ZH/9/CR5Mwb46SzaSjCYuHedeeO9omWFnFeQlHPTHhQPZFHE3I15c29f7NEKpe2b +kWv3S1+EO7jz67MCAwEAAaMaMBgwCQYDVR0TBAIwADALBgNVHQ8EBAMCBeAwDQYJ +KoZIhvcNAQEFBQADggEBAF3q5wDDgpe+t5IcwV3xpe6WJ6S0ro4se1JoSh9avaUP +62XOS1tKvIjKXVAp+MzHhBCojlNt8YEC1ABkWfbPk27ttrTHsAqOjfSsG7W1Uzsl +sk8kC6150USWREKcW9G2Jxor23fUjLQjo1cuLUv9zt8ckouHvWmwgfM85mLpjyg1 +vLG61dCp84B74BWLkkOJFxQnXLuk1Zm8RrDbq4dXnCD7P9CF9gnc/ddZH8fWBbX7 +jM/km4Hmq91JqiagFMdl6rZPA2kNBmzmtcN9utITzihYd2d+XjuRdVO4umUPrVWI +kN5Y0o6tkhkBYOpevIaALILZRT/q0whhaS+2G30EJzo= +-----END CERTIFICATE----- diff -Naur clinkc/ztest_https/cert/cserver.org.key clinkc_patch/ztest_https/cert/cserver.org.key --- clinkc/ztest_https/cert/cserver.org.key 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/ztest_https/cert/cserver.org.key 2014-01-29 13:54:26.750322413 +0800 @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAopT1VPag66LJFdUj/AL0Uk7E8Izmv557KxxYJ7oycNUbyQdl +PTL20DGG3eRkPuXaA8rbgvp0LWZwlj23MfCDfPPFMUWaUp89ywAPRpfGr6zv5Fej +DXKtnyVqUwQ4uWzp1b1qP4i0QTQK2xmkaCnZKJVYqqA8j7BAg3Gka+wlITzIw4Ph +YI1mShVwukU77CffS/jJK2y2OYKhuammB0TZiJoyjVHej9+EZYhLPDErggpGiL7u +i29Vv1NrNv5D7Ec9T7uzIgVkf/38JHkzBvjpLNpKMJi4d515472iZYWcV5CUc9Me +FA9kUcTcjXlzb1/s0Qql7ZuRa/dLX4Q7uPPrswIDAQABAoIBADWVADHrQmfGc51V +bJGe66TAvxlEZrwaYB96LPeS3xLeuVSMsmn0BPHikL9KiVtNZ4e+cI//ORDJZSuu +1VSJHtysfn3ZoZ2/S58+usoaNWoqhblsxJknBV+g9iS8DHHYGkzOK1kbFcUzgKxr +DAskV6SPa/R38N2uSeTILFdBMY99MTsYfktE3DvUBmqTlqCgmH8qNM/Ucimw4yeh +Z+jrt9YgfxEKYgT22zPeERTg6lrM5Gcf6oIpwVVtUY5UFluXHXM6jvwlDv5oNWCZ ++zlnU7feGKCmxRhfB49hy1Q5H5WZ9EgnCubeJOAvGib6/MWUi8PWrFfLWvUVwoxj +lZHjI3kCgYEA2IO6DiJSLfBN7bL++Aufxf0wvQyOlT0f9Uuhgk8C/Sgq+Ge+FZIF +gOgraST2GxUCMwF6CjKJoNjY0Fwy6OBLHpdLigdhQUwUsUfSOz4XcLxHJTRgVJDe +2IciNZMK1kQLUErEizrdFkoJ/E9Ud6u6YatO/nOxkk2p8IEkrYcL1x0CgYEAwDtP +up3ay312vyYFAN92V62LfmOe00SgDxhL9uPd3XH7454ulq+XeOchZYXNQsErN1um +A9B/KmchBlAN7CXRRemK4pwIhpRjL2DinHsoc/sepDAtLk2ZKmsD9G/o33qtb3fA +xhlpij+UKXpOO5UrbJZcdyYArFL6QxpSNctNxQ8CgYBHu7Tb0/EoOTKIa0JgSfGg +dhc8uzlOJpc8/NbAxo618yXxcOWgXeWm5MTlLBLBvD8jSPz2/fFtMgr7VWCkmRMq +SnQDghhtutgsOCBl8ldvyWFE6Up1Gh5K3NKvr0zq2lZpPqxJeLIhHVyblGjm0SWK +EGi2kvwk/cgs34yYVWLN3QKBgFEjN73fDxDA/jQkSgxaRcswNya7ybgGyUBV0wp8 +l5L2n4ktpSB5MQgZFqGRXlgEzMbq6iHGCUbOjMPrWlUIiVJnBvYrQfX7//lpfXzr +BuIdZouKwic/HZ0n2l18NuDNGRNpinaTF1cBCvqO4yKHDfMhbBnmcnZJ99QG8hg+ +na7FAoGBALO5ePrcFvWUy3JJCmrx31/Khn6rNko7U+zhTUdVIku5IXRpDxLHAqCr +/qWtIhfFT5CfDP+dCKUcvfhZgkOyKb8kF+5buv60Mma15B3j2PKohwhntd63bi6p +44xeR5x1haXiXt07vAFnrR+MoeGn2558siFJp4Nx7T1jIFJNJJmg +-----END RSA PRIVATE KEY----- diff -Naur clinkc/ztest_https/cert/rootca.crt clinkc_patch/ztest_https/cert/rootca.crt --- clinkc/ztest_https/cert/rootca.crt 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/ztest_https/cert/rootca.crt 2014-01-29 13:54:26.750322413 +0800 @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEbjCCA1agAwIBAgIJAPLbb8J7iV4cMA0GCSqGSIb3DQEBBQUAMIGAMQswCQYD +VQQGEwJUVzEPMA0GA1UECBMGVGFpd2FuMQ8wDQYDVQQHEwZUYWlwZWkxDjAMBgNV +BAoTBVp5WEVMMQ4wDAYDVQQLEwVaeVhFTDENMAsGA1UEAxMEY29yZTEgMB4GCSqG +SIb3DQEJARYRY29yZUB6eXhlbC5jb20udHcwHhcNMTMwMTEwMDE0MTU1WhcNMzMw +MTEwMDE0MTU1WjCBgDELMAkGA1UEBhMCVFcxDzANBgNVBAgTBlRhaXdhbjEPMA0G +A1UEBxMGVGFpcGVpMQ4wDAYDVQQKEwVaeVhFTDEOMAwGA1UECxMFWnlYRUwxDTAL +BgNVBAMTBGNvcmUxIDAeBgkqhkiG9w0BCQEWEWNvcmVAenl4ZWwuY29tLnR3MIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2YxeD0keAm8ywzUhIMtBAvd0 +ZfX90Uxi8poDwFaEiwjlL/dEnYTzvoJrW9rparTdZYiCXwaSpsR4Kh1LfXOZ4G2j +2oDU+F+s34VdqPEPDx9V+TOFyseCFGqmLoTeuO3f4f2Q6bgLVvbpdAxEePJfyiBs +f+TOnil5EdkAhSQQ3IKQnj8+JraeD6i2Tc6Oyz/dTUiQ5Jimq7OIhhiWiyfvJrtt +DdzYvSS2n56YYx+Sd+a/xBxkAXFd/08rvUwf9Xq+H7Pind0Zdb5dbmTT6fyaTH4T +nyXDuYOuhiJErVyuS0nunRDUMagmBOhUy1QLrCg3ZeAJXsa85PoTelgLzRe03QID +AQABo4HoMIHlMB0GA1UdDgQWBBTUmxZQ4pI4/ch/ZTAG+RO5/YMcmjCBtQYDVR0j +BIGtMIGqgBTUmxZQ4pI4/ch/ZTAG+RO5/YMcmqGBhqSBgzCBgDELMAkGA1UEBhMC +VFcxDzANBgNVBAgTBlRhaXdhbjEPMA0GA1UEBxMGVGFpcGVpMQ4wDAYDVQQKEwVa +eVhFTDEOMAwGA1UECxMFWnlYRUwxDTALBgNVBAMTBGNvcmUxIDAeBgkqhkiG9w0B +CQEWEWNvcmVAenl4ZWwuY29tLnR3ggkA8ttvwnuJXhwwDAYDVR0TBAUwAwEB/zAN +BgkqhkiG9w0BAQUFAAOCAQEAbL83YiMwPJrLTUTU6rGZkMK2b3nG7Lfcj0b+brKi +MSLbttUQZ9/JGkQoLs3YHtCXtHNfzBJ1vhUmNnVnWndCMCdByPTnDs/MU5TmV4Xi +sqFN4EMDs6lTPrPh/z60+G2gj4nN8VBW++UVqsTl9K0BMNrYkSWDi82w1iyx/ych +zaS8YRsmBXjR8Fl1Tq9RiW1iYjS6CG4sv+lLceIgoRennjGsXZwcACVqm1fH9g9c +jUw2PLvNtblE4agnPXOYvYQRM3aEdo9ZG+VQIssqsKaof6to96SAdqAHGU3PCuRJ +eEzvGSq1ku4RHUYln5jisOtbfm0QbqW6SMBNRufiX47YLw== +-----END CERTIFICATE----- diff -Naur clinkc/ztest_https/ztest.c clinkc_patch/ztest_https/ztest.c --- clinkc/ztest_https/ztest.c 1970-01-01 08:00:00.000000000 +0800 +++ clinkc_patch/ztest_https/ztest.c 2014-01-29 13:54:26.750322413 +0800 @@ -0,0 +1,128 @@ +/******************************************************************************/ +/* +* Copyright (C) 2012 ZyXEL Communications, Corp. +* All Rights Reserved. +* +* ZyXEL Confidential; Need to Know only. +* Protected as an unpublished work. +* +* The computer program listings, specifications and documentation +* herein are the property of ZyXEL Communications, Corp. and +* shall not be reproduced, copied, disclosed, or used in whole or +* in part for any reason without the prior express written permission of +* ZyXEL Communications, Corp. +*/ +/******************************************************************************/ + +#include +#include +#include +#include + +#define CLINK_TESTCASE_HTTP_PORT 4435 +#define CLINK_TESTCASE_HTTP_PAGE "Z_Server Say World" +#define CLINK_TESTCASE_HTTP_URL "/index.html" +#define CLINK_TESTCASE_HTTP_LOOP 1 +#define CLINK_TESTCASE_HTTPCLIENT_PAGE "Z_Client Say Hellow" + +#define SERVER_ADDR "127.0.0.1" +#define CLIENT 1 +#define SERVER 1 +#define isSecure 1 + +static int verify_callback(int ok, X509_STORE_CTX *ctx) +{ + printf("%s\n", __func__); + if (ok == 0) + { + switch (ctx->error) + { + case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY : + case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE : + case X509_V_ERR_CERT_UNTRUSTED : + ok=1; + } + } + + return(ok); +} + +void ClinkTestcaseHttpRequestRecieved(CgHttpRequest *httpReq) +{ + CgHttpResponse *httpRes; + httpRes = cg_http_response_new(); + cg_http_response_setstatuscode(httpRes, CG_HTTP_STATUS_OK); + cg_http_response_setcontent(httpRes, CLINK_TESTCASE_HTTP_PAGE); + cg_http_response_setcontenttype(httpRes, "text/html"); + cg_http_response_setcontentlength(httpRes, strlen(CLINK_TESTCASE_HTTP_PAGE)); + cg_http_request_postresponse(httpReq, httpRes); + cg_http_response_delete(httpRes); +} +int main(void) +{ + CgHttpResponse *httpRes = NULL; + CgHttpRequest *httpReq; + Cgctx *s_ctxdata = NULL; + Cgctx *c_ctxdata = NULL; + char certfile[]="/etc/cert/cserver.org.crt"; + char keyfile[]="/etc/cert/cserver.org.key"; + + char cafile[]="/etc/cert/rootca.crt"; + + s_ctxdata = (Cgctx*) malloc(sizeof(Cgctx)); + memset(s_ctxdata, '\0', sizeof(Cgctx));; + s_ctxdata->cert_file= certfile; + s_ctxdata->key_file = keyfile; + s_ctxdata->verify_mode =SSL_VERIFY_PEER /*|SSL_VERIFY_FAIL_IF_NO_PEER_CERT*/; + + + c_ctxdata = (Cgctx*) malloc(sizeof(Cgctx)); + memset(c_ctxdata, '\0', sizeof(Cgctx)); + c_ctxdata->CAfile = cafile; + c_ctxdata->verify_mode = SSL_VERIFY_PEER; + c_ctxdata->verify_callback = verify_callback; +#if SERVER + /**** HTTP Server ****/ + CgHttpServer *httpServer = cg_http_server_new(); + cg_http_server_open(httpServer, CLINK_TESTCASE_HTTP_PORT, SERVER_ADDR, isSecure, (void*)s_ctxdata); + cg_http_server_setlistener(httpServer, ClinkTestcaseHttpRequestRecieved); + cg_http_server_start(httpServer); +#endif + +#if CLIENT + /**** HTTP Client ****/ + { + httpReq = cg_http_request_new(); + cg_http_request_setmethod(httpReq, CG_HTTP_GET); + cg_http_request_seturi(httpReq, CLINK_TESTCASE_HTTP_URL); + cg_http_response_setcontenttype(httpReq, "text/html"); + cg_http_request_setcontentlength(httpReq, sizeof(CLINK_TESTCASE_HTTPCLIENT_PAGE)); + cg_http_request_setcontent(httpReq, CLINK_TESTCASE_HTTPCLIENT_PAGE); + if(isSecure){ + httpReq->ctxdata = (void*)c_ctxdata; + httpRes =cg_https_request_post(httpReq, SERVER_ADDR, CLINK_TESTCASE_HTTP_PORT); + } + else{ + httpRes =cg_http_request_post(httpReq, SERVER_ADDR, CLINK_TESTCASE_HTTP_PORT); + } + printf( "cg_http_response_getstatuscode=%d\n", cg_http_response_getstatuscode(httpRes)); + cg_streq(cg_http_response_getcontent(httpRes), CLINK_TESTCASE_HTTP_PAGE); + printf("Response content :\n%s\n", cg_http_response_getcontent(httpRes)); + cg_http_request_delete(httpReq); + } + free(c_ctxdata); +#else + while(1){ + printf("live\n"); + sleep(5); + } +#endif + /**** HTTP Server ****/ +#if SERVER + cg_http_server_stop(httpServer); + cg_http_server_delete(httpServer); + free(s_ctxdata); +#endif + return 0; +} +