openct-0.6.20/0000777000175000017500000000000011336457577010116 500000000000000openct-0.6.20/depcomp0000755000175000017500000004426711336457520011410 00000000000000#! /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: openct-0.6.20/LGPL-2.10000644000175000017500000006363710422076714011011 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! openct-0.6.20/src/0000777000175000017500000000000011336457577010705 500000000000000openct-0.6.20/src/ifd/0000777000175000017500000000000011336457577011447 500000000000000openct-0.6.20/src/ifd/modules.c0000644000175000017500000000316410422076714013164 00000000000000/* * Module handling * * Copyright (C) 2003 Olaf Kirch */ #include "internal.h" #include #include #include #include #include #include static const char *ifd_module_path(const char *subdir) { static char path[PATH_MAX]; if (!ct_config.modules_dir && !(ct_config.modules_dir = getenv("IFD_MODULES"))) ct_config.modules_dir = OPENCT_MODULES_PATH; snprintf(path, sizeof(path), "%s/%ss", ct_config.modules_dir, subdir); return path; } int ifd_load_module(const char *type, const char *name) { const char *dirname; char path[PATH_MAX]; lt_dlhandle handle; void (*init_func) (void); if (strstr(name, "..")) { ct_error("Illegal module path \"%s\"", name); return -1; } if (!strcmp(type, "driver")) { dirname = ct_config.driver_modules_dir; } else if (!strcmp(type, "protocol")) { dirname = ct_config.protocol_modules_dir; } else { ct_error("Unknown module type \"%s\"", type); return -1; } if (!dirname) dirname = ifd_module_path(type); #if defined(HAVE_DLFCN_H) && defined(__APPLE__) snprintf(path, sizeof(path), "%s/%s.so", dirname, name); #elif defined(__APPLE__) snprintf(path, sizeof(path), "%s/%s.bundle", dirname, name); #else snprintf(path, sizeof(path), "%s/%s.so", dirname, name); #endif handle = lt_dlopen(path); if (!handle) { ct_error("Failed to load %s: %s", path, lt_dlerror()); return -1; } init_func = (void (*)(void))lt_dlsym(handle, "ifd_init_module"); if (!init_func) { ct_error("%s: no function called ifd_init_module", path); lt_dlclose(handle); return -1; } init_func(); return 0; } openct-0.6.20/src/ifd/ifd-acr30u.c0000644000175000017500000003134710625640312013351 00000000000000/* * ACR30U driver * Copyright (C) 2005, Laurent Pinchart */ #include "internal.h" #include "usb-descriptors.h" #include #include /* Maximum buffer sizes * * The send buffer must be able to contain a short APDU. In the worst case * (Case 4S, Lc = 255), the APDU will be 5 (CLA + INS + P1 + P2 + Lc) + * 255 (Data) + 1 (Le) = 261 bytes long. The send buffer must then be big * enough to contain an extended command with 261 bytes of data, which gives * us a total of 5 (HDR + INS + LEN) + 261 (APDU) + 1 (CHK) = 267 bytes. * * The receive buffer must be able to contain a short APDU response. In the * worst case (Case 2S or Case 4S, Le = 256), the APDU will be 256 (Data) + * 2 (SW1, SW2) = 258 bytes long. The receive buffer must then be big enough * to contain an extended response with 258 bytes of data, which gives us a * total of 6 (HDR + SW1 + SW2 + LEN) + 258 (APDU) + 1 (CHK) = 265 bytes. * * The ASCII buffer must be able to contain either the command or the reply * with the STX and ETX bytes. */ typedef struct acr_priv { int icc_proto; unsigned char sw1, sw2; unsigned char abuf[267 * 2 + 2]; unsigned char sbuf[267]; unsigned char rbuf[265]; unsigned int head, tail; } acr_priv_t; typedef int complete_fn_t(const void *, size_t); #define ACR_GET_STATUS 0x01 #define ACR_SELECT_CARD_TYPE 0x02 #define ACR_SET_PROTOCOL 0x03 #define ACR_SET_NOTIFICATION 0x06 #define ACR_SET_OPTION 0x07 #define ACR_RESET 0x80 #define ACR_POWER_OFF 0x81 #define ACR_ACTIVATE_SAM 0X88 #define ACR_DEACTIVATE_SAM 0X89 #define ACR_READ_DATA 0x90 #define ACR_WRITE_DATA 0x91 #define ACR_PRESENT_CODE 0x92 #define ACR_CHANGE_CODE 0X93 #define ACR_WRITE_PROTECTION 0x94 #define ACR_EXCHANGE_APDU 0xa0 #define ACR_EXCHANGE_T1 0xa1 #define ACR_EXCHANGE_SAM_APDU 0xb0 #define ACR_EXCHANGE_SAM_T1 0xb1 #define ACR_CARD_AUTO 0x00 #define ACR_CARD_GPM103 0x01 #define ACR_CARD_I2C 0x02 #define ACR_CARD_SLE44x8 0x05 #define ACR_CARD_SLE44x2 0x06 #define ACR_CARD_MCU_T0 0x0c #define ACR_CARD_MCU_T1 0x0d #define ACR_CARD_SAM_T0 0xc0 #define ACR_CARD_SAM_T1 0xd0 #define ACR_STATUS_DATA_ERROR 0x60 #define ACR_STATUS_COMMAND_ERROR 0x67 #define ACR_STATUS_OK 0x90 #define ACR_STATUS_STATUS 0xff #define ACR_STATUS_LENGTH 16 /* * Send USB control message, and receive data via * Interrupt URBs. */ static int acr_usb_int(ifd_device_t * dev, int requesttype, int request, int value, int idx, const void *sbuf, size_t slen, void *rbuf, size_t rlen, complete_fn_t complete, long timeout) { ifd_usb_capture_t *cap; struct timeval begin; unsigned int total = 0; unsigned char *etx; int rc; if (timeout < 0) timeout = dev->timeout; rc = ifd_usb_begin_capture(dev, IFD_USB_URB_TYPE_INTERRUPT, 0x81, 8, &cap); if (rc < 0) return rc; gettimeofday(&begin, NULL); ifd_debug(3, "sending %u bytes:%s", slen, ct_hexdump(sbuf, slen)); rc = ifd_usb_control(dev, requesttype, request, value, idx, (void *)sbuf, slen, timeout); if (rc < 0) goto out; /* Capture URBs until we have a complete answer */ while (rc >= 0 && total < rlen) { unsigned char temp[8]; long wait; wait = timeout - ifd_time_elapsed(&begin); if (wait <= 0) return IFD_ERROR_TIMEOUT; memset(temp, 0, sizeof temp); rc = ifd_usb_capture(dev, cap, temp, sizeof(temp), wait); if (rc > 0) { if (rc > (int)(rlen - total)) rc = rlen - total; memcpy((caddr_t) rbuf + total, temp, rc); total += rc; if (complete && complete(rbuf, total)) break; } } /* Why does the USB spec provide short packets if the device doesn't * use them ? Every interrupt URB contains 8 bytes, which means we * must discard everything after the ETX marker or we will end up * with garbage. */ if ((etx = memchr(rbuf, 0x03, total)) != NULL) total = etx - (unsigned char *)rbuf + 1; if (rc >= 0) { ifd_debug(3, "received %u bytes:%s", total, ct_hexdump(rbuf, total)); rc = total; } out: ifd_usb_end_capture(dev, cap); return rc; } static int acr_reply_complete(const void *ptr, size_t len) { return memchr(ptr, 0x03, len) != NULL; } /* * Transmit a command to the reader. */ static int acr_transmit(ifd_reader_t * reader, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { static const char acr_hex[16] = "0123456789ABCDEF"; acr_priv_t *priv = (acr_priv_t *) reader->driver_data; ifd_device_t *dev = reader->device; unsigned char *abuf = priv->abuf; unsigned char *cbuf = (unsigned char *)sbuf; unsigned char checksum; unsigned char c; int requesttype; int rc; int i; if (slen > 261) return IFD_ERROR_GENERIC; /* Convert the command to ascii and compute the checksum */ *abuf++ = 0x02; checksum = 0x01; *abuf++ = '0'; *abuf++ = '1'; for (i = 0; i < (int)slen; ++i) { checksum ^= cbuf[i]; *abuf++ = acr_hex[cbuf[i] >> 4]; *abuf++ = acr_hex[cbuf[i] & 0x0f]; } *abuf++ = acr_hex[checksum >> 4]; *abuf++ = acr_hex[checksum & 0x0f]; *abuf++ = 0x03; /* Transmit the encoded command */ requesttype = IFD_USB_RECIP_DEVICE | IFD_USB_TYPE_VENDOR | IFD_USB_ENDPOINT_OUT; rc = acr_usb_int(dev, requesttype, 0, 0, 0, priv->abuf, slen * 2 + 6, priv->abuf, sizeof priv->abuf, acr_reply_complete, -1); if (rc <= 0) return rc; if (rc < 12) { ct_error("acr: communication error: short response received"); return IFD_ERROR_COMM_ERROR; } /* Decode and verify the response */ abuf = priv->abuf; if (abuf[0] != 0x02 || abuf[rc - 1] != 0x03) { ifd_debug(1, "data: %s", ct_hexdump(abuf, rc)); ct_error("acr: communication error: invalid header/footer"); return IFD_ERROR_COMM_ERROR; } abuf++; rc = (rc - 2) / 2; checksum = 0; for (i = 0; i < rc; ++i) { *abuf -= '0'; if (*abuf > 9) *abuf -= 'A' - '0' - 10; c = (*abuf++ & 0x0f) << 4; *abuf -= '0'; if (*abuf > 9) *abuf -= 'A' - '0' - 10; c += *abuf++ & 0x0f; priv->abuf[i] = c; checksum ^= c; } if (checksum != 0) { ct_error("acr: communication error: invalid checksum"); return IFD_ERROR_COMM_ERROR; } priv->sw1 = priv->abuf[1]; priv->sw2 = priv->abuf[2]; if (priv->abuf[3] == 0xff) { rc = (priv->abuf[4] << 8) + priv->abuf[5]; abuf = &priv->abuf[6]; } else { rc = priv->abuf[3]; abuf = &priv->abuf[4]; } if (rc > (int)rlen) { ifd_debug(1, "received more data than requested, " "discarding data: %s", ct_hexdump(abuf, rlen - rc)); } rc = rc > (int)rlen ? (int)rlen : rc; memcpy(rbuf, abuf, rc); return rc; } /* * Read the reader status */ static int acr_reader_status(ifd_reader_t * reader, void *status, size_t len) { unsigned char cmd[2]; int rc; cmd[0] = ACR_GET_STATUS; cmd[1] = 0x00; rc = acr_transmit(reader, &cmd, sizeof cmd, status, len); if (rc < 0) return rc; if (rc != ACR_STATUS_LENGTH) { ct_error("acr: invalid status length"); return IFD_ERROR_COMM_ERROR; } return rc; } /* * Initialize the device */ static int acr_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; acr_priv_t *priv; ifd_device_params_t params; unsigned char status[ACR_STATUS_LENGTH]; int rc; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("acr30u: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("acr30u: setting parameters failed", device_name); ifd_device_close(dev); return -1; } priv = (acr_priv_t *) calloc(1, sizeof(acr_priv_t)); reader->driver_data = priv; reader->device = dev; reader->name = NULL; reader->nslots = 1; dev->timeout = 2000; if ((rc = acr_reader_status(reader, status, sizeof status)) < 0) return rc; /* strndup is a GNU extension, so it might not be available on all * the target platforms. Use malloc and memcpy instead. */ reader->name = (char *)calloc(1, 11); memcpy((char *)reader->name, status, 10); ifd_debug(1, "found %s reader.", reader->name); ifd_debug(1, "supported cards: %02x%02x", status[12], status[13]); return 0; } /* * Close the device */ static int acr_close(ifd_reader_t * reader) { free((char *)reader->name); free(reader->driver_data); return 0; } /* * Power up the reader - always powered up. * TODO: What about an USB standby mode ? */ static int acr_activate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int acr_deactivate(ifd_reader_t * reader) { ifd_debug(1, "called."); return -1; } /* * Card status */ static int acr_card_status(ifd_reader_t * reader, int slot, int *status) { unsigned char acr_status[ACR_STATUS_LENGTH]; int rc; *status = 0; if ((rc = acr_reader_status(reader, acr_status, sizeof acr_status)) < 0) { ct_error("acr: failed to get card status"); return -1; } ifd_debug(2, "C_SEL: %02x C_STAT: %02x", acr_status[14], acr_status[15]); if (acr_status[15]) *status = IFD_CARD_PRESENT; ifd_debug(2, "card %spresent", *status ? "" : "not "); return 0; } /* * Reset */ static int acr_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { unsigned char buffer[IFD_MAX_ATR_LEN]; unsigned char cmd[2]; int rc; cmd[0] = ACR_RESET; cmd[1] = 0x00; rc = acr_transmit(reader, &cmd, sizeof cmd, buffer, sizeof buffer); if (rc < 0) return rc; if (rc < (int)size) size = rc; memcpy(atr, buffer, size); return size; } /* * Select a protocol for communication with the ICC. */ static int acr_set_protocol(ifd_reader_t * reader, int nslot, int proto) { ifd_slot_t *slot; acr_priv_t *priv; unsigned char cmd[3]; int rc; ifd_debug(1, "called, proto=%d", proto); cmd[0] = ACR_SELECT_CARD_TYPE; cmd[1] = 0x01; switch (proto) { case IFD_PROTOCOL_T0: cmd[2] = ACR_CARD_MCU_T0; break; case IFD_PROTOCOL_T1: cmd[2] = ACR_CARD_MCU_T1; break; default: return IFD_ERROR_NOT_SUPPORTED; } if ((rc = acr_transmit(reader, cmd, sizeof cmd, NULL, 0)) < 0) { ct_error("acr: unable to set the protocol"); return IFD_ERROR_COMM_ERROR; } slot = &reader->slot[nslot]; slot->proto = ifd_protocol_new(proto, reader, slot->dad); if (slot->proto == NULL) { ct_error("acr: unable to create protocol"); return -1; } ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 1); priv = (acr_priv_t *) reader->driver_data; priv->icc_proto = proto; return 0; } /* * Send/receive routines */ static int acr_send_t0(ifd_reader_t * reader, unsigned int dad, const unsigned char *sbuf, size_t slen) { acr_priv_t *priv = (acr_priv_t *) reader->driver_data; ifd_iso_apdu_t iso; int rc; if (slen > 260) return IFD_ERROR_GENERIC; /* The reader expects Lc and Le to always be present, so fix the * APDU to add a null Le byte for Case 1, Case 3S and Case 4S and * insert a null Lc byte for Case 2S. The T=0 protocol handler already * took care of inserting a null Lc byte for Case 1, and removed the * Le byte for Case 4S. */ priv->sbuf[0] = ACR_EXCHANGE_APDU; priv->sbuf[1] = slen + 1; memcpy(&priv->sbuf[2], sbuf, slen); if ((rc = ifd_iso_apdu_parse(sbuf, slen, &iso)) < 0) return rc; if (iso.cse == IFD_APDU_CASE_2S) { priv->sbuf[slen + 2] = priv->sbuf[slen + 1]; priv->sbuf[slen + 1] = 0; } else priv->sbuf[slen + 2] = 0; priv->head = priv->tail = 0; rc = acr_transmit(reader, priv->sbuf, slen + 3, priv->rbuf, sizeof priv->rbuf); if (rc >= 0) { priv->tail = rc; rc = slen; } return rc; } static int acr_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { acr_priv_t *priv = (acr_priv_t *) reader->driver_data; switch (priv->icc_proto) { case IFD_PROTOCOL_T0: return acr_send_t0(reader, dad, buffer, len); } return IFD_ERROR_NOT_SUPPORTED; } static int acr_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { acr_priv_t *priv = (acr_priv_t *) reader->driver_data; switch (priv->icc_proto) { case IFD_PROTOCOL_T0: if (priv->tail - priv->head < len) len = priv->tail - priv->head; memcpy(buffer, priv->rbuf + priv->head, len); priv->head += len; return len; } return IFD_ERROR_NOT_SUPPORTED; /* not yet */ } #if 0 /* * Set the card's baud rate etc */ static int acr_set_card_parameters(ifd_device_t * dev, unsigned int baudrate) { return 0; } #endif /* * Driver operations */ static struct ifd_driver_ops acr30u_driver; /* * Initialize this module */ void ifd_acr30u_register(void) { memset(&acr30u_driver, 0, sizeof acr30u_driver); acr30u_driver.open = acr_open; acr30u_driver.close = acr_close; acr30u_driver.activate = acr_activate; acr30u_driver.deactivate = acr_deactivate; acr30u_driver.card_status = acr_card_status; acr30u_driver.card_reset = acr_card_reset; acr30u_driver.send = acr_send; acr30u_driver.recv = acr_recv; acr30u_driver.set_protocol = acr_set_protocol; ifd_driver_register("acr30u", &acr30u_driver); } openct-0.6.20/src/ifd/ifd-cardman.c0000644000175000017500000002317310625650421013661 00000000000000/* * OMNIKEY CardMan 2020/6020/6120 driver * This driver is not yet complete, but at least it * spits out the ATR already. * Needs a recentish Linux Kernel (2.4.5 does NOT work) * * Copyright (C) 2003, Olaf Kirch * * Based on information from the cm2020 driver by * Omnikey AG. */ #include "internal.h" #include #include typedef struct cm_priv { int icc_proto; unsigned char rbuf[64]; unsigned int head, tail; } cm_priv_t; typedef int complete_fn_t(const void *, size_t); static int cm_set_card_parameters(ifd_device_t *, unsigned int baudRate); static int cm_transceive_t0(ifd_reader_t * reader, const void *sbuf, size_t slen, void *rbuf, size_t rlen); static int cm_usb_int(ifd_device_t * dev, int requesttype, int request, int value, int idx, const void *sbuf, size_t slen, void *rbuf, size_t rlen, complete_fn_t check, long timeout); static int cm_anyreply(const void *, size_t); /* * Initialize the device */ static int cm_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; cm_priv_t *priv; ifd_device_params_t params; reader->name = "OMNIKEY CardMan 2020/6020/6120"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("cardman: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ifd_device_close(dev); return -1; } priv = (cm_priv_t *) calloc(1, sizeof(cm_priv_t)); if (!priv) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } reader->driver_data = priv; reader->device = dev; dev->timeout = 2000; return 0; } /* * Power up the card slot */ static int cm_activate(ifd_reader_t * reader) { ifd_device_t *dev = reader->device; int rc; ifd_debug(1, "called."); /* Set async card @9600 bps, 2 stop bits, even parity */ if ((rc = cm_set_card_parameters(dev, 0x01)) < 0) { ct_error("cardman: failed to set card parameters 9600/8E2"); return rc; } return 0; } static int cm_deactivate(ifd_reader_t * reader) { ifd_device_t *dev = reader->device; int rc; ifd_debug(1, "called."); if ((rc = ifd_usb_control(dev, 0x42, 0x11, 0, 0, NULL, 0, -1)) < 0) { ct_error("cardman: failed to deactivate card"); return rc; } return 0; } /* * Card status - always present */ static int cm_card_status(ifd_reader_t * reader, int slot, int *status) { ifd_device_t *dev = reader->device; unsigned char cm_status = 0; int rc; *status = 0; if ((rc = cm_usb_int(dev, 0x42, 0x20, 0, 0, NULL, 0, &cm_status, 1, NULL, -1)) < 0) { ct_error("cardman: failed to get card status"); return -1; } if (rc == 1 && (cm_status & 0x42)) *status = IFD_CARD_PRESENT; ifd_debug(1, "card %spresent", *status ? "" : "not "); return 0; } /* * Reset */ static int cm_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[IFD_MAX_ATR_LEN]; int n; /* Request the ATR */ if ((n = cm_usb_int(dev, 0x42, 0x10, 1, 0, NULL, 0, buffer, sizeof(buffer), (complete_fn_t *) ifd_atr_complete, -1)) < 0) { ct_error("cardman: failed to reset card"); return n; } /* XXX Handle inverse convention, odd parity, etc */ if ((size_t) n > size) n = size; memcpy(atr, buffer, n); return n; } /* * Select a protocol for communication with the ICC. */ static int cm_set_protocol(ifd_reader_t * reader, int nslot, int proto) { ifd_device_t *dev = reader->device; ifd_slot_t *slot; cm_priv_t *priv; unsigned char pts[4], reply[4]; unsigned int baudRate; int n; ifd_debug(1, "called, proto=%d", proto); pts[0] = 0xFF; switch (proto) { case IFD_PROTOCOL_T0: pts[1] = 0x10; pts[2] = 0x11; break; case IFD_PROTOCOL_T1: pts[1] = 0x11; /* XXX select Fi/Di according to TA1 */ pts[2] = 0x11; break; default: return IFD_ERROR_NOT_SUPPORTED; } pts[3] = pts[0] ^ pts[1] ^ pts[2]; /* Send the PTS bytes */ if ((n = cm_usb_int(dev, 0x42, 1, 0, 0, pts, 4, reply, 2, NULL, -1)) < 0) { ct_error("cardman: failed to send PTS"); return n; } if (reply[0] != 4) { ct_error("cardman: card refused PTS"); return IFD_ERROR_COMM_ERROR; } #ifdef notyet /* Receive PTS response */ if ((n = ifd_usb_control(dev, 0xC2, 0, 0, 0, reply, 4, -1)) < 0) { ct_error("cardman: failed to receive PTS response"); return n; } if (n != 4) { ct_error("cardman: received short PTS response (%u bytes)", n); return IFD_ERROR_COMM_ERROR; } if (memcmp(pts, reply, 4)) { ct_error("cardman: PTS reply does not match request", n); return IFD_ERROR_COMM_ERROR; } #endif baudRate = pts[2] & 0xf; /* Select f=5.12 MHz */ if ((pts[2] & 0xF0) == 0x90) baudRate |= 0x10; if ((n = cm_set_card_parameters(dev, baudRate)) < 0) { ct_error ("cardman: failed to set card communication parameters"); return n; } /* T=0 goes through send/receive functions, but * T=1 needs special massaging */ slot = &reader->slot[nslot]; if (proto == IFD_PROTOCOL_T0) { slot->proto = ifd_protocol_new(proto, reader, slot->dad); } else { slot->proto = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, reader, slot->dad); } if (slot->proto == NULL) { ct_error("cardman: internal error"); return -1; } priv = (cm_priv_t *) reader->driver_data; priv->icc_proto = proto; return 0; } /* * Send/receive using the underlying protocol. */ static int cm_transparent(ifd_reader_t * reader, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { cm_priv_t *priv = (cm_priv_t *) reader->driver_data; switch (priv->icc_proto) { case IFD_PROTOCOL_T0: return cm_transceive_t0(reader, sbuf, slen, rbuf, rlen); case IFD_PROTOCOL_T1: return IFD_ERROR_NOT_SUPPORTED; /* not yet */ } return IFD_ERROR_NOT_SUPPORTED; } static int cm_transceive_t0(ifd_reader_t * reader, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { #if 0 ifd_device_t *dev = reader->device; int rc; if (len > 5) { rc = ifd_usb_control(dev, 0x42, 2, 0, 0, rbuf, rlen); } else { unsigned char temp[5]; if (len < 4) return IFD_ERROR_INVALID_ARG; temp[4] = 0; memcpy(temp, sbuf, slen); rc = ifd_usb_control(dev, 0x42, 3, 8, (temp[1] << 8) | temp[4], temp, 5); } #endif return IFD_ERROR_NOT_SUPPORTED; } /* * Send/receive routines */ static int cm_send_t0(ifd_reader_t * reader, unsigned int dad, const unsigned char *sbuf, size_t slen) { cm_priv_t *priv = (cm_priv_t *) reader->driver_data; ifd_device_t *dev = reader->device; int rc; /* XXX how can we know if this is a CASE 1 or CASE 2 APDU? */ priv->head = priv->tail = 0; rc = cm_usb_int(dev, 0x42, 2, 0, 0, sbuf, slen, priv->rbuf, sizeof(priv->rbuf), cm_anyreply, -1); if (rc >= 0) { priv->tail = rc; rc = slen; } return rc; } static int cm_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { cm_priv_t *priv = (cm_priv_t *) reader->driver_data; switch (priv->icc_proto) { case IFD_PROTOCOL_T0: return cm_send_t0(reader, dad, buffer, len); } return IFD_ERROR_NOT_SUPPORTED; } static int cm_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { cm_priv_t *priv = (cm_priv_t *) reader->driver_data; switch (priv->icc_proto) { case IFD_PROTOCOL_T0: if (priv->tail - priv->head < len) len = priv->tail - priv->head; memcpy(buffer, priv->rbuf + priv->head, len); priv->head += len; return len; } return IFD_ERROR_NOT_SUPPORTED; /* not yet */ } /* * Set the card's baud rate etc */ static int cm_set_card_parameters(ifd_device_t * dev, unsigned int baudrate) { return ifd_usb_control(dev, 0x42, 0x30, baudrate << 8, 2, NULL, 0, -1); } /* * Send USB control message, and receive data via * Interrupt URBs. */ static int cm_usb_int(ifd_device_t * dev, int requesttype, int request, int value, int idx, const void *sbuf, size_t slen, void *rbuf, size_t rlen, complete_fn_t complete, long timeout) { ifd_usb_capture_t *cap; struct timeval begin; unsigned int total = 0; int rc; if (timeout < 0) timeout = dev->timeout; rc = ifd_usb_begin_capture(dev, IFD_USB_URB_TYPE_INTERRUPT, 0x81, 8, &cap); if (rc < 0) return rc; gettimeofday(&begin, NULL); rc = ifd_usb_control(dev, requesttype, request, value, idx, (void *)sbuf, slen, timeout); if (rc < 0) goto out; /* Capture URBs until we have a complete answer */ while (rc >= 0 && total < rlen) { unsigned char temp[8]; long wait; wait = timeout - ifd_time_elapsed(&begin); if (wait <= 0) return IFD_ERROR_TIMEOUT; rc = ifd_usb_capture(dev, cap, temp, sizeof(temp), wait); if (rc > 0) { if (rc > (int)(rlen - total)) rc = rlen - total; memcpy((caddr_t) rbuf + total, temp, rc); total += rc; if (complete && complete(rbuf, total)) break; } } if (rc >= 0) { ifd_debug(3, "received %u bytes:%s", total, ct_hexdump(rbuf, total)); rc = total; } out: ifd_usb_end_capture(dev, cap); return rc; } static int cm_anyreply(const void *ptr, size_t len) { return 1; } /* * Driver operations */ static struct ifd_driver_ops cardman_driver; /* * Initialize this module */ void ifd_cardman_register(void) { cardman_driver.open = cm_open; cardman_driver.activate = cm_activate; cardman_driver.deactivate = cm_deactivate; cardman_driver.card_status = cm_card_status; cardman_driver.card_reset = cm_card_reset; cardman_driver.send = cm_send; cardman_driver.recv = cm_recv; cardman_driver.set_protocol = cm_set_protocol; cardman_driver.transparent = cm_transparent; ifd_driver_register("cardman", &cardman_driver); } openct-0.6.20/src/ifd/ria.c0000644000175000017500000002772210625650421012273 00000000000000/* * RIA - remote IFD access * * Copyright (C) 2003, Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "internal.h" #include "ria.h" #define RIA_RESPONSE 255 /* pseudo command code */ #define RIA_QUEUE_LEN 256 #define RIA_SEND_CHUNK 128 #define RIA_DEFAULT_TIMEOUT 4000 static void ifd_remote_close(ifd_device_t *); ria_client_t *ria_connect(const char *address) { ria_client_t *clnt; char path[PATH_MAX]; int rc; if (!address) { return NULL; } if (!ct_format_path(path, PATH_MAX, address)) { return NULL; } clnt = (ria_client_t *) calloc(1, sizeof(*clnt) + RIA_QUEUE_LEN); if (!clnt) { ct_error("out of memory"); return NULL; } ct_buf_init(&clnt->data, (clnt + 1), RIA_QUEUE_LEN); clnt->sock = ct_socket_new(1024); if ((rc = ct_socket_connect(clnt->sock, path)) < 0) { ct_error("Failed to connect to RIA server \"%s\": %s", path, ct_strerror(rc)); ria_free(clnt); return NULL; } return clnt; } void ria_free(ria_client_t * clnt) { if (clnt->sock) ct_socket_free(clnt->sock); free(clnt); } int ria_send(ria_client_t * clnt, unsigned char cmd, const void *arg_buf, size_t arg_len) { unsigned char buffer[512]; ct_buf_t args; header_t header; int rc; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_putc(&args, cmd); ct_buf_put(&args, arg_buf, arg_len); clnt->xid++; if (clnt->xid == 0) clnt->xid++; memset(&header, 0, sizeof(header)); header.xid = clnt->xid; ria_print_packet(clnt->sock, 4, "ria_send", &header, &args); if ((rc = ct_socket_put_packet(clnt->sock, &header, &args)) < 0) return rc; /* Leave transmitting to the main loop */ return 0; } static int ria_recv(ria_client_t * clnt, unsigned char expect, uint32_t xid, void *res_buf, size_t res_len, long timeout) { ct_socket_t *sock = clnt->sock; struct timeval begin; unsigned char buffer[512]; ct_buf_t resp; header_t header; int rc; /* Flush out any pending packets */ if ((rc = ct_socket_flsbuf(sock, 1)) < 0) return rc; gettimeofday(&begin, NULL); if (timeout < 0) timeout = 0; /* Always slap on addition timeout for round-trip */ timeout += RIA_DEFAULT_TIMEOUT; /* Now receive packets until we get the response. * Handle data packets properly */ ct_buf_init(&resp, buffer, sizeof(buffer)); while (1) { unsigned char cmd; long wait = -1; size_t count; ct_buf_clear(&resp); if ((rc = ct_socket_get_packet(sock, &header, &resp)) < 0) return rc; /* If there's no complete packet in the receive * buffer, we need to wait for input. */ if (rc == 0) { wait = timeout - ifd_time_elapsed(&begin); if (wait < 0) return IFD_ERROR_TIMEOUT; if ((rc = ct_socket_filbuf(sock, wait)) < 0) return rc; continue; } ria_print_packet(sock, 4, "ria_recv", &header, &resp); /* Complete packet. Check type */ if (header.dest != 0) { cmd = RIA_RESPONSE; } else if (ct_buf_get(&resp, &cmd, 1) < 0) continue; count = ct_buf_avail(&resp); if (cmd == RIA_DATA) { ct_buf_put(&clnt->data, ct_buf_head(&resp), count); if (expect == RIA_DATA) return count; continue; } if (header.xid == xid && cmd == expect) { if (header.error < 0) return header.error; if (count < res_len) res_len = count; ct_buf_get(&resp, res_buf, res_len); return res_len; } } while (header.xid != xid) ; } int ria_command(ria_client_t * clnt, unsigned char cmd, const void *arg_buf, size_t arg_len, void *res_buf, size_t res_len, long timeout) { int rc; if ((rc = ria_send(clnt, cmd, arg_buf, arg_len)) < 0) return rc; if (timeout < 0) timeout = RIA_DEFAULT_TIMEOUT; rc = ria_recv(clnt, RIA_RESPONSE, clnt->xid, res_buf, res_len, timeout); return rc; } static int ria_claim_device(ria_client_t * clnt, const char *name, ria_device_t * info) { return ria_command(clnt, RIA_MGR_CLAIM, name, strlen(name), info, sizeof(*info), -1); } /* * Reset remote device */ static int ifd_remote_reset(ifd_device_t * dev) { ria_client_t *clnt = (ria_client_t *) dev->user_data; ifd_debug(2, "called"); if (clnt == NULL) return IFD_ERROR_DEVICE_DISCONNECTED; return ria_command(clnt, RIA_RESET_DEVICE, NULL, 0, NULL, 0, -1); } /* * Device specific portion of RIA client */ static int ifd_remote_get_params(ifd_device_t * dev, ifd_device_params_t * params) { ria_client_t *clnt = (ria_client_t *) dev->user_data; ifd_debug(2, "called"); if (clnt == NULL) return IFD_ERROR_DEVICE_DISCONNECTED; if (dev->type == IFD_DEVICE_TYPE_SERIAL) { ria_serial_conf_t rconf; int rc; rc = ria_command(clnt, RIA_SERIAL_GET_CONFIG, NULL, 0, &rconf, sizeof(rconf), -1); params->serial.speed = ntohl(rconf.speed); params->serial.bits = rconf.bits; params->serial.stopbits = rconf.stopbits; params->serial.parity = rconf.parity; params->serial.check_parity = rconf.check_parity; params->serial.rts = rconf.rts; params->serial.dtr = rconf.dtr; return 0; } return IFD_ERROR_NOT_SUPPORTED; } static int ifd_remote_set_params(ifd_device_t * dev, const ifd_device_params_t * params) { ria_client_t *clnt = (ria_client_t *) dev->user_data; ifd_debug(2, "called"); if (clnt == NULL) return IFD_ERROR_DEVICE_DISCONNECTED; if (dev->type == IFD_DEVICE_TYPE_SERIAL) { ria_serial_conf_t rconf; rconf.speed = htonl(params->serial.speed); rconf.bits = params->serial.bits; rconf.stopbits = params->serial.stopbits; rconf.parity = params->serial.parity; rconf.check_parity = params->serial.check_parity; rconf.rts = params->serial.rts; rconf.dtr = params->serial.dtr; return ria_command(clnt, RIA_SERIAL_SET_CONFIG, &rconf, sizeof(rconf), NULL, 0, -1); } return IFD_ERROR_NOT_SUPPORTED; } static void ifd_remote_flush(ifd_device_t * dev) { ria_client_t *clnt = (ria_client_t *) dev->user_data; ifd_debug(2, "called"); if (clnt == NULL) return; ria_command(clnt, RIA_FLUSH_DEVICE, NULL, 0, NULL, 0, -1); ct_buf_clear(&clnt->data); } static void ifd_remote_send_break(ifd_device_t * dev, unsigned int usec) { ria_client_t *clnt = (ria_client_t *) dev->user_data; unsigned int wait; ifd_debug(2, "called"); if (clnt == NULL) return; wait = htonl(usec); ria_command(clnt, RIA_SEND_BREAK, &wait, sizeof(wait), NULL, 0, -1); ct_buf_clear(&clnt->data); } static int ifd_remote_send(ifd_device_t * dev, const unsigned char *buffer, size_t len) { ria_client_t *clnt = (ria_client_t *) dev->user_data; unsigned int n, count = 0; int rc; ifd_debug(2, "called, data:%s", ct_hexdump(buffer, len)); if (clnt == NULL) return IFD_ERROR_DEVICE_DISCONNECTED; while (count < len) { if ((n = len - count) > RIA_SEND_CHUNK) n = RIA_SEND_CHUNK; if ((rc = ria_send(clnt, RIA_DATA, buffer, n)) < 0) { if (rc == IFD_ERROR_NOT_CONNECTED) { ifd_remote_close(dev); return IFD_ERROR_DEVICE_DISCONNECTED; } return rc; } count += n; } return count; } static int ifd_remote_recv(ifd_device_t * dev, unsigned char *buffer, size_t len, long timeout) { ria_client_t *clnt = (ria_client_t *) dev->user_data; size_t total = len; struct timeval begin; int n; gettimeofday(&begin, NULL); ifd_debug(2, "called, timeout=%ld, len=%u", timeout, len); if (clnt == NULL) return IFD_ERROR_DEVICE_DISCONNECTED; while (len) { long wait; /* See if there's any data queued */ if ((n = ct_buf_avail(&clnt->data)) != 0) { if (n > len) n = len; ct_buf_get(&clnt->data, buffer, n); if (ct_config.debug >= 9) ifd_debug(9, "got %s", ct_hexdump(buffer, n)); buffer += n; len -= n; continue; } if ((wait = timeout - ifd_time_elapsed(&begin)) < 0) goto timeout; ifd_debug(8, "Need another %u bytes of data, " "remaining timeout %ld", len, wait); n = ria_recv(clnt, RIA_DATA, 0, NULL, 0, wait); if (n < 0) { ct_error("%s: error while waiting for input: %s", dev->name, ct_strerror(n)); if (n == IFD_ERROR_NOT_CONNECTED) { ifd_remote_close(dev); return IFD_ERROR_DEVICE_DISCONNECTED; } return n; } } return total; timeout: /* Timeouts are a little special; they may happen e.g. * when trying to obtain the ATR */ if (!ct_config.suppress_errors) ct_error("%s: timed out while waiting for input", dev->name); ifd_debug(9, "(%u bytes received so far)", total - len); return IFD_ERROR_TIMEOUT; } static int ifd_remote_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { if (dev->user_data == NULL) return 0; return IFD_ERROR_NOT_SUPPORTED; } static void ifd_remote_close(ifd_device_t * dev) { ria_client_t *clnt = (ria_client_t *) dev->user_data; dev->user_data = NULL; if (clnt) ria_free(clnt); } static struct ifd_device_ops ifd_remote_ops; /* * Open remote IFD */ ifd_device_t *ifd_open_remote(const char *ident) { ria_client_t *clnt; ria_device_t devinfo; ifd_device_t *dev; char name[256], *addr; int rc, type; strncpy(name, ident, sizeof(name)); name[sizeof(name) - 1] = '\0'; if ((addr = strchr(name, '@')) == NULL) { ct_error("remote device name must be handle@host"); return NULL; } *addr++ = '\0'; /* Connect to RIA server */ if (!(clnt = ria_connect(addr))) return NULL; if ((rc = ria_claim_device(clnt, name, &devinfo)) < 0) { ct_error("unable to claim device \"%s\": %s", name, ct_strerror(rc)); ria_free(clnt); return NULL; } if (!strcmp(devinfo.type, "serial")) { type = IFD_DEVICE_TYPE_SERIAL; } else if (!strcmp(devinfo.type, "usb")) { type = IFD_DEVICE_TYPE_USB; } else { ct_error("Unknown device type \"%s\"", devinfo.type); ria_free(clnt); return NULL; } ifd_remote_ops.reset = ifd_remote_reset; ifd_remote_ops.set_params = ifd_remote_set_params; ifd_remote_ops.get_params = ifd_remote_get_params; ifd_remote_ops.flush = ifd_remote_flush; ifd_remote_ops.send = ifd_remote_send; ifd_remote_ops.send_break = ifd_remote_send_break; ifd_remote_ops.recv = ifd_remote_recv; ifd_remote_ops.close = ifd_remote_close; ifd_remote_ops.poll_presence = ifd_remote_poll_presence; dev = ifd_device_new(ident, &ifd_remote_ops, sizeof(*dev)); dev->hotplug = 1; dev->timeout = 2000; dev->type = type; dev->user_data = clnt; if ((rc = ifd_device_reset(dev)) < 0) { ct_error("Failed to reset device: %s", ct_strerror(rc)); ifd_device_close(dev); return NULL; } return dev; } /* * Debugging aid: print packet */ void ria_print_packet(ct_socket_t * sock, int level, const char *func, header_t * hdr, ct_buf_t * args) { ct_buf_t temp = *args; char buffer[128], *msg; unsigned char cmd; unsigned int len; if (level > ct_config.debug) return; if (hdr->dest) { int err = hdr->error; msg = "RESP"; if (err) { snprintf(buffer, sizeof(buffer), "RESP, err=%d (%s)", err, ct_strerror(err)); msg = buffer; } } else if (ct_buf_get(&temp, &cmd, 1) < 0) { msg = "TRUNC-CALL"; } else { switch (cmd) { case RIA_MGR_LIST: msg = "LIST"; break; case RIA_MGR_INFO: msg = "INFO"; break; case RIA_MGR_CLAIM: msg = "CLAIM"; break; case RIA_MGR_REGISTER: msg = "REGISTER"; break; case RIA_RESET_DEVICE: msg = "RESET_DEVICE"; break; case RIA_FLUSH_DEVICE: msg = "FLUSH_DEVICE"; break; case RIA_SEND_BREAK: msg = "SEND_BREAK"; break; case RIA_SERIAL_GET_CONFIG: msg = "SERIAL_GET_CONFIG"; break; case RIA_SERIAL_SET_CONFIG: msg = "SERIAL_SET_CONFIG"; break; case RIA_DATA: msg = "DATA"; break; default: snprintf(buffer, sizeof(buffer), "CALL%u", cmd); msg = buffer; } } len = ct_buf_avail(&temp); if (len == 0) { ct_debug("%s: [%08x] %s", func, hdr->xid, msg); } else if (len < 16) { ct_debug("%s: [%08x] %s, args%s", func, hdr->xid, msg, ct_hexdump(ct_buf_head(&temp), len)); } else { ct_debug("%s: [%08x] %s, args%s ... (%u bytes total)", func, hdr->xid, msg, ct_hexdump(ct_buf_head(&temp), 16), len); } } openct-0.6.20/src/ifd/ifd-ccid.c0000644000175000017500000011401111233772200013142 00000000000000/* * driver for some CCID-compliant devices * * Copyright 2003, Chaskiel Grundman * * 2005-04-20: Harald Welte * Add support for PCMCIA based CCID Device (CardMan 4040) * * 2005-05-22: Harald Welte * Add suport for OmniKey Cardman 5121 RFID extensions */ #include "internal.h" #include "usb-descriptors.h" #include "atr.h" #include #include #include #include #define CCID_ERR_ABORTED 0xFF /* CMD ABORTED */ #define CCID_ERR_ICC_MUTE 0xFE #define CCID_ERR_XFR_PARITY 0xFD /* XFR PARITY ERROR */ #define CCID_ERR_OVERRUN 0xFC /* XFR OVERRUN */ #define CCID_ERR_HW_ERROR 0xFB #define CCID_ERR_BAD_ATR_TS 0xF8 #define CCID_ERR_BAD_ATR_TCK 0xF7 #define CCID_ERR_PROT_NOSUP 0xF6 /* ICC PROTOCOL NOT SUPPORTED */ #define CCID_ERR_CLASS_NOSUP 0xF5 /* ICC CLASS NOT SUPPORTED */ #define CCID_ERR_BAD_PROC_BYTE 0xF4 /* PROCEDURE BYTE CONFLICT */ #define CCID_ERR_XXX 0xF3 /* DEACTIVATED PROTOCOL (?) */ #define CCID_ERR_BUSY_AUTO_SEQ 0xF2 /* BUSY WITH AUTO SEQUENCE */ #define CCID_ERR_PIN_TIMEOUT 0xF0 #define CCID_ERR_PIN_CANCELED 0xEF #define CCID_ERR_SLOT_BUSY 0xE0 /* CMD SLOT BUSY */ #define CCID_OFFSET_MSGTYPE 0 #define CCID_OFFSET_LENGTH 1 #define CCID_OFFSET_SLOT 5 #define CCID_OFFSET_SEQ 6 #define CCID_REQ_ABORT 1 #define CCID_REQ_GETCLOCKRATE 2 #define CCID_REQ_GETDATARATE 3 #define CCID_CMD_FIRST 0x60 #define CCID_CMD_ICCPOWERON 0x62 #define CCID_CMD_ICCPOWEROFF 0x63 #define CCID_CMD_GETSLOTSTAT 0x65 #define CCID_CMD_XFRBLOCK 0x6F #define CCID_CMD_GETPARAMS 0x6C #define CCID_CMD_RESETPARAMS 0x6D #define CCID_CMD_SETPARAMS 0x61 #define CCID_CMD_ESCAPE 0x6B #define CCID_CMD_ICCCLOCK 0x6E #define CCID_CMD_T0APDU 0x6A #define CCID_CMD_SECURE 0x69 #define CCID_CMD_MECHANICAL 0x71 #define CCID_CMD_ABORT 0x72 #define CCID_CMD_SET_DR_FREQ 0x73 #define CCID_RESP_DATA 0x80 #define CCID_RESP_SLOTSTAT 0x81 #define CCID_RESP_PARAMS 0x82 #define CCID_RESP_ESCAPE 0x83 #define CCID_RESP_DR_FREQ 0x84 /* maximum sensical size: * 10 bytes ccid header + 4 bytes command header + * 1 byte Lc + 255 bytes data + 1 byte Le = 271 */ #define CCID_MAX_MSG_LEN 271 static int msg_expected[] = { 0, CCID_RESP_PARAMS, CCID_RESP_DATA, CCID_RESP_SLOTSTAT, 0, CCID_RESP_SLOTSTAT, 0, 0, 0, CCID_RESP_DATA, CCID_RESP_SLOTSTAT, CCID_RESP_ESCAPE, CCID_RESP_PARAMS, CCID_RESP_PARAMS, CCID_RESP_SLOTSTAT, CCID_RESP_DATA, 0, CCID_RESP_SLOTSTAT, CCID_RESP_SLOTSTAT, CCID_RESP_DR_FREQ }; enum { TYPE_APDU, TYPE_TPDU, TYPE_CHAR }; /* Some "ccid" devices have non-compliant descriptors. (perhaps their design predates the approval of the standard?) Attempt to recognize them anyway. */ static struct force_parse_device_st { unsigned short vendor; unsigned short product; } force_parse_devices[] = { { 0x04e6, 0xe003}, /* SCM SPR 532 */ { 0x046a, 0x003e}, /* Cherry SmartTerminal ST-2XXX */ { 0x413c, 0x2100}, /* Dell USB Smartcard Keyboard */ { 0x04e6, 0x5120}, /* SCM SCR331-DI (NTT) */ { 0x04e6, 0x5111}, /* SCM SCR331-DI */ { 0x08e6, 0x1359}, /* Verisign secure storage token */ { 0x08e6, 0xACE0}, /* Verisign secure token */ { 0, 0} }; #define SUPPORT_T0 0x1 #define SUPPORT_T1 0x2 #define SUPPORT_ESCAPE 0x80 #define SUPPORT_50V 1 #define SUPPORT_33V 2 #define SUPPORT_18V 4 #define AUTO_VOLTAGE 0x80 #define FLAG_NO_PTS 1 #define FLAG_NO_SETPARAM 2 #define FLAG_AUTO_ACTIVATE 4 #define FLAG_AUTO_ATRPARSE 8 #define USB_CCID_DESCRIPTOR_LENGTH 54 struct usb_ccid_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t bcdCCID; uint8_t bMaxSlotIndex; uint8_t bVoltageSupport; uint32_t dwProtocols; uint32_t dwDefaultClock; uint32_t dwMaximumClock; uint8_t bNumClockRatesSupported; uint32_t dwDataRate; uint32_t dwMaxDataRate; uint8_t bNumDataRatesSupported; uint32_t dwMaxIFSD; uint32_t dwSynchProtocols; uint32_t dwMechanical; uint32_t dwFeatures; uint32_t dwMaxCCIDMessageLength; uint8_t bClassGetResponse; uint8_t bClassEnvelope; uint16_t wLcdLayout; uint8_t bPINSupport; uint8_t bMaxCCIDBusySlots; }; static int ccid_parse_descriptor(struct usb_ccid_descriptor *ret, unsigned char *in, size_t inlen) { if (inlen < USB_CCID_DESCRIPTOR_LENGTH) return 1; ret->bLength = in[0]; if (ret->bLength < USB_CCID_DESCRIPTOR_LENGTH) return 1; ret->bDescriptorType = in[1]; ret->bcdCCID = in[3] << 8 | in[2]; ret->bMaxSlotIndex = in[4]; ret->bVoltageSupport = in[5]; ret->dwProtocols = in[9] << 24 | in[8] << 16 | in[7] << 8 | in[6]; ret->dwDefaultClock = in[13] << 24 | in[12] << 16 | in[11] << 8 | in[10]; ret->dwMaximumClock = in[17] << 24 | in[16] << 16 | in[15] << 8 | in[14]; ret->bNumClockRatesSupported = in[18]; ret->dwDataRate = in[22] << 24 | in[21] << 16 | in[20] << 8 | in[19]; ret->dwMaxDataRate = in[26] << 24 | in[25] << 16 | in[24] << 8 | in[23]; ret->bNumDataRatesSupported = in[27]; ret->dwMaxIFSD = in[31] << 24 | in[30] << 16 | in[29] << 8 | in[28]; ret->dwSynchProtocols = in[35] << 24 | in[34] << 16 | in[33] << 8 | in[32]; ret->dwMechanical = in[39] << 24 | in[38] << 16 | in[37] << 8 | in[36]; ret->dwFeatures = in[43] << 24 | in[42] << 16 | in[41] << 8 | in[40]; ret->dwMaxCCIDMessageLength = in[47] << 24 | in[46] << 16 | in[45] << 8 | in[44]; ret->bClassGetResponse = in[48]; ret->bClassEnvelope = in[49]; ret->wLcdLayout = in[51] << 8 | in[50]; ret->bPINSupport = in[52]; ret->bMaxCCIDBusySlots = in[53]; return 0; } /* * CT status */ typedef struct ccid_status { int reader_type; int usb_interface; int proto_support; int voltage_support; int ifsd; int maxmsg; int flags; unsigned char icc_present[OPENCT_MAX_SLOTS]; unsigned char icc_proto[OPENCT_MAX_SLOTS]; unsigned char *sbuf[OPENCT_MAX_SLOTS]; size_t slen[OPENCT_MAX_SLOTS]; unsigned char seq; int support_events; int events_active; ifd_usb_capture_t *event_cap; } ccid_status_t; static int ccid_checkresponse(void *status, int r) { unsigned char *p = (unsigned char *)status; if ((p[7] >> 6 & 3) == 0) return 0; /* XXX */ if ((p[7] >> 6 & 3) == 2) { /*ct_error("card requests more time"); */ return -300; } switch (p[8]) { case CCID_ERR_ICC_MUTE: return IFD_ERROR_NO_CARD; case CCID_ERR_XFR_PARITY: case CCID_ERR_OVERRUN: return IFD_ERROR_COMM_ERROR; case CCID_ERR_BAD_ATR_TS: case CCID_ERR_BAD_ATR_TCK: return IFD_ERROR_NO_ATR; case CCID_ERR_PROT_NOSUP: case CCID_ERR_CLASS_NOSUP: return IFD_ERROR_INCOMPATIBLE_DEVICE; case CCID_ERR_BAD_PROC_BYTE: return IFD_ERROR_INVALID_ARG; case CCID_ERR_BUSY_AUTO_SEQ: case CCID_ERR_SLOT_BUSY: return IFD_ERROR_TIMEOUT; case CCID_ERR_PIN_TIMEOUT: return IFD_ERROR_USER_TIMEOUT; case CCID_ERR_PIN_CANCELED: return IFD_ERROR_USER_ABORT; case CCID_OFFSET_MSGTYPE: return IFD_ERROR_NOT_SUPPORTED; case CCID_OFFSET_SLOT: return IFD_ERROR_INVALID_SLOT; } return IFD_ERROR_GENERIC; } static int ccid_prepare_cmd(ifd_reader_t * reader, unsigned char *out, size_t outsz, int slot, unsigned char cmd, const void *ctl, const void *snd, size_t sendlen) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; unsigned char *p = out; if (slot >= reader->nslots) return IFD_ERROR_INVALID_SLOT; if (sendlen + 10 > outsz) /* this probably means the apdu is larger than the supported MaxMessageSize - 10 */ return IFD_ERROR_NOT_SUPPORTED; *p++ = cmd; *p++ = sendlen & 0xFF; *p++ = (sendlen >> 8) & 0xFF; *p++ = (sendlen >> 16) & 0xFF; *p++ = (sendlen >> 24) & 0xFF; *p++ = slot; *p++ = st->seq++; if (ctl) memcpy(p, (unsigned char *)ctl, 3); else memset(p, 0, 3); if (sendlen) memcpy(&p[3], (unsigned char *)snd, sendlen); return sendlen + 10; } static int ccid_extract_data(const void *in, size_t inlen, void *out, size_t outlen) { unsigned char dlen[4]; size_t len; if (inlen < 5) { ct_error("short response from reader?!"); return IFD_ERROR_BUFFER_TOO_SMALL; } memcpy(dlen, ((char *)in) + 1, 4); len = dlen[0] | dlen[1] << 8 | dlen[2] << 16 | dlen[3] << 24; if (len == 0) return 0; if (inlen < len + 10) { ct_error("truncated response from reader"); return IFD_ERROR_BUFFER_TOO_SMALL; } if (outlen < len) { ct_error("user buffer too small (%d < %d)", outlen, len); return IFD_ERROR_BUFFER_TOO_SMALL; } memcpy(out, ((char *)in) + 10, len); return len; } static int ccid_command(ifd_reader_t * reader, const unsigned char *cmd, size_t cmd_len, unsigned char *res, size_t res_len) { int rc; size_t req_len; if (!cmd_len || !res_len) { ct_error("missing parameters to ccid_command"); return IFD_ERROR_INVALID_ARG; } req_len = res_len; if (ct_config.debug >= 3) ifd_debug(3, "sending:%s", ct_hexdump(cmd, cmd_len)); rc = ifd_device_send(reader->device, cmd, cmd_len); if (rc < 0) { ifd_debug(1, "ifd_device_send failed %d", rc); return rc; } while (1) { rc = ifd_device_recv(reader->device, res, req_len, 10000); if (rc < 0) return rc; if (rc == 0) { ct_error("zero length response from reader?!"); return IFD_ERROR_GENERIC; } if (ct_config.debug >= 3) ifd_debug(3, "received:%s", ct_hexdump(res, rc)); if (rc < 9) { return IFD_ERROR_GENERIC; } if (cmd[CCID_OFFSET_SLOT] == res[CCID_OFFSET_SLOT] && cmd[CCID_OFFSET_SEQ] == res[CCID_OFFSET_SEQ]) { res_len = rc; rc = ccid_checkresponse(res, res_len); if (rc == -300) { continue; } if (rc < 0) return rc; break; } } return res_len; } static int ccid_simple_rcommand(ifd_reader_t * reader, int slot, int cmd, void *ctl, void *res, size_t res_len) { ccid_status_t *st = reader->driver_data; unsigned char cmdbuf[10]; unsigned char resbuf[CCID_MAX_MSG_LEN + 1]; int r; r = ccid_prepare_cmd(reader, cmdbuf, 10, slot, cmd, ctl, NULL, 0); if (r < 0) return r; r = ccid_command(reader, cmdbuf, 10, resbuf, st->maxmsg); if (r < 0) return r; if (resbuf[0] != msg_expected[cmd - CCID_CMD_FIRST]) { ct_error("Received a message of type x%02x instead of x%02x", resbuf[0], msg_expected[cmd - CCID_CMD_FIRST]); return -1; } if (res_len) r = ccid_extract_data(&resbuf, r, res, res_len); return r; } static int ccid_simple_wcommand(ifd_reader_t * reader, int slot, int cmd, void *ctl, void *data, size_t data_len) { ccid_status_t *st = reader->driver_data; unsigned char cmdbuf[CCID_MAX_MSG_LEN + 1]; unsigned char resbuf[CCID_MAX_MSG_LEN + 1]; int r; r = ccid_prepare_cmd(reader, cmdbuf, st->maxmsg, slot, cmd, ctl, data, data_len); if (r < 0) return r; r = ccid_command(reader, cmdbuf, r, resbuf, st->maxmsg); if (r < 0) return r; if (resbuf[0] != msg_expected[cmd - CCID_CMD_FIRST]) { ct_error("Received a message of type x%02x instead of x%02x", resbuf[0], msg_expected[cmd - CCID_CMD_FIRST]); return -1; } return r; } #ifdef notyet static int ccid_abort(ifd_reader_t * reader, int slot) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; int r; if (ifd_device_type(reader->device) == IFD_DEVICE_TYPE_USB) { r = ifd_usb_control(reader->device, 0x21 /*USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE */ , CCID_REQ_ABORT, st->seq << 8 | slot, st->usb_interface, NULL, 0, 10000); if (r < 0) return r; r = ccid_simple_wcommand(reader, slot, CCID_CMD_ABORT, NULL, NULL, 0); return r; } else if (ifd_device_type(reader->device == IFD_DEVICE_TYPE_PCMCIA_BLOCK)) { /* FIXME */ return IFD_ERROR_NOT_SUPPORTED; } return IFD_ERROR_NOT_SUPPORTED; } #endif static int ccid_exchange(ifd_reader_t * reader, int slot, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { ccid_status_t *st = reader->driver_data; unsigned char sendbuf[CCID_MAX_MSG_LEN + 1]; unsigned char recvbuf[CCID_MAX_MSG_LEN + 1]; int r; unsigned char ctlbuf[3], *ctlptr=NULL; ctlptr=NULL; if (st->reader_type == TYPE_CHAR) { ctlbuf[0] = 0; ctlbuf[1] = rlen & 0xff; ctlbuf[2] = (rlen >> 8) & 0xff; ctlptr = ctlbuf; } r = ccid_prepare_cmd(reader, sendbuf, st->maxmsg, slot, CCID_CMD_XFRBLOCK, ctlptr, sbuf, slen); if (r < 0) return r; r = ccid_command(reader, &sendbuf[0], r, recvbuf, st->maxmsg); if (r < 0) return r; return ccid_extract_data(&recvbuf, r, rbuf, rlen); } static int ccid_open_usb(ifd_device_t * dev, ifd_reader_t * reader) { ccid_status_t *st; ifd_device_params_t params; int r, i, c, ifc, alt, num_alt; struct ifd_usb_device_descriptor de; struct ifd_usb_config_descriptor conf; struct ifd_usb_interface_descriptor *intf; struct usb_ccid_descriptor ccid = { 0 }; int force_parse; struct force_parse_device_st *force_dev; unsigned char *_class; unsigned char *p; int support_events = 0; #define PCSCLITE_FILE "/var/run/pcscd/pcscd.comm" struct stat buf; /* give priority to pcsc-lite for CCID devices */ if (0 == stat(PCSCLITE_FILE, &buf)) sleep(3); if (ifd_usb_get_device(dev, &de)) { ct_error("ccid: device descriptor not found"); ifd_device_close(dev); return -1; } force_parse = 0; for (force_dev = force_parse_devices; force_dev->vendor; force_dev++) { if (de.idVendor == force_dev->vendor && de.idProduct == force_dev->product) { force_parse = 1; break; } } intf = NULL; p = NULL; r = i = 0; memset(&conf, 0, sizeof(conf)); for (c = 0; c < de.bNumConfigurations; c++) { if (ifd_usb_get_config(dev, c, &conf)) { ct_error("ccid: config descriptor %d not found", c); continue; } if (!conf.interface) continue; for (ifc = 0; ifc < conf.bNumInterfaces; ifc++) { num_alt = conf.interface[ifc].num_altsetting; for (alt = 0; alt < num_alt; alt++) { int typeok = 0; int ok = 0; intf = &conf.interface[ifc].altsetting[alt]; if (intf->bInterfaceClass == 0xb || intf->bInterfaceSubClass == 0 || intf->bInterfaceProtocol == 0) typeok = 1; /* accept class 0xFF if force_parse != 0 */ if (force_parse && intf->bInterfaceClass == 0xff) typeok = 1; if (intf->bNumEndpoints < 2 || intf->bNumEndpoints > 3) typeok = 0; if (typeok == 0) { intf = NULL; continue; } if (intf->bNumEndpoints == 2) { params.usb.ep_intr = 0; ok |= 4; } if (intf->bNumEndpoints == 3) { support_events = 1; } for (i = 0; i < intf->bNumEndpoints; i++) { if (((intf->endpoint[i].bmAttributes & IFD_USB_ENDPOINT_TYPE_MASK) == IFD_USB_ENDPOINT_TYPE_BULK) && (intf->endpoint[i]. bEndpointAddress & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_OUT) { ok |= 1; params.usb.ep_o = intf->endpoint[i]. bEndpointAddress; } if (((intf->endpoint[i].bmAttributes & IFD_USB_ENDPOINT_TYPE_MASK) == IFD_USB_ENDPOINT_TYPE_BULK) && (intf->endpoint[i]. bEndpointAddress & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_IN) { ok |= 2; params.usb.ep_i = intf->endpoint[i]. bEndpointAddress; } if (((intf->endpoint[i].bmAttributes & IFD_USB_ENDPOINT_TYPE_MASK) == IFD_USB_ENDPOINT_TYPE_INTERRUPT) && (intf->endpoint[i]. bEndpointAddress & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_IN) { ok |= 4; params.usb.ep_intr = intf->endpoint[i]. bEndpointAddress; } } if (ok == 7) break; intf = NULL; } if (!intf) continue; if (!intf->extralen) { int i; /* Buggy O2 Micro CCID SC Reader has zero extra len at interface level but not endpoint descriptor. * Patch the interface level field and proceed. * ProdID 7762 reader is in Dell Latitude D620 and 7772 is in D630. */ if( de.idVendor == 0x0b97 && (de.idProduct == 0x7762 || de.idProduct == 0x7772) ) { ct_error("ccid: extra len is zero, patching O2 Micro support"); for (i=0; ibNumEndpoints; i++) { /* find the extra[] array */ if( intf->endpoint[i].extralen == 54 ) { /* get the extra[] from the endpoint */ intf->extralen = 54; /* avoid double free on close, allocate here */ intf->extra = malloc(54); if( intf->extra ) { memcpy( intf->extra, intf->endpoint[i].extra, 54 ); break; } else { intf = NULL; continue; } } } } else { intf = NULL; ct_error("ccid: extra len is zero, continuing"); continue; } } r = intf->extralen; _class = intf->extra; i = 0; p = _class + i; /* 0x21 == USB_TYPE_CLASS | 0x1 */ /* accept descriptor type 0xFF if force_parse != 0 */ while (i < r && p[0] > 2 && (p[1] != 0x21 && (force_parse == 0 || p[1] != 0xff))) { i += p[0]; p = _class + i; } if (i >= r || p[0] < 2 || (p[1] != 0x21 && (force_parse == 0 || p[1] != 0xff))) { intf = NULL; } if (intf) break; } if (intf) break; ifd_usb_free_configuration(&conf); } if (!intf) { ct_error("ccid: class descriptor not found"); ifd_device_close(dev); return -1; } /* Don't touch the device configuration if it's the one and only. * The reason for this is that in multi purpose devices (eg keyboards * with an integrated reader) some interfaces might already be in use. * Trying to change the device configuration in such a case will produce * this kernel message on Linux: * usbfs: interface X claimed while 'ifdhandler' sets config #N * and often the call will fail with EBUSY. * Actually a bit better fix could be implemented in usb_set_params. * The code there should check if the device is already in the requested * configuration and thus if the change is needed after all. However * implementing this would need a bunch of new sysdep functions to * determine the current device configuration. * So IMHO we should postpone this hard work until some USB device * surfaces that really needs such magic. * * Antti Andreimann Thu Feb 2 2006 */ if (de.bNumConfigurations > 1) params.usb.configuration = conf.bConfigurationValue; else params.usb.configuration = -1; params.usb.interface = intf->bInterfaceNumber; if (num_alt > 1 || intf->bAlternateSetting > 0) params.usb.altsetting = intf->bAlternateSetting; else params.usb.altsetting = -1; r = ccid_parse_descriptor(&ccid, p, r - i); ifd_usb_free_configuration(&conf); if (r) { ct_error("ccid: class descriptor is invalid"); ifd_device_close(dev); return -1; } if (ccid.bcdCCID != 0x100 && ccid.bcdCCID != 0x110) { ct_error("ccid: unknown ccid version %02x.%02x supported only 1.00, 1.10", (ccid.bcdCCID >> 8) & 0xff, (ccid.bcdCCID >> 0) & 0xff ); ifd_device_close(dev); return -1; } if ((st = (ccid_status_t *) calloc(1, sizeof(*st))) == NULL) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } st->usb_interface = intf->bInterfaceNumber; memset(st->icc_present, -1, OPENCT_MAX_SLOTS); st->voltage_support = ccid.bVoltageSupport & 0x7; st->proto_support = ccid.dwProtocols; if ((st->proto_support & 3) == 0) { ct_error ("ccid: device does not provide any supported protocols"); free(st); ifd_device_close(dev); return -1; } /* "When a CCID doesn't declare the values 00000010h and 00000020h, the * frequency or the baud rate must be made via manufacturer proprietary * PC_to_RDR_Escape command." - ccid class specification v1.00 * * "The value of the lower word (=0840) indicates that the host will only * send requests that are valid for the USB-ICC." - ISO/IEC 7816-12:2005 * 7.2/Table 8 */ if ((ccid.dwFeatures & 0xFFFF) != 0x0840 && ~ccid.dwFeatures & (0x10 | 0x20)) { ct_error("ccid: required card initialization features missing"); free(st); ifd_device_close(dev); return -1; } st->reader_type = TYPE_CHAR; if (ccid.dwFeatures & 0x10000) { st->reader_type = TYPE_TPDU; } else if (ccid.dwFeatures & 0x60000) { st->reader_type = TYPE_APDU; } if (ccid.dwFeatures & 0x2) st->flags |= FLAG_AUTO_ATRPARSE; if (ccid.dwFeatures & 0x4) st->flags |= FLAG_AUTO_ACTIVATE; if (ccid.dwFeatures & 0x8) st->voltage_support |= AUTO_VOLTAGE; if (ccid.dwFeatures & 0x40) st->flags |= FLAG_NO_PTS | FLAG_NO_SETPARAM; if (ccid.dwFeatures & 0x80) st->flags |= FLAG_NO_PTS; st->ifsd = ccid.dwMaxIFSD; /* must provide AUTO or at least one of 5/3.3/1.8 */ if (st->voltage_support == 0) { ct_error ("ccid: device does not provide any supported voltages"); free(st); ifd_device_close(dev); return -1; } if (ccid.dwMaxCCIDMessageLength > CCID_MAX_MSG_LEN) { st->maxmsg = CCID_MAX_MSG_LEN; } else { st->maxmsg = ccid.dwMaxCCIDMessageLength; } reader->driver_data = st; reader->device = dev; reader->nslots = ccid.bMaxSlotIndex + 1; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ifd_device_close(dev); return -1; } if (de.idVendor == 0x08e6 && de.idProduct == 0x3437) { unsigned char settpdu[] = { 0xA0, 0x1 }; unsigned char setiso[] = { 0x1F, 0x1 }; r = ccid_simple_wcommand(reader, 0, CCID_CMD_ESCAPE, NULL, settpdu, 2); if (r < 0) { ct_error("ccid: cannot set GemPlus TPDU mode"); ifd_device_close(dev); return -1; } r = ccid_simple_wcommand(reader, 0, CCID_CMD_ESCAPE, NULL, setiso, 2); if (r < 0) { ct_error("ccid: cannot set GemPlus ISO APDU mode"); ifd_device_close(dev); return -1; } st->reader_type = TYPE_TPDU; } if (de.idVendor == 0x076b && de.idProduct == 0x5121) { /* special handling of RFID part of OmniKey 5121 */ reader->nslots++; /* one virtual slot for RFID escape */ st->proto_support |= SUPPORT_ESCAPE; } st->support_events = support_events; ifd_debug(3, "Accepted %04x:%04x with features 0x%x and protocols 0x%x events=%d", de.idVendor, de.idProduct, ccid.dwFeatures, ccid.dwProtocols, st->support_events); return 0; } static int ccid_open_pcmcia_block(ifd_device_t * dev, ifd_reader_t * reader) { ccid_status_t *st; /* unfortunately I know of no sanity checks that we could do with the * hardware to confirm we're actually accessing a real pcmcia/ccid * device -HW */ if ((st = (ccid_status_t *) calloc(1, sizeof(*st))) == NULL) return IFD_ERROR_NO_MEMORY; /* setup fake ccid_status_t based on totally guessed values */ memset(st->icc_present, -1, OPENCT_MAX_SLOTS); st->voltage_support = 0x7; st->proto_support = SUPPORT_T0 | SUPPORT_T1; st->reader_type = TYPE_APDU; st->voltage_support |= AUTO_VOLTAGE; st->ifsd = 1; /* ? */ st->maxmsg = CCID_MAX_MSG_LEN; st->flags = FLAG_AUTO_ATRPARSE | FLAG_NO_PTS; /*|FLAG_NO_SETPARAM; */ reader->driver_data = st; reader->device = dev; reader->nslots = 1; return 0; } /* * Initialize the device */ static int ccid_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; reader->name = "CCID Compatible"; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) == IFD_DEVICE_TYPE_USB) return ccid_open_usb(dev, reader); else if (ifd_device_type(dev) == IFD_DEVICE_TYPE_PCMCIA_BLOCK) return ccid_open_pcmcia_block(dev, reader); else { ct_error("ccid: device %s is not a supported device", device_name); ifd_device_close(dev); return -1; } } /* * Close the device */ static int ccid_close(ifd_reader_t * reader) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; ifd_debug(1, "called."); if (st->event_cap != NULL) { ifd_usb_end_capture(reader->device, st->event_cap); st->event_cap = NULL; } return 0; } static int ccid_activate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int ccid_deactivate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int ccid_card_status(ifd_reader_t * reader, int slot, int *status) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; int r, stat; unsigned char ret[20]; unsigned char cmdbuf[10]; if (ifd_device_type(reader->device) == IFD_DEVICE_TYPE_USB && reader->device->settings.usb.ep_intr) { ifd_usb_capture_t *cap; int any = 0; int i, j, bits; if (st->proto_support & SUPPORT_ESCAPE && slot == reader->nslots - 1) { ifd_debug(1, "virtual escape slot, setting card present\n"); *status = IFD_CARD_PRESENT; return 0; } i = 1 + (slot / 4); j = 2 * (slot % 4); stat = 0; r = ifd_usb_begin_capture(reader->device, IFD_USB_URB_TYPE_INTERRUPT, reader->device->settings.usb.ep_intr, 8, &cap); if (r < 0) { ct_error("ccid: begin capture: %d", r); return r; } /* read any bufferred interrupt pipe messages */ while (1) { r = ifd_usb_capture(reader->device, cap, ret, 8, 100); if (r < 0) break; if (ret[0] != 0x50) continue; ifd_debug(3, "status received:%s", ct_hexdump(ret, r)); bits = (ret[i] >> j) & 0x3; if (bits & 2) stat |= IFD_CARD_STATUS_CHANGED; if (bits & 1) stat |= IFD_CARD_PRESENT; else stat &= ~IFD_CARD_PRESENT; any = 1; } ifd_usb_end_capture(reader->device, cap); if (any) { ifd_debug(1, "polled result: %d", stat); st->icc_present[slot] = stat & IFD_CARD_PRESENT; *status = stat; return 0; } if (st->icc_present[slot] != 0xFF) { ifd_debug(1, "cached result: %d", st->icc_present[slot]); *status = st->icc_present[slot]; return 0; } } r = ccid_prepare_cmd(reader, cmdbuf, 10, 0, CCID_CMD_GETSLOTSTAT, NULL, NULL, 0); if (r < 0) return r; r = ccid_command(reader, cmdbuf, 10, ret, 10); if (r == IFD_ERROR_NO_CARD) { stat = 0; } else if (r < 0) { return r; } else { switch (ret[7] & 3) { case 2: stat = 0; break; default: stat = IFD_CARD_PRESENT; break; } } ifd_debug(1, "probed result: %d", IFD_CARD_STATUS_CHANGED | stat); *status = IFD_CARD_STATUS_CHANGED | stat; st->icc_present[slot] = stat; return 0; } static int ccid_set_protocol(ifd_reader_t * reader, int s, int proto); /* * Reset */ static int ccid_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; unsigned char buffer[IFD_MAX_ATR_LEN]; char ctlbuf[3]; int n, r, i; int status; r = ccid_card_status(reader, slot, &status); if (r < 0) return r; if (!(status & IFD_CARD_PRESENT)) return IFD_ERROR_NO_CARD; if (st->proto_support & SUPPORT_ESCAPE && slot == reader->nslots - 1) { ifd_debug(1, "slot: %d, setting atr to 0xff", slot); *((char *)atr) = 0xff; ccid_set_protocol(reader, slot, IFD_PROTOCOL_ESCAPE); return 1; } memset(ctlbuf, 0, 3); n = -1; if (st->voltage_support & AUTO_VOLTAGE || st->flags & FLAG_AUTO_ACTIVATE) { ifd_debug(1, "called. powering on with auto voltage selection"); n = ccid_simple_rcommand(reader, slot, CCID_CMD_ICCPOWERON, ctlbuf, buffer, IFD_MAX_ATR_LEN); } if (n < 0 && (st->voltage_support & AUTO_VOLTAGE) == 0) { ifd_debug(1, "called. powering on with manual voltage selection"); for (i = 1; i <= 3; i++) { if ((st->voltage_support & (1 << (i - 1))) == 0) continue; ifd_debug(3, "Trying voltage parameter %d", i); ctlbuf[0] = i; n = ccid_simple_rcommand(reader, slot, CCID_CMD_ICCPOWERON, ctlbuf, buffer, IFD_MAX_ATR_LEN); if (n > 0) break; } } if (n < 0) return n; if (n > size) return IFD_ERROR_BUFFER_TOO_SMALL; memcpy(atr, buffer, n); return n; } static int ccid_set_protocol(ifd_reader_t * reader, int s, int proto) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; unsigned char parambuf[17], ctl[3]; ifd_slot_t *slot; ifd_protocol_t *p; ifd_atr_info_t atr_info; int r, paramlen; slot = &reader->slot[s]; /* If we support RFID escaping, we only allow ESCAPE protocol * at the last (== virtual) slot */ if ((st->proto_support & SUPPORT_ESCAPE) && (proto != IFD_PROTOCOL_ESCAPE) && (s == reader->nslots - 1)) { ct_error("reader doesn't support this protocol at this slot\n"); return IFD_ERROR_NOT_SUPPORTED; } switch (proto) { case IFD_PROTOCOL_T0: if (!(st->proto_support & SUPPORT_T0)) { ct_error("reader does not support this protocol"); return IFD_ERROR_NOT_SUPPORTED; } break; case IFD_PROTOCOL_T1: if (!(st->proto_support & SUPPORT_T1)) { ct_error("reader does not support this protocol"); return IFD_ERROR_NOT_SUPPORTED; } break; case IFD_PROTOCOL_ESCAPE: /* virtual "escape" fallthrough protocol for stacking RFID * protocol stack on top of openct */ if (!(st->proto_support & SUPPORT_ESCAPE)) { ct_error("reader does not support this protocol"); return IFD_ERROR_NOT_SUPPORTED; } if (s != reader->nslots - 1) { ct_error ("reader doesn't support this protocol at this slot"); return IFD_ERROR_NOT_SUPPORTED; } p = ifd_protocol_new(IFD_PROTOCOL_ESCAPE, reader, slot->dad); if (!p) { ct_error("%s: internal error", reader->name); return -1; } if (slot->proto) { ifd_protocol_free(slot->proto); slot->proto = NULL; } slot->proto = p; st->icc_proto[s] = proto; ifd_debug(1, "set protocol to ESCAPE\n"); return 0; break; default: ct_error("protocol unknown"); return IFD_ERROR_NOT_SUPPORTED; } if (st->reader_type == TYPE_APDU) { p = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, reader, slot->dad); if (p == NULL) { ct_error("%s: internal error", reader->name); return -1; } if (slot->proto) { ifd_protocol_free(slot->proto); slot->proto = NULL; } slot->proto = p; st->icc_proto[s] = proto; return 0; } r = ifd_atr_parse(&atr_info, slot->atr, slot->atr_len); if (r < 0) { ct_error("%s: Bad ATR", reader->name); return r; } /* ccid doesn't have a parameter for this */ if (atr_info.TC[0] == 255) atr_info.TC[0] = -1; /* * guard time increase must precede PTS * we don't need to do this separate step if * a) the ccid does automatic parameter setting, or * b) the ccid parses the atr itself, or * c) the ccid does pts itself when we set parameters, or * d) the ICC does not require extra guard time * In all but the first case, we'll do parameter setting later, * so fetch the default parameters now. */ if ((st->flags & FLAG_NO_SETPARAM) == 0) { memset(parambuf, 0, sizeof(parambuf)); memset(ctl, 0, 3); r = ccid_simple_rcommand(reader, s, CCID_CMD_GETPARAMS, ctl, parambuf, 7); if (r < 0) return r; if (proto == IFD_PROTOCOL_T0) { paramlen = 5; ctl[0] = 0; } else { paramlen = 7; ctl[0] = 1; } if ((st->flags & (FLAG_NO_PTS | FLAG_AUTO_ATRPARSE)) == 0 && atr_info.TC[0] != -1) { parambuf[2] = atr_info.TC[0]; r = ccid_simple_wcommand(reader, s, CCID_CMD_SETPARAMS, ctl, parambuf, paramlen); if (r < 0) return r; } } if ((st->flags & FLAG_NO_PTS) == 0 && (proto == IFD_PROTOCOL_T1 || atr_info.TA[0] != -1)) { unsigned char pts[7], ptsret[7]; int ptslen; ptslen = ifd_build_pts(&atr_info, proto, pts, sizeof(pts)); if (ptslen < 0) { ct_error("%s: Could not perform PTS: %s", reader->name, ct_strerror(r)); return ptslen; } r = ccid_exchange(reader, s, pts, ptslen, ptsret, ptslen); if (r < 0) return r; r = ifd_verify_pts(&atr_info, proto, ptsret, r); if (r) { ct_error("%s: Bad PTS response", reader->name); return r; } } if ((st->flags & FLAG_NO_SETPARAM) == 0 && ((st->flags & FLAG_AUTO_ATRPARSE) == 0 || proto != IFD_PROTOCOL_T0)) { /* if FLAG_AUTO_ATRPARSE, only set the protocol. */ if ((st->flags & FLAG_AUTO_ATRPARSE) == 0) { if (proto == IFD_PROTOCOL_T0) { /* TA1 -> Fi | Di */ if (atr_info.TA[0] != -1) parambuf[0] = atr_info.TA[0]; /* TC1 -> N */ if (atr_info.TC[0] != -1) parambuf[2] = atr_info.TC[0]; /* TC2 -> WI */ if (atr_info.TC[1] != -1) parambuf[3] = atr_info.TC[1]; /* TA3 -> clock stop parameter */ /* XXX check for IFD clock stop support */ if (atr_info.TA[2] != -1) parambuf[4] = atr_info.TA[2] >> 6; } else if (proto == IFD_PROTOCOL_T1) { if (atr_info.TA[0] != -1) parambuf[0] = atr_info.TA[0]; parambuf[1] = 0x10; /* TC3 -> LRC/CRC selection */ if (atr_info.TC[2] == 1) parambuf[1] |= 0x1; else parambuf[1] &= 0xfe; /* TC1 -> N */ if (atr_info.TC[0] != -1) parambuf[2] = atr_info.TC[0]; /* atr_info->TB3 -> BWI/CWI */ if (atr_info.TB[2] != -1) parambuf[3] = atr_info.TB[2]; /* TA3 -> IFSC */ if (atr_info.TA[2] != -1) parambuf[5] = atr_info.TA[2]; /* * XXX CCID supports setting up clock stop for T=1, but the * T=1 ATR does not define a clock-stop byte. */ } } r = ccid_simple_wcommand(reader, s, CCID_CMD_SETPARAMS, ctl, parambuf, paramlen); if (r < 0) return r; } memset(¶mbuf[r], 0, sizeof(parambuf) - r); if (proto == IFD_PROTOCOL_T0) { if (st->reader_type == TYPE_CHAR) { p = ifd_protocol_new(proto, reader, slot->dad); } else { p = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, reader, slot->dad); } } else { p = ifd_protocol_new(proto, reader, slot->dad); if (p) { /* guessing that ifsc is limited by ifsd */ if (atr_info.TA[2] != -1) ifd_protocol_set_parameter(p, IFD_PROTOCOL_T1_IFSC, atr_info.TA[2] > st->ifsd ? st-> ifsd : atr_info. TA[2]); ifd_protocol_set_parameter(p, IFD_PROTOCOL_T1_IFSD, st->ifsd); if (atr_info.TC[2] == 1) ifd_protocol_set_parameter(p, IFD_PROTOCOL_T1_CHECKSUM_CRC, 0); } } if (p == NULL) { ct_error("%s: internal error", reader->name); return -1; } /* ccid_recv needs to know the exact expected data length */ if (st->reader_type == TYPE_CHAR) ifd_protocol_set_parameter(p, IFD_PROTOCOL_BLOCK_ORIENTED, 0); if (slot->proto) { ifd_protocol_free(slot->proto); slot->proto = NULL; } slot->proto = p; st->icc_proto[s] = proto; return 0; } static int ccid_escape(ifd_reader_t * reader, int slot, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { unsigned char sendbuf[CCID_MAX_MSG_LEN]; unsigned char recvbuf[CCID_MAX_MSG_LEN]; int r; ifd_debug(1, "slot: %d, slen %d, rlen %d", slot, slen, rlen); r = ccid_prepare_cmd(reader, sendbuf, sizeof(sendbuf), slot, CCID_CMD_ESCAPE, NULL, sbuf, slen); if (r < 0) return r; r = ccid_command(reader, &sendbuf[0], r, recvbuf, sizeof(recvbuf)); if (r < 0) return r; return ccid_extract_data(&recvbuf, r, rbuf, rlen); } static int ccid_transparent(ifd_reader_t * reader, int slot, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; ifd_debug(1, "called."); if (st->reader_type == TYPE_APDU || (st->reader_type == TYPE_TPDU && st->icc_proto[slot] == IFD_PROTOCOL_T0)) return ccid_exchange(reader, slot, sbuf, slen, rbuf, rlen); return IFD_ERROR_NOT_SUPPORTED; } static int ccid_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; unsigned char *apdu; ifd_debug(1, "called."); if (st->sbuf[dad]) { free(st->sbuf[dad]); st->sbuf[dad] = NULL; st->slen[dad] = 0; } apdu = (unsigned char *)calloc(1, len); if (!apdu) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } memcpy(apdu, buffer, len); st->sbuf[dad] = apdu; st->slen[dad] = len; return 0; } static int ccid_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; int r; ifd_debug(1, "called."); r = ccid_exchange(reader, dad, st->sbuf[dad], st->slen[dad], buffer, len); if (st->sbuf[dad]) free(st->sbuf[dad]); st->sbuf[dad] = NULL; st->slen[dad] = 0; if (r < 0) ifd_debug(3, "failed: %d", r); return r; } static int ccid_before_command(ifd_reader_t * reader) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; int rc; ifd_debug(1, "called."); if (!st->events_active) { return 0; } if (st->event_cap == NULL) { return 0; } rc = ifd_usb_end_capture(reader->device, st->event_cap); st->event_cap = NULL; return rc; } static int ccid_after_command(ifd_reader_t * reader) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; ifd_debug(1, "called."); if (!st->events_active) { return 0; } if (st->event_cap != NULL) { return 0; } return ifd_usb_begin_capture( reader->device, IFD_USB_URB_TYPE_INTERRUPT, reader->device->settings.usb.ep_intr, 8, &st->event_cap ); } static int ccid_get_eventfd(ifd_reader_t * reader, short *events) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; int fd; ifd_debug(1, "called."); if (!st->support_events) { return -1; } fd = ifd_device_get_eventfd(reader->device, events); if (fd != -1) { st->events_active = 1; } return fd; } static int ccid_event(ifd_reader_t * reader, int *status, size_t status_size) { ccid_status_t *st = (ccid_status_t *) reader->driver_data; unsigned char ret[20]; int bytes; ifd_debug(1, "called."); if (status_size < reader->nslots) { return IFD_ERROR_BUFFER_TOO_SMALL; } bytes = ifd_usb_capture_event(reader->device, st->event_cap, ret, 8); if (bytes < 0) { return bytes; } if (bytes > 0 && ret[0] == 0x50) { int slot; ifd_debug(3, "status received:%s", ct_hexdump(ret, bytes)); for (slot=0;slotnslots;slot++) { if (1 + (slot / 4) < bytes) { int bits = (ret[1 + (slot / 4)] >> (2 * (slot % 4))) & 0x3; if (bits & 2) status[slot] |= IFD_CARD_STATUS_CHANGED; if (bits & 1) status[slot] |= IFD_CARD_PRESENT; else status[slot] &= ~IFD_CARD_PRESENT; ifd_debug(1, "slot %d event result: %08x", slot, status[slot]); st->icc_present[slot] = status[slot] & IFD_CARD_PRESENT; } } } return 0; } static int ccid_error(ifd_reader_t * reader) { (void)reader; ifd_debug(1, "called."); return IFD_ERROR_DEVICE_DISCONNECTED; } /* * Driver operations */ static struct ifd_driver_ops ccid_driver; /* * Initialize this module */ void ifd_ccid_register(void) { ccid_driver.open = ccid_open; ccid_driver.close = ccid_close; ccid_driver.activate = ccid_activate; ccid_driver.deactivate = ccid_deactivate; ccid_driver.card_status = ccid_card_status; ccid_driver.card_reset = ccid_card_reset; ccid_driver.set_protocol = ccid_set_protocol; ccid_driver.transparent = ccid_transparent; ccid_driver.send = ccid_send; ccid_driver.recv = ccid_recv; ccid_driver.escape = ccid_escape; ccid_driver.before_command = ccid_before_command; ccid_driver.after_command = ccid_after_command; ccid_driver.get_eventfd = ccid_get_eventfd; ccid_driver.event = ccid_event; ccid_driver.error = ccid_error; ifd_driver_register("ccid", &ccid_driver); } openct-0.6.20/src/ifd/proto-t0.c0000644000175000017500000001475710625650421013210 00000000000000/* * Implementation of T=0 * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include typedef struct { ifd_protocol_t base; int state; long timeout; unsigned int block_oriented; unsigned int max_nulls; } t0_state_t; enum { IDLE, SENDING, RECEIVING, CONFUSED }; static int t0_xcv(ifd_protocol_t *, const void *, size_t, void *, size_t); static int t0_send(ifd_protocol_t *, ct_buf_t *, int); static int t0_recv(ifd_protocol_t *, ct_buf_t *, int, long); static int t0_resynch(t0_state_t *); /* * Set default T=1 protocol parameters */ static void t0_set_defaults(t0_state_t * t0) { t0->state = IDLE; t0->timeout = 2000; t0->max_nulls = 800; } /* * Attach t0 protocol */ static int t0_init(ifd_protocol_t * prot) { t0_set_defaults((t0_state_t *) prot); return 0; } /* * Detach t0 protocol */ static void t0_release(ifd_protocol_t * prot) { /* NOP */ } /* * Get/set parmaters for T1 protocol */ static int t0_set_param(ifd_protocol_t * prot, int type, long value) { t0_state_t *t0 = (t0_state_t *) prot; switch (type) { case IFD_PROTOCOL_RECV_TIMEOUT: t0->timeout = value; break; case IFD_PROTOCOL_BLOCK_ORIENTED: t0->block_oriented = value; break; default: ct_error("Unsupported parameter %d", type); return -1; } return 0; } static int t0_get_param(ifd_protocol_t * prot, int type, long *result) { t0_state_t *t0 = (t0_state_t *) prot; long value; switch (type) { case IFD_PROTOCOL_RECV_TIMEOUT: value = t0->timeout; break; case IFD_PROTOCOL_BLOCK_ORIENTED: value = t0->block_oriented; break; default: ct_error("Unsupported parameter %d", type); return -1; } if (result) *result = value; return 0; } /* * Send an APDU through T=0 */ static int t0_transceive(ifd_protocol_t * prot, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { t0_state_t *t0 = (t0_state_t *) prot; ifd_iso_apdu_t iso; unsigned char sdata[5]; unsigned int cla, cse, lc, le; int rc; if (t0->state != IDLE) { if (t0_resynch(t0) < 0) return -1; t0->state = IDLE; } if (slen < 4 || rlen < 2) return -1; /* Check the APDU case etc */ if ((rc = ifd_iso_apdu_parse(sbuf, slen, &iso)) < 0) return rc; cse = iso.cse; cla = iso.cla; lc = iso.lc; le = iso.le; switch (cse) { case IFD_APDU_CASE_1: /* Include a NUL lc byte */ memcpy(sdata, sbuf, 4); sdata[4] = 0; sbuf = sdata; slen = 5; break; case IFD_APDU_CASE_2S: case IFD_APDU_CASE_3S: break; case IFD_APDU_CASE_4S: /* Strip off the Le byte */ slen--; break; default: /* We don't handle ext APDUs */ return -1; } /* if (le + 2 > slen) { ct_error("t0_transceive: recv buffer too small"); return -1; } */ if (lc) { t0->state = SENDING; if ((rc = t0_xcv(prot, sbuf, slen, rbuf, 2)) < 0) return rc; /* Can this happen? */ if (rc != 2) return IFD_ERROR_COMM_ERROR; /* Case 4 APDU - check whether we should * try to get the response */ if (cse == IFD_APDU_CASE_4S) { unsigned char *sw; sw = (unsigned char *)rbuf; if (sw[0] == 0x61) { /* additional length info */ if (sw[1] != 0 && sw[1] < le) le = sw[1]; } else if ((sw[0] & 0xF0) == 0x60) { /* Command not accepted, do not * retrieve response */ goto done; } /* Transmit a Get Response command */ sdata[0] = cla; sdata[1] = 0xC0; sdata[2] = 0x00; sdata[3] = 0x00; sdata[4] = le; t0->state = RECEIVING; rc = t0_xcv(prot, sdata, 5, rbuf, le + 2); } } else { t0->state = RECEIVING; rc = t0_xcv(prot, sbuf, slen, rbuf, le + 2); } done:t0->state = IDLE; return rc; } static int t0_xcv(ifd_protocol_t * prot, const void *sdata, size_t slen, void *rdata, size_t rlen) { t0_state_t *t0 = (t0_state_t *) prot; ct_buf_t sbuf, rbuf; unsigned int null_count = 0; unsigned int ins; /* Let the driver handle any chunking etc */ if (t0->block_oriented) { int rc; if ((rc = ifd_send_command(prot, sdata, slen)) >= 0) rc = ifd_recv_response(prot, rdata, rlen, t0->timeout); return rc; } /* Set up the send buffer */ ct_buf_set(&sbuf, (void *)sdata, slen); ct_buf_init(&rbuf, rdata, rlen); /* Get the INS */ ins = sbuf.base[1]; if (t0_send(prot, &sbuf, 5) < 0) goto failed; while (1) { unsigned char byte; int count; if (ifd_recv_response(prot, &byte, 1, t0->timeout) < 0) goto failed; /* Null byte to extend wait time */ if (byte == 0x60) { usleep(100000); if (++null_count > t0->max_nulls) goto failed; continue; } /* ICC sends SW1 SW2 */ if ((byte & 0xF0) == 0x60 || (byte & 0xF0) == 0x90) { /* Store SW1, then get SW2 and store it */ if (ct_buf_put(&rbuf, &byte, 1) < 0 || t0_recv(prot, &rbuf, 1, t0->timeout) < 0) goto failed; break; } /* Send/receive data. * ACK byte means transfer everything in one go, * ~ACK means do it octet by octet. * SCEZ masks off using 0xFE, but the Towitoko * driver uses 0x0E. * Do we need to make this configurable? */ if (((byte ^ ins) & 0xFE) == 0) { /* Send/recv as much as we can */ count = -1; } else if (((~byte ^ ins) & 0xFE) == 0) { count = 1; } else { ifd_debug(2, "unexpected byte 0x%02x", byte); return -1; } if (t0->state == SENDING) { if (t0_send(prot, &sbuf, count) < 0) goto failed; } else { if (t0_recv(prot, &rbuf, count, t0->timeout) < 0) goto failed; if (ct_buf_tailroom(&rbuf) == 0) break; } } return ct_buf_avail(&rbuf); failed:t0->state = CONFUSED; return -1; } static int t0_send(ifd_protocol_t * prot, ct_buf_t * bp, int count) { int n, avail; avail = ct_buf_avail(bp); if (count < 0) count = avail; if (count > avail || !avail) return -1; n = ifd_send_command(prot, ct_buf_head(bp), count); if (n >= 0) ct_buf_get(bp, NULL, count); return n; } static int t0_recv(ifd_protocol_t * prot, ct_buf_t * bp, int count, long timeout) { int n; if (count < 0) count = ct_buf_tailroom(bp); n = ifd_recv_response(prot, ct_buf_tail(bp), count, timeout); if (n >= 0) ct_buf_put(bp, NULL, count); return n; } static int t0_resynch(t0_state_t * t0) { return -1; } /* * Protocol struct */ struct ifd_protocol_ops ifd_protocol_t0 = { IFD_PROTOCOL_T0, /* id */ "T=0", /* name */ sizeof(t0_state_t), /* size */ t0_init, /* init */ t0_release, /* release */ t0_set_param, /* set_param */ t0_get_param, /* get_param */ NULL, /* resynchronize */ t0_transceive, /* transceive */ NULL, /* sync_read */ NULL, /* sync_write */ }; openct-0.6.20/src/ifd/ifdproxy.c0000644000175000017500000001304610625650421013356 00000000000000/* * Remote device access - debugging utility that allows to * test smart card readers on remote hosts. * * Copyright (C) 2003, Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #ifdef HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "internal.h" #include "ria.h" static int opt_foreground = 0; static char *opt_config = NULL; static const char *opt_device_port = ":6666"; static const char *opt_server_port = "proxy"; static const char *opt_chroot = NULL; static const char *opt_user = NULL; static int get_ports(void); static int run_server(int, char **); static int run_client(int, char **); static int list_devices(int, char **); static void usage(int); static void version(void); int main(int argc, char **argv) { char *command; int c; if (argc < 2) usage(1); ct_log_destination("@stderr"); while ((c = getopt(argc, argv, "df:FR:U:v")) != -1) { switch (c) { case 'd': ct_config.debug++; break; case 'f': opt_config = optarg; break; case 'F': opt_foreground++; break; case 'R': opt_chroot = optarg; break; case 'U': opt_user = optarg; break; case 'v': version(); break; default: usage(1); } } if (ifd_config_parse(opt_config) < 0) return 1; if (optind >= argc) usage(1); command = argv[optind++]; if (get_ports() < 0) return 1; if (!strcmp(command, "server")) { run_server(argc - optind, argv + optind); } else if (!strcmp(command, "export")) { return run_client(argc - optind, argv + optind); } else if (!strcmp(command, "list")) { list_devices(argc - optind, argv + optind); } else if (!strcmp(command, "version")) { version(); } else { ct_error("Unknown command `%s'\n", command); return 1; } return 0; } static void enter_jail(void) { struct passwd *pw = NULL; if (opt_chroot && !opt_user) opt_user = "nobody"; if (opt_user) { if (!(pw = getpwnam(opt_user))) { ct_error("Unknown user %s\n", opt_user); exit(1); } endpwent(); } if (opt_chroot) { if (chdir("/") < 0 || chroot(opt_chroot) < 0) { ct_error("chroot(%s) failed: %m", opt_chroot); exit(1); } } if (pw) { if (setgroups(0, NULL) < 0 || setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) { ct_error("Failed to drop privileges: %m"); exit(1); } } } static void background_process(void) { int fd; if (daemon(0, 0) < 0) { ct_error("failed to background process: %m"); exit(1); } if ((fd = open("/dev/null", O_RDWR)) >= 0) { dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); if (fd > 2) close(fd); } ct_log_destination("@syslog"); setsid(); } static int get_ports(void) { char *address; int rc; if ((rc = ifd_conf_get_string("ifdproxy.device-port", &address)) >= 0) opt_device_port = address; if ((rc = ifd_conf_get_string("ifdproxy.server-port", &address)) >= 0) opt_server_port = address; return 0; } static int run_server(int argc, char **argv) { int rc; char path[PATH_MAX]; if (!ct_format_path(path, PATH_MAX, opt_server_port)) { return -1; } if (argc != 0) usage(1); if (ct_config.debug) ct_socket_reuseaddr(1); if ((rc = ria_svc_listen(path, 1)) < 0) { ct_error("Cannot bind to server port \"%s\": %s\n", path, ct_strerror(rc)); return rc; } if ((rc = ria_svc_listen(opt_device_port, 0)) < 0) { ct_error("Cannot bind to device port \"%s\": %s\n", opt_device_port, ct_strerror(rc)); return rc; } enter_jail(); if (!opt_foreground) background_process(); ct_mainloop(); return 0; } static int run_client(int argc, char **argv) { const char *name, *device, *address; ria_client_t *ria; int rc; /* Initialize IFD library */ if (ifd_init()) return 1; if (argc != 2 && argc != 3) usage(1); name = argv[0]; device = argv[1]; address = argc == 3 ? argv[2] : opt_device_port; ria = ria_export_device(address, device); ifd_debug(1, "About to register device as \"%s\"", name); if ((rc = ria_register_device(ria, name)) < 0) { ct_error("Unable to register device: %s\n", ct_strerror(rc)); exit(1); } enter_jail(); if (!opt_foreground) background_process(); ct_mainloop(); return 0; } static int list_devices(int argc, char **argv) { unsigned char buffer[8192]; ria_device_t *info; ria_client_t *clnt; unsigned int n, count; int rc; if (argc == 1) opt_server_port = argv[0]; else if (argc > 1) usage(1); if (!(clnt = ria_connect(opt_server_port))) exit(1); rc = ria_command(clnt, RIA_MGR_LIST, NULL, 0, buffer, sizeof(buffer), -1); if (rc < 0) { ct_error("Failed to list exported devices: %s", ct_strerror(rc)); ria_free(clnt); return 1; } count = rc / sizeof(ria_device_t); if (count == 0) { printf("No exported devices\n"); ria_free(clnt); return 0; } printf("Exported devices\n"); for (info = (ria_device_t *) buffer, n = 0; n < count; info++, n++) { printf(" %-16s %-30s %s\n", info->handle, info->address, info->name); } ria_free(clnt); return 0; } static void version(void) { fprintf(stderr, "OpenCT " VERSION "\n"); exit(0); } static void usage(int exval) { fprintf(exval ? stderr : stdout, "Usage:\n" "ifdproxy server [-dF]\n" "ifdproxy export [-dF] name device address\n" "ifdproxy list [-dF] address\n" "ifdproxy version\n"); exit(exval); } openct-0.6.20/src/ifd/ctbcs.c0000644000175000017500000000566210625650421012615 00000000000000/* * Build Extended CTBCS APDUs for those readers that * support them (such as Kobil Kaan). * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include #include "ctbcs.h" /* * Start building CTBCS apdu */ void ctbcs_begin(ct_buf_t * bp, unsigned int ins, unsigned int p1, unsigned int p2) { ct_buf_putc(bp, 0x20); ct_buf_putc(bp, ins); ct_buf_putc(bp, p1); ct_buf_putc(bp, p2); ct_buf_putc(bp, 0); } /* * Finish CTBCS apdu */ int ctbcs_finish(ct_buf_t * bp) { unsigned int len; if (ct_buf_overrun(bp)) return IFD_ERROR_BUFFER_TOO_SMALL; len = ct_buf_avail(bp); bp->base[4] = len - 5; /* lc */ return len; } /* * Output a string to the display */ int ctbcs_build_output(unsigned char *cmd, size_t size, const char *message) { ct_buf_t buf; if (message == NULL) return IFD_ERROR_INVALID_ARG; ct_buf_init(&buf, cmd, size); ctbcs_begin(&buf, 0x17, 0x40, 0x00); ctbcs_add_message(&buf, message); return ctbcs_finish(&buf); } /* * Generic Verify APDU */ static int ctbcs_build_verify_apdu(unsigned char *cmd, size_t size, unsigned char ins, unsigned char p1, const char *prompt, unsigned int timeout, const unsigned char *data, size_t data_len) { ct_buf_t buf; if (!data || !data_len) return IFD_ERROR_INVALID_ARG; if (prompt == NULL) return IFD_ERROR_INVALID_ARG; ct_buf_init(&buf, cmd, size); ctbcs_begin(&buf, ins, p1, 0x00); ctbcs_add_timeout(&buf, timeout); ctbcs_add_message(&buf, prompt); ct_buf_putc(&buf, 0x52); ct_buf_putc(&buf, data_len); ct_buf_put(&buf, data, data_len); if (ct_buf_overrun(&buf)) return IFD_ERROR_BUFFER_TOO_SMALL; cmd[4] = ct_buf_avail(&buf) - 5; /* lc */ return ct_buf_avail(&buf); } /* * Build Perform Verify APDU */ int ctbcs_build_perform_verify_apdu(unsigned char *cmd, size_t size, unsigned int p1, const char *prompt, unsigned int timeout, const unsigned char *data, size_t data_len) { return ctbcs_build_verify_apdu(cmd, size, 0x18, p1, prompt, timeout, data, data_len); } /* * Build Modify Verify APDU */ int ctbcs_build_modify_verify_apdu(unsigned char *cmd, size_t size, unsigned int p1, const char *prompt, unsigned int timeout, const unsigned char *data, size_t data_len) { return ctbcs_build_verify_apdu(cmd, size, 0x19, p1, prompt, timeout, data, data_len); } /* * Helper function add message/timeout arguments to command * buffer */ int ctbcs_add_timeout(ct_buf_t * bp, unsigned int timeout) { if (!timeout) return 0; ct_buf_putc(bp, 0x80); ct_buf_putc(bp, 1); ct_buf_putc(bp, timeout); return ct_buf_avail(bp); } int ctbcs_add_message(ct_buf_t * bp, const char *message) { int n; if (!message || !strcmp(message, "@")) return 0; if ((n = strlen(message)) > 32) n = 32; ct_buf_putc(bp, 0x50); ct_buf_putc(bp, n); ct_buf_put(bp, message, n); return ct_buf_avail(bp); } openct-0.6.20/src/ifd/atr.c0000644000175000017500000000727711303255320012302 00000000000000/* * ATR parsing functions * * Copyright (C) 2004, Olaf Kirch */ #include "internal.h" #include #include "atr.h" int ifd_atr_parse(ifd_atr_info_t * info, const unsigned char *atr, size_t len) { unsigned int m, n, k; ifd_debug(1, "atr=%s", ct_hexdump(atr, len)); /* Initialize the atr_info struct */ memset(info, 0, sizeof(*info)); info->default_protocol = -1; for (n = 0; n < 3; n++) { info->TA[n] = -1; info->TB[n] = -1; info->TC[n] = -1; } if (len < 2 + (atr[1] & 0x0f)) return IFD_ERROR_INVALID_ATR; /* Ignore hysterical bytes */ len -= atr[1] & 0x0f; for (m = 0, n = 2; n < len; m++) { unsigned int TDi; /* TA1, TA2, TA3, TA4 are legal, TA5 wouldn't be */ if (m > 3) return IFD_ERROR_INVALID_ATR; TDi = atr[n - 1]; if (n != 2) { int prot; prot = TDi & 0x0f; if (info->default_protocol < 0) info->default_protocol = prot; info->supported_protocols |= (1 << prot); } k = ifd_count_bits(TDi & 0xF0); if (k == 0 || n + k > len) return IFD_ERROR_INVALID_ATR; if (TDi & 0x10) info->TA[m] = atr[n++]; if (TDi & 0x20) info->TB[m] = atr[n++]; if (TDi & 0x40) info->TC[m] = atr[n++]; if (!(TDi & 0x80)) { /* If the ATR indicates we support anything * in addition to T=0, there'll be a TCK byte * at the end of the string. * For now, simply chop it off. Later we may * want to verify it. */ if (info->supported_protocols & ~0x1) len--; if (n < len) return IFD_ERROR_INVALID_ATR; break; } n++; } /* ATR didn't list any supported protocols, so * we default to T=0 */ if (info->supported_protocols == 0) { info->supported_protocols = 0x01; info->default_protocol = IFD_PROTOCOL_T0; } ifd_debug(1, "supported protocols=0x%x, default protocol=%d", info->supported_protocols, info->default_protocol); return 0; } /* * Given the ATR info and a selected protocol, build the PTS * string. */ int ifd_build_pts(const ifd_atr_info_t * info, int protocol, unsigned char *buf, size_t len) { unsigned char ptsbuf[7], pck; size_t n, ptslen = 0; /* IFD_PROTOCOL_Tn is just n, so we take it easy here */ if (!(info->supported_protocols & (1 << protocol))) { ct_error("Protocol not supported by card (according to ATR)"); return IFD_ERROR_NOT_SUPPORTED; } ptsbuf[ptslen++] = 0xFF; ptsbuf[ptslen++] = protocol; if (info->TA[0] != -1) { ptsbuf[ptslen++] = info->TA[0]; ptsbuf[1] |= 0x10; } if (info->TC[0] == 255) { ptsbuf[ptslen++] = 1; ptsbuf[1] |= 0x20; } for (n = 0, pck = 0; n < ptslen; n++) pck ^= ptsbuf[n]; ptsbuf[ptslen++] = pck; if (ptslen > len) return IFD_ERROR_BUFFER_TOO_SMALL; memcpy(buf, ptsbuf, ptslen); return ptslen; } /* validate a PTS response according to ISO7816-3 */ int ifd_verify_pts(ifd_atr_info_t * info, int protocol, const unsigned char *buf, size_t len) { int n, i; int ptsr[3]; int pck; if (len < 3) return IFD_ERROR_BUFFER_TOO_SMALL; if (buf[0] != 0xFF) return IFD_ERROR_INCOMPATIBLE_DEVICE; /* not a pts response */ for (n = 0, pck = 0; n < len; n++) pck ^= buf[n]; if (pck) return IFD_ERROR_COMM_ERROR; for (i = 0; i < 3; i++) ptsr[i] = -1; for (i = 0, n = 2; i < 3 && n < len - 1; i++) { if (buf[1] & 1 << (i + 4)) ptsr[i] = buf[n++]; } if (n < len - 1) /* extra bytes in response */ return IFD_ERROR_INCOMPATIBLE_DEVICE; if (info->TA[0] != -1 && ptsr[0] != info->TA[0]) info->TA[0] = -1; if (info->TC[0] == 255 && (ptsr[1] == -1 || (ptsr[1] & 1) == 0)) return IFD_ERROR_INCOMPATIBLE_DEVICE; return 0; } int ifd_pts_complete(const unsigned char *pts, size_t len) { unsigned int j = 2; if (j > len) return 0; j = +ifd_count_bits(pts[1] & 0x70); j++; if (j > len) return 0; return 1; } openct-0.6.20/src/ifd/ifd-smartboard.c0000644000175000017500000002244610625650421014414 00000000000000/* * Driver for Cherry smartboard * * This was written just by looking at the Smartboard protocol * on the wire. * * Some notes on the Smartboard protocol. * The basic message format seems to be * * 00 [len] [code] * * 00 Seems to be some general "I'm okay, you're okay" byte. * Never seen anything else, but maybe it can be used to * convey some critical errors etc. * len One byte; length of following data * code One byte; message code. * Followed by data * * I have no clue yet how to use the num block for PIN entry... * * This driver is alpha code - it works for me with a Cryptoflex card, * but that doesn't mean a thing :) * * Copyright (C) 2003 Olaf Kirch */ #include "internal.h" #include #include #include #include #include #include #include "ctbcs.h" static int smartboard_reset_ct(ifd_reader_t * reader); static int smartboard_command(ifd_reader_t *, unsigned char, const unsigned char *, size_t, unsigned char *, void *, size_t); static int __smartboard_cmd(ifd_reader_t *, unsigned char, const void *, size_t); static int __smartboard_rsp(ifd_reader_t *, unsigned char *, void *, size_t); /* * Initialize the device */ static int smartboard_open(ifd_reader_t * reader, const char *device_name) { ifd_device_params_t params; ifd_device_t *dev; int res; reader->name = "Cherry Smartboard"; reader->nslots = 1; reader->slot[0].dad = 0; if (!(dev = ifd_device_open(device_name))) return -1; ifd_device_flush(dev); if (ifd_device_type(dev) != IFD_DEVICE_TYPE_SERIAL) { ct_error("Smartboard: must be a serial device"); return -1; } if ((res = ifd_device_get_parameters(dev, ¶ms)) < 0) { ct_error("Smartboard: failed to get serial config"); return res; } params.serial.bits = 8; params.serial.parity = IFD_SERIAL_PARITY_EVEN; params.serial.stopbits = 2; params.serial.speed = 115200; params.serial.check_parity = 1; if ((res = ifd_device_set_parameters(dev, ¶ms)) < 0) { ct_error("Smartboard: failed to get serial line to 115200/8E2"); return res; } /* Toggle RTS briefly */ { int bits = 0x4000; usleep(230000); ioctl(dev->fd, TIOCMSET, &bits); usleep(230000); bits |= TIOCM_DTR; ioctl(dev->fd, TIOCMSET, &bits); usleep(230000); bits |= TIOCM_RTS; ioctl(dev->fd, TIOCMSET, &bits); usleep(100000); } ifd_serial_send_break(dev, 500000); ifd_device_flush(dev); reader->device = dev; /* Reset the CT */ if ((res = smartboard_reset_ct(reader)) < 0) return res; return 0; } /* * Reset the card reader */ static int smartboard_reset_ct(ifd_reader_t * reader) { unsigned char buffer[128], code; int rc; #if 1 /* shutdown reader - occasionally needed before we can init it */ rc = smartboard_command(reader, 0x6a, NULL, 0, &code, NULL, 0); if (rc < 0) return rc; #endif /* init reader */ rc = smartboard_command(reader, 0x60, NULL, 0, &code, buffer, sizeof(buffer)); if (rc < 0) return rc; if (code != 0x60) { ct_error("smartboard_reset_ct, expected status 0x60, got 0x%x", code); return -1; } ifd_debug(1, "Detected %.*s", rc, buffer); return 0; } /* * Power up the reader */ static int smartboard_activate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int smartboard_deactivate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } /* * Get the card status */ static int smartboard_card_status(ifd_reader_t * reader, int idx, int *status) { unsigned char code, buffer[16]; int rc; ifd_debug(1, "slot=%d", idx); rc = smartboard_command(reader, 0x65, NULL, 0, &code, buffer, sizeof(buffer)); if (rc < 0) return rc; *status = 0; switch (code) { case 0x61: /* card absent: 00 00 00 01 * card present: 08 00 00 02 * after reset: 19 01 00 04 */ if (rc >= 4 && (buffer[0] & 0x08)) *status = IFD_CARD_PRESENT; break; case 0x65: ifd_debug(1, "event: card inserted."); *status = IFD_CARD_PRESENT | IFD_CARD_STATUS_CHANGED; break; case 0x66: ifd_debug(1, "event: card removed."); *status = IFD_CARD_STATUS_CHANGED; break; default: ct_error("smartboard_card_status: unexpected status code 0x%x", code); return -1; } return 0; } /* * Reset card and get ATR */ static int smartboard_card_reset(ifd_reader_t * reader, int slot, void *result, size_t size) { unsigned char code; int rc; rc = smartboard_command(reader, 0x65, NULL, 0, &code, result, size); if (rc < 0) return rc; rc = smartboard_command(reader, 0x62, NULL, 0, &code, result, size); if (rc < 0) return rc; if (code != 0x64) { ct_error ("smartboard_card_reset: expected status code 0x62, got 0x%x", code); return -1; } return rc; } /* * Select a protocol for communication with the ICC. * We cannot use the T=0 driver directly, because it thinks it can * talk over the wire. */ static int smartboard_set_protocol(ifd_reader_t * reader, int nslot, int proto) { unsigned char cmd_t0[5] = { 0x00, 0x00, 0x0a, 0x00, 0x10 }; unsigned char cmd_t1[5] = { 0x10, 0x00, 0x00, 0x75, 0x10 }; unsigned char *args, code; ifd_slot_t *slot; int rc; slot = &reader->slot[nslot]; if (proto == IFD_PROTOCOL_T0) { args = cmd_t0; } else if (proto == IFD_PROTOCOL_T1) { args = cmd_t1; } else { ct_error("%s: protocol not supported", reader->name); return -1; } if ((rc = smartboard_command(reader, 0x61, args, 5, &code, NULL, 0)) < 0) return rc; if (code != 0x62) { ct_error("smartboard: unexpected status code 0x%x", code); return -1; } slot->proto = ifd_protocol_new(proto, reader, slot->dad); if (slot->proto == NULL) { ct_error("%s: internal error", reader->name); return -1; } /* Tell the protocol handler that we will do the framing */ ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 1); return 0; } #if 0 /* * Perform a PIN verification */ static int smartboard_perform_verify(ifd_reader_t * reader, int nslot, unsigned int timeout, const char *prompt, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len) { ...} #endif /* * Simple command */ static int __smartboard_cmd(ifd_reader_t * reader, unsigned char cmd, const void *arg, size_t arg_len) { unsigned char buffer[257]; if (arg_len > sizeof(buffer) - 3) return -1; buffer[0] = 0x00; /* never seen anything other than this */ buffer[1] = 1 + arg_len; buffer[2] = cmd; memcpy(buffer + 3, arg, arg_len); if (ct_config.debug > 1) ifd_debug(3, "sending:%s", ct_hexdump(buffer, 3 + arg_len)); return ifd_device_send(reader->device, buffer, 3 + arg_len); } static int __smartboard_rsp(ifd_reader_t * reader, unsigned char *code, void *res, size_t res_len) { unsigned char buffer[257]; unsigned int rsp_len = 0, total = 2; int rc; while (rsp_len < total) { rc = ifd_device_recv(reader->device, buffer + rsp_len, total - rsp_len, -1); if (rc < 0) return rc; if (buffer[0] != 0x00) goto bad_reply; rsp_len += rc; if (rsp_len == 2) { if (buffer[1] == 0) goto bad_reply; total += buffer[1]; } } if (total < 3) goto bad_reply; *code = buffer[2]; if (ct_config.debug > 1) ifd_debug(3, "received:%s", ct_hexdump(buffer, total)); rsp_len = total - 3; if (res_len > rsp_len) res_len = rsp_len; if (res && res_len) memcpy(res, buffer + 3, res_len); return res_len; bad_reply: ct_error("smartboard: bad reply from device"); return -1; } static int smartboard_command(ifd_reader_t * reader, unsigned char cmd, const unsigned char *arg, size_t arg_len, unsigned char *code, void *res, size_t res_len) { int n = 0, rc; do { if ((rc = __smartboard_cmd(reader, cmd, arg, arg_len)) < 0 || (rc = __smartboard_rsp(reader, code, res, res_len)) < 0) ct_error("smartboard: transceive error"); } while (rc >= 0 && *code == 0x67 && n++ < 3); return rc; } /* * Send/receive APDU */ static int smartboard_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { ifd_debug(3, "data:%s", ct_hexdump(buffer, len)); return __smartboard_cmd(reader, 0x67, buffer, len); } static int smartboard_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { unsigned char code; int rc; ifd_debug(4, "called."); /* Status code 63 seems to be some sort of wait time extension */ while (1) { if ((rc = __smartboard_rsp(reader, &code, buffer, len)) < 0) return rc; if (code != 0x63) break; } if (code != 0x64) { ct_error("smartboard: unexpected status code 0x%x", code); return -1; } ifd_debug(3, "resp:%s", ct_hexdump(buffer, rc)); return rc; } /* * Driver operations */ static struct ifd_driver_ops smartboard_driver; /* * Initialize this module */ void ifd_smartboard_register(void) { smartboard_driver.open = smartboard_open, smartboard_driver.activate = smartboard_activate, smartboard_driver.deactivate = smartboard_deactivate, smartboard_driver.card_status = smartboard_card_status, smartboard_driver.card_reset = smartboard_card_reset, #ifdef notyet smartboard_driver.perform_verify = smartboard_perform_verify, #endif smartboard_driver.send = smartboard_send, smartboard_driver.recv = smartboard_recv, smartboard_driver.set_protocol = smartboard_set_protocol, ifd_driver_register("smartboard", &smartboard_driver); } openct-0.6.20/src/ifd/ifdhandler.c0000644000175000017500000002242311151454644013615 00000000000000/* * Manage a single reader * * Copyright (C) 2003 Olaf Kirch */ #include "internal.h" #include #include #include #ifdef HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ifdhandler.h" static int opt_debug = 0; static int opt_hotplug = 0; static int opt_foreground = 0; static int opt_info = 0; static int opt_poll = 0; static const char *opt_reader = NULL; static void usage(int exval); static void version(void); static void ifdhandler_run(ifd_reader_t *); static int ifdhandler_poll_presence(ct_socket_t *, struct pollfd *); static int ifdhandler_event(ct_socket_t * sock); static int ifdhandler_accept(ct_socket_t *); static int ifdhandler_error(ct_socket_t *); static int ifdhandler_recv(ct_socket_t *); static int ifdhandler_send(ct_socket_t *); static void ifdhandler_close(ct_socket_t *); static void print_info(void); int main(int argc, char **argv) { const char *driver = NULL, *type = NULL, *device = NULL; ifd_reader_t *reader; ct_info_t *status; int c; /* Make sure the mask is good */ umask(033); while ((c = getopt(argc, argv, "dFHhvipr:s")) != -1) { switch (c) { case 'd': opt_debug++; break; case 'F': opt_foreground = 1; break; case 'H': opt_hotplug = 1; break; case 'i': opt_info = 1; break; case 'p': opt_poll = 1; break; case 'r': opt_reader = optarg; break; case 's': ct_log_destination("@syslog"); break; case 'v': version(); case 'h': usage(0); default: usage(1); } } if (opt_info) { if (optind != argc) usage(1); if (ifd_init()) return 1; print_info(); return 0; } if (optind != argc - 3) usage(1); driver = argv[optind++]; type = argv[optind++]; device = argv[optind++]; ct_config.debug = opt_debug; /* Initialize IFD library */ if (ifd_init()) return 1; /* Allocate a socket slot * FIXME: may need to use a lock file here to * prevent race condition */ { int r = -1; char path[PATH_MAX]; status = ct_status_alloc_slot(&r); if (status == NULL) { ct_error("too many readers, no reader slot available"); return 1; } snprintf(path, PATH_MAX, "%d", r); opt_reader = strdup(path); } /* Become a daemon if needed - we do this after allocating the * slot so openct-control can synchronize slot allocation */ if (!opt_foreground) { pid_t pid; int fd; if ((pid = fork()) < 0) { ct_error("fork: %m"); return 1; } if (pid) { status->ct_pid = pid; return 0; } if ((fd = open("/dev/null", O_RDWR)) >= 0) { dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); close(fd); } ct_log_destination("@syslog"); setsid(); } /* Create reader */ { char *typedev = malloc(strlen(type) + strlen(device) + 2); if (!typedev) { ct_error("out of memory"); return 1; } sprintf(typedev, "%s:%s", type, device); if (!(reader = ifd_open(driver, typedev))) { ct_error("unable to open reader %s %s %s", driver, type, device); return 1; } free(typedev); } ifd_device_set_hotplug(reader->device, opt_hotplug); reader->status = status; strncpy(status->ct_name, reader->name, sizeof(status->ct_name) - 1); status->ct_slots = reader->nslots; if (reader->flags & IFD_READER_DISPLAY) status->ct_display = 1; if (reader->flags & IFD_READER_KEYPAD) status->ct_keypad = 1; ifdhandler_run(reader); return 0; } static void TERMhandler(int signo) { ct_mainloop_leave(); } /* * Spawn a new ifd handler thread */ static void ifdhandler_run(ifd_reader_t * reader) { ct_socket_t *sock; int rc; struct sigaction act; char path[PATH_MAX]; if (!ct_format_path(path, PATH_MAX, opt_reader)) { ct_error("ct_format_path failed!"); exit(1); } /* Activate reader */ if ((rc = ifd_activate(reader)) < 0) { ct_error("Failed to activate reader; err=%d", rc); exit(1); } sock = ct_socket_new(0); if (ct_socket_listen(sock, path, 0666) < 0) { ct_error("Failed to create server socket"); exit(1); } sock->user_data = reader; sock->recv = ifdhandler_accept; ct_mainloop_add_socket(sock); /* Set an TERM signal handler for clean exit */ act.sa_handler = TERMhandler; sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(SIGTERM, &act, NULL); /* Encapsulate the reader into a socket struct */ sock = ct_socket_new(0); if (opt_poll) { sock->fd = -1; } else { sock->fd = ifd_get_eventfd(reader, &sock->events); } if (sock->fd == -1) { ifd_debug(1, "events inactive for reader %s", reader->name); sock->fd = 0x7FFFFFFF; sock->poll = ifdhandler_poll_presence; } else { ifd_debug(1, "events active for reader %s", reader->name); sock->error = ifdhandler_error; sock->send = ifdhandler_event; ifd_before_command(reader); ifd_poll(reader); ifd_after_command(reader); } sock->user_data = reader; ct_mainloop_add_socket(sock); /* Call the server loop */ ct_mainloop(); ct_socket_unlink(sock); ct_socket_free(sock); memset(reader->status, 0, sizeof(*reader->status)); ct_status_update(reader->status); ifd_debug(1, "ifdhandler for reader %s shut down", reader->name); exit(0); } static void exit_on_device_disconnect(ifd_reader_t *reader) { ifd_debug(1, "Reader %s detached", reader->name); memset(reader->status, 0, sizeof(*reader->status)); exit(0); } /* * Poll for presence of hotplug device */ static int ifdhandler_poll_presence(ct_socket_t * sock, struct pollfd *pfd) { ifd_reader_t *reader = (ifd_reader_t *) sock->user_data; ifd_device_t *dev = reader->device; ifd_poll(reader); if (dev->hotplug && ifd_device_poll_presence(dev, pfd) == 0) { exit_on_device_disconnect(reader); } return 1; } /* * Error from socket */ static int ifdhandler_error(ct_socket_t * sock) { ifd_reader_t *reader = (ifd_reader_t *) sock->user_data; if (ifd_error(reader) < 0) { exit_on_device_disconnect(reader); } return 0; } /* * Receive data from client */ static int ifdhandler_event(ct_socket_t * sock) { ifd_reader_t *reader = (ifd_reader_t *) sock->user_data; if (ifd_event(reader) < 0) { exit_on_device_disconnect(reader); } return 0; } /* * Handle connection request from client */ static int ifdhandler_accept(ct_socket_t * listener) { ct_socket_t *sock; if (!(sock = ct_socket_accept(listener))) return 0; sock->user_data = listener->user_data; sock->recv = ifdhandler_recv; sock->send = ifdhandler_send; sock->close = ifdhandler_close; return 0; } /* * Receive data from client */ static int ifdhandler_recv(ct_socket_t * sock) { ifd_reader_t *reader; char buffer[CT_SOCKET_BUFSIZ + 64]; header_t header; ct_buf_t args, resp; int rc; /* Error or client closed connection? */ if ((rc = ct_socket_filbuf(sock, -1)) <= 0) return -1; /* If request is incomplete, go back * and wait for more * XXX add timeout? */ if ((rc = ct_socket_get_packet(sock, &header, &args)) < 1) return rc; ct_buf_init(&resp, buffer, sizeof(buffer)); reader = (ifd_reader_t *) sock->user_data; header.error = ifdhandler_process(sock, reader, &args, &resp); if (header.error) ct_buf_clear(&resp); /* Put packet into transmit buffer */ header.count = ct_buf_avail(&resp); if (ct_socket_put_packet(sock, &header, &resp) < 0) return -1; /* Leave transmitting to the main server loop */ return 0; } /* * Transmit data to client */ static int ifdhandler_send(ct_socket_t * sock) { return ct_socket_flsbuf(sock, 0); } /* * Socket is closed - for whatever reason * Release any locks held by this client */ static void ifdhandler_close(ct_socket_t * sock) { ifdhandler_unlock_all(sock); } /* * Display ifdhandler configuration stuff */ static void print_list(const char **names, unsigned int n) { unsigned int i, width = 0, len; for (i = 0; i < n; i++) { len = 1 + strlen(names[i]); if (width && width + len > 64) { printf("\n"); width = 0; } if (width == 0) { printf(" "); width = 3; } printf(" %s", names[i]); if (i < n - 1) { printf(","); len++; } width += len; } if (width) printf("\n"); } static void print_info(void) { const char *names[64]; unsigned int n; n = ifd_drivers_list(names, 64); if (n == 0) { printf("No reader drivers configured\n"); } else { printf("Reader drivers:\n"); print_list(names, n); } n = ifd_protocols_list(names, 64); if (n == 0) { printf("No protocols configured\n"); } else { printf("Protocols:\n"); print_list(names, n); } } /* * Display version */ static void version(void) { fprintf(stdout, "OpenCT " VERSION "\n"); exit(0); } /* * Usage message */ static void usage(int exval) { fprintf(exval ? stderr : stdout, "usage: ifdhandler [-Hds] [-r reader] driver type device\n" " -r specify index of reader\n" " -F stay in foreground\n" " -H hotplug device, monitor for detach\n" " -p force polling device even if events supported\n" " -s send error and debug messages to syslog\n" " -d enable debugging; repeat to increase verbosity\n" " -i display list of available drivers and protocols\n" " -h display this message\n" " -v display version and exit\n"); exit(exval); } openct-0.6.20/src/ifd/cardman.h0000644000175000017500000001073310422076714013126 00000000000000#ifndef _CARDMAN_H_ #define _CARDMAN_H_ #define MAX_ATR 33 #define CM2020_MAX_DEV 16 #define CM4000_MAX_DEV 4 typedef struct atreq { int atr_len; unsigned char atr[64]; int power_act; unsigned char bIFSD; unsigned char bIFSC; } atreq_t; typedef struct ptsreq { unsigned long protocol; /*T=0: 2^0, T=1: 2^1 */ unsigned char flags; unsigned char pts1; unsigned char pts2; unsigned char pts3; } ptsreq_t; #define CM_IOC_MAGIC 'c' #define CM_IOC_MAXNR 255 #define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *) #define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *) #define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *) #define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3) #define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4) #define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*) /* card and device states */ #define CM_CARD_INSERTED 0x01 #define CM_CARD_POWERED 0x02 #define CM_ATR_PRESENT 0x04 #define CM_ATR_VALID 0x08 #define CM_STATE_VALID 0x0f /* extra info only from CM4000 */ #define CM_NO_READER 0x10 #define CM_BAD_CARD 0x20 #ifdef __KERNEL__ /* USB can have 16 readers, while PCMCIA is allowed 4 slots */ #define CM4000_MAX_DEV 4 #ifdef __CM2020__ #define MODULE_NAME "cardman_usb" #define CM2020_MAX_DEV 16 #define CM2020_MINOR 224 #define CM2020_REQT_WRITE 0x42 #define CM2020_REQT_READ 0xc2 #define CM2020_MODE_1 0x01 #define CM2020_MODE_2 0x02 #define CM2020_MODE_3 0x03 #define CM2020_MODE_4 0x08 #define CM2020_CARD_ON 0x10 #define CM2020_CARD_OFF 0x11 #define CM2020_GET_STATUS 0x20 #define CM2020_STATUS_MASK 0xc0 #define CM2020_STATUS_NO_CARD 0x00 #define CM2020_STATUS_NOT_POWERD 0x40 #define CM2020_STATUS_POWERD 0xc0 #define CM2020_SET_PARAMETER 0x30 #define CM2020_CARDON_COLD 0x00 #define CM2020_CARDON_WARM 0x01 #define CM2020_FREQUENCY_3_72MHZ 0x00 #define CM2020_FREQUENCY_5_12MHZ 0x10 #define CM2020_BAUDRATE_115200 0x0C #define CM2020_BAUDRATE_76800 0x08 #define CM2020_BAUDRATE_57600 0x06 #define CM2020_BAUDRATE_38400 0x04 #define CM2020_BAUDRATE_28800 0x03 #define CM2020_BAUDRATE_19200 0x02 #define CM2020_BAUDRATE_9600 0x01 #define CM2020_ODD_PARITY 0x80 #define CM2020_CARD_ASYNC 0x00 enum { CB_NOP, CB_SET_PARAMETER, CB_READ_STATUS, CB_READ_ATR, CB_WRITE_PTS, CB_READ_PTS, CB_WRITE_T1, CB_PROG_T1, CB_READ_T1, CB_WRITE_T0, CB_WRITE_T0_SW1SW2, CB_READ_T0, CB_READ_T0_DATA, CB_CARD_OFF, CB_T1MODE2 }; #define TIMEOUT_LEN 60000 #define MAX_RBUF 512 typedef struct usb_cardman { struct usb_device *dev; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) struct usb_interface *interface; /* the interface for this device */ #endif struct task_struct *owner; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20) struct usb_ctrlrequest *dr; #else devrequest *dr; #endif struct urb *irq, *ctrl, *rctl; unsigned char *ibuf, *cbuf, *rcbuf; wait_queue_head_t waitq; unsigned char atr[MAX_ATR]; unsigned char atr_csum; unsigned char atr_len; unsigned char bIFSD, bIFSC; unsigned char ta1; /* TA(1) specifies Fi over b8 to b5, Di over b4 to b1 */ unsigned char pts[4]; unsigned char rbuf[MAX_RBUF]; short rlen; int t1_reply_len; /* length of a T=0 packet, excl. the header length */ unsigned char t0_data_len; /* relative data offset as we proceed through the packet */ unsigned char t0_data_off; /* byte 2 of the T=0 header (INS from CLA INS ADR...) */ unsigned char t0_ins; /* length of T=0 reply we expcet. 2 for a WriteT0, else * ReadT0 length + 2 (Sw1 Sw2) */ unsigned short t0_expected_reply_len; int bInterval; unsigned char ctrlendp; unsigned char intendp; unsigned char card_state; int flags; int op; unsigned char proto; int ttl, ttl_hi, /* CWT */ bwt, /* BWT */ ptsttl; /* PTS retry */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) int open; int present; struct semaphore sem; int minor; #endif } usb_cardman_t; #endif /* __CM2020__ */ #ifdef __CM4000__ #define DEVICE_NAME "cmm" #define MODULE_NAME "cardman_cs" /* unofficial CM4000 ioctl */ #define CM4000_IOCMONITOR _IO (CM_IOC_MAGIC, 251) #define CM4000_IOCDUMPATR _IO (CM_IOC_MAGIC, 252) #define CM4000_IOCDECUSECOUNT _IO (CM_IOC_MAGIC, 253) #define CM4000_IOCPOWERON _IO (CM_IOC_MAGIC, 254) #define CM4000_IOCGIOADDR _IOW(CM_IOC_MAGIC, 255, int*) #endif /* __CM4000__ */ #endif /* __KERNEL__ */ #endif /* _CARDMAN_H_ */ openct-0.6.20/src/ifd/conf.c0000644000175000017500000002146110625650421012437 00000000000000/* * libifd configuration handling * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include #include #include #include #include #include struct ct_config ct_config = { 0, /* debug */ 1, /* autoload */ 1, /* hotplug */ 0, /* suppress_errors */ OPENCT_IFDHANDLER_PATH, /* ifdhandler */ OPENCT_MODULES_PATH, /* modules_dir */ NULL, /* driver_modules_dir */ NULL, /* protocol_modules_dir */ OPENCT_SOCKET_PATH, /* socket_dir */ }; #define issepa(c) (strchr("=;,{}", (c)) != NULL) enum { GROUP_BEGIN = '{', GROUP_END = '}', COMMA = ',', SEMICOLON = ';', EQUALS = '=', END_OF_FILE = -1 }; static const char *config_filename = NULL; static ct_buf_t config_buf; static int config_fd = -1; static int config_line = 0; static ifd_conf_node_t config_top; static int conf_parse_group(ifd_conf_node_t *, char); static void conf_dump(ifd_conf_node_t *, int); static ifd_conf_node_t *conf_add_node(ifd_conf_node_t *, const char *); static int get_token(char **); static int skipws(void); static int ateof(void); /* * Parse the ifd config file */ int ifd_config_parse(const char *filename) { char buffer[512]; int rc; if ((config_filename = filename) == NULL) config_filename = OPENCT_CONF_PATH; /* If config file doesn't exist, quietly sneak out of here */ if ((config_fd = open(config_filename, O_RDONLY)) < 0) { if (errno == ENOENT) return 0; ct_error("Unable to open %s: %m", filename); return -1; } /* Init parse buffer. */ ct_buf_init(&config_buf, buffer, sizeof(buffer)); config_line = 1; config_top.name = ""; rc = conf_parse_group(&config_top, END_OF_FILE); close(config_fd); config_fd = -1; if (ct_config.debug > 2) conf_dump(&config_top, 0); return rc; } /* * Parse list of statements */ static int conf_parse_group(ifd_conf_node_t * group, char closing) { ifd_conf_node_t *node; char *token; int rc = 0; while (1) { if (ateof()) { if (closing == (char)END_OF_FILE) break; ct_error("%s:%u: unexpected end of file", config_filename, config_line); return -1; } if ((rc = get_token(&token)) < 0) break; /* Check if this is the closing group character; if * so, return. No other separators allowed here */ if (*token == closing) break; if (issepa(*token)) goto unexpected; node = conf_add_node(group, token); if ((rc = get_token(&token)) < 0) break; /* Get the value - the following are valid * name = value; * name value { ... }; * name { ... }; * value, value, ... */ if (*token == EQUALS) { /* name = value case */ if ((rc = get_token(&token)) < 0) break; } if (!issepa(*token)) { node->value = strdup(token); /* Get the next token */ if ((rc = get_token(&token)) < 0) break; } else if (*token == GROUP_BEGIN || *token == COMMA) { /* Do-nothing cases: * name { ... } * foo, bar, baz, ... */ } else { /* everything else illegal here */ goto unexpected; } if (*token == GROUP_BEGIN) { /* Parse the group, then get the next * token */ if ((rc = conf_parse_group(node, GROUP_END)) < 0 || (rc = get_token(&token)) < 0) break; } if (*token != SEMICOLON && *token != COMMA) goto unexpected; } return rc; unexpected: ct_error("%s: line %d: unexpected token \"%s\"", config_filename, config_line, token); return -1; } /* * Debugging - dump the config tree */ static void conf_dump(ifd_conf_node_t * node, int indent) { for (; node; node = node->next) { printf("%*.*s%s", indent, indent, "", node->name); if (node->value) { if (!node->children) printf(" ="); printf(" %s", node->value); } if (node->children) { printf(" %c\n", GROUP_BEGIN); conf_dump(node->children, indent + 2); printf("%*.*s%c", indent, indent, "", GROUP_END); } else { printf("%c", SEMICOLON); } printf("\n"); } } /* * Config node handling */ static ifd_conf_node_t *conf_add_node(ifd_conf_node_t * parent, const char *name) { ifd_conf_node_t **p, *node; node = (ifd_conf_node_t *) calloc(1, sizeof(*node)); if (!node) { ct_error("out of memory"); return NULL; } node->name = strdup(name); for (p = &parent->children; *p; p = &(*p)->next) ; *p = node; return node; } static ifd_conf_node_t *conf_find_node(ifd_conf_node_t * node, const char *name) { unsigned int len; if (!name) return node; while (*name == '.') name++; if (!*name) return node; len = strcspn(name, "."); for (node = node->children; node; node = node->next) { if (!strncmp(node->name, name, len) && node->name[len] == '\0') return conf_find_node(node, name + len); } return NULL; } int ifd_conf_get_string(const char *name, char **result) { return ifd_conf_node_get_string(&config_top, name, result); } int ifd_conf_get_bool(const char *name, unsigned int *result) { return ifd_conf_node_get_bool(&config_top, name, result); } int ifd_conf_get_integer(const char *name, unsigned int *result) { return ifd_conf_node_get_integer(&config_top, name, result); } int ifd_conf_get_string_list(const char *name, char **list, size_t max) { return ifd_conf_node_get_string_list(&config_top, name, list, max); } int ifd_conf_get_nodes(const char *name, ifd_conf_node_t ** list, size_t max) { return ifd_conf_node_get_nodes(&config_top, name, list, max); } int ifd_conf_node_get_string(ifd_conf_node_t * node, const char *name, char **result) { if (!(node = conf_find_node(node, name)) || !node->value) return -1; *result = node->value; return 0; } int ifd_conf_node_get_integer(ifd_conf_node_t * node, const char *name, unsigned int *result) { if (!(node = conf_find_node(node, name)) || !node->value) return -1; *result = strtoul(node->value, NULL, 0); return 0; } int ifd_conf_node_get_bool(ifd_conf_node_t * node, const char *name, unsigned int *result) { const char *v; if (!(node = conf_find_node(node, name)) || !(v = node->value)) return -1; if (!strcmp(v, "0") || !strcmp(v, "off") || !strcmp(v, "no")) { *result = 0; } else if (!strcmp(v, "1") || !strcmp(v, "on") || !strcmp(v, "yes")) { *result = 1; } else { return -1; } return 0; } int ifd_conf_node_get_string_list(ifd_conf_node_t * node, const char *name, char **list, size_t max) { unsigned int j = 0; if (!(node = conf_find_node(node, name))) return -1; for (node = node->children; node; node = node->next) { if (list && j < max) list[j] = node->name; j += 1; } return j; } int ifd_conf_node_get_nodes(ifd_conf_node_t * node, const char *name, ifd_conf_node_t ** list, size_t max) { unsigned int j = 0; for (node = node->children; node; node = node->next) { if (strcmp(node->name, name)) continue; if (list && j < max) list[j] = node; j += 1; } return j; } /* * Tokenizer */ static int get_token(char **tok) { static char buffer[512]; unsigned int m, n, copy, retry = 1; char *s; /* consume initial white space */ if (skipws() < 0) return -1; again: s = (char *)ct_buf_head(&config_buf); n = ct_buf_avail(&config_buf); if (n && issepa(*s)) { m = 1; } else { for (m = 0; !isspace((int)s[m]) && !issepa(s[m]) && m < n; m++) ; } /* If we hit the end of the buffer while scanning * for white space, read more data and try * again */ if (m >= n && retry) { if (ct_buf_read(&config_buf, config_fd) < 0) { ct_error("%s: error while reading file: %m", config_filename); return -1; } retry = 0; goto again; } if (m == 0) return -1; if ((copy = m) >= sizeof(buffer)) copy = sizeof(buffer) - 1; memcpy(buffer, s, copy); buffer[copy] = '\0'; ct_buf_get(&config_buf, NULL, m); ifd_debug(5, "ifd_config_parse: token=\"%s\"", buffer); *tok = buffer; return 0; } /* * Check if we're at the end of the file */ static int ateof(void) { int retry = 1; again: if (skipws() < 0) return -1; if (ct_buf_avail(&config_buf) == 0) { if (!retry) return 1; if (ct_buf_read(&config_buf, config_fd) < 0) { ct_error("%s: error while reading file: %m", config_filename); return -1; } retry = 0; goto again; } return 0; } /* * Eat initial white space from buffer */ static int skipws(void) { unsigned int m, n, in_comment = 0; char *s; again: s = (char *)ct_buf_head(&config_buf); n = ct_buf_avail(&config_buf); for (m = 0; m < n; m++, s++) { if (*s == '#') { in_comment = 1; } else if (!in_comment && !isspace((int)*s)) { break; } else if (*s == '\n') { config_line++; in_comment = 0; } } ct_buf_get(&config_buf, NULL, m); if (in_comment) { if (ct_buf_read(&config_buf, config_fd) < 0) { ct_error("%s: error while reading file: %m", config_filename); return -1; } goto again; } return 0; } openct-0.6.20/src/ifd/usb.c0000644000175000017500000001351111151454644012304 00000000000000/* * USB device handling * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include /* * Send/receive USB control block */ int ifd_usb_control(ifd_device_t * dev, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int idx, void *buffer, size_t len, long timeout) { int n; if (dev->type != IFD_DEVICE_TYPE_USB) return -1; if (timeout < 0) timeout = 10000; if ((ct_config.debug >= 3) && !(requesttype & 0x80)) { ifd_debug(4, "usb req type=x%02x req=x%02x val=x%04x ind=x%04x len=%u", requesttype, request, value, idx, len); if (len) ifd_debug(4, "send %s", ct_hexdump(buffer, len)); } n = ifd_sysdep_usb_control(dev, requesttype, request, value, idx, buffer, len, timeout); if ((ct_config.debug >= 3) && (requesttype & 0x80)) { ifd_debug(4, "usb req type=x%02x req=x%02x val=x%04x ind=x%04x len=%d", requesttype, request, value, idx, n); if (n > 0) ifd_debug(4, "recv %s", ct_hexdump(buffer, n)); } return n; } /* * USB frame capture */ int ifd_usb_begin_capture(ifd_device_t * dev, int type, int endpoint, size_t maxpacket, ifd_usb_capture_t ** capret) { if (dev->type != IFD_DEVICE_TYPE_USB) return -1; if (ct_config.debug >= 5) ifd_debug(5, "usb capture type=%d ep=x%x maxpacket=%u", type, endpoint, maxpacket); return ifd_sysdep_usb_begin_capture(dev, type, endpoint, maxpacket, capret); } int ifd_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len) { int rc; if (dev->type != IFD_DEVICE_TYPE_USB) return -1; ifd_debug(5, "called."); rc = ifd_sysdep_usb_capture_event(dev, cap, buffer, len); if (ct_config.debug >= 3) { if (rc < 0) ifd_debug(1, "usb event capture: %s", ct_strerror(rc)); if (rc > 0) ifd_debug(5, "usb event capture: recv %s", ct_hexdump(buffer, rc)); if (rc == 0) ifd_debug(5, "usb event capture: rc=%d (timeout?)", rc); } return rc; } int ifd_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len, long timeout) { int rc; if (dev->type != IFD_DEVICE_TYPE_USB) return -1; ifd_debug(5, "called, timeout=%ld ms.", timeout); rc = ifd_sysdep_usb_capture(dev, cap, buffer, len, timeout); if (ct_config.debug >= 3) { if (rc < 0) ifd_debug(1, "usb capture: %s", ct_strerror(rc)); if (rc > 0) ifd_debug(5, "usb capture: recv %s", ct_hexdump(buffer, rc)); if (rc == 0) ifd_debug(5, "usb capture: rc=%d (timeout?)", rc); } return rc; } int ifd_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap) { ifd_debug(5, "called."); if (dev->type != IFD_DEVICE_TYPE_USB) return -1; return ifd_sysdep_usb_end_capture(dev, cap); } /* * Set usb params (for now, endpoint for transceive) */ static int usb_set_params(ifd_device_t * dev, const ifd_device_params_t * params) { ifd_debug(1, "called. config x%02x ifc x%02x eps x%02x/x%02x", params->usb.configuration, params->usb.interface, params->usb.ep_o, params->usb.ep_i); if (params->usb.interface != -1 && params->usb.interface > 255) return IFD_ERROR_INVALID_ARG; if (params->usb.ep_o != -1 && (params->usb.ep_o & ~0x7F)) return IFD_ERROR_INVALID_ARG; if ((params->usb.ep_i != -1 && (params->usb.ep_i & ~0xFF)) || !(params->usb.ep_i & 0x80)) return IFD_ERROR_INVALID_ARG; if (dev->settings.usb.interface != -1) ifd_sysdep_usb_release_interface(dev, dev->settings.usb.interface); if (params->usb.configuration != -1 && ifd_sysdep_usb_set_configuration(dev, params->usb.configuration)) return -1; if (params->usb.interface != -1) { if (ifd_sysdep_usb_claim_interface(dev, params->usb.interface)) return -1; if (params->usb.altsetting != -1 && ifd_sysdep_usb_set_interface(dev, params->usb.interface, params->usb.altsetting)) return -1; } dev->settings = *params; return 0; } static int usb_send(ifd_device_t * dev, const unsigned char *send, size_t sendlen) { if (dev->settings.usb.ep_o == -1) return IFD_ERROR_NOT_SUPPORTED; if (ct_config.debug >= 3) { ifd_debug(4, "usb send to=x%02x", dev->settings.usb.ep_o); if (sendlen) ifd_debug(4, "send %s", ct_hexdump(send, sendlen)); } return ifd_sysdep_usb_bulk(dev, dev->settings.usb.ep_o, (unsigned char *)send, sendlen, 10000); } static int usb_recv(ifd_device_t * dev, unsigned char *recv, size_t recvlen, long timeout) { int rc; if (dev->settings.usb.ep_i == -1) return IFD_ERROR_NOT_SUPPORTED; rc = ifd_sysdep_usb_bulk(dev, dev->settings.usb.ep_i, recv, recvlen, timeout); if (rc >= 0 && ct_config.debug >= 4) { ifd_debug(4, "usb recv from=x%02x", dev->settings.usb.ep_i); if (rc > 0) ifd_debug(4, "recv %s", ct_hexdump(recv, rc)); } return rc; } static int usb_reset(ifd_device_t * dev) { int rc; rc = ifd_sysdep_usb_reset(dev); return rc; } static int usb_get_eventfd(ifd_device_t * dev, short *events) { int rc; rc = ifd_sysdep_usb_get_eventfd(dev, events); return rc; } static struct ifd_device_ops ifd_usb_ops; /* * Open USB device */ ifd_device_t *ifd_open_usb(const char *device) { ifd_device_t *dev; int fd; if ((fd = ifd_sysdep_usb_open(device)) < 0) { ct_error("Unable to open USB device %s: %m", device); return NULL; } ifd_usb_ops.poll_presence = ifd_sysdep_usb_poll_presence; ifd_usb_ops.set_params = usb_set_params; ifd_usb_ops.send = usb_send; ifd_usb_ops.recv = usb_recv; ifd_usb_ops.reset = usb_reset; ifd_usb_ops.get_eventfd = usb_get_eventfd; dev = ifd_device_new(device, &ifd_usb_ops, sizeof(*dev)); dev->type = IFD_DEVICE_TYPE_USB; dev->timeout = 10000; dev->fd = fd; dev->settings.usb.configuration = -1; dev->settings.usb.interface = -1; dev->settings.usb.altsetting = -1; dev->settings.usb.ep_o = -1; dev->settings.usb.ep_i = -1; return dev; } openct-0.6.20/src/ifd/ifd-etoken64.c0000644000175000017500000000742411151454644013720 00000000000000/* * eToken 64 driver * * Copyright (C) 2005, Olaf Kirch * Copyright (C) 2005, Andreas Jellinghaus . */ #include "internal.h" #include #include #define ET64_TIMEOUT 1000 /* * Initialize the device */ static int et64_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; reader->name = "Aladdin eToken PRO 64k"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("etoken64: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("etoken64: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; return 0; } /* * Power up the reader */ static int et64_activate(ifd_reader_t * reader) { return 0; } static int et64_deactivate(ifd_reader_t * reader) { return -1; } /* * Card status - always present */ static int et64_card_status(ifd_reader_t * reader, int slot, int *status) { *status = IFD_CARD_PRESENT; return 0; } /* * Reset - nothing to be done? * We should do something to make it come back with all state zapped */ static int et64_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[256]; int rc, n, atrlen; /* Request the ATR */ rc = ifd_usb_control(dev, 0x40, 0x01, 0, 0, NULL, 0, ET64_TIMEOUT); if (rc < 0) goto failed; /* Receive the ATR */ rc = ifd_usb_control(dev, 0xc0, 0x81, 0, 0, buffer, 0x23, ET64_TIMEOUT); if (rc <= 0) goto failed; n = buffer[0]; if (n + 1 > rc) goto failed; if (n > IFD_MAX_ATR_LEN) goto failed; if (n > size) n = size; atrlen = n; memcpy(atr, buffer + 1, atrlen); if (ifd_usb_control(dev, 0x40, 0x08, 0, 0, NULL, 0, -1) < 0 || ifd_usb_control(dev, 0xc0, 0x88, 0, 0, buffer, 02, -1) != 02 || ifd_usb_control(dev, 0x40, 0x03, 0, 0, NULL, 0, -1) < 0 || ifd_usb_control(dev, 0xc0, 0x83, 0, 0, buffer, 1, -1) != 1 || buffer[0] != 0) goto failed; return atrlen; failed: ct_error("etoken64: failed to activate token"); return -1; } /* * Send/receive routines */ static int et64_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { return ifd_usb_control(reader->device, 0x40, 0x06, 0, 0, (void *)buffer, len, -1); } static int et64_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { return ifd_usb_control(reader->device, 0xc0, 0x86, 0, 0, buffer, len, timeout); } static int et64_get_eventfd(ifd_reader_t * reader, short *events) { ifd_debug(1, "called."); return ifd_device_get_eventfd(reader->device, events); } static int et64_event(ifd_reader_t * reader, int *status, size_t status_size) { (void)reader; (void)status; (void)status_size; ifd_debug(1, "called."); return 0; } static int et64_error(ifd_reader_t * reader) { (void)reader; ifd_debug(1, "called."); return IFD_ERROR_DEVICE_DISCONNECTED; } /* * Driver operations */ static struct ifd_driver_ops etoken64_driver; /* * Initialize this module */ void ifd_etoken64_register(void) { etoken64_driver.open = et64_open; etoken64_driver.activate = et64_activate; etoken64_driver.deactivate = et64_deactivate; etoken64_driver.card_status = et64_card_status; etoken64_driver.card_reset = et64_card_reset; etoken64_driver.send = et64_send; etoken64_driver.recv = et64_recv; etoken64_driver.get_eventfd = et64_get_eventfd; etoken64_driver.event = et64_event; etoken64_driver.error = et64_error; ifd_driver_register("etoken64", &etoken64_driver); } openct-0.6.20/src/ifd/ifd-egate.c0000644000175000017500000001606010625650421013336 00000000000000/* * e-gate driver * * Copyright (C) 2003, Chaskiel Grundman */ #include "internal.h" #include #include #include #define EG_TIMEOUT 1000 #define EGATE_CMD_SEND_APDU 0x80 #define EGATE_CMD_READ 0x81 #define EGATE_CMD_WRITE 0x82 #define EGATE_CMD_READ_ATR 0x83 #define EGATE_CMD_RESET 0x90 #define EGATE_CMD_STATUS 0xA0 #define EGATE_STATUS_READY 0x00 #define EGATE_STATUS_DATA 0x10 #define EGATE_STATUS_SW 0x20 #define EGATE_STATUS_BUSY 0x40 #define EGATE_STATUS_MASK 0xF0 #define EGATE_ATR_MAXSIZE 0x23 #ifdef IFD_USB_ENDPOINT_IN #define EGATE_DIR_OUT (IFD_USB_ENDPOINT_OUT | \ IFD_USB_TYPE_VENDOR | \ IFD_USB_RECIP_DEVICE) #define EGATE_DIR_IN (IFD_USB_ENDPOINT_IN | \ IFD_USB_TYPE_VENDOR | \ IFD_USB_RECIP_DEVICE) #else #define EGATE_DIR_OUT 0x40 #define EGATE_DIR_IN 0xc0 #endif /* * Initialize the device */ static int eg_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; ifd_debug(1, "device=%s", device_name); reader->name = "Schlumberger E-Gate"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("egate: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("egate: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; return 0; } /* * Power up the reader */ static int eg_activate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int eg_deactivate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } /* * Card status - always present */ static int eg_card_status(ifd_reader_t * reader, int slot, int *status) { ifd_debug(3, "slot=%d", slot); *status = IFD_CARD_PRESENT; return 0; } static int eg_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[EGATE_ATR_MAXSIZE]; int rc, atrlen, stat; ifd_debug(1, "called."); usleep(100000); /* Reset the device */ rc = ifd_usb_control(dev, EGATE_DIR_OUT, EGATE_CMD_RESET, 0, 0, NULL, 0, EG_TIMEOUT * 2); if (rc < 0) { failed: ct_error("egate: failed to activate token"); return IFD_ERROR_COMM_ERROR; } usleep(100000); rc = ifd_usb_control(reader->device, EGATE_DIR_IN, EGATE_CMD_STATUS, 0, 0, &stat, 1, EG_TIMEOUT); if (rc != 1) return IFD_ERROR_COMM_ERROR; /* Fetch the ATR */ usleep(100000); rc = ifd_usb_control(dev, EGATE_DIR_IN, EGATE_CMD_READ_ATR, 0, 0, buffer, EGATE_ATR_MAXSIZE, EG_TIMEOUT); if (rc <= 0) goto failed; if (rc > IFD_MAX_ATR_LEN) goto failed; if (rc > size) rc = size; atrlen = rc; memcpy(atr, buffer, atrlen); return atrlen; } static int eg_set_protocol(ifd_reader_t * reader, int s, int proto) { ifd_slot_t *slot; ifd_protocol_t *p; ifd_debug(1, "proto=%d", proto); if (proto != IFD_PROTOCOL_T0 && proto != IFD_PROTOCOL_TRANSPARENT) { ct_error("%s: protocol %d not supported", reader->name, proto); return IFD_ERROR_NOT_SUPPORTED; } slot = &reader->slot[s]; p = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, reader, slot->dad); if (p == NULL) { ct_error("%s: internal error", reader->name); return IFD_ERROR_GENERIC; } if (slot->proto) { ifd_protocol_free(slot->proto); slot->proto = NULL; } slot->proto = p; return 0; } static unsigned char eg_status(ifd_reader_t * reader) { int rc; unsigned char stat; /* Shouldn't there be a retry counter that prevents the command * from hanging indefinitely? Are there scenarios where the * egate would be busy for more than say 180 secs? --okir */ while (1) { rc = ifd_usb_control(reader->device, EGATE_DIR_IN, EGATE_CMD_STATUS, 0, 0, &stat, 1, EG_TIMEOUT); if (rc != 1) return -1; stat &= EGATE_STATUS_MASK; if (stat != EGATE_STATUS_BUSY) { return stat; } usleep(100); } } /* * Send/receive routines */ static int eg_transparent(ifd_reader_t * reader, int dad, const void *inbuffer, size_t inlen, void *outbuffer, size_t outlen) { int rc, bytesread; unsigned char stat; ifd_iso_apdu_t iso; unsigned char cmdbuf[5]; int i; stat = eg_status(reader); if (stat != EGATE_STATUS_READY) { for (i = 0; i < 4; i++) { ifd_debug(2, "device not ready, attempting reset"); rc = ifd_usb_control(reader->device, EGATE_DIR_OUT, EGATE_CMD_RESET, 0, 0, NULL, 0, EG_TIMEOUT); if (rc < 0) return IFD_ERROR_COMM_ERROR; usleep(100); stat = eg_status(reader); if (stat == EGATE_STATUS_READY) { ifd_debug(2, "reset succeeded"); /* FIXME: we need a better error code */ return IFD_ERROR_COMM_ERROR; } ifd_debug(2, "reset failed"); } ifd_debug(2, "giving up on reset"); return IFD_ERROR_COMM_ERROR; } if (ifd_iso_apdu_parse(inbuffer, inlen, &iso) < 0) return IFD_ERROR_INVALID_ARG; if (inlen >= 5 && inlen < 5 + iso.lc) return IFD_ERROR_BUFFER_TOO_SMALL; if (outlen < 2 + iso.le) return IFD_ERROR_BUFFER_TOO_SMALL; memset(cmdbuf, 0, 5); memmove(cmdbuf, inbuffer, inlen < 5 ? inlen : 5); rc = ifd_usb_control(reader->device, EGATE_DIR_OUT, EGATE_CMD_SEND_APDU, 0, 0, (void *)cmdbuf, 5, -1); if (rc != 5) return IFD_ERROR_COMM_ERROR; stat = eg_status(reader); if (inlen > 5 && stat == EGATE_STATUS_DATA) { rc = ifd_usb_control(reader->device, EGATE_DIR_OUT, EGATE_CMD_WRITE, 0, 0, (void *)(((unsigned char *)inbuffer) + 5), iso.lc, -1); if (rc < 0) return IFD_ERROR_COMM_ERROR; if (rc != iso.lc) { ifd_debug(1, "short USB write (%u of %u bytes)", rc, iso.lc); return IFD_ERROR_COMM_ERROR; } ifd_debug(3, "sent %d bytes of data", iso.lc); stat = eg_status(reader); } bytesread = 0; while (stat == EGATE_STATUS_DATA && bytesread < iso.le) { rc = ifd_usb_control(reader->device, EGATE_DIR_IN, EGATE_CMD_READ, 0, 0, (void *)(((unsigned char *)outbuffer) + bytesread), iso.le - bytesread, EG_TIMEOUT); if (rc < 0) return IFD_ERROR_COMM_ERROR; bytesread += rc; ifd_debug(3, "received %d bytes of data", rc); stat = eg_status(reader); } iso.le = bytesread; if (stat != EGATE_STATUS_SW) return IFD_ERROR_DEVICE_DISCONNECTED; rc = ifd_usb_control(reader->device, EGATE_DIR_IN, EGATE_CMD_READ, 0, 0, (void *)(((unsigned char *)outbuffer) + iso.le), 2, EG_TIMEOUT); if (rc != 2) return IFD_ERROR_COMM_ERROR; ifd_debug(2, "returning a %d byte response", iso.le + 2); return iso.le + 2; } /* * Driver operations */ static struct ifd_driver_ops egate_driver; /* * Initialize this module */ void ifd_egate_register(void) { egate_driver.open = eg_open; egate_driver.activate = eg_activate; egate_driver.deactivate = eg_deactivate; egate_driver.card_status = eg_card_status; egate_driver.card_reset = eg_card_reset; egate_driver.set_protocol = eg_set_protocol; egate_driver.transparent = eg_transparent; ifd_driver_register("egate", &egate_driver); } openct-0.6.20/src/ifd/utils.c0000644000175000017500000001157311141256300012645 00000000000000/* * Utility functions * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include #include #include #include #include #include #include #include #ifndef __GNUC__ void ifd_debug(int level, const char *fmt, ...) { va_list ap; char str[2048]; va_start(ap, fmt); vsnprintf(str, sizeof(str), fmt, ap); if (level <= ct_config.debug) ct_debug(str); va_end(ap); } #endif unsigned int ifd_count_bits(unsigned int word) { static unsigned int bcount[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; unsigned int num; for (num = 0; word; word >>= 4) num += bcount[word & 0xF]; return num; } void ifd_revert_bits(unsigned char *data, size_t len) { unsigned char j, k, c, d; while (len--) { c = *data; for (j = 1, k = 0x80, d = 0; k != 0; j <<= 1, k >>= 1) { if (c & j) d |= k; } *data++ = d ^ 0xFF; } } #ifndef timersub # define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif /* return time elapsed since "then" in miliseconds */ long ifd_time_elapsed(struct timeval *then) { struct timeval now, delta; gettimeofday(&now, NULL); timersub(&now, then, &delta); return delta.tv_sec * 1000 + (delta.tv_usec / 1000); } /* * Spawn an ifdhandler */ int ifd_spawn_handler(const char *driver, const char *devtype, int idx) { const char *argv[16]; char reader[16], debug[10]; char *type, *device; int argc, n; pid_t pid; char *user = NULL; int force_poll = 1; ifd_debug(1, "driver=%s, devtype=%s, index=%d", driver, devtype, idx); if ((pid = fork()) < 0) { ct_error("fork failed: %m"); return 0; } if (pid != 0) { /* We're the parent process. The child process should * call daemon(), causing the process to exit * immediately after allocating a slot in the status * file. We wait for it here to make sure USB devices * don't claim a slot reserved for another device */ waitpid(pid, NULL, 0); return 1; } argc = 0; argv[argc++] = ct_config.ifdhandler; if (idx >= 0) { snprintf(reader, sizeof(reader), "-r%u", idx); argv[argc++] = reader; } else { argv[argc++] = "-H"; } if (ct_config.debug) { if ((n = ct_config.debug) > 6) n = 6; debug[n + 1] = '\0'; while (n--) debug[n + 1] = 'd'; debug[0] = '-'; argv[argc++] = debug; } ifd_conf_get_bool("ifdhandler.force_poll", &force_poll); if (force_poll) { argv[argc++] = "-p"; } type = strdup(devtype); device = strtok(type, ":"); device = strtok(NULL, ":"); if (!device || !type) { ct_error("failed to parse devtype %s", devtype); exit(1); } argv[argc++] = driver; argv[argc++] = type; argv[argc++] = device; argv[argc] = NULL; n = getdtablesize(); while (--n > 2) close(n); if ((n = ifd_conf_get_string_list("ifdhandler.groups", NULL, 0)) > 0) { char **groups = (char **)calloc(n, sizeof(char *)); gid_t *gids = (gid_t *)calloc(n, sizeof(gid_t)); int j; if (!groups || !gids) { ct_error("out of memory"); exit(1); } n = ifd_conf_get_string_list("ifdhandler.groups", groups, n); for (j = 0; j < n; j++) { struct group *g = getgrnam(groups[j]); if (g == NULL) { ct_error("failed to parse group %s", groups[j]); exit(1); } gids[j] = g->gr_gid; } if (setgroups(n-1, &gids[1]) == -1) { ct_error("failed set groups %m"); exit(1); } if (setgid(gids[0]) == -1) { ct_error("failed setgid %d %m", gids[0]); exit(1); } free(groups); free(gids); } if (ifd_conf_get_string("ifdhandler.user", &user) >= 0) { struct passwd *p = getpwnam(user); if (p == NULL) { ct_error("failed to parse user %s", user); exit(1); } if (setuid(p->pw_uid) == -1) { ct_error("failed to set*uid user %s %m", user); exit(1); } } execv(ct_config.ifdhandler, (char **)argv); ct_error("failed to execute %s: %m", ct_config.ifdhandler); exit(1); } /* * Replacement for the BSD daemon() function */ #ifndef HAVE_DAEMON int daemon(int nochdir, int noclose) { pid_t pid; pid = fork(); /* In case of fork is error. */ if (pid < 0) return -1; /* In case of this is parent process. */ if (pid != 0) exit(0); /* Become session leader and get pid. */ pid = setsid(); if (pid < -1) { perror("setsid"); return -1; } /* Change directory to root. */ if (!nochdir) chdir("/"); /* File descriptor close. */ if (!noclose) { int fd; fd = open("/dev/null", O_RDWR, 0); if (fd != -1) { dup2(fd, STDIN_FILENO); dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); if (fd > 2) close(fd); } } umask(0027); return 0; } #endif openct-0.6.20/src/ifd/pcmcia-block.c0000644000175000017500000000511310625650421014032 00000000000000/* * I/O routines for pcmcia devices * * Copyright (C) 2003 Olaf Kirch * Copyright (C) 2005 Harald Welte */ #include "internal.h" #include #include #include #include #include #include #include #include /* * Input/output routines */ static int ifd_pcmcia_block_send(ifd_device_t * dev, const unsigned char *buffer, size_t len) { size_t total = len; int n; while (len) { n = write(dev->fd, buffer, len); if (n < 0) { ct_error("Error writing to %s: %m", dev->name); return -1; } buffer += n; len -= n; } return total; } static int ifd_pcmcia_block_recv(ifd_device_t * dev, unsigned char *buffer, size_t len, long timeout) { struct timeval begin; int n; struct pollfd pfd; long wait; gettimeofday(&begin, NULL); if ((wait = timeout - ifd_time_elapsed(&begin)) < 0) goto timeout; pfd.fd = dev->fd; pfd.events = POLLIN; n = poll(&pfd, 1, wait); if (n < 0) { ct_error("%s: error while waiting for input: %m", dev->name); return -1; } if (n == 0) goto timeout; n = read(dev->fd, buffer, len); if (n < 0) { ct_error("%s: failed to read from device: %m", dev->name); return -1; } if (ct_config.debug >= 9) ifd_debug(9, "pcmcia recv:%s", ct_hexdump(buffer, n)); return n; timeout: /* Timeouts are a little special; they may happen e.g. * when trying to obtain the ATR */ if (!ct_config.suppress_errors) ct_error("%s: timed out while waiting for input", dev->name); return IFD_ERROR_TIMEOUT; } /* * Set pcmcia params */ static int ifd_pcmcia_block_set_params(ifd_device_t * dev, const ifd_device_params_t * params) { /* nothing to do so far */ dev->settings = *params; return 0; } /* * Close the device */ static void ifd_pcmcia_block_close(ifd_device_t * dev) { if (dev->fd >= 0) close(dev->fd); dev->fd = -1; } static struct ifd_device_ops ifd_pcmcia_block_ops; /* * Open serial device */ ifd_device_t *ifd_open_pcmcia_block(const char *name) { ifd_device_t *dev; int fd; if ((fd = open(name, O_RDWR)) < 0) { ct_error("Unable to open %s: %m", name); return NULL; } ifd_pcmcia_block_ops.send = ifd_pcmcia_block_send; ifd_pcmcia_block_ops.recv = ifd_pcmcia_block_recv; ifd_pcmcia_block_ops.set_params = ifd_pcmcia_block_set_params; ifd_pcmcia_block_ops.close = ifd_pcmcia_block_close; dev = ifd_device_new(name, &ifd_pcmcia_block_ops, sizeof(*dev)); dev->timeout = 1000; /* acceptable? */ dev->type = IFD_DEVICE_TYPE_PCMCIA_BLOCK; dev->fd = fd; return dev; } openct-0.6.20/src/ifd/proto-t1.c0000644000175000017500000003236511141256300013174 00000000000000/* * Implementation of T=1 * * Copyright (C) 2003, Olaf Kirch * * improvements by: * Copyright (C) 2004 Ludovic Rousseau */ #include "internal.h" #include #include #include #include typedef struct { ifd_protocol_t base; int state; int block_oriented; unsigned char ns; unsigned char nr; unsigned int ifsc; unsigned int ifsd; unsigned int timeout, wtx; unsigned int retries; unsigned int rc_bytes; unsigned int (*checksum) (const unsigned char *, size_t, unsigned char *); } t1_state_t; /* T=1 protocol constants */ #define T1_I_BLOCK 0x00 #define T1_R_BLOCK 0x80 #define T1_S_BLOCK 0xC0 #define T1_MORE_BLOCKS 0x20 /* I block */ #define T1_I_SEQ_SHIFT 6 /* R block */ #define T1_IS_ERROR(pcb) ((pcb) & 0x0F) #define T1_EDC_ERROR 0x01 #define T1_OTHER_ERROR 0x02 #define T1_R_SEQ_SHIFT 4 /* S block stuff */ #define T1_S_IS_RESPONSE(pcb) ((pcb) & T1_S_RESPONSE) #define T1_S_TYPE(pcb) ((pcb) & 0x0F) #define T1_S_RESPONSE 0x20 #define T1_S_RESYNC 0x00 #define T1_S_IFS 0x01 #define T1_S_ABORT 0x02 #define T1_S_WTX 0x03 #define T1_BUFFER_SIZE (3 + 254 + 2) #define NAD 0 #define PCB 1 #define LEN 2 #define DATA 3 /* internal state, do not mess with it. */ /* should be != DEAD after reset/init */ enum { SENDING, RECEIVING, RESYNCH, DEAD }; static void t1_set_checksum(t1_state_t *, int); static unsigned int t1_block_type(unsigned char); static unsigned int t1_seq(unsigned char); static unsigned int t1_build(t1_state_t *, unsigned char *, unsigned char, unsigned char, ct_buf_t *, size_t *); static unsigned int t1_compute_checksum(t1_state_t *, unsigned char *, size_t); static int t1_verify_checksum(t1_state_t *, unsigned char *, size_t); static int t1_xcv(t1_state_t *, unsigned char *, size_t, size_t); /* * Set default T=1 protocol parameters */ static void t1_set_defaults(t1_state_t * t1) { t1->retries = 3; /* This timeout is rather insane, but we need this right now * to support cryptoflex keygen */ t1->timeout = 20000; t1->ifsc = 32; t1->ifsd = 32; t1->nr = 0; t1->ns = 0; t1->wtx = 0; } static void t1_set_checksum(t1_state_t * t1, int csum) { switch (csum) { case IFD_PROTOCOL_T1_CHECKSUM_LRC: t1->rc_bytes = 1; t1->checksum = csum_lrc_compute; break; case IFD_PROTOCOL_T1_CHECKSUM_CRC: t1->rc_bytes = 2; t1->checksum = csum_crc_compute; break; } } /* * Attach t1 protocol */ static int t1_init(ifd_protocol_t * prot) { t1_state_t *t1 = (t1_state_t *) prot; t1_set_defaults(t1); t1_set_checksum(t1, IFD_PROTOCOL_T1_CHECKSUM_LRC); /* If the device is attached through USB etc, assume the * device will do the framing for us */ if (prot->reader->device->type != IFD_DEVICE_TYPE_SERIAL) t1->block_oriented = 1; return 0; } /* * Detach t1 protocol */ static void t1_release(ifd_protocol_t * prot) { /* NOP */ } /* * Get/set parmaters for T1 protocol */ static int t1_set_param(ifd_protocol_t * prot, int type, long value) { t1_state_t *t1 = (t1_state_t *) prot; switch (type) { case IFD_PROTOCOL_RECV_TIMEOUT: t1->timeout = value; break; case IFD_PROTOCOL_BLOCK_ORIENTED: t1->block_oriented = value; break; case IFD_PROTOCOL_T1_CHECKSUM_LRC: case IFD_PROTOCOL_T1_CHECKSUM_CRC: t1_set_checksum(t1, type); break; case IFD_PROTOCOL_T1_IFSC: t1->ifsc = value; break; case IFD_PROTOCOL_T1_IFSD: t1->ifsd = value; break; default: ct_error("Unsupported parameter %d", type); return -1; } return 0; } static int t1_get_param(ifd_protocol_t * prot, int type, long *result) { t1_state_t *t1 = (t1_state_t *) prot; long value; switch (type) { case IFD_PROTOCOL_RECV_TIMEOUT: value = t1->timeout; break; case IFD_PROTOCOL_BLOCK_ORIENTED: value = t1->block_oriented; break; default: ct_error("Unsupported parameter %d", type); return -1; } if (result) *result = value; return 0; } /* * Send an APDU through T=1 */ static int t1_transceive(ifd_protocol_t * prot, int dad, const void *snd_buf, size_t snd_len, void *rcv_buf, size_t rcv_len) { t1_state_t *t1 = (t1_state_t *) prot; ct_buf_t sbuf, rbuf, tbuf; unsigned char sdata[T1_BUFFER_SIZE], sblk[5]; unsigned int slen, retries, resyncs, sent_length = 0; size_t last_send = 0; if (snd_len == 0) return -1; /* we can't talk to a dead card / reader. Reset it! */ if (t1->state == DEAD) return -1; t1->state = SENDING; retries = t1->retries; resyncs = 3; /* Initialize send/recv buffer */ ct_buf_set(&sbuf, (void *)snd_buf, snd_len); ct_buf_init(&rbuf, rcv_buf, rcv_len); /* Send the first block */ slen = t1_build(t1, sdata, dad, T1_I_BLOCK, &sbuf, &last_send); while (1) { unsigned char pcb; int n; retries--; if ((n = t1_xcv(t1, sdata, slen, sizeof(sdata))) < 0) { ifd_debug(1, "fatal: transmit/receive failed"); t1->state = DEAD; goto error; } if (!t1_verify_checksum(t1, sdata, n)) { ifd_debug(1, "checksum failed"); if (retries == 0 || sent_length) goto resync; slen = t1_build(t1, sdata, dad, T1_R_BLOCK | T1_EDC_ERROR, NULL, NULL); continue; } pcb = sdata[PCB]; switch (t1_block_type(pcb)) { case T1_R_BLOCK: if (T1_IS_ERROR(pcb)) { ifd_debug(1, "received error block, err=%d", T1_IS_ERROR(pcb)); goto resync; } if (t1->state == RECEIVING) { slen = t1_build(t1, sdata, dad, T1_R_BLOCK, NULL, NULL); break; } /* If the card terminal requests the next * sequence number, it received the previous * block successfully */ if (t1_seq(pcb) != t1->ns) { ct_buf_get(&sbuf, NULL, last_send); sent_length += last_send; last_send = 0; t1->ns ^= 1; } /* If there's no data available, the ICC * shouldn't be asking for more */ if (ct_buf_avail(&sbuf) == 0) goto resync; slen = t1_build(t1, sdata, dad, T1_I_BLOCK, &sbuf, &last_send); break; case T1_I_BLOCK: /* The first I-block sent by the ICC indicates * the last block we sent was received successfully. */ if (t1->state == SENDING) { ct_buf_get(&sbuf, NULL, last_send); last_send = 0; t1->ns ^= 1; } t1->state = RECEIVING; /* If the block sent by the card doesn't match * what we expected it to send, reply with * an R block */ if (t1_seq(pcb) != t1->nr) { slen = t1_build(t1, sdata, dad, T1_R_BLOCK | T1_OTHER_ERROR, NULL, NULL); continue; } t1->nr ^= 1; if (ct_buf_put(&rbuf, sdata + 3, sdata[LEN]) < 0) goto error; if ((pcb & T1_MORE_BLOCKS) == 0) goto done; slen = t1_build(t1, sdata, dad, T1_R_BLOCK, NULL, NULL); break; case T1_S_BLOCK: if (T1_S_IS_RESPONSE(pcb) && t1->state == RESYNCH) { t1->state = SENDING; sent_length = 0; last_send = 0; resyncs = 3; retries = t1->retries; ct_buf_init(&rbuf, rcv_buf, rcv_len); slen = t1_build(t1, sdata, dad, T1_I_BLOCK, &sbuf, &last_send); continue; } if (T1_S_IS_RESPONSE(pcb)) goto resync; ct_buf_init(&tbuf, sblk, sizeof(sblk)); switch (T1_S_TYPE(pcb)) { case T1_S_RESYNC: /* the card is not allowed to send a resync. */ goto resync; case T1_S_ABORT: ifd_debug(1, "abort requested"); break; case T1_S_IFS: ifd_debug(1, "CT sent S-block with ifs=%u", sdata[DATA]); if (sdata[DATA] == 0) goto resync; t1->ifsc = sdata[DATA]; ct_buf_putc(&tbuf, sdata[DATA]); break; case T1_S_WTX: /* We don't handle the wait time extension * yet */ ifd_debug(1, "CT sent S-block with wtx=%u", sdata[DATA]); t1->wtx = sdata[DATA]; ct_buf_putc(&tbuf, sdata[DATA]); break; default: ct_error("T=1: Unknown S block type 0x%02x", T1_S_TYPE(pcb)); goto resync; } slen = t1_build(t1, sdata, dad, T1_S_BLOCK | T1_S_RESPONSE | T1_S_TYPE(pcb), &tbuf, NULL); } /* Everything went just splendid */ retries = t1->retries; continue; resync: /* the number or resyncs is limited, too */ if (resyncs == 0) goto error; resyncs--; t1->ns = 0; t1->nr = 0; slen = t1_build(t1, sdata, dad, T1_S_BLOCK | T1_S_RESYNC, NULL, NULL); t1->state = RESYNCH; continue; } done: return ct_buf_avail(&rbuf); error: t1->state = DEAD; return -1; } static int t1_resynchronize(ifd_protocol_t * p, int nad) { t1_state_t *t1 = (t1_state_t *) p; unsigned char block[4]; unsigned int retries = 3; if (p->reader && p->reader->device) ifd_device_flush(p->reader->device); while (retries--) { t1->ns = 0; t1->nr = 0; block[0] = nad; block[1] = T1_S_BLOCK | T1_S_RESYNC; block[2] = 0; t1_compute_checksum(t1, block, 3); if (t1_xcv(t1, block, 4, sizeof(block)) != 4) { ifd_debug(1, "fatal: transmit/receive failed"); break; } if (!t1_verify_checksum(t1, block, 4)) { ifd_debug(1, "checksum failed"); continue; } if (block[1] == (T1_S_BLOCK | T1_S_RESPONSE | T1_S_RESYNC)) return 0; } t1->state = DEAD; return -1; } static unsigned t1_block_type(unsigned char pcb) { switch (pcb & 0xC0) { case T1_R_BLOCK: return T1_R_BLOCK; case T1_S_BLOCK: return T1_S_BLOCK; default: return T1_I_BLOCK; } } static unsigned int t1_seq(unsigned char pcb) { switch (pcb & 0xC0) { case T1_R_BLOCK: return (pcb >> T1_R_SEQ_SHIFT) & 1; case T1_S_BLOCK: return 0; default: return (pcb >> T1_I_SEQ_SHIFT) & 1; } } static unsigned int t1_build(t1_state_t * t1, unsigned char *block, unsigned char dad, unsigned char pcb, ct_buf_t * bp, size_t * lenp) { unsigned int len; len = bp ? ct_buf_avail(bp) : 0; if (len > t1->ifsc) { pcb |= T1_MORE_BLOCKS; len = t1->ifsc; } /* Add the sequence number */ switch (t1_block_type(pcb)) { case T1_R_BLOCK: pcb |= t1->nr << T1_R_SEQ_SHIFT; break; case T1_I_BLOCK: pcb |= t1->ns << T1_I_SEQ_SHIFT; break; } block[0] = dad; block[1] = pcb; block[2] = len; if (len) memcpy(block + 3, ct_buf_head(bp), len); if (lenp) *lenp = len; return t1_compute_checksum(t1, block, len + 3); } /* * Protocol struct */ struct ifd_protocol_ops ifd_protocol_t1 = { IFD_PROTOCOL_T1, /* id */ "T=1", /* name */ sizeof(t1_state_t), /* size */ t1_init, /* init */ t1_release, /* release */ t1_set_param, /* set_param */ t1_get_param, /* get_param */ t1_resynchronize, /* resynchronize */ t1_transceive, /* transceive */ NULL, /* sync_read */ NULL, /* sync_write */ }; /* * Build/verify checksum */ static unsigned int t1_compute_checksum(t1_state_t * t1, unsigned char *data, size_t len) { return len + t1->checksum(data, len, data + len); } static int t1_verify_checksum(t1_state_t * t1, unsigned char *rbuf, size_t len) { unsigned char csum[2]; int m, n; m = len - t1->rc_bytes; n = t1->rc_bytes; if (m < 0) return 0; t1->checksum(rbuf, m, csum); if (!memcmp(rbuf + m, csum, n)) return 1; return 0; } /* * Send/receive block */ static int t1_xcv(t1_state_t * t1, unsigned char *block, size_t slen, size_t rmax) { ifd_protocol_t *prot = &t1->base; unsigned int rlen, timeout; int n, m; if (ct_config.debug >= 3) ifd_debug(3, "sending %s", ct_hexdump(block, slen)); n = ifd_send_command(prot, block, slen); if (n < 0) return n; /* Maximum amount of data we'll receive - some devices * such as the eToken need this. If you request more, it'll * just barf */ rlen = 3 + t1->ifsd + t1->rc_bytes; /* timeout. For now our WTX treatment is very dumb */ timeout = t1->timeout + 1000 * t1->wtx; t1->wtx = 0; if (t1->block_oriented) { /* Note - Linux USB seems to have an off by one error, you * actually need the + 1 to get the RC byte */ rlen++; if (rlen < rmax) rmax = rlen; /* Get the response en bloc */ n = ifd_recv_response(prot, block, rmax, timeout); if (n >= 0) { m = block[2] + 3 + t1->rc_bytes; if (m < n) n = m; } } else { /* Get the header */ if (ifd_recv_response(prot, block, 3, timeout) < 0) return -1; n = block[2] + t1->rc_bytes; if (n + 3 > rmax || block[2] >= 254) { ct_error("receive buffer too small"); return -1; } /* Now get the rest */ if (ifd_recv_response(prot, block + 3, n, t1->timeout) < 0) return -1; n += 3; } if (n >= 0 && ct_config.debug >= 3) ifd_debug(3, "received %s", ct_hexdump(block, n)); return n; } int t1_negotiate_ifsd(ifd_protocol_t * proto, unsigned int dad, int ifsd) { t1_state_t *t1 = (t1_state_t *) proto; ct_buf_t sbuf; unsigned char sdata[T1_BUFFER_SIZE]; unsigned int slen; unsigned int retries; size_t snd_len; int n; unsigned char snd_buf[1], pcb; retries = t1->retries; /* S-block IFSD request */ snd_buf[0] = ifsd; snd_len = 1; /* Initialize send/recv buffer */ ct_buf_set(&sbuf, (void *)snd_buf, snd_len); while (1) { /* Build the block */ slen = t1_build(t1, sdata, dad, T1_S_BLOCK | T1_S_IFS, &sbuf, NULL); if ((n = t1_xcv(t1, sdata, slen, sizeof(sdata))) < 0) { ifd_debug(1, "fatal: transmit/receive failed"); t1->state = DEAD; goto error; } if (!t1_verify_checksum(t1, sdata, n)) { ifd_debug(1, "checksum failed"); if (retries == 0) goto error; continue; } pcb = sdata[1]; if (t1_block_type(pcb) == T1_S_BLOCK && T1_S_TYPE(pcb) == T1_S_IFS && T1_S_IS_RESPONSE(pcb)) { if (sdata[LEN] != 1 || sdata[DATA] != ifsd) goto error; break; } if (retries == 0) goto error; } return n; error: t1_resynchronize(proto, dad); return -1; } openct-0.6.20/src/ifd/ctbcs.h0000644000175000017500000000171710422076714012621 00000000000000/* * Build Extended CTBCS APDUs for those readers that * support them (such as Kobil Kaan). * * Copyright (C) 2003, Olaf Kirch */ #ifndef IFD_CTBCS_H #define IFD_CTBCS_H extern int ctbcs_build_output(unsigned char *cmd, size_t size, const char *message); extern int ctbcs_build_perform_verify_apdu(unsigned char *cmd, size_t size, unsigned int slot, const char *prompt, unsigned int timeout, const unsigned char *data, size_t data_len); extern int ctbcs_build_modify_verify_apdu(unsigned char *cmd, size_t size, unsigned int dest, const char *prompt, unsigned int timeout, const unsigned char *data, size_t data_len); extern void ctbcs_begin(ct_buf_t *, unsigned int, unsigned int, unsigned int); extern int ctbcs_finish(ct_buf_t *); extern int ctbcs_add_message(ct_buf_t *, const char *); extern int ctbcs_add_timeout(ct_buf_t *, unsigned int); #endif /* IFD_CTBCS_H */ openct-0.6.20/src/ifd/sys-bsd.c0000644000175000017500000003665011252127023013076 00000000000000/* * *BSD specific functions * * Copyright (C) 2003 Olaf Kirch * Copyright (C) 2003 Andreas Jellinghaus * Copyright (C) 2003 Markus Friedl * Copyright (C) 2004-2005 William Wanders * * These functions need to be re-implemented for every * new platform. */ #include "internal.h" #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #include #ifndef ENABLE_LIBUSB #if defined(__DragonFly__) #include #else #include #endif #endif /* !ENABLE_LIBUSB */ #include #include #include #include #include #include #include #include #include #include #include #include #ifdef ENABLE_LIBUSB #include #endif #include "usb-descriptors.h" #ifdef ENABLE_LIBUSB struct usb_dev_handle *devices[128]; #endif /* * Poll for presence of USB device */ int ifd_sysdep_usb_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { if (pfd->revents & POLLHUP) return 0; pfd->fd = dev->fd; pfd->events = POLLHUP; return 1; } #ifndef ENABLE_LIBUSB typedef struct ep { int ep_fd; } ep_t; typedef ep_t interface_t[128]; static interface_t interfaces[1]; #define USB_REQUEST_SIZE 8 /* * Open interface endpoint */ int open_ep(char *name, int interface, int endpoint, int flags) { char filename[256]; if (interfaces[interface][endpoint].ep_fd) { ifd_debug(6, "open_ep: endpoint already opened"); return 0; } #ifdef __OpenBSD__ snprintf(filename, sizeof(filename), "%s.%02d", name, endpoint); #else snprintf(filename, sizeof(filename), "%s.%d", name, endpoint); #endif /* __OpenBSD__ */ if ((interfaces[interface][endpoint].ep_fd = open(filename, flags)) < 0) { ifd_debug(6, "open_ep: error opening \"%s\": %s", filename, strerror(errno)); interfaces[interface][endpoint].ep_fd = 0; return -1; } return 0; } static void close_ep(int interface, int endpoint) { if (interfaces[interface][endpoint].ep_fd) { close(interfaces[interface][endpoint].ep_fd); interfaces[interface][endpoint].ep_fd = 0; } } #endif /* !ENABLE_LIBUSB */ int ifd_sysdep_usb_bulk(ifd_device_t * dev, int ep, void *buffer, size_t len, long timeout) { int bytes_to_process; int bytes_processed; int direction = (ep & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_IN ? 1 : 0; int endpoint = (ep & ~IFD_USB_ENDPOINT_DIR_MASK); ct_debug("ifd_sysdep_usb_bulk: endpoint=%d direction=%d", endpoint, direction); if (direction) { #ifdef ENABLE_LIBUSB if ((bytes_to_process = usb_bulk_read(devices[dev->fd], ep, buffer, len, timeout)) < 0) { ifd_debug(6, "ifd_sysdep_usb_bulk: read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } #else int one = 1; if (open_ep(dev->name, 0, endpoint, O_RDONLY | O_NONBLOCK)) { ct_debug("ifd_sysdep_usb_bulk: opening endpoint failed"); return -1; } if (ioctl(interfaces[0][endpoint].ep_fd, USB_SET_SHORT_XFER, &one) < 0) { ifd_debug(6, "ifd_sysdep_usb_bulk: USB_SET_SHORT_XFER" " failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); } if ((bytes_to_process = read(interfaces[0][endpoint].ep_fd, buffer, len)) < 0) { ifd_debug(6, "ifd_sysdep_usb_bulk: read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } #endif /* ENABLE_LIBUSB */ ct_debug("ifd_sysdep_usb_bulk: read %d bytes", bytes_to_process); return bytes_to_process; } else { #ifndef ENABLE_LIBUSB if (open_ep(dev->name, 0, endpoint, O_WRONLY | O_NONBLOCK)) { ct_debug("ifd_sysdep_usb_bulk: opening endpoint failed"); return -1; } #endif /* !ENABLE_LIBUSB */ bytes_to_process = len; if ((bytes_processed = #ifdef ENABLE_LIBUSB usb_bulk_write(devices[dev->fd], ep, buffer, bytes_to_process, timeout) #else write(interfaces[0][endpoint].ep_fd, buffer, bytes_to_process) #endif /* ENABLE_LIBUSB */ ) != bytes_to_process) { ifd_debug(6, "ifd_sysdep_usb_bulk: write failed: %s", strerror(errno)); ct_error("usb_bulk write failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } ct_debug("ifd_sysdep_usb_bulk: wrote buffer[%d]=%s", bytes_processed, ct_hexdump(buffer, len)); return bytes_processed; } } int ifd_sysdep_usb_get_eventfd(ifd_device_t * dev, short *events) { return -1; } /* * USB URB capture */ struct ifd_usb_capture { int type; int endpoint; size_t maxpacket; unsigned int interface; }; int ifd_sysdep_usb_begin_capture(ifd_device_t * dev, int type, int ep, size_t maxpacket, ifd_usb_capture_t ** capret) { ifd_usb_capture_t *cap; #ifndef ENABLE_LIBUSB int direction = (ep & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_IN ? 1 : 0; int endpoint = (ep & ~IFD_USB_ENDPOINT_DIR_MASK); #endif /* !ENABLE_LIBUSB */ if (!(cap = (ifd_usb_capture_t *) calloc(1, sizeof(*cap) + maxpacket))) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } cap->type = type; cap->endpoint = ep; cap->maxpacket = maxpacket; #ifndef ENABLE_LIBUSB if (!interfaces[0][endpoint].ep_fd) { if (open_ep(dev->name, 0, endpoint, O_RDONLY | O_NONBLOCK)) { ct_debug ("ifd_sysdep_usb_begin_capture: opening endpoint failed"); return -1; } } #endif /* !ENABLE_LIBUSB */ *capret = cap; return 0; } int ifd_sysdep_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len) { return IFD_ERROR_NOT_SUPPORTED; } int ifd_sysdep_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len, long timeout) { int bytes_to_process = 0; #ifdef ENABLE_LIBUSB if ((bytes_to_process = usb_interrupt_read(devices[dev->fd], cap->endpoint, buffer, len, timeout)) < 0) { ifd_debug(6, "ifd_sysdep_usb_capture: usb_interrupt_read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } #else struct timeval begin; int direction = (cap->endpoint & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_IN ? 1 : 0; int endpoint = (cap->endpoint & ~IFD_USB_ENDPOINT_DIR_MASK); gettimeofday(&begin, NULL); do { struct pollfd pfd; long wait; if ((wait = (timeout - ifd_time_elapsed(&begin))) <= 0) return IFD_ERROR_TIMEOUT; pfd.fd = interfaces[0][endpoint].ep_fd; pfd.events = POLLIN; if (poll(&pfd, 1, wait) != 1) continue; if ((bytes_to_process = read(interfaces[0][endpoint].ep_fd, buffer, len)) < 0) { ifd_debug(6, "ifd_sysdep_usb_bulk: read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } } while (!bytes_to_process); #endif /* ENABLE_LIBUSB */ ct_debug("ifd_sysdep_usb_capture: read buffer[%d]=%s", bytes_to_process, ct_hexdump(buffer, bytes_to_process)); return bytes_to_process; } int ifd_sysdep_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap) { #ifndef ENABLE_LIBUSB int direction = (cap->endpoint & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_IN ? 1 : 0; int endpoint = (cap->endpoint & ~IFD_USB_ENDPOINT_DIR_MASK); close_ep(0, endpoint); #endif /* !ENABLE_LIBUSB */ if (cap) free(cap); return 0; } /* * USB control command */ int ifd_sysdep_usb_control(ifd_device_t * dev, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len, long timeout) { int rc, val; #ifdef ENABLE_LIBUSB ct_debug("ifd_sysdep_usb_control: dev->fd=%d handle=0x%x", dev->fd, devices[dev->fd]); if ((rc = usb_control_msg(devices[dev->fd], requesttype, request, value, index, data, len, timeout)) < 0) { ifd_debug(1, "usb_control_msg failed: %d", rc); ct_error("usb_control_msg failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } ct_debug("ifd_sysdep_usb_control: return rc=%d", rc); return rc; #else struct usb_ctl_request ctrl; int retries; ifd_debug(1, "BSD: ifd_sysdep_usb_control(0x%x)", request); memset(&ctrl, 0, sizeof(ctrl)); ctrl.ucr_request.bmRequestType = requesttype; ctrl.ucr_request.bRequest = request; USETW(ctrl.ucr_request.wValue, value); USETW(ctrl.ucr_request.wIndex, index); USETW(ctrl.ucr_request.wLength, len); ctrl.ucr_data = data; ctrl.ucr_flags = USBD_SHORT_XFER_OK; ifd_debug(1, "BSD: CTRL bmRequestType 0x%x bRequest 0x%x " "wValue 0x%x wIndex 0x%x wLength 0x%x", requesttype, request, value, index, len); if (len) ifd_debug(5, "BSD: CTRL SEND data %s", ct_hexdump(data, len)); val = timeout; if ((rc = ioctl(dev->fd, USB_SET_TIMEOUT, &val)) < 0) { ifd_debug(1, "USB_SET_TIMEOUT failed: %d", rc); ct_error("usb_set_timeout failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } retries = 5; while ((rc = ioctl(dev->fd, USB_DO_REQUEST, &ctrl)) < 0 && retries > 0) { ifd_debug(1, "USB_DO_REQUEST failed: %d", rc); ct_error("usb_do_request failed: %s (%d)", strerror(errno), errno); retries--; if ((retries == 0) || (errno != EIO)) return IFD_ERROR_COMM_ERROR; } if (ctrl.ucr_data == NULL) ifd_debug(1, "BSD: ctrl.ucr_data == NULL "); if (ctrl.ucr_data && ctrl.ucr_actlen) ifd_debug(1, "BSD: CTRL RECV data %s", ct_hexdump(ctrl.ucr_data, ctrl.ucr_actlen)); return ctrl.ucr_actlen; #endif /* ENABLE_LIBUSB */ } int ifd_sysdep_usb_set_configuration(ifd_device_t * dev, int config) { int rc; #ifdef ENABLE_LIBUSB if ((rc = usb_set_configuration(devices[dev->fd], config)) < 0) { ifd_debug(1, "usb_set_configuration failed: %d", rc); #else int value; value = config; if ((rc = ioctl(dev->fd, USB_SET_CONFIG, &value)) < 0) { ifd_debug(1, "USB_SET_CONFIG failed: %d", rc); #endif /* ENABLE_LIBUSB */ ct_error("usb_set_configuration failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_set_interface(ifd_device_t * dev, int ifc, int alt) { int rc; #ifdef ENABLE_LIBUSB if ((rc = usb_set_altinterface(devices[dev->fd], alt)) < 0) { ifd_debug(1, "usb_set_altinterface failed: %d", rc); #else struct usb_alt_interface { int uai_config_index; int uai_interface_index; int uai_alt_no; } value; value.uai_config_index = ifc; value.uai_interface_index = 0; value.uai_alt_no = alt; if ((rc = ioctl(dev->fd, USB_SET_ALTINTERFACE, &value)) < 0) { ifd_debug(1, "USB_SET_ALTINTERFACE failed: %d", rc); #endif /* ENABLE_LIBUSB */ ct_error("usb_set_interface failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_claim_interface(ifd_device_t * dev, int interface) { #ifdef ENABLE_LIBUSB int rc; ct_debug("ifd_sysdep_usb_claim_interface: interface=%d", interface); if ((rc = usb_claim_interface(devices[dev->fd], interface)) < 0) { ifd_debug(1, "usb_clain_interface failed: %d", rc); ct_error("usb_release_interface failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } #else ct_debug ("ifd_sysdep_usb_claim_interface: interface=%d (not yet implemented)", interface); #endif /* ENABLE_LIBUSB */ return 0; } int ifd_sysdep_usb_release_interface(ifd_device_t * dev, int interface) { #ifdef ENABLE_LIBUSB int rc; ct_debug("ifd_sysdep_usb_release_interface: interface=%d", interface); if ((rc = usb_release_interface(devices[dev->fd], interface)) < 0) { ifd_debug(1, "usb_release_interface failed: %d", rc); ct_error("usb_release_interface failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } #else ct_debug ("ifd_sysdep_usb_release_interface: interface=%d (not yet implemented)", interface); #endif /* ENABLE_LIBUSB */ return 0; } int ifd_sysdep_usb_open(const char *device) { #ifdef ENABLE_LIBUSB struct usb_bus *bus; struct usb_device *dev; ct_debug("ifd_sysdep_usb_open: name=%s", device); ct_debug("ifd_sysdep_usb_open: usb_init()"); usb_init(); ct_debug("ifd_sysdep_usb_open: usb_find_busses()"); usb_find_busses(); ct_debug("ifd_sysdep_usb_open: usb_find_devices()"); usb_find_devices(); ct_debug("ifd_sysdep_usb_open: walk devices"); for (bus = usb_busses; bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { int i; if (strcmp(dev->filename, device) != 0) continue; ct_debug ("ifd_sysdep_usb_open: found match name=%s device=%s", device, dev->filename); for (i = 0; i < 128; i++) { if (devices[i] == NULL) { devices[i] = usb_open(dev); ct_debug ("ifd_sysdep_usb_open: usb_open index=%d handle=0x%x", i, devices[i]); return i; } } } } return -1; #else #ifdef __OpenBSD__ char path[256]; if (snprintf(&path, sizeof(path), "%s.00", device) < 0) return -1; return open(path, O_RDWR); #else return open(device, O_RDWR); #endif /* __OpenBSD__ */ #endif /* ENABLE_LIBUSB */ } int ifd_sysdep_usb_reset(ifd_device_t * dev) { /* not implemented so far */ return -1; } /* * Scan all usb devices to see if there is one we support */ int ifd_scan_usb(void) { #ifdef ENABLE_LIBUSB struct usb_bus *bus; struct usb_device *dev; ifd_devid_t id; usb_init(); usb_find_busses(); usb_find_devices(); id.type = IFD_DEVICE_TYPE_USB; id.num = 2; for (bus = usb_busses; bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { const char *driver; char typedev[PATH_MAX]; id.val[0] = dev->descriptor.idVendor; id.val[1] = dev->descriptor.idProduct; /* FIXME: if we don't find a driver with vendor/product * then check for the interface type (ccid) and use * driver ccid... */ if (!(driver = ifd_driver_for_id(&id))) continue; snprintf(typedev, sizeof(typedev), "usb:%s", dev->filename); ifd_spawn_handler(driver, typedev, -1); } } #else int i, controller_fd; char controller_devname[10]; ifd_debug(1, "BSD: ifd_scan_usb"); for (i = 0; i < 10; i++) { int address; snprintf(controller_devname, 10, "/dev/usb%d.00", i); if ((controller_fd = open(controller_devname, O_RDONLY)) < 0) continue; if (controller_fd < 0) { if (errno == ENOENT || errno == ENXIO) continue; /* a more suitable error recovery should be done here */ continue; } for (address = 1; address < USB_MAX_DEVICES; address++) { struct usb_device_info device_info; ifd_devid_t id; const char *driver; char typedev[256]; device_info.udi_addr = address; if (ioctl(controller_fd, USB_DEVICEINFO, &device_info)) { if (errno != ENXIO) fprintf(stderr, "addr %d: I/O error\n", address); continue; } if (strncmp (device_info.udi_devnames[0], "ugen", 4) != 0) continue; id.type = IFD_DEVICE_TYPE_USB; id.num = 2; id.val[0] = device_info.udi_vendorNo; id.val[1] = device_info.udi_productNo; ifd_debug(1, "BSD: ifd_scan_usb: " "ifd_driver_for(%s[0x%04x].%s[0x%04x)", device_info.udi_vendor, device_info.udi_vendorNo, device_info.udi_product, device_info.udi_productNo); /* FIXME: if we don't find a driver with vendor/product * then check for the interface type (ccid) and use * driver ccid... */ if (!(driver = ifd_driver_for_id(&id))) continue; snprintf(typedev, sizeof(typedev), "usb:/dev/%s", device_info.udi_devnames[0]); ifd_spawn_handler(driver, typedev, -1); } close(controller_fd); } #endif /* ENABLE_LIBUSB */ return 0; } #endif /* __Net/Free/OpenBSD__ */ openct-0.6.20/src/ifd/ifd-smph.c0000644000175000017500000002334010636423304013217 00000000000000/* * Driver for SmartMouse/Phoenix readers * * Thanks to Alexandre Becoulet and its SCTK project ;) * In agreement with him, this project's license has been changed to LGPL. * URL: http://freshmeat.net/projects/sctk/ * * 2005, Antoine Nguyen */ #include "internal.h" #include #include #include #include #include #include #include #include #define PHS_CONV_DIRECT 0 #define PHS_CONV_INDIRECT 1 #define TIMEOUT 1000 /* table for indirect to direct byte mode conversion */ static const uint8_t dir_conv_table[0x100] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0xf, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x7, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0xb, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x3, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0xd, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x5, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x9, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x1, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0xe, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x6, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0xa, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x2, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0xc, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x4, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x8, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x0 }; enum prot_e { prot_phoenix, /* phoenix smartcard interface */ prot_smartmouse, /* smartmouse smartcard interface */ }; typedef struct smph_priv { enum prot_e prot; unsigned int mode; } smph_priv_t; static int smph_card_reset(ifd_reader_t *, int, void *, size_t); static int smph_recv(ifd_reader_t *, unsigned int, unsigned char *, size_t, long); /* * Common functions */ static int smph_setctrl(ifd_device_t *dev, const int ctrl) { int tmp; if (ioctl(dev->fd, TIOCMGET, &tmp) == -1) return -1; tmp &= ~(TIOCM_RTS | TIOCM_CTS | TIOCM_DTR); tmp |= ctrl; return (ioctl(dev->fd, TIOCMSET, &tmp)); } /* * Initialize the reader */ static int _smph_open(ifd_reader_t *reader, const char *device_name, smph_priv_t *privd) { ifd_device_params_t params; ifd_device_t *dev; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; reader->device = dev; if (dev->type == IFD_DEVICE_TYPE_SERIAL) { if (ifd_device_get_parameters(dev, ¶ms) < 0) return -1; params.serial.speed = 9600; params.serial.bits = 8; params.serial.stopbits = 1; params.serial.parity = IFD_SERIAL_PARITY_NONE; params.serial.dtr = 1; params.serial.rts = 1; if (ifd_device_set_parameters(dev, ¶ms) < 0) return -1; } dev->user_data = (void *)privd; dev->timeout = TIMEOUT; return 0; } static int phx_open(ifd_reader_t * reader, const char *device_name) { smph_priv_t *privd = NULL; ifd_debug(1, "device=%s", device_name); reader->name = "Phoenix reader"; if (!(privd = (smph_priv_t *)malloc(sizeof (smph_priv_t)))) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } privd->mode = PHS_CONV_DIRECT; privd->prot = prot_phoenix; return _smph_open(reader, device_name, privd); } static int smtm_open(ifd_reader_t * reader, const char *device_name) { smph_priv_t *privd = NULL; ifd_debug(1, "device=%s", device_name); reader->name = "SmartMouse reader"; if (!(privd = (smph_priv_t *)malloc(sizeof (smph_priv_t)))) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } privd->mode = PHS_CONV_DIRECT; privd->prot = prot_smartmouse; return _smph_open(reader, device_name, privd); } /* * Change the parity */ static int smph_change_parity(ifd_reader_t *reader, int parity) { ifd_device_t *dev = reader->device; ifd_device_params_t params; if (dev->type != IFD_DEVICE_TYPE_SERIAL) return IFD_ERROR_NOT_SUPPORTED; if (ifd_device_get_parameters(dev, ¶ms) < 0) return -1; params.serial.parity = parity; return ifd_device_set_parameters(dev, ¶ms); } /* * Activate the reader */ static int smph_activate(ifd_reader_t * reader) { ifd_device_t *dev = reader->device; smph_priv_t *privd = (smph_priv_t *)dev->user_data; int tmp; uint8_t mode; if (smph_card_reset(reader, 0, &mode, 1) < 0) return -1; ifd_debug(1, "Mode received: 0x%x\n", mode); switch (mode) { case 0x03: privd->mode = PHS_CONV_INDIRECT; tmp = IFD_SERIAL_PARITY_ODD; break; case 0x3B: privd->mode = PHS_CONV_DIRECT; tmp = IFD_SERIAL_PARITY_EVEN; break; default: return -1; } smph_change_parity(reader, tmp); return 0; } static int smph_deactivate(ifd_reader_t * reader) { ifd_device_t *dev = reader->device; tcflush(dev->fd, TCIOFLUSH); if (smph_setctrl(dev, TIOCM_CTS)) return -1; return 0; } /* * Check card status */ static int smph_card_status(ifd_reader_t * reader, int slot, int *status) { ifd_device_t *dev = reader->device; int tmp; if (slot) { ct_error("smph: bad slot index %u", slot); return IFD_ERROR_INVALID_SLOT; } tcflush(dev->fd, TCIOFLUSH); if (ioctl(dev->fd, TIOCMGET, &tmp) < 0) return -1; *status = 0; *status |= ((tmp & TIOCM_CTS) != TIOCM_CTS) ? IFD_CARD_PRESENT : 0; return 0; } /* * Reset the card and get the ATR */ static int smph_card_reset(ifd_reader_t *reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; smph_priv_t *privd = dev->user_data; int res; if (slot) { ct_error("%s: bad slot index %u", (privd->prot == prot_phoenix) ? "phoenix" : "smartmouse", slot); return IFD_ERROR_INVALID_SLOT; } tcflush(dev->fd, TCIOFLUSH); if (smph_setctrl(dev, (privd->prot == prot_phoenix) ? TIOCM_RTS | TIOCM_CTS | TIOCM_DTR : TIOCM_CTS | TIOCM_DTR) < 0) return -1; /* FIXME: use ifd_serial_reset instead? */ sleep(1); if (smph_setctrl(dev, (privd->prot == prot_phoenix) ? TIOCM_CTS | TIOCM_DTR : TIOCM_RTS | TIOCM_CTS | TIOCM_DTR) < 0) return -1; /* FIXME: use ifd_serial_reset instead? */ usleep(200); if ((res = smph_recv(reader, 0, (unsigned char *)atr, size, dev->timeout)) < 1) return -1; ifd_debug(1, "Bytes received %i\n", res); return res; } /* * Send command to IFD */ static int _smph_send(ifd_device_t *dev, const unsigned char *buffer, size_t len) { unsigned char tmp; unsigned int i; struct pollfd pfd; ifd_debug(3, "data:%s", ct_hexdump(buffer, len)); for (i = 0; i < len; i++) { if (write(dev->fd, buffer + i, 1) < 1) return -1; tcdrain(dev->fd); } for (i = 0; i < len; i++) { pfd.fd = dev->fd; pfd.events = POLLIN; if (poll(&pfd, 1, dev->timeout) < 1) return -1; if (read(dev->fd, &tmp, 1) < 1) return -1; if (tmp != *(buffer + i)) return -1; } return 0; } static int smph_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { smph_priv_t *privd; ifd_device_t *dev = reader->device; uint8_t *fbuff = NULL; int i; if (!dev) return -1; privd = (smph_priv_t *)dev->user_data; if (privd->mode == PHS_CONV_INDIRECT) { if (!(fbuff = (uint8_t *)malloc(len * sizeof (uint8_t)))) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } for (i = 0; i < len; i++) fbuff[i] = dir_conv_table[buffer[i]]; i = _smph_send(dev, fbuff, len); free(fbuff); return i; } return _smph_send(dev, buffer, len); } /* * Receive data from IFD */ static int smph_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { ifd_device_t *dev = reader->device; smph_priv_t *privd; int n; int i; for (i = 0; i < len; i++) { n = ifd_device_recv(dev, buffer + i, 1, timeout); if (n == IFD_ERROR_TIMEOUT) break; if (n == -1) return -1; } privd = (smph_priv_t *)dev->user_data; if (privd->mode == PHS_CONV_INDIRECT) for (i = 0; i < len; i++) buffer[i] = dir_conv_table[buffer[i]]; ifd_debug(3, "data:%s", ct_hexdump(buffer, len)); return i; } /* * Driver operations */ static struct ifd_driver_ops phx_driver; static struct ifd_driver_ops smtm_driver; void ifd_smph_register(void) { phx_driver.open = phx_open; //smph_driver.change_parity = smph_change_parity; phx_driver.activate = smph_activate; phx_driver.deactivate = smph_deactivate; phx_driver.card_status = smph_card_status; phx_driver.card_reset = smph_card_reset; phx_driver.send = smph_send; phx_driver.recv = smph_recv; ifd_driver_register("phoenix", &phx_driver); smtm_driver.open = smtm_open; //smph_driver.change_parity = smph_change_parity; smtm_driver.activate = smph_activate; smtm_driver.deactivate = smph_deactivate; smtm_driver.card_status = smph_card_status; smtm_driver.card_reset = smph_card_reset; smtm_driver.send = smph_send; smtm_driver.recv = smph_recv; ifd_driver_register("smartmouse", &smtm_driver); } openct-0.6.20/src/ifd/proto-trans.c0000644000175000017500000000306310422076714014002 00000000000000/* * Transparent protocol - simply pass everything to the reader driver * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include /* * Attach t0 protocol */ static int trans_init(ifd_protocol_t * prot) { ifd_reader_t *reader = prot->reader; const ifd_driver_t *drv; if (!reader || !(drv = reader->driver) || !drv->ops || !drv->ops->transparent) return -1; return 0; } /* * Detach t0 protocol */ static void trans_release(ifd_protocol_t * prot) { /* NOP */ } /* * Get/set parmaters for T1 protocol */ static int trans_set_param(ifd_protocol_t * prot, int type, long value) { ct_error("set_pameter not supported"); return -1; } static int trans_get_param(ifd_protocol_t * prot, int type, long *result) { ct_error("get_pameter not supported"); return -1; } /* * Transceive an APDU */ static int trans_transceive(ifd_protocol_t * prot, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { ifd_reader_t *reader = prot->reader; const ifd_driver_t *drv = reader->driver; return drv->ops->transparent(reader, dad, sbuf, slen, rbuf, rlen); } /* * Protocol struct */ struct ifd_protocol_ops ifd_protocol_trans = { IFD_PROTOCOL_TRANSPARENT, /* id */ "transparent", /* name */ sizeof(ifd_protocol_t), /* size */ trans_init, /* init */ trans_release, /* release */ trans_set_param, /* set_param */ trans_get_param, /* get_param */ NULL, /* resynchronize */ trans_transceive, /* transceive */ NULL, /* sync_read */ NULL, /* sync_write */ }; openct-0.6.20/src/ifd/proto-escape.c0000644000175000017500000000352510625650421014114 00000000000000/* * Escape protocol - simply pass everything to the reader driver's escape() * * This is required for exporting access to vendor-specific CCID extensions, * such as the Omnikey CardMan 5121 RFID support. * * The higher-level applications select a virtual slot (the last available slot * number). This virtual slot will automatically get the IFD_PROTOCOL_ESCAPE * assgigned to it and can then be used to transceive() data to/from the CCID. * * It's a bit ugly, but I was unable to come up with something cleaner. * * Copyright (C) 2005, Harald Welte */ #include "internal.h" #include #include #include static int escape_init(ifd_protocol_t * prot) { ifd_reader_t *reader = prot->reader; const ifd_driver_t *drv; if (!reader || !(drv = reader->driver) || !drv->ops || !drv->ops->escape) return -1; return 0; } static void escape_release(ifd_protocol_t * prot) { /* NOP */ } static int escape_set_param(ifd_protocol_t * prot, int type, long value) { ct_error("set_pameter not supported"); return -1; } static int escape_get_param(ifd_protocol_t * prot, int type, long *result) { ct_error("get_pameter not supported"); return -1; } static int escape_transceive(ifd_protocol_t * prot, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { ifd_reader_t *reader = prot->reader; const ifd_driver_t *drv = reader->driver; return drv->ops->escape(reader, dad, sbuf, slen, rbuf, rlen); } struct ifd_protocol_ops ifd_protocol_esc = { IFD_PROTOCOL_ESCAPE, /* id */ "escape", /* name */ sizeof(ifd_protocol_t), /* size */ escape_init, /* init */ escape_release, /* release */ escape_set_param, /* set_param */ escape_get_param, /* get_param */ NULL, /* resynchronize */ escape_transceive, /* transceive */ NULL, /* sync_read */ NULL, /* sync_write */ }; openct-0.6.20/src/ifd/protocol.c0000644000175000017500000001250310422076714013352 00000000000000/* * Protocol selection * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include struct ifd_protocol_info { struct ifd_protocol_info *next; struct ifd_protocol_ops *ops; }; static struct ifd_protocol_info *list = NULL; /* * Register a protocol */ int ifd_protocol_register(struct ifd_protocol_ops *ops) { struct ifd_protocol_info *info, **ptr; info = (struct ifd_protocol_info *)calloc(1, sizeof(*info)); if (!info) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } info->ops = ops; for (ptr = &list; *ptr; ptr = &(*ptr)->next) ; *ptr = info; return 0; } /* * Look up protocol based on its ID */ static struct ifd_protocol_ops *ifd_protocol_by_id(int id) { struct ifd_protocol_info *info; for (info = list; info; info = info->next) { if (info->ops->id == id) return info->ops; } /* Autoload protocols defined in external modules? */ return NULL; } /* * Select a protocol */ ifd_protocol_t *ifd_protocol_select(ifd_reader_t * reader, int nslot, int preferred) { const ifd_driver_t *drv; ifd_slot_t *slot = &reader->slot[nslot]; unsigned char *atr, TDi; unsigned int supported = 0; int def_proto = -1, n, len; ifd_debug(1, "atr=%s", ct_hexdump(slot->atr, slot->atr_len)); /* FIXME: use ifd_atr_parse() instead */ atr = slot->atr; len = slot->atr_len; if (len < 2) return NULL; /* Ignore hysterical bytes */ len -= atr[1] & 0x0f; n = 2; do { int prot; TDi = atr[n - 1]; if (n != 2) { prot = TDi & 0x0f; supported |= (1 << prot); if (def_proto < 0) def_proto = prot; } n += ifd_count_bits(TDi & 0xF0); } while (n < len && (TDi & 0x80)); if (supported == 0) supported |= 0x01; if (def_proto < 0) def_proto = IFD_PROTOCOL_T0; ifd_debug(1, "default T=%d, supported protocols=0x%x", def_proto, supported); if (preferred >= 0 && preferred != def_proto && (supported & (1 << preferred))) { /* XXX perform PTS */ ifd_debug(1, "protocol selection not supported"); } if ((drv = reader->driver) && drv->ops && drv->ops->set_protocol) { if (drv->ops->set_protocol(reader, nslot, def_proto) < 0) return NULL; } else { slot->proto = ifd_protocol_new(def_proto, reader, slot->dad); } return slot->proto; } /* * Force the protocol driver to resynchronize */ int ifd_protocol_resynchronize(ifd_protocol_t * p, int nad) { ifd_debug(1, "called."); if (!p || !p->ops || !p->ops->resynchronize) return IFD_ERROR_NOT_SUPPORTED; return p->ops->resynchronize(p, nad); } /* * Protocol transceive */ int ifd_protocol_transceive(ifd_protocol_t * p, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { int rc; if (!p || !p->ops || !p->ops->transceive) return IFD_ERROR_NOT_SUPPORTED; ifd_debug(1, "cmd: %s", ct_hexdump(sbuf, slen)); rc = p->ops->transceive(p, dad, sbuf, slen, rbuf, rlen); if (rc >= 0) ifd_debug(1, "resp:%s", ct_hexdump(rbuf, rc)); else ifd_debug(1, "transceive error: %s", ct_strerror(rc)); return rc; } /* * Read/write synchronous ICCs */ int ifd_protocol_read_memory(ifd_protocol_t * p, int slot, unsigned short addr, unsigned char *rbuf, size_t rlen) { int rc; if (!p || !p->ops || !p->ops->sync_read) return IFD_ERROR_NOT_SUPPORTED; ifd_debug(1, "read %u@%04x (%s)", (unsigned int)rlen, addr, p->ops->name); rc = p->ops->sync_read(p, slot, addr, rbuf, rlen); if (rc >= 0) ifd_debug(1, "resp:%s", ct_hexdump(rbuf, rc)); return rc; } int ifd_protocol_write_memory(ifd_protocol_t * p, int slot, unsigned short addr, const unsigned char *sbuf, size_t slen) { int rc; if (!p || !p->ops || !p->ops->sync_write) return IFD_ERROR_NOT_SUPPORTED; ifd_debug(1, "write %u@%04x (%s):%s", (unsigned int)slen, addr, p->ops->name, ct_hexdump(sbuf, slen)); rc = p->ops->sync_write(p, slot, addr, sbuf, slen); ifd_debug(1, "resp = %d", rc); return rc; } /* * Create new protocol object */ ifd_protocol_t *ifd_protocol_new(int id, ifd_reader_t * reader, unsigned int dad) { struct ifd_protocol_ops *ops; ifd_protocol_t *p; if (reader == NULL) return NULL; if (!(ops = ifd_protocol_by_id(id))) { ct_error("unknown protocol id %d", id); return NULL; } p = (ifd_protocol_t *) calloc(1, ops->size); if (!p) { ct_error("out of memory"); return p; } p->reader = reader; p->ops = ops; p->dad = dad; if (ops->init && ops->init(p) < 0) { ct_error("Protocol initialization failed"); ifd_protocol_free(p); return NULL; } return p; } /* * Set a protocol specific parameter */ int ifd_protocol_set_parameter(ifd_protocol_t * p, int type, long value) { if (!p || !p->ops || !p->ops->set_param) return -1; return p->ops->set_param(p, type, value); } int ifd_protocol_get_parameter(ifd_protocol_t * p, int type, long *value) { if (!p || !p->ops || !p->ops->get_param) return -1; return p->ops->get_param(p, type, value); } /* * Free protocol object */ void ifd_protocol_free(ifd_protocol_t * p) { if (p->ops) { if (p->ops->release) p->ops->release(p); memset(p, 0, p->ops->size); } else { memset(p, 0, sizeof(*p)); } free(p); } /* * List available protocols */ unsigned int ifd_protocols_list(const char **names, unsigned int max) { struct ifd_protocol_info *info; unsigned int n; for (info = list, n = 0; info && n < max; info = info->next, n++) { names[n] = info->ops->name; } return n; } openct-0.6.20/src/ifd/device.c0000644000175000017500000001164411151454644012757 00000000000000/* * Generic IFD device layer * * Copyright (C) 2003 Olaf Kirch */ #include "internal.h" #include #include /* * Open a device given the name */ ifd_device_t *ifd_device_open(const char *name) { if (name == NULL) { ct_error("Null device"); return NULL; } if (!strncmp(name, "serial:", 7)) return ifd_open_serial(name + 7); if (!strncmp(name, "usb:", 4)) return ifd_open_usb(name + 4); if (!strncmp(name, "remote:", 7)) return ifd_open_remote(name + 7); if (!strncmp(name, "pcmcia:", 7)) return ifd_open_pcmcia(name + 7); if (!strncmp(name, "pcmcia_block:", 13)) return ifd_open_pcmcia_block(name + 13); ct_error("Unknown device type \"%s\"", name); return NULL; } /* * Create a new device struct * This is an internal function called by the different device * type handlers (serial, usb, etc) */ ifd_device_t *ifd_device_new(const char *name, struct ifd_device_ops * ops, size_t size) { ifd_device_t *dev; dev = (ifd_device_t *) calloc(1, size); if (!dev) { ct_error("out of memory"); return NULL; } dev->name = strdup(name); dev->ops = ops; return dev; } /* * Destroy a device handle */ void ifd_device_free(ifd_device_t * dev) { if (dev->name) free(dev->name); memset(dev, 0, sizeof(*dev)); free(dev); } /* * Miscellaneous device operations. These functions * just do a consistency check on the handle, and route * the call to the appropriate member function */ int ifd_device_type(ifd_device_t * dev) { return dev->type; } int ifd_device_reset(ifd_device_t * dev) { if (!dev || !dev->ops || !dev->ops->reset) return IFD_ERROR_NOT_SUPPORTED; return dev->ops->reset(dev); } void ifd_device_set_hotplug(ifd_device_t * dev, int hotplug) { if (hotplug) dev->hotplug = 1; } int ifd_device_set_parameters(ifd_device_t * dev, const ifd_device_params_t * parms) { if (!dev || !dev->ops || !dev->ops->set_params) return IFD_ERROR_NOT_SUPPORTED; return dev->ops->set_params(dev, parms); } int ifd_device_get_parameters(ifd_device_t * dev, ifd_device_params_t * parms) { if (!dev || !dev->ops || !dev->ops->get_params) return IFD_ERROR_NOT_SUPPORTED; return dev->ops->get_params(dev, parms); } void ifd_device_flush(ifd_device_t * dev) { if (!dev || !dev->ops || !dev->ops->flush) return; dev->ops->flush(dev); } void ifd_device_send_break(ifd_device_t * dev, unsigned int usec) { if (!dev || !dev->ops || !dev->ops->send_break) return; dev->ops->send_break(dev, usec); } int ifd_device_send(ifd_device_t * dev, const unsigned char *data, size_t len) { if (!dev || !dev->ops || !dev->ops->send) return IFD_ERROR_NOT_SUPPORTED; return dev->ops->send(dev, data, len); } int ifd_device_control(ifd_device_t * dev, void *cmsg, size_t len) { if (!dev || !dev->ops || !dev->ops->control) return IFD_ERROR_NOT_SUPPORTED; return dev->ops->control(dev, cmsg, len); } int ifd_device_recv(ifd_device_t * dev, unsigned char *data, size_t len, long timeout) { if (timeout < 0) timeout = dev->timeout; if (!dev || !dev->ops || !dev->ops->recv) return IFD_ERROR_NOT_SUPPORTED; return dev->ops->recv(dev, data, len, timeout); } int ifd_device_transceive(ifd_device_t * dev, const void *sbuf, size_t slen, void *rbuf, size_t rlen, long timeout) { int rc; if (timeout < 0) timeout = dev->timeout; if (!dev || !dev->ops) return -1; if (dev->ops->transceive) return dev->ops->transceive(dev, sbuf, slen, rbuf, rlen, timeout); /* Fall back to send/recv */ ifd_device_flush(dev); if ((rc = ifd_device_send(dev, (const unsigned char *)sbuf, slen)) < 0) return rc; return ifd_device_recv(dev, (unsigned char *)rbuf, rlen, timeout); } int ifd_device_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { if (!dev || !dev->ops || !dev->ops->poll_presence) return 1; return dev->ops->poll_presence(dev, pfd); } int ifd_device_get_eventfd(ifd_device_t * dev, short *events) { if (!dev || !dev->ops) return -1; if (!dev->ops->get_eventfd) return -1; return dev->ops->get_eventfd(dev, events); } void ifd_device_close(ifd_device_t * dev) { if (!dev) return; if (dev->ops && dev->ops->close) dev->ops->close(dev); ifd_device_free(dev); } /* * Device ID handling */ int ifd_device_id_parse(const char *str, ifd_devid_t * id) { unsigned int n; id->type = IFD_DEVICE_TYPE_OTHER; n = strcspn(str, ":"); if (str[n] == ':') { if (!strncmp(str, "usb", n)) id->type = IFD_DEVICE_TYPE_USB; else if (!strncmp(str, "pcmcia", n)) id->type = IFD_DEVICE_TYPE_PCMCIA; else return -1; str += n + 1; } for (n = 0; *str && n < IFD_MAX_DEVID_PARTS; n++) { id->val[n] = strtoul(str, (char **)&str, 16); if (*str == '/') str++; } if (*str || n == 0) return -1; id->num = n; return 0; } int ifd_device_id_match(const ifd_devid_t * match, const ifd_devid_t * id) { if (id->type != match->type || id->num < match->num || memcmp(id->val, match->val, match->num * sizeof(id->val[0]))) return 0; return 1; } openct-0.6.20/src/ifd/ria-server.c0000644000175000017500000001725310625650421013575 00000000000000/* * Remote device access - debugging utility that allows to * test smart card readers on remote hosts. * * Copyright (C) 2003, Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "internal.h" #include "ria.h" typedef struct ria_peer { struct ria_peer *next; struct ria_peer *prev; ct_socket_t *sock; struct ria_peer *peer; ria_device_t device; } ria_peer_t; static unsigned int dev_handle = 1; static ria_peer_t clients = { &clients, &clients }; static int ria_svc_accept(ct_socket_t *); static int ria_svc_app_handler(ct_socket_t *, header_t *, ct_buf_t *, ct_buf_t *); static int ria_svc_dev_handler(ct_socket_t *, header_t *, ct_buf_t *, ct_buf_t *); static void ria_svc_app_close(ct_socket_t *); static void ria_svc_dev_close(ct_socket_t *); static ria_peer_t *ria_peer_new(ct_socket_t *); static void ria_peer_free(ria_peer_t *, int); static ria_peer_t *ria_find_device(const char *, size_t); static void ria_svc_link(ria_peer_t *); static void ria_svc_unlink(ria_peer_t *); int ria_svc_listen(const char *address, int trusted) { ct_socket_t *sock; int rc; sock = ct_socket_new(1024); if ((rc = ct_socket_listen(sock, address, 0666)) < 0) { ct_error("Cannot bind to network address \"%s\"\n", address); ct_socket_free(sock); return rc; } sock->recv = ria_svc_accept; sock->send = NULL; if (trusted) { sock->process = ria_svc_app_handler; sock->close = ria_svc_app_close; } else { sock->process = ria_svc_dev_handler; sock->close = ria_svc_dev_close; } ct_mainloop_add_socket(sock); return 0; } static int ria_svc_accept(ct_socket_t * listener) { ria_peer_t *clnt; ct_socket_t *sock; int rc; if (!(sock = ct_socket_accept(listener))) return 0; clnt = ria_peer_new(sock); rc = ct_socket_getpeername(sock, clnt->device.address, sizeof(clnt->device.address)); if (rc < 0) { ria_peer_free(clnt, 0); return rc; } ifd_debug(1, "New connection from %s", clnt->device.address); sock->user_data = clnt; sock->process = listener->process; sock->close = listener->close; return 0; } static void ria_svc_app_close(ct_socket_t * sock) { ria_peer_t *clnt = (ria_peer_t *) sock->user_data; ifd_debug(1, "Application on %s closed connection", clnt->device.address); ria_peer_free((ria_peer_t *) sock->user_data, 0); } static void ria_svc_dev_close(ct_socket_t * sock) { ria_peer_t *clnt = (ria_peer_t *) sock->user_data; ifd_debug(1, "Device on %s closed connection", clnt->device.address); ria_peer_free((ria_peer_t *) sock->user_data, 1); } /* * Process commands from local clients (i.e. those allowed * to claim a device). */ static int ria_svc_app_handler(ct_socket_t * sock, header_t * hdr, ct_buf_t * args, ct_buf_t * resp) { unsigned char cmd; ria_peer_t *clnt, *peer; int rc; clnt = (ria_peer_t *) sock->user_data; ria_print_packet(sock, 2, "app >>", hdr, args); if (ct_buf_get(args, &cmd, 1) < 0) return IFD_ERROR_INVALID_MSG; switch (cmd) { case RIA_MGR_LIST: peer = &clients; ifd_debug(1, "%s requests a device listing", clnt->device.address); while ((peer = peer->next) != &clients) { if (peer->device.name[0] != '\0') ct_buf_put(resp, &peer->device, sizeof(peer->device)); } return 0; case RIA_MGR_INFO: peer = ria_find_device((const char *)ct_buf_head(args), ct_buf_avail(args)); if (peer == NULL) return IFD_ERROR_UNKNOWN_DEVICE; ct_buf_put(resp, &peer->device, sizeof(peer->device)); return 0; case RIA_MGR_CLAIM: peer = ria_find_device((const char *)ct_buf_head(args), ct_buf_avail(args)); if (peer == NULL) return IFD_ERROR_UNKNOWN_DEVICE; if (peer->peer) return IFD_ERROR_DEVICE_BUSY; ifd_debug(1, "%s claimed %s device %s/%s", clnt->device.address, peer->device.type, peer->device.address, peer->device.name); ct_buf_put(resp, &peer->device, sizeof(peer->device)); clnt->peer = peer; peer->peer = clnt; return 0; } if (cmd < __RIA_PEER_CMD_BASE) return IFD_ERROR_INVALID_CMD; /* All subsequent commands require a device */ if ((peer = clnt->peer) == NULL) return IFD_ERROR_NOT_CONNECTED; /* Push back the command byte */ ct_buf_push(args, &cmd, 1); rc = ct_socket_put_packet(peer->sock, hdr, args); /* Tell the caller not to send a response */ hdr->xid = 0; return rc; } /* * Process commands from remote clients (i.e. those offering a device). */ static int ria_svc_dev_handler(ct_socket_t * sock, header_t * hdr, ct_buf_t * args, ct_buf_t * resp) { unsigned char cmd; ria_peer_t *clnt, *peer; ria_device_t devinfo; int rc; clnt = (ria_peer_t *) sock->user_data; ria_print_packet(sock, 2, "dev <<", hdr, args); /* bounce response to peer right away */ if (hdr->dest) goto bounce_to_peer; if (ct_buf_get(args, &cmd, 1) < 0) return IFD_ERROR_INVALID_MSG; switch (cmd) { case RIA_MGR_REGISTER: if (clnt->device.name[0]) return IFD_ERROR_INVALID_ARG; if ((rc = ct_buf_get(args, &devinfo, sizeof(devinfo))) < 0) return IFD_ERROR_INVALID_ARG; if (devinfo.type[0] == '\0') return IFD_ERROR_INVALID_ARG; /* For security reasons, don't allow the handle counter * to wrap around. */ if (dev_handle == 0) return IFD_ERROR_GENERIC; memcpy(&devinfo.address, clnt->device.address, RIA_NAME_MAX); clnt->device = devinfo; snprintf(clnt->device.handle, RIA_NAME_MAX, "%s%u", clnt->device.type, dev_handle++); ifd_debug(1, "%s registered new %s device , handle '%s', name `%s'", clnt->device.address, clnt->device.type, clnt->device.handle, clnt->device.name); return 0; } if (cmd < __RIA_PEER_CMD_BASE) return IFD_ERROR_INVALID_CMD; /* Push back the command byte */ ct_buf_push(args, &cmd, 1); bounce_to_peer: if ((peer = clnt->peer) == NULL) return IFD_ERROR_NOT_CONNECTED; rc = ct_socket_put_packet(peer->sock, hdr, args); /* Tell the caller not to send a response */ hdr->xid = 0; return rc; } static ria_peer_t *ria_peer_new(ct_socket_t * sock) { ria_peer_t *clnt; clnt = (ria_peer_t *) calloc(1, sizeof(ria_peer_t)); if (!clnt) { ct_error("out of memory"); return NULL; } clnt->sock = sock; ria_svc_link(clnt); return clnt; } static void ria_peer_free(ria_peer_t * clnt, int detach_peer) { ria_peer_t *peer; if ((peer = clnt->peer) != NULL) { if (detach_peer) shutdown(peer->sock->fd, SHUT_RD); peer->peer = NULL; } if (clnt->device.name[0]) ifd_debug(1, "Removing device `%s' on %s", clnt->device.name, clnt->device.address); ria_svc_unlink(clnt); memset(clnt, 0, sizeof(*clnt)); free(clnt); } static void ria_svc_link(ria_peer_t * clnt) { ria_peer_t *prev; prev = clients.prev; clnt->next = &clients; clnt->prev = prev; prev->next = clnt; clients.prev = clnt; } static ria_peer_t *ria_find_device(const char *handle, size_t len) { ria_peer_t *peer; ifd_debug(2, "handle=%*.*s", (int)len, (int)len, handle); if (len == 0 || len > RIA_NAME_MAX - 1) return NULL; peer = &clients; while ((peer = peer->next) != &clients) { if (!memcmp(peer->device.handle, handle, len) && peer->device.handle[len] == '\0') return peer; if (!memcmp(peer->device.name, handle, len) && peer->device.name[len] == '\0') return peer; } return NULL; } static void ria_svc_unlink(ria_peer_t * clnt) { ria_peer_t *prev, *next; prev = clnt->prev; next = clnt->next; prev->next = next; next->prev = prev; clnt->prev = clnt->next = clnt; } openct-0.6.20/src/ifd/ifd-epass3k.c0000644000175000017500000001721511125447432013627 00000000000000/* * OpenCT driver for ePass3000 device * * Copyright (C) 2008, EnterSafe */ #include "internal.h" #include #include typedef struct { unsigned char TagH; unsigned char TagL; unsigned char CommandH; unsigned char CommandL; unsigned char LengthH; unsigned char LengthL; unsigned char Value[1]; } epass3k_command_t; typedef struct { unsigned char TagH; unsigned char TagL; unsigned char StatusH; unsigned char StatusL; unsigned char LengthH; unsigned char LengthL; unsigned char Value[1]; } epass3k_status_t; #define TIMEOUT 200000 #define USB_BULK_IN 0x81 #define USB_BULK_OUT 2 #define EPASS3K_COMMAND_SIZE 7 #define EPASS3K_STATUS_SIZE 7 #define TOKEN_TYPE_ID_LENGTH 64 #define EPASS3K_COMMAND_GET_ATR (unsigned char)0X01 #define EPASS3K_COMMAND_TRANSMIT_APDU (unsigned char)0X02 /* * Initialize the device */ static int epass3k_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; ifd_debug(1, "%s:%d epass3k_open()", __FILE__, __LINE__); reader->name = "FT SCR2000A"; /* ePass3000 reader name */ reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("ePass3000: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.ep_o = USB_BULK_OUT; params.usb.ep_i = USB_BULK_IN; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("ePass3000: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; dev->timeout = TIMEOUT; return 0; } static int epass3k_activate(ifd_reader_t * reader) { ifd_debug(1, "%s:%d epass3k_activate()", __FILE__, __LINE__); return 0; } static int epass3k_deactivate(ifd_reader_t * reader) { ifd_debug(1, "%s:%d epass3k_deactivate()", __FILE__, __LINE__); return -1; } static int epass3k_change_parity(ifd_reader_t * reader, int parity) { ifd_debug(1, "%s:%d epass3k_change_parity()", __FILE__, __LINE__); return 0; } static int epass3k_change_speed(ifd_reader_t * reader, unsigned int speed) { ifd_debug(1, "%s:%d epass3k_change_speed()", __FILE__, __LINE__); return 0; } static int epass3k_set_protocol(ifd_reader_t * reader, int nslot, int proto) { ifd_debug(1, "%s:%d epass3k_set_protocol()", __FILE__, __LINE__); ifd_protocol_t *protocol; ifd_slot_t *slot; if (IFD_PROTOCOL_T0 != proto) return IFD_ERROR_NOT_SUPPORTED; slot = &reader->slot[nslot]; slot->proto = ifd_protocol_new(proto, reader, slot->dad); if (slot->proto == NULL) { ct_error("acr: unable to create protocol"); return -1; } ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 1); return 1; } static int epass3k_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t atr_len) { int ret; epass3k_command_t *pepass3k_send = NULL; epass3k_status_t *pepass3k_receive = NULL; ifd_debug(1, "%s:%d epass3k_card_reset()", __FILE__, __LINE__); pepass3k_send = (epass3k_command_t *) malloc(EPASS3K_COMMAND_SIZE); pepass3k_receive = (epass3k_status_t *) malloc(EPASS3K_STATUS_SIZE + TOKEN_TYPE_ID_LENGTH); if ((NULL == pepass3k_send) || (NULL == pepass3k_receive)) { return -1; } memset(pepass3k_send, 0, EPASS3K_COMMAND_SIZE); pepass3k_send->TagH = 'R'; pepass3k_send->TagL = '6'; pepass3k_send->CommandH = 0x00; pepass3k_send->CommandL = EPASS3K_COMMAND_GET_ATR; pepass3k_send->LengthH = 0x00; pepass3k_send->LengthL = 0x00; ret = ifd_device_send(reader->device, (unsigned char *)pepass3k_send, EPASS3K_COMMAND_SIZE - 1); if (ret != EPASS3K_COMMAND_SIZE - 1) { free(pepass3k_send); pepass3k_send = NULL; free(pepass3k_receive); pepass3k_receive = NULL; return -1; } memset(pepass3k_receive, 0, EPASS3K_STATUS_SIZE + TOKEN_TYPE_ID_LENGTH); pepass3k_receive->TagH = 'R'; pepass3k_receive->TagL = '6'; pepass3k_receive->LengthH = 0x00; pepass3k_receive->LengthL = 0x20; ret = ifd_device_recv(reader->device, (unsigned char *)pepass3k_receive, EPASS3K_STATUS_SIZE + TOKEN_TYPE_ID_LENGTH, TIMEOUT); if (ret < EPASS3K_STATUS_SIZE) { free(pepass3k_send); pepass3k_send = NULL; free(pepass3k_receive); pepass3k_receive = NULL; return -1; } if (atr_len < pepass3k_receive->LengthH * 256 + pepass3k_receive->LengthL - 5) { free(pepass3k_send); pepass3k_send = NULL; free(pepass3k_receive); pepass3k_receive = NULL; return -1; } if (NULL != atr) { memcpy(atr, pepass3k_receive->Value + 2, pepass3k_receive->LengthH * 256 + pepass3k_receive->LengthL - 5); } ret = pepass3k_receive->LengthH * 256 + pepass3k_receive->LengthL - 5; free(pepass3k_send); pepass3k_send = NULL; free(pepass3k_receive); pepass3k_receive = NULL; return ret; } static int epass3k_card_status(ifd_reader_t * reader, int slot, int *status) { ifd_debug(1, "%s:%d epass3k_card_status()", __FILE__, __LINE__); *status = IFD_CARD_PRESENT; return 0; } static int epass3k_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { int ret = 0; ifd_debug(1, "%s:%d epass3k_send()", __FILE__, __LINE__); epass3k_command_t *pepass3k_send = NULL; pepass3k_send = (epass3k_command_t *) malloc(EPASS3K_COMMAND_SIZE + len); if (NULL == pepass3k_send) { return -1; } memset(pepass3k_send, 0, EPASS3K_COMMAND_SIZE + len); pepass3k_send->TagH = 'R'; pepass3k_send->TagL = '6'; pepass3k_send->CommandH = 0x00; pepass3k_send->CommandL = EPASS3K_COMMAND_TRANSMIT_APDU; pepass3k_send->LengthH = len / 256; pepass3k_send->LengthL = len % 256; memcpy(pepass3k_send->Value, buffer, len); ret = ifd_device_send(reader->device, (unsigned char *)pepass3k_send, EPASS3K_COMMAND_SIZE + len - 1); if (NULL != pepass3k_send) ; { free(pepass3k_send); pepass3k_send = NULL; } if (ret != EPASS3K_COMMAND_SIZE + len - 1) { return -1; } return 0; } static int epass3k_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { int ret = 0; ifd_debug(1, "%s:%d epass3k_recv()", __FILE__, __LINE__); epass3k_status_t *pepass3k_receive = NULL; pepass3k_receive = (epass3k_status_t *) malloc(EPASS3K_STATUS_SIZE + len); memset(pepass3k_receive, 0, EPASS3K_STATUS_SIZE + len); if (NULL == pepass3k_receive) { return -1; } memset(pepass3k_receive, 0, EPASS3K_STATUS_SIZE + len); pepass3k_receive->TagH = 'R'; pepass3k_receive->TagL = '6'; pepass3k_receive->LengthH = len / 256; pepass3k_receive->LengthL = len % 256; ret = ifd_device_recv(reader->device, (unsigned char *)pepass3k_receive, EPASS3K_STATUS_SIZE + len, TIMEOUT); if (ret < EPASS3K_STATUS_SIZE) { if (pepass3k_receive) free(pepass3k_receive); return -1; } if ((NULL != buffer) && (pepass3k_receive->LengthH * 256 + pepass3k_receive->LengthL <= len)) { memcpy(buffer, pepass3k_receive->Value, pepass3k_receive->LengthH * 256 + pepass3k_receive->LengthL); } ret = pepass3k_receive->LengthH * 256 + pepass3k_receive->LengthL; if (pepass3k_receive) free(pepass3k_receive); return ret; } static struct ifd_driver_ops epass3k_driver; void ifd_epass3k_register(void) { epass3k_driver.open = epass3k_open; epass3k_driver.activate = epass3k_activate; epass3k_driver.deactivate = epass3k_deactivate; epass3k_driver.card_reset = epass3k_card_reset; epass3k_driver.card_status = epass3k_card_status; epass3k_driver.change_parity = epass3k_change_parity; epass3k_driver.change_speed = epass3k_change_speed; epass3k_driver.send = epass3k_send; epass3k_driver.recv = epass3k_recv; epass3k_driver.set_protocol = epass3k_set_protocol; ifd_driver_register("ePass3000", &epass3k_driver); } openct-0.6.20/src/ifd/ifd-eutron.c0000644000175000017500000001761011043042742013563 00000000000000/* * Eutron Crypto Idendity IT-Sec driver * * Copyright (C) 2003, Andreas Jellinghaus * Copyright (C) 2003, Olaf Kirch * Copyright 2006, Chaskiel Grundman */ #include "internal.h" #include "atr.h" #include "usb-descriptors.h" #include #include #include #include #define EUTRON_OUT IFD_USB_ENDPOINT_OUT | IFD_USB_TYPE_VENDOR | IFD_USB_RECIP_ENDPOINT #define EUTRON_IN IFD_USB_ENDPOINT_IN | IFD_USB_TYPE_VENDOR | IFD_USB_RECIP_ENDPOINT #define EUTRON_CMD_WRITE 0x1 #define EUTRON_CMD_READ 0x2 #define EUTRON_CMD_ATR 0x9 #define EUTRON_CMD_SETPARAM 0x65 typedef struct eut_priv { unsigned char readbuffer[500]; int head; int tail; } eut_priv_t; /* * Initialize the device */ static int eutron_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; eut_priv_t *priv; ifd_device_params_t params; reader->name = "Eutron CryptoIdendity"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("eutron: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("eutron: setting parameters failed", device_name); ifd_device_close(dev); return -1; } priv = (eut_priv_t *) calloc(1, sizeof(eut_priv_t)); if (!priv) { ct_error("out of memory"); ifd_device_close(dev); return IFD_ERROR_NO_MEMORY; } reader->driver_data = priv; reader->device = dev; return 0; } /* * Power up the reader */ static int eutron_activate(ifd_reader_t * reader) { return 0; } static int eutron_deactivate(ifd_reader_t * reader) { return -1; } /* * Card status - always present */ static int eutron_card_status(ifd_reader_t * reader, int slot, int *status) { *status = IFD_CARD_PRESENT; return 0; } /* * Reset - nothing to be done? * We should do something to make it come back with all state zapped */ static int eutron_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[IFD_MAX_ATR_LEN + 100]; int rc, lr, c, atrlen; if (ifd_usb_control(dev, EUTRON_OUT, 0xa3, 0, 0, NULL, 0, -1) != 0 || ifd_usb_control(dev, EUTRON_OUT, 0xa1, 0, 0, NULL, 0, -1) != 0 || ifd_usb_control(dev, EUTRON_OUT, 0xa2, 0, 0, NULL, 0, -1) != 0 || ifd_usb_control(dev, EUTRON_OUT, 0xa0, 0, 0, NULL, 0, -1) != 0) goto failed; /* flush any leftover buffered data */ while (ifd_usb_control(dev, EUTRON_IN, EUTRON_CMD_READ, 0, 0, buffer, IFD_MAX_ATR_LEN + 100, 1000) > 0) ; if (ifd_usb_control(dev, EUTRON_OUT, EUTRON_CMD_ATR, 0, 0, NULL, 0, -1) != 0) goto failed; for (lr = 0, c = 0; c < 20; c++) { rc = ifd_usb_control(dev, EUTRON_IN, EUTRON_CMD_READ, 0, 0, &buffer[lr], IFD_MAX_ATR_LEN - lr, 1000); if (rc < 0) goto failed; lr += rc; rc = ifd_atr_complete(buffer, lr); if (rc) break; if (lr > IFD_MAX_ATR_LEN) goto failed; usleep(100000); } if (c >= 20) goto failed; atrlen = lr; memcpy(atr, buffer, atrlen); return atrlen; failed: ct_error("eutron: failed to activate token"); return -1; } /* * Send/receive routines */ static int eutron_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { return ifd_usb_control(reader->device, EUTRON_OUT, EUTRON_CMD_WRITE, 0, 0, (void *)buffer, len, 1000); } static int eutron_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { int rc, c, rbs; eut_priv_t *priv = reader->driver_data; ct_debug("eutron_recv: len=%d", len); if (len <= priv->head - priv->tail) { memcpy(buffer, priv->readbuffer + priv->tail, len); priv->tail += len; ct_debug("eutron_recv: returning buffered data, %d bytes left", priv->head - priv->tail); return len; } /* move the data to the beginning of the buffer, so there's a big * contiguous chunk */ memmove(priv->readbuffer, &priv->readbuffer[priv->tail], priv->head - priv->tail); priv->head -= priv->tail; /* since we set tail=0 here, the rest of the function can ignore it */ priv->tail = 0; for (c = 0; c < 30; c++) { rbs = 499 - priv->head; if (rbs == 0) break; rc = ifd_usb_control(reader->device, EUTRON_IN, EUTRON_CMD_READ, 0, 0, &priv->readbuffer[priv->head], rbs, timeout); if (rc < 0) goto failed; priv->head += rc; if (priv->head >= len) break; usleep(100000); } if (len > priv->head) return -1; memcpy(buffer, priv->readbuffer, len); priv->tail += len; if (priv->head - priv->tail) ct_debug("eutron_recv: buffering %d bytes of data", priv->head - priv->tail); return len; failed: ct_error("eutron: receive failed"); return -1; } static int eutron_set_protocol(ifd_reader_t * reader, int nslot, int proto) { ifd_slot_t *slot; ifd_atr_info_t atr_info; unsigned char pts[7], ptsret[7]; int ptslen, ptsrlen, r, c, speedparam; slot = &reader->slot[nslot]; if (proto != IFD_PROTOCOL_T0 && proto != IFD_PROTOCOL_T1) { ct_error("%s: protocol not supported", reader->name); return -1; } r = ifd_atr_parse(&atr_info, slot->atr, slot->atr_len); if (r < 0) { ct_error("%s: Bad ATR", reader->name); return r; } /* if the card supports T=1, prefer it, even if * it is not the default protocol */ if (atr_info.supported_protocols & 0x2) { proto = IFD_PROTOCOL_T1; } /* XXX disable baud change */ atr_info.TA[0] = -1; /* ITSEC-P does not respond correctly to request with PTS2 present */ atr_info.TC[0] = -1; ptslen = ifd_build_pts(&atr_info, proto, pts, 7); if (ptslen < 0) { return r; } if (eutron_send(reader, slot->dad, pts, ptslen) != ptslen) return IFD_ERROR_COMM_ERROR; for (ptsrlen = 0, c = 0; c < 20; c++) { r = ifd_usb_control(reader->device, EUTRON_IN, EUTRON_CMD_READ, 0, 0, &ptsret[ptsrlen], sizeof(ptsret) - ptsrlen, 1000); if (r < 0) return IFD_ERROR_COMM_ERROR; ptsrlen += r; if (ifd_pts_complete(ptsret, ptsrlen)) break; if (ptsrlen >= 7) return IFD_ERROR_COMM_ERROR; usleep(100000); } if (c >= 20) return IFD_ERROR_TIMEOUT; r = ifd_verify_pts(&atr_info, proto, ptsret, ptsrlen); if (r < 0) { ct_error("%s: Protocol selection failed", reader->name); return r; } if (atr_info.TA[0] != -1) speedparam = atr_info.TA[0]; else speedparam = 1; if (ifd_usb_control (reader->device, EUTRON_OUT, EUTRON_CMD_SETPARAM, speedparam, 0, NULL, 0, -1) != 0 || ifd_usb_control(reader->device, EUTRON_OUT, 0xa1, 0, 0, NULL, 0, -1) != 0 || ifd_usb_control(reader->device, EUTRON_OUT, 0xa0, 0, 0, NULL, 0, -1) != 0) return IFD_ERROR_COMM_ERROR; slot->proto = ifd_protocol_new(proto, reader, slot->dad); if (slot->proto == NULL) { ct_error("%s: internal error", reader->name); return -1; } /* device is not guaranteed to return whole frames */ ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 0); /* Enable larger transfers */ if (proto == IFD_PROTOCOL_T1 && atr_info.TA[2] != -1) { ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSC, atr_info.TA[2]); if (t1_negotiate_ifsd(slot->proto, slot->dad, atr_info.TA[2]) > 0) ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSD, atr_info.TA[2]); } return 0; } /* * Driver operations */ static struct ifd_driver_ops eutron_driver; /* * Initialize this module */ void ifd_eutron_register(void) { eutron_driver.open = eutron_open; eutron_driver.activate = eutron_activate; eutron_driver.deactivate = eutron_deactivate; eutron_driver.card_status = eutron_card_status; eutron_driver.card_reset = eutron_card_reset; eutron_driver.send = eutron_send; eutron_driver.recv = eutron_recv; eutron_driver.set_protocol = eutron_set_protocol; ifd_driver_register("eutron", &eutron_driver); } openct-0.6.20/src/ifd/ifd-kaan.c0000644000175000017500000006537710625640312013200 00000000000000/* * Driver for Kobil Kaan Professional and Telesec B1 * * Copyright (C) 2003 Olaf Kirch * Copyright (C) 2003 Michael Haardt (B1 support) */ #include "internal.h" #include #include #include #include #include #include "ctbcs.h" /* Freeze after that many seconds of inactivity */ #define FREEZE_DELAY 5 enum { TYPE_KAAN, TYPE_B1 }; /* * CT status */ typedef struct kaan_status { int reader_type; ifd_protocol_t *p; time_t last_activity; unsigned int frozen:1; int icc_proto[OPENCT_MAX_SLOTS]; } kaan_status_t; static int kaan_reset_ct(ifd_reader_t * reader); static int kaan_get_units(ifd_reader_t * reader); static int kaan_freeze(ifd_reader_t * reader); static int kaan_sync_detect(ifd_reader_t * reader, int nslot); static int kaan_set_protocol(ifd_reader_t *, int, int); static int __kaan_apdu_xcv(ifd_reader_t *, const unsigned char *, size_t, unsigned char *, size_t, time_t, int); static int kaan_get_tlv_from_file(ifd_reader_t *, unsigned int, unsigned int, unsigned char, unsigned char *, size_t); static int kaan_get_tlv(unsigned char *, size_t, unsigned char tag, unsigned char **ptr); static int kaan_select_file(ifd_reader_t *, unsigned char, unsigned int, size_t *); static int kaan_read_binary(ifd_reader_t *, unsigned char, unsigned int, unsigned char *, size_t); static int kaan_update_binary(ifd_reader_t *, unsigned char, unsigned int, const unsigned char *, size_t); static int kaan_check_sw(const char *, const unsigned char *, int); static int kaan_get_sw(const unsigned char *, unsigned int, unsigned short *); static int kaan_select_app(ifd_reader_t * reader, int nad, const void *, size_t); #define kaan_apdu_xcv(reader, sbuf, slen, rbug, rlen, timeout) \ __kaan_apdu_xcv(reader, sbuf, slen, rbug, rlen, timeout, 1) /* * Initialize the device */ static int kaan_open(ifd_reader_t * reader, const char *device_name) { kaan_status_t *st; ifd_device_t *dev; ifd_device_params_t params; int r; reader->name = "Kobil Kaan PRO"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) == IFD_DEVICE_TYPE_SERIAL && ifd_device_get_parameters(dev, ¶ms) >= 0) { /* The default configuration for Kobil serial * readers is 8E1 at 9600bps */ params.serial.bits = 8; params.serial.parity = IFD_SERIAL_PARITY_EVEN; params.serial.stopbits = 1; ifd_device_set_parameters(dev, ¶ms); } if (ifd_device_type(dev) == IFD_DEVICE_TYPE_USB) { params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("kaan: setting parameters failed", device_name); ifd_device_close(dev); return -1; } } reader->device = dev; if ((st = (kaan_status_t *) calloc(1, sizeof(*st))) == NULL) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } st->reader_type = TYPE_KAAN; st->icc_proto[0] = -1; st->icc_proto[1] = -1; reader->driver_data = st; if (!(st->p = ifd_protocol_new(IFD_PROTOCOL_T1, reader, 0x12))) { /* Something is badly hosed */ ct_error("unable to get T1 protocol handler"); return IFD_ERROR_GENERIC; } /* Force a T=1 resync. We don't know what state the reader's * T=1 engine is in. */ if ((r = ifd_protocol_resynchronize(st->p, 0x12)) < 0) return r; /* Reset the CT */ if ((r = kaan_reset_ct(reader)) < 0) return r; /* Get list of functional units */ if ((r = kaan_get_units(reader)) < 0) return r; #if 0 /* Clear the display */ reader->ops->display(reader, ""); #endif return 0; } /* * Initialize the device */ static int b1_open(ifd_reader_t * reader, const char *device_name) { kaan_status_t *st; ifd_device_t *dev; ifd_device_params_t params; unsigned long w; int r; reader->name = "DTAG/T-TeleSec B1 standard"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) == IFD_DEVICE_TYPE_SERIAL) { if (ifd_device_get_parameters(dev, ¶ms) >= 0) { /* The default configuration for B1 serial * readers is 8E1 at 9600 bps */ params.serial.bits = 8; params.serial.parity = IFD_SERIAL_PARITY_EVEN; params.serial.stopbits = 1; params.serial.dtr = 0; params.serial.rts = 0; ifd_device_set_parameters(dev, ¶ms); /* wait 35+-15 = 50 ms for DSR low */ poll((struct pollfd *)0, 0, 50); if (ifd_serial_get_dsr(dev)) return -1; /* wait further 300 ms until setting DTR */ poll((struct pollfd *)0, 0, 300); /* set DTR */ params.serial.dtr = 1; ifd_device_set_parameters(dev, ¶ms); /* wait until DSR is set, which may take up to 5 s (typically 0.8 s) */ for (w = 0; w <= 5000; w += 210) { poll((struct pollfd *)0, 0, 210); if (ifd_serial_get_dsr(dev)) break; } if (w > 5000) return -1; } else return -1; } reader->device = dev; if ((st = (kaan_status_t *) calloc(1, sizeof(*st))) == NULL) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } st->reader_type = TYPE_B1; st->icc_proto[0] = -1; st->icc_proto[1] = -1; reader->driver_data = st; if (!(st->p = ifd_protocol_new(IFD_PROTOCOL_T1, reader, 0x12))) { ct_error("unable to get T1 protocol handler"); return IFD_ERROR_GENERIC; } /* Reset the CT */ if ((r = kaan_reset_ct(reader)) < 0) return r; /* Get list of functional units */ if ((r = kaan_get_units(reader)) < 0) return r; return 0; } /* * Reset the card reader */ static int kaan_reset_ct(ifd_reader_t * reader) { unsigned char cmd1[] = { 0x20, 0x10, 0x00, 0x00 }; unsigned char cmd2[] = { 0x20, 0x11, 0x00, 0x00 }; unsigned char resp[2]; int rc; unsigned short sw; if ((rc = kaan_apdu_xcv(reader, cmd1, sizeof(cmd1), resp, sizeof(resp), 0)) < 0) { ct_error("kaan_reset_ct: %s", ct_strerror(rc)); return rc; } ifd_debug(1, "kaan_reset_ct: rc=%d", rc); if ((rc = kaan_get_sw(resp, rc, &sw)) < 0) return rc; if (sw == 0x6b00) { /* Reset for older readers */ if ((rc = kaan_apdu_xcv(reader, cmd2, sizeof(cmd2), resp, sizeof(resp), 0)) < 0) { ct_error("kaan_reset_ct: %s", ct_strerror(rc)); return rc; } if ((rc = kaan_get_sw(resp, rc, &sw)) < 0) return rc; } if (sw != 0x9000) { ct_error("kaan_reset_ct: failure, status code %04X", sw); return IFD_ERROR_COMM_ERROR; } return rc; } /* * Get functional units */ static int kaan_get_units(ifd_reader_t * reader) { unsigned char cmd[] = { 0x20, 0x13, 0x00, 0x81, 0x00 }; unsigned char buffer[16], *units; int rc, n; unsigned short sw; reader->slot[0].dad = 0x02; if ((rc = kaan_apdu_xcv(reader, cmd, sizeof(cmd), buffer, sizeof(buffer), 0)) < 0) { ct_error("kaan_get_units: %s", ct_strerror(rc)); return rc; } if ((rc = kaan_get_sw(buffer, rc, &sw)) < 0) return rc; if (sw != 0x9000) { return 0; } if ((n = kaan_get_tlv(buffer, rc, 0x81, &units)) < 0) return 0; while (n--) { switch (units[n]) { case 0x01: /* ICC1 */ break; case 0x02: /* ICC2 */ reader->slot[1].dad = 0x32; reader->nslots = 2; break; case 0x40: /* Display */ reader->flags |= IFD_READER_KEYPAD; break; case 0x50: /* Display */ reader->flags |= IFD_READER_DISPLAY; break; } } return 0; } /* * Power up the reader */ static int kaan_activate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int kaan_deactivate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } /* * Get the card status */ static int kaan_card_status(ifd_reader_t * reader, int slot, int *status) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; unsigned char buffer[16] = { 0x20, 0x13, 0x00, 0x80, 0x00 }; unsigned char *byte; int rc, n; buffer[2] = slot + 1; ifd_debug(1, "slot=%d", slot); if (!st->frozen && st->last_activity + FREEZE_DELAY < time(NULL) && ifd_device_type(reader->device) == IFD_DEVICE_TYPE_SERIAL) { if ((rc = kaan_freeze(reader)) < 0) return rc; usleep(10000); st->frozen = 1; } if (st->frozen) { /* Get the DSR status */ if (!ifd_serial_get_dsr(reader->device)) { *status = reader->slot[slot].status; return 0; } /* Activity detected - go on an get status */ st->last_activity = time(NULL); st->frozen = 0; } rc = __kaan_apdu_xcv(reader, buffer, 5, buffer, sizeof(buffer), 0, 0); if ((rc = kaan_check_sw("kaan_card_status", buffer, rc)) < 0) return rc; if (buffer[0] == 0x80) { if ((n = kaan_get_tlv(buffer, rc, 0x80, &byte)) >= 0) { if (*byte & 0x01) *status |= IFD_CARD_PRESENT; } } else /* older implementations may return only value part */ if (buffer[0] & 0x01) *status |= IFD_CARD_PRESENT; return 0; } /* * Get the card status */ static int b1_card_status(ifd_reader_t * reader, int slot, int *status) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; unsigned char buffer[16]; int rc; buffer[2] = slot + 1; ifd_debug(1, "slot=%d", slot); if (!st->frozen && st->last_activity + FREEZE_DELAY < time(NULL) && ifd_device_type(reader->device) == IFD_DEVICE_TYPE_SERIAL) { if ((rc = kaan_freeze(reader)) < 0) return rc; usleep(10000); st->frozen = 1; } if (st->frozen) { /* Get the DSR status */ if (!ifd_serial_get_dsr(reader->device)) { *status = reader->slot[slot].status; return 0; } /* Activity detected - go on an get status */ st->last_activity = time(NULL); st->frozen = 0; } rc = kaan_get_tlv_from_file(reader, 0x7F70 | (slot), 0x7021 | (slot << 8), 0x21, buffer, 1); if (rc < 0) return rc; ct_error("buffer[0] = %i\n", buffer[0] ); if (buffer[0]) { *status |= IFD_CARD_PRESENT; } return 0; } /* * Send the Freeze command to the reader */ static int kaan_freeze(ifd_reader_t * reader) { unsigned char freeze[16] = { 0x80, 0x70, 0x00, 0x00, 0x00, 0x30, 00 }; unsigned int m, n; int rc; ifd_debug(1, "trying to freeze reader"); for (n = 0, m = 7; n < reader->nslots; n++, m++) { freeze[m] = n + 1; if (reader->slot[n].status != 0) freeze[m] |= 0x02; } freeze[6] = n; freeze[4] = n + 2; rc = __kaan_apdu_xcv(reader, freeze, m, freeze, sizeof(freeze), 0, 0); return kaan_check_sw("kaan_card_freeze", freeze, rc); } /* * Common code for card_reset and card_request */ static int kaan_do_reset(ifd_reader_t * reader, int nslot, const unsigned char *cmd, size_t cmd_len, unsigned char *atr, size_t atr_len, unsigned int timeout) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; unsigned char buffer[64]; unsigned short sw; size_t got; int rc; st->icc_proto[nslot] = -1; if ((rc = kaan_apdu_xcv(reader, cmd, cmd_len, buffer, sizeof(buffer), timeout)) < 0) return rc; if ((rc = kaan_get_sw(buffer, rc, &sw)) < 0) return rc; if ((got = rc) > atr_len) got = atr_len; switch (sw) { case 0x9000: case 0x62a6: /* Synchronous ICC, CT has already done everything we need * to know. Now just get the info from the CT. */ memcpy(atr, buffer, got); if ((rc = kaan_sync_detect(reader, nslot)) < 0) return rc; if (got == 4 && st->reader_type == TYPE_B1) { /* Try to select KVK file. This is required for * B1 readers and failure is ignored. */ static unsigned char aid[] = { 0xd2, 0x80, 0x00, 0x00, 0x01, 0x01 }; kaan_select_app(reader, 0x02, aid, sizeof(aid)); } break; case 0x62a5: /* ATR was read, but protocol is unknown. B1 readers */ /* use that for phone cards, because their size can not */ /* automatically be detected. Chose the largest possible */ /* size. */ memcpy(atr, buffer, got); if (got == 4 && st->reader_type == TYPE_B1) kaan_set_protocol(reader, nslot, IFD_PROTOCOL_EUROCHIP); if ((rc = kaan_sync_detect(reader, nslot)) < 0) return rc; break; case 0x9001: /* asynchronous ICC, just copy the ATR */ memcpy(atr, buffer, got); break; case 0x62a7: /* synchronous ICC, unknown proto - try to detect * the standard way */ return ifd_sync_detect_icc(reader, nslot, atr, atr_len); default: ifd_debug(1, "kaan_card_reset: unable to reset card, sw=0x%04x", sw); return IFD_ERROR_COMM_ERROR; } return got; } /* * Reset card and get ATR */ static int kaan_card_reset(ifd_reader_t * reader, int nslot, void *result, size_t size) { unsigned char cmd[5] = { 0x20, 0x10, 0x00, 0x01, 0x00 }; cmd[2] = nslot + 1; ifd_debug(1, "called."); return kaan_do_reset(reader, nslot, cmd, 5, (unsigned char *)result, size, 0); } /* * Request ICC */ static int kaan_card_request(ifd_reader_t * reader, int slot, time_t timeout, const char *message, void *atr, size_t atr_len) { ct_buf_t buf; unsigned char buffer[256] = { 0x20, 0x17, 0x00, 0x01, 0x00 }; int n; buffer[2] = slot + 1; /* Build the APDU, which is basically a modified CTBCS OUTPUT command */ ct_buf_init(&buf, buffer, sizeof(buffer) - 1); ctbcs_begin(&buf, 0x17, slot + 1, 0x01); ctbcs_add_timeout(&buf, timeout); ctbcs_add_message(&buf, message); if ((n = ctbcs_finish(&buf)) < 0) return n; buffer[n++] = 0x00; return kaan_do_reset(reader, slot, buffer, n, (unsigned char *)atr, atr_len, timeout); } /* * Select a protocol for communication with the ICC. * Note that we continue to communicate with the terminal * using T=1; internally, the terminal talks to the * card using whatever protocol we selected. */ static int kaan_set_protocol(ifd_reader_t * reader, int nslot, int proto) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; unsigned char cmd[] = { 0x80, 0x60, 0x00, 0x00, 0x03, 0x22, 0x01, 0x00 }; unsigned char buffer[2]; unsigned short sw; ifd_slot_t *slot; int rc; cmd[2] = nslot + 1; ifd_debug(1, "proto=%d", proto); switch (proto) { case IFD_PROTOCOL_T0: cmd[7] = 0x01; break; case IFD_PROTOCOL_T1: cmd[7] = 0x02; break; case IFD_PROTOCOL_I2C_SHORT: cmd[7] = 0x80; break; case IFD_PROTOCOL_I2C_LONG: cmd[7] = 0x80; break; case IFD_PROTOCOL_3WIRE: cmd[7] = 0x81; break; case IFD_PROTOCOL_2WIRE: cmd[7] = 0x82; break; case IFD_PROTOCOL_EUROCHIP: cmd[7] = 0x93; break; default: ifd_debug(1, "kaan_set_protocol: protocol %d not supported", proto); return -1; } if ((rc = kaan_apdu_xcv(reader, cmd, sizeof(cmd), buffer, sizeof(buffer), 0)) < 0 || (rc = kaan_get_sw(buffer, rc, &sw)) < 0) return rc; /* B1 returns 6985 for German KVK health care cards */ if (sw != 0x9000 && sw != 0x6985) { ifd_debug(1, "kaan_set_protocol: protocol %d not supported, sw=%04hx", proto, sw); return -1; } slot = &reader->slot[nslot]; slot->proto = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, reader, slot->dad); if (slot->proto == NULL) { ct_error("%s: internal error", reader->name); return -1; } st->icc_proto[nslot] = proto; return 0; } /* * APDU exchange with ICC */ static int kaan_transparent(ifd_reader_t * reader, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; ifd_iso_apdu_t iso; int rc, nslot, n, prot; nslot = (dad == 0x02) ? 0 : 1; prot = st->icc_proto[nslot]; /* Parse the APDU; extract class byte, case, etc */ if ((rc = ifd_iso_apdu_parse(sbuf, slen, &iso)) < 0) return rc; if (prot == IFD_PROTOCOL_T0) { if (iso.cse == IFD_APDU_CASE_4S) slen--; } n = ifd_protocol_transceive(st->p, dad, sbuf, slen, rbuf, rlen); if (iso.cse == IFD_APDU_CASE_4S && n == 2) { unsigned char cmd[5], *sw; sw = (unsigned char *)rbuf; if (sw[0] == 0x61) { cmd[0] = iso.cla; cmd[1] = 0xC0; cmd[2] = 0x00; cmd[3] = 0x00; cmd[4] = sw[1]; n = ifd_protocol_transceive(st->p, dad, cmd, 5, rbuf, rlen); } } if (n < 0) return n; if (n < 2) { ct_error("kaan: T=1 protocol failure, not enough bytes for SW"); return IFD_ERROR_COMM_ERROR; } return n; } /* * Output a string to the display */ static int kaan_display(ifd_reader_t * reader, const char *string) { unsigned char buffer[256] = { 0x20, 0x17, 0x40, 00 }; int rc, n; if (!(reader->flags & IFD_READER_DISPLAY)) return 0; n = ctbcs_build_output(buffer, sizeof(buffer), string); if (n < 0) return n; rc = kaan_apdu_xcv(reader, buffer, n, buffer, sizeof(buffer), 0); return kaan_check_sw("kaan_display", buffer, rc); } /* * Perform a PIN verification */ static int kaan_perform_verify(ifd_reader_t * reader, int nslot, unsigned int timeout, const char *prompt, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len) { unsigned char buffer[256]; int n; unsigned short sw; if (!(reader->flags & IFD_READER_KEYPAD)) return 0; n = ctbcs_build_perform_verify_apdu(buffer, sizeof(buffer), nslot + 1, prompt, timeout, data, data_len); if (n < 0) return n; n = kaan_apdu_xcv(reader, buffer, n, resp, resp_len, 0); if (n < 0) { ct_error("perform_verify failed: %s", ct_strerror(n)); return n; } if ((n = kaan_get_sw(resp, n, &sw)) < 0) return n; switch (sw) { case 0x6400: ct_error("perform_verify failed: timeout"); return IFD_ERROR_USER_TIMEOUT; case 0x6401: ct_error("perform_verify failed: user pressed cancel"); return IFD_ERROR_USER_ABORT; case 0x6402: ct_error("perform_verify failed: PIN mismatch"); return IFD_ERROR_PIN_MISMATCH; } return 2; } /* * Read from synchronous ICC */ static int kaan_sync_read(ifd_reader_t * reader, int slot, int proto, unsigned short addr, unsigned char *data, size_t len) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; int r; ifd_debug(1, "called, addr=0x%04x, len=%u", addr, len); if (st->icc_proto[slot] != proto) { r = kaan_set_protocol(reader, slot, proto); if (r < 0) return r; } return kaan_read_binary(reader, reader->slot[slot].dad, addr, data, len); } static int kaan_sync_write(ifd_reader_t * reader, int slot, int proto, unsigned short addr, const unsigned char *buffer, size_t len) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; int r; ifd_debug(1, "called, addr=0x%04x, len=%u", addr, len); if (st->icc_proto[slot] != proto) { r = kaan_set_protocol(reader, slot, proto); if (r < 0) return r; } return kaan_update_binary(reader, reader->slot[slot].dad, addr, buffer, len); } /* * Detect type and size of synchronous card. * When we get here, the CT has done most of the work for us * already, we just need to get the information from it. * * XXX - there does not seem to be a way to find out the size * of the card, so we have to resort to poking around the * card. */ static int kaan_sync_detect(ifd_reader_t * reader, int nslot) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; ifd_slot_t *slot = &reader->slot[nslot]; unsigned char protocol; int rc; rc = kaan_get_tlv_from_file(reader, 0x7F70 | nslot, 0x7021 | (nslot << 8), 0x22, &protocol, 1); if (rc < 0) return rc; switch (protocol) { case 0x80: protocol = IFD_PROTOCOL_I2C_LONG; break; case 0x81: protocol = IFD_PROTOCOL_3WIRE; break; case 0x82: protocol = IFD_PROTOCOL_2WIRE; break; case 0x90: case 0x91: case 0x92: case 0x93: protocol = IFD_PROTOCOL_EUROCHIP; break; default: ct_error("kaan_sync_detect: unknown card protocol 0x%x", protocol); return IFD_ERROR_NOT_SUPPORTED; } slot->proto = ifd_protocol_new(protocol, reader, slot->dad); st->icc_proto[nslot] = protocol; return 0; } /* * Read from config/status file */ static int kaan_get_tlv_from_file(ifd_reader_t * reader, unsigned int df_id, unsigned int ef_id, unsigned char tag, unsigned char *data, size_t len) { unsigned char buffer[256 + 2], *ptr; size_t size; int rc; if ((rc = kaan_select_file(reader, 0x12, 0x3F00, &size)) < 0 || (rc = kaan_select_file(reader, 0x12, df_id, &size)) < 0 || (rc = kaan_select_file(reader, 0x12, ef_id, &size)) < 0) return rc; if (size > 256) size = 256; if ((rc = kaan_read_binary(reader, 0x12, 0, buffer, 256)) < 0) return rc; if ((rc = kaan_get_tlv(buffer, rc, tag, &ptr)) < 0) return rc; if ((size_t) rc > len) rc = len; memcpy(data, ptr, rc); return rc; } /* * Stuff to interface with the Kaan's internal file system */ static int kaan_select_file(ifd_reader_t * reader, unsigned char nad, unsigned int fid, size_t * sizep) { unsigned char cmd[] = { 0x00, 0xa4, 0x00, 0x00, 2, 0x00, 0x00 }; unsigned char resp[64]; int r; ifd_debug(1, "called, fid=0x%04x", fid); cmd[5] = fid >> 8; cmd[6] = fid & 0xFF; r = kaan_transparent(reader, nad, cmd, sizeof(cmd), resp, sizeof(resp)); if (r < 0) return r; if ((r = kaan_check_sw("kaan_select_file", resp, r)) < 0) return r; if (sizep) *sizep = (resp[0] << 8) | resp[1]; return 0; } static int kaan_select_app(ifd_reader_t * reader, int nad, const void *aid, size_t len) { unsigned char cmd[32] = { 0x00, 0xa4, 0x04, 0x00 }; unsigned char resp[64]; int r; if (len > sizeof(cmd) - 5) return IFD_ERROR_BUFFER_TOO_SMALL; cmd[4] = len; memcpy(cmd + 5, aid, len); r = kaan_transparent(reader, nad, cmd, len + 5, resp, sizeof(resp)); if (r < 0) return r; return kaan_check_sw("kaan_select_app", resp, r); } static int kaan_read_binary(ifd_reader_t * reader, unsigned char nad, unsigned int offset, unsigned char *data, size_t len) { unsigned char cmd[] = { 0x00, 0xB0, 0x00, 0x00, 0x00 }; unsigned char buffer[258]; size_t count, total = 0, got; unsigned short sw; int r; ifd_debug(1, "called, offset=0x%04x, len=%u", offset, len); while (total < len) { if ((count = len) > 256) count = 256; cmd[2] = offset >> 8; cmd[3] = offset & 0xFF; cmd[4] = count; r = kaan_transparent(reader, nad, cmd, sizeof(cmd), buffer, sizeof(buffer)); if (r < 0) return r; got = r - 2; if ((r = kaan_get_sw(buffer, r, &sw)) < 0) return r; switch (sw) { case 0x6B00: /* offset outside of file */ goto done; case 0x9000: case 0x6282: /* EOF reached */ memcpy(data + total, buffer, got); offset += got; total += got; break; default: ct_error("kaan_read_binary: " "failure, status code %04X", sw); return IFD_ERROR_COMM_ERROR; } /* end of file? */ if (got == 0 || sw == 0x6282) break; } done: return total; } static int kaan_update_binary(ifd_reader_t * reader, unsigned char nad, unsigned int offset, const unsigned char *data, size_t len) { unsigned char cmd[256 + 5] = { 0x00, 0xD0, 0x00, 0x00, 0x00 }; unsigned char resp[2]; size_t count, total = 0; int r; ifd_debug(2, "called, offset=0x%04x, len=%u", offset, len); while (total < len) { if ((count = len) > 256) count = 256; cmd[2] = offset >> 8; cmd[3] = offset & 0xFF; cmd[4] = count; memcpy(cmd + 5, data + total, count); r = kaan_transparent(reader, nad, cmd, 5 + count, resp, sizeof(resp)); if (r < 0) return r; if ((r = kaan_check_sw("kaan_update_binary", resp, r)) < 0) return r; if (r == 0) break; offset += r; total += r; } return total; } /* * APDU exchange with terminal */ static int __kaan_apdu_xcv(ifd_reader_t * reader, const unsigned char *sbuf, size_t slen, unsigned char *rbuf, size_t rlen, time_t timeout, int activity) { kaan_status_t *st = (kaan_status_t *) reader->driver_data; long orig_timeout = 0; int rc; /* Override timeout if needed */ if (timeout) { ifd_protocol_get_parameter(st->p, IFD_PROTOCOL_RECV_TIMEOUT, &orig_timeout); ifd_protocol_set_parameter(st->p, IFD_PROTOCOL_RECV_TIMEOUT, timeout * 1000); } rc = ifd_protocol_transceive(st->p, 0x12, sbuf, slen, rbuf, rlen); if (rc < 0) return rc; if (rc < 2) { ct_error("kaan: T=1 protocol failure, rc=%d", rc); rc = IFD_ERROR_COMM_ERROR; } if (timeout) { ifd_protocol_set_parameter(st->p, IFD_PROTOCOL_RECV_TIMEOUT, orig_timeout); } if (activity) { st->last_activity = time(NULL); st->frozen = 0; } return rc; } /* * Check status word returned by Kaan */ static int kaan_check_sw(const char *msg, const unsigned char *buf, int rc) { unsigned short sw; if (rc < 0) { ct_error("%s: %s", msg, ct_strerror(rc)); } else if ((rc = kaan_get_sw(buf, rc, &sw)) >= 0) { if (sw != 0x9000) { ct_error("%s: failure, status code %04X", msg, sw); rc = IFD_ERROR_COMM_ERROR; } } return rc; } static int kaan_get_sw(const unsigned char *buf, unsigned int n, unsigned short *sw) { if (n < 2) { ifd_debug(1, "response too short (%d bytes)", n); return IFD_ERROR_COMM_ERROR; } n -= 2; *sw = (buf[n] << 8) | buf[n + 1]; return n; } /* * Send/receive T=1 apdu * This is just for the communication with the card reader. */ static int kaan_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { return ifd_device_send(reader->device, buffer, len); } static int kaan_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { return ifd_device_recv(reader->device, buffer, len, timeout); } /* * Extract data from TLV encoded result. * The length is encoded as a single byte in the range 0 to 254. * A value of 255 means a big endian two byte length value follows. */ static int kaan_get_tlv(unsigned char *buf, size_t len, unsigned char tag, unsigned char **res) { unsigned char *p = buf; unsigned int n; n = len; while (n >= 2) { len = p[1]; if (len + 2 > n) break; if (p[0] == tag) { *res = p + 2; return len; } p += len + 2; n -= len + 2; } return -1; } /* * Driver operations */ static struct ifd_driver_ops kaan_driver, b1_driver; /* * Initialize this module */ void ifd_kaan_register(void) { kaan_driver.open = kaan_open; kaan_driver.activate = kaan_activate; kaan_driver.deactivate = kaan_deactivate; kaan_driver.card_status = kaan_card_status; kaan_driver.card_reset = kaan_card_reset; kaan_driver.card_request = kaan_card_request; kaan_driver.output = kaan_display; kaan_driver.perform_verify = kaan_perform_verify; kaan_driver.send = kaan_send; kaan_driver.recv = kaan_recv; kaan_driver.set_protocol = kaan_set_protocol; kaan_driver.transparent = kaan_transparent; kaan_driver.sync_read = kaan_sync_read; kaan_driver.sync_write = kaan_sync_write; b1_driver.open = b1_open; b1_driver.activate = kaan_activate; b1_driver.deactivate = kaan_deactivate; b1_driver.card_status = b1_card_status; b1_driver.card_reset = kaan_card_reset; b1_driver.card_request = kaan_card_request; b1_driver.output = kaan_display; b1_driver.perform_verify = kaan_perform_verify; b1_driver.send = kaan_send; b1_driver.recv = kaan_recv; b1_driver.set_protocol = kaan_set_protocol; b1_driver.transparent = kaan_transparent; b1_driver.sync_read = kaan_sync_read; b1_driver.sync_write = kaan_sync_write; ifd_driver_register("kaan", &kaan_driver); ifd_driver_register("b1", &b1_driver); } openct-0.6.20/src/ifd/usb-descriptors.c0000644000175000017500000002543611143001716014641 00000000000000/* from libusb 0.1.6a: descriptors.c * Copyright (c) 2001 Johannes Erdfelt * * This library is covered by the LGPL, read LICENSE for details. */ /* * This code looks surprisingly similar to the code I wrote for the Linux * kernel. It's not a coincidence :) */ #include "internal.h" #include #include #include #include "usb-descriptors.h" static int ifd_usb_parse_endpoint(struct ifd_usb_endpoint_descriptor *endpoint, unsigned char *buffer, int size) { struct ifd_usb_descriptor_header *header; unsigned char *begin; int parsed = 0, len, numskipped; header = (struct ifd_usb_descriptor_header *)buffer; /* Everything should be fine being passed into here, but we sanity */ /* check JIC */ if (header->bLength > size) { ct_debug("ran out of descriptors parsing"); return -1; } if (header->bDescriptorType != IFD_USB_DT_ENDPOINT) { ct_debug ("unexpected descriptor 0x%X, expecting endpoint descriptor, type 0x%X", endpoint->bDescriptorType, IFD_USB_DT_ENDPOINT); return parsed; } if (header->bLength == IFD_USB_DT_ENDPOINT_AUDIO_SIZE) memcpy(endpoint, buffer, IFD_USB_DT_ENDPOINT_AUDIO_SIZE); else memcpy(endpoint, buffer, IFD_USB_DT_ENDPOINT_SIZE); IFD_USB_LE16_TO_CPU(endpoint->wMaxPacketSize); buffer += header->bLength; size -= header->bLength; parsed += header->bLength; /* Skip over the rest of the Class Specific or Vendor Specific */ /* descriptors */ begin = buffer; numskipped = 0; while (size >= sizeof(struct ifd_usb_descriptor_header)) { header = (struct ifd_usb_descriptor_header *)buffer; if (header->bLength < 2) { ct_debug("invalid descriptor length of %d", header->bLength); return -1; } /* If we find another "proper" descriptor then we're done */ if ((header->bDescriptorType == IFD_USB_DT_ENDPOINT) || (header->bDescriptorType == IFD_USB_DT_INTERFACE) || (header->bDescriptorType == IFD_USB_DT_CONFIG) || (header->bDescriptorType == IFD_USB_DT_DEVICE)) break; ct_debug("in p_ep: skipping descriptor 0x%X", header->bDescriptorType); numskipped++; buffer += header->bLength; size -= header->bLength; parsed += header->bLength; } if (numskipped) ct_debug ("skipped %d class/vendor specific endpoint descriptors", numskipped); /* Copy any unknown descriptors into a storage area for drivers */ /* to later parse */ len = (int)(buffer - begin); if (!len) { endpoint->extra = NULL; endpoint->extralen = 0; return parsed; } endpoint->extra = (unsigned char *)malloc(len); if (!endpoint->extra) { ct_error("out of memory"); endpoint->extralen = 0; return parsed; } memcpy(endpoint->extra, begin, len); endpoint->extralen = len; return parsed; } static int ifd_usb_parse_interface(struct ifd_usb_interface *interface, unsigned char *buffer, int size) { int i, len, numskipped, retval, parsed = 0; struct ifd_usb_descriptor_header *header; struct ifd_usb_interface_descriptor *ifp; unsigned char *begin; interface->num_altsetting = 0; while (size > 0) { interface->altsetting = (struct ifd_usb_interface_descriptor *) realloc(interface->altsetting, sizeof(struct ifd_usb_interface_descriptor) * (interface->num_altsetting + 1) ); if (!interface->altsetting) { ct_error("out of memory"); return -1; } ifp = interface->altsetting + interface->num_altsetting; interface->num_altsetting++; memcpy(ifp, buffer, IFD_USB_DT_INTERFACE_SIZE); /* Skip over the interface */ buffer += ifp->bLength; parsed += ifp->bLength; size -= ifp->bLength; begin = buffer; numskipped = 0; /* Skip over any interface, class or vendor descriptors */ while (size >= sizeof(struct ifd_usb_descriptor_header)) { header = (struct ifd_usb_descriptor_header *)buffer; if (header->bLength < 2) { ct_debug("invalid descriptor length of %d", header->bLength); return -1; } /* If we find another "proper" descriptor then we're done */ if ((header->bDescriptorType == IFD_USB_DT_INTERFACE) || (header->bDescriptorType == IFD_USB_DT_ENDPOINT) || (header->bDescriptorType == IFD_USB_DT_CONFIG) || (header->bDescriptorType == IFD_USB_DT_DEVICE)) break; numskipped++; buffer += header->bLength; parsed += header->bLength; size -= header->bLength; } if (numskipped) ct_debug ("skipped %d class/vendor specific interface descriptors", numskipped); /* Copy any unknown descriptors into a storage area for */ /* drivers to later parse */ len = (int)(buffer - begin); if (!len) { ifp->extra = NULL; ifp->extralen = 0; } else { ifp->extra = (unsigned char *)malloc(len); if (!ifp->extra) { ct_error("out of memory"); ifp->extralen = 0; return -1; } memcpy(ifp->extra, begin, len); ifp->extralen = len; } /* Did we hit an unexpected descriptor? */ header = (struct ifd_usb_descriptor_header *)buffer; if ((size >= sizeof(struct ifd_usb_descriptor_header)) && ((header->bDescriptorType == IFD_USB_DT_CONFIG) || (header->bDescriptorType == IFD_USB_DT_DEVICE))) return parsed; if (ifp->bNumEndpoints > IFD_USB_MAXENDPOINTS) { ct_debug("too many endpoints"); return -1; } ifp->endpoint = (struct ifd_usb_endpoint_descriptor *) malloc(ifp->bNumEndpoints * sizeof(struct ifd_usb_endpoint_descriptor)); if (!ifp->endpoint) { ct_debug("couldn't allocate memory for ifp->endpoint"); return -1; } memset(ifp->endpoint, 0, ifp->bNumEndpoints * sizeof(struct ifd_usb_endpoint_descriptor)); for (i = 0; i < ifp->bNumEndpoints; i++) { header = (struct ifd_usb_descriptor_header *)buffer; if (header->bLength > size) { ct_debug("ran out of descriptors parsing"); return -1; } retval = ifd_usb_parse_endpoint(ifp->endpoint + i, buffer, size); if (retval < 0) return retval; buffer += retval; parsed += retval; size -= retval; } /* We check to see if it's an alternate to this one */ ifp = (struct ifd_usb_interface_descriptor *)buffer; if (size < IFD_USB_DT_INTERFACE_SIZE || ifp->bDescriptorType != IFD_USB_DT_INTERFACE || !ifp->bAlternateSetting) return parsed; } return parsed; } static int ifd_usb_parse_configuration(struct ifd_usb_config_descriptor *config, unsigned char *buffer) { int i, retval, size; struct ifd_usb_descriptor_header *header; memcpy(config, buffer, IFD_USB_DT_CONFIG_SIZE); IFD_USB_LE16_TO_CPU(config->wTotalLength); size = config->wTotalLength; if (config->bNumInterfaces > IFD_USB_MAXINTERFACES) { ct_debug("too many interfaces"); return -1; } config->interface = (struct ifd_usb_interface *) malloc(config->bNumInterfaces * sizeof(struct ifd_usb_interface)); if (!config->interface) { ct_debug("out of memory"); return -1; } memset(config->interface, 0, config->bNumInterfaces * sizeof(struct ifd_usb_interface)); buffer += config->bLength; size -= config->bLength; config->extra = NULL; config->extralen = 0; for (i = 0; i < config->bNumInterfaces; i++) { int numskipped, len; unsigned char *begin; /* Skip over the rest of the Class Specific or Vendor */ /* Specific descriptors */ begin = buffer; numskipped = 0; while (size >= sizeof(struct ifd_usb_descriptor_header)) { header = (struct ifd_usb_descriptor_header *)buffer; if ((header->bLength > size) || (header->bLength < 2)) { ct_debug("invalid descriptor length of %d", header->bLength); return -1; } /* If we find another "proper" descriptor then we're done */ if ((header->bDescriptorType == IFD_USB_DT_ENDPOINT) || (header->bDescriptorType == IFD_USB_DT_INTERFACE) || (header->bDescriptorType == IFD_USB_DT_CONFIG) || (header->bDescriptorType == IFD_USB_DT_DEVICE)) break; ct_debug("skipping descriptor 0x%X", header->bDescriptorType); numskipped++; buffer += header->bLength; size -= header->bLength; } if (numskipped) ct_debug ("skipped %d class/vendor specific endpoint descriptors", numskipped); /* Copy any unknown descriptors into a storage area for */ /* drivers to later parse */ len = (int)(buffer - begin); if (len) { /* FIXME: We should realloc and append here */ if (!config->extralen) { config->extra = (unsigned char *)malloc(len); if (!config->extra) { ct_debug ("couldn't allocate memory for config extra descriptors"); config->extralen = 0; return -1; } memcpy(config->extra, begin, len); config->extralen = len; } } retval = ifd_usb_parse_interface(config->interface + i, buffer, size); if (retval < 0) return retval; buffer += retval; size -= retval; } return size; } int ifd_usb_get_device(ifd_device_t * dev, struct ifd_usb_device_descriptor *d) { unsigned char devd[18]; int r; /* 0x6 == USB_REQ_GET_DESCRIPTOR * 0x1 == USB_DT_DEVICE */ r = ifd_usb_control(dev, 0x80, 0x6, 0x100, 0, devd, 18, 10000); if (r <= 0) { ct_error("cannot get descriptors"); return 1; } memcpy(d, devd, sizeof(devd)); d->bcdUSB = devd[3] << 8 | devd[2]; d->idVendor = devd[9] << 8 | devd[8]; d->idProduct = devd[11] << 8 | devd[10]; d->bcdDevice = devd[13] << 8 | devd[12]; return 0; } int ifd_usb_get_config(ifd_device_t * dev, int n, struct ifd_usb_config_descriptor *ret) { unsigned char *b; unsigned short len; int r; memset(ret, 0, sizeof(struct ifd_usb_config_descriptor)); /* 0x6 == USB_REQ_GET_DESCRIPTOR * 0x2 == USB_DT_CONFIG */ r = ifd_usb_control(dev, 0x80, 0x6, 0x200 | n, 0, ret, 8, 1000); if (r <= 0) { ct_error("cannot get descriptors"); return 1; } IFD_USB_LE16_TO_CPU(ret->wTotalLength); len = ret->wTotalLength; b = (unsigned char *)malloc(len); if (!b) { ct_error("cannot malloc descriptor buffer"); return 1; } r = ifd_usb_control(dev, 0x80, 0x6, 0x200 | n, 0, b, len, 1000); if (r < len) { ct_error("cannot get descriptors"); free(b); return 1; } r = ifd_usb_parse_configuration(ret, b); free(b); if (r < 0) { return 1; } return 0; } void ifd_usb_free_configuration(struct ifd_usb_config_descriptor *cf) { int i, j, k; if (!cf->interface) return; for (i = 0; i < cf->bNumInterfaces; i++) { struct ifd_usb_interface *ifp = &cf->interface[i]; if (!ifp->altsetting) break; for (j = 0; j < ifp->num_altsetting; j++) { struct ifd_usb_interface_descriptor *as = &ifp->altsetting[j]; if (as->extra) { free(as->extra); as->extra = NULL; } if (!as->endpoint) break; for (k = 0; k < as->bNumEndpoints; k++) { if (as->endpoint[k].extra) { free(as->endpoint[k].extra); as->endpoint[k].extra = NULL; } } free(as->endpoint); as->endpoint = NULL; } free(ifp->altsetting); ifp->altsetting = NULL; } free(cf->interface); cf->interface = NULL; } openct-0.6.20/src/ifd/atr.h0000644000175000017500000000136710422076714012312 00000000000000/* * ATR type definitions * * Copyright (C) 2004, Olaf Kirch */ #ifndef OPENCT_ATR_H #define OPENCT_ATR_H #ifdef __cplusplus extern "C" { #endif typedef struct ifd_atr_info { /* The following contain -1 if the field wasn't present */ int TA[4]; int TB[4]; int TC[4]; unsigned int supported_protocols; int default_protocol; } ifd_atr_info_t; extern int ifd_atr_parse(ifd_atr_info_t *, const unsigned char *, size_t); extern int ifd_build_pts(const ifd_atr_info_t *, int, unsigned char *, size_t); extern int ifd_verify_pts(ifd_atr_info_t *, int, const unsigned char *, size_t); extern int ifd_pts_complete(const unsigned char *pts, size_t len); #ifdef __cplusplus } #endif #endif /* OPENCT_ATR_H */ openct-0.6.20/src/ifd/proto-sync.c0000644000175000017500000001265410625640312013631 00000000000000/* * Implementation of synchronous protocols * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include typedef struct { ifd_protocol_t base; } sync_state_t; /* * Detach protocol */ static void sync_release(ifd_protocol_t * prot) { /* NOP */ } /* * Read/write operations */ static int sync_read(ifd_protocol_t * prot, int slot, unsigned short addr, unsigned char *rbuf, size_t rlen) { ifd_reader_t *reader = prot->reader; const ifd_driver_t *drv; if (!(drv = reader->driver) || !drv->ops || !drv->ops->sync_read) return IFD_ERROR_NOT_SUPPORTED; return drv->ops->sync_read(reader, slot, prot->ops->id, addr, rbuf, rlen); } static int sync_write(ifd_protocol_t * prot, int slot, unsigned short addr, const unsigned char *sbuf, size_t slen) { ifd_reader_t *reader = prot->reader; const ifd_driver_t *drv; unsigned int retries = 1; int prot_id; if (!(drv = reader->driver) || !drv->ops || !drv->ops->sync_read) return IFD_ERROR_NOT_SUPPORTED; prot_id = prot->ops->id; if ((prot_id == IFD_PROTOCOL_I2C_SHORT || prot_id == IFD_PROTOCOL_I2C_LONG) && slen > 1) retries = 2; while (slen) { unsigned char temp[256]; size_t count; int r; /* All bytes must be within a 256 page. * Is this generic, or a Towitoko requirement? */ count = 256 - (addr & 255); if (count > slen) count = slen; ifd_debug(2, "writing %u@%04x", count, addr); r = drv->ops->sync_write(reader, slot, prot_id, addr, sbuf, count); if (r < 0) return r; /* Verify that data was written correctly */ ifd_debug(2, "verifying %u@%04x", count, addr); r = drv->ops->sync_read(reader, slot, prot_id, addr, temp, count); if (memcmp(sbuf, temp, count)) { ifd_debug(2, "failed to verify write"); if (retries--) continue; return -1; } addr += count; sbuf += count; slen -= count; } return 0; } /* * Probe for sync ICC type */ static ifd_protocol_t *ifd_sync_probe_icc(ifd_reader_t * reader, int slot, int proto) { ifd_protocol_t *p; unsigned char byte; int res = 0; if (ifd_deactivate(reader) < 0 || ifd_activate(reader) < 0) return NULL; if (!(p = ifd_protocol_new(proto, reader, slot))) return NULL; if (ifd_protocol_read_memory(p, slot, 0, &byte, 1) != 1) goto out; if (proto == IFD_PROTOCOL_2WIRE || proto == IFD_PROTOCOL_3WIRE) { if (byte != 0x00 && byte != 0x0FF) res = 1; } else { byte = ~byte; if (ifd_protocol_write_memory(p, slot, 0, &byte, 1) >= 0) { byte = ~byte; ifd_protocol_write_memory(p, slot, 0, &byte, 1); res = 1; } } out: if (!res) { ifd_protocol_free(p); p = NULL; } return p; } /* * Detect synchronous ICC */ int ifd_sync_detect_icc(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_protocol_t *p = NULL; int n; if ((p = ifd_sync_probe_icc(reader, slot, IFD_PROTOCOL_I2C_SHORT)) || (p = ifd_sync_probe_icc(reader, slot, IFD_PROTOCOL_I2C_LONG))) { /* I2C card. Empty ATR */ n = 0; } else if ((p = ifd_sync_probe_icc(reader, slot, IFD_PROTOCOL_2WIRE)) || (p = ifd_sync_probe_icc(reader, slot, IFD_PROTOCOL_3WIRE))) { /* Try to read the ATR */ if (ifd_deactivate(reader) < 0 || ifd_activate(reader) < 0) goto failed; n = ifd_protocol_read_memory(p, slot, 0, (unsigned char *)atr, size); if (n < 0) goto failed; } else { goto failed; } reader->slot[slot].proto = p; ifd_debug(1, "Detected synchronous card (%s), %satr%s", p->ops->name, n ? "" : "no ", ct_hexdump(atr, n)); return n; failed: if (p != NULL) ifd_protocol_free(p); return IFD_ERROR_NO_ATR; } /* * Protocol structs */ struct ifd_protocol_ops ifd_protocol_i2c_short = { IFD_PROTOCOL_I2C_SHORT, /* id */ "I2C short", /* name */ sizeof(sync_state_t), /* size */ NULL, /* init */ sync_release, /* release */ NULL, /* set_param */ NULL, /* get_param */ NULL, /* resynchronize */ NULL, /* transceive */ sync_read, /* sync_read */ sync_write, /* sync_write */ }; struct ifd_protocol_ops ifd_protocol_i2c_long = { IFD_PROTOCOL_I2C_LONG, /* id */ "I2C long", /* name */ sizeof(sync_state_t), /* size */ NULL, /* init */ sync_release, /* release */ NULL, /* set_param */ NULL, /* get_param */ NULL, /* resynchronize */ NULL, /* transceive */ sync_read, /* sync_read */ sync_write, /* sync_write */ }; struct ifd_protocol_ops ifd_protocol_2wire = { IFD_PROTOCOL_2WIRE, /* id */ "2Wire", /* name */ sizeof(sync_state_t), /* size */ NULL, /* init */ sync_release, /* release */ NULL, /* set_param */ NULL, /* get_param */ NULL, /* resynchronize */ NULL, /* transceive */ sync_read, /* sync_read */ sync_write, /* sync_write */ }; struct ifd_protocol_ops ifd_protocol_3wire = { IFD_PROTOCOL_3WIRE, /* id */ "3Wire", /* name */ sizeof(sync_state_t), /* size */ NULL, /* init */ sync_release, /* release */ NULL, /* set_param */ NULL, /* get_param */ NULL, /* resynchronize */ NULL, /* transceive */ sync_read, /* sync_read */ sync_write, /* sync_write */ }; struct ifd_protocol_ops ifd_protocol_eurochip = { IFD_PROTOCOL_EUROCHIP, /* id */ "Eurochip Countercard", /* name */ sizeof(sync_state_t), /* size */ NULL, /* init */ sync_release, /* release */ NULL, /* set_param */ NULL, /* get_param */ NULL, /* resynchronize */ NULL, /* transceive */ sync_read, /* sync_read */ sync_write, /* sync_write */ }; openct-0.6.20/src/ifd/ifd-ikey3k.c0000644000175000017500000001013310625650421013443 00000000000000/* * driver for Rainbow iKey 3000 devices * * Copyright (C) 2003, Andreas Jellinghaus * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include /* * Initialize the device */ static int ikey3k_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; reader->name = "Rainbow iKey 3000"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("ikey3k: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("ikey3k: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; return 0; } /* * Power up the reader */ static int ikey3k_activate(ifd_reader_t * reader) { return 0; } static int ikey3k_deactivate(ifd_reader_t * reader) { return -1; } /* * Card status - always present */ static int ikey3k_card_status(ifd_reader_t * reader, int slot, int *status) { *status = IFD_CARD_PRESENT; return 0; } /* * Reset - nothing to be done? * We should do something to make it come back with all state zapped */ static int ikey3k_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[256]; int rc, n, atrlen; unsigned char expect5[] = { 0x0a, 0x61, 0x00, 0x07, 0x2d, 0x2d, 0xc0, 0x80, 0x80, 0x60 }; unsigned char expect11[] = { 0xff, 0x11, 0x11, 0xff }; if (ifd_usb_control(dev, 0xc1, 0x00, 0, 0, buffer, 0x40, -1) != 10 || memcmp(buffer, expect5, sizeof(expect5)) != 0 || ifd_usb_control(dev, 0x41, 0x16, 0, 0, buffer, 00, -1) != 0 || ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 02, -1) != 1 || buffer[0] != 00) goto failed; rc = ifd_usb_control(dev, 0x41, 0x16, 0x2005, 0, buffer, 0, 1000); if (rc < 0) goto failed; rc = ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 0x20, 1000); if (rc <= 0) goto failed; n = buffer[0]; if (n + 1 > rc) goto failed; if (n > IFD_MAX_ATR_LEN) goto failed; if (n > size) n = size; atrlen = n; memcpy(atr, buffer + 1, atrlen); if (ifd_usb_control(dev, 0x41, 0x16, 0x0002, 0, buffer, 0, -1) != 0 || ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 04, -1) != 4 || memcmp(buffer, expect11, sizeof(expect11)) != 0) goto failed; return atrlen; failed: ct_error("ikey3k: failed to activate token"); return -1; } /* * Select a protocol. We override this function to be able to set the T=1 IFSC */ static int ikey3k_set_protocol(ifd_reader_t * reader, int nslot, int proto) { ifd_slot_t *slot = &reader->slot[nslot]; int r; if (!(slot->proto = ifd_protocol_new(proto, reader, slot->dad))) return -1; if (proto == IFD_PROTOCOL_T1) { r = ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSC, 256); if (r < 0) return r; } return 0; } /* * Send/receive routines */ static int ikey3k_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { int value, idx; value = buffer[1] << 8 | buffer[0]; idx = buffer[3] << 8 | buffer[2]; return ifd_usb_control(reader->device, 0x41, 0x17, value, idx, (void *)&buffer[4], len - 4, -1); } static int ikey3k_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { return ifd_usb_control(reader->device, 0xc1, 0x01, 0, 0, buffer, 255, timeout); } /* * Driver operations */ static struct ifd_driver_ops ikey3k_driver; /* * Initialize this module */ void ifd_ikey3k_register(void) { ikey3k_driver.open = ikey3k_open; ikey3k_driver.activate = ikey3k_activate; ikey3k_driver.deactivate = ikey3k_deactivate; ikey3k_driver.card_status = ikey3k_card_status; ikey3k_driver.card_reset = ikey3k_card_reset; ikey3k_driver.set_protocol = ikey3k_set_protocol; ikey3k_driver.send = ikey3k_send; ikey3k_driver.recv = ikey3k_recv; ifd_driver_register("ikey3k", &ikey3k_driver); } openct-0.6.20/src/ifd/manager.c0000644000175000017500000000312710625640312013121 00000000000000/* * IFD manager * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include static ifd_reader_t *ifd_readers[OPENCT_MAX_READERS]; static unsigned int ifd_reader_handle = 1; /* * Return number of readers available */ int ifd_reader_count(void) { return OPENCT_MAX_READERS; } /* * Register a reader */ int ifd_attach(ifd_reader_t * reader) { unsigned int slot; if (!reader) return -1; if (reader->num) return 0; for (slot = 0; slot < OPENCT_MAX_READERS; slot++) { if (!ifd_readers[slot]) break; } if (slot >= OPENCT_MAX_READERS) { ct_error("Too many readers"); return -1; } reader->handle = ifd_reader_handle++; reader->num = slot; ifd_readers[slot] = reader; return 0; } /* * Functions to look up registered readers */ ifd_reader_t *ifd_reader_by_handle(unsigned int handle) { ifd_reader_t *reader; unsigned int i; for (i = 0; i < OPENCT_MAX_READERS; i++) { if ((reader = ifd_readers[i]) && reader->handle == handle) return reader; } return NULL; } ifd_reader_t *ifd_reader_by_index(unsigned int idx) { ifd_reader_t *reader; if (idx >= OPENCT_MAX_READERS) { ct_error("ifd_reader_by_index: invalid index %u", idx); return NULL; } if (!(reader = ifd_readers[idx])) return NULL; return reader; } /* * Unregister a reader */ void ifd_detach(ifd_reader_t * reader) { unsigned int slot; if (reader->num == 0) return; if ((slot = reader->num) >= OPENCT_MAX_READERS || ifd_readers[slot] != reader) { ct_error("ifd_detach: unknown reader"); return; } ifd_readers[slot] = NULL; } openct-0.6.20/src/ifd/sys-sunray.c0000644000175000017500000002070211151454644013650 00000000000000/* * Sunray specific functions * * Copyright (C) 2005 William Wanders * * These functions need to be re-implemented for every * new platform. */ #include "internal.h" #if defined(sunray) #include #include #include #include #include #include #include #include #include #include #include #include #include #define USB_READ_INTERRUPT_TIMEOUT_WORKAROUND 1 #ifdef USB_READ_INTERRUPT_TIMEOUT_WORKAROUND #include #endif #include "usb-descriptors.h" struct usb_dev_handle *devices[128]; /* * Poll for presence of USB device */ int ifd_sysdep_usb_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { if (pfd->revents & POLLHUP) return 0; pfd->fd = dev->fd; pfd->events = POLLHUP; return 1; } int ifd_sysdep_usb_bulk(ifd_device_t * dev, int ep, void *buffer, size_t len, long timeout) { int bytes_to_process; int bytes_processed; int direction = (ep & IFD_USB_ENDPOINT_DIR_MASK) == IFD_USB_ENDPOINT_IN ? 1 : 0; ct_debug("ifd_sysdep_usb_bulk: endpoint=%d direction=%d", ep, direction); if (direction) { if ((bytes_to_process = usb_bulk_read(devices[dev->fd], ep, buffer, len, timeout)) < 0) { ifd_debug(6, "ifd_sysdep_usb_bulk: read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } ct_debug("ifd_sysdep_usb_bulk: read %d bytes", bytes_to_process); return bytes_to_process; } else { bytes_to_process = len; if ((bytes_processed = usb_bulk_write(devices[dev->fd], ep, buffer, bytes_to_process, timeout)) != bytes_to_process) { ifd_debug(6, "ifd_sysdep_usb_bulk: write failed: %s", strerror(errno)); ct_error("usb_bulk write failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } ct_debug("ifd_sysdep_usb_bulk: wrote buffer[%d]=%s", bytes_processed, ct_hexdump(buffer, len)); return bytes_processed; } } /* * USB URB capture */ struct ifd_usb_capture { int type; int endpoint; size_t maxpacket; unsigned int interface; }; int ifd_sysdep_usb_begin_capture(ifd_device_t * dev, int type, int ep, size_t maxpacket, ifd_usb_capture_t ** capret) { ifd_usb_capture_t *cap; if (!(cap = (ifd_usb_capture_t *) calloc(1, sizeof(*cap) + maxpacket))) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } cap->type = type; cap->endpoint = ep; cap->maxpacket = maxpacket; *capret = cap; return 0; } #ifdef USB_READ_INTERRUPT_TIMEOUT_WORKAROUND static jmp_buf env; void workaround_timeout(int sig) { ifd_debug(6, "SunRay: signal_handler: sig=%d", sig); switch (sig) { case SIGALRM: ifd_debug(6, "SunRay: workaround_timeout: sig=SIGALRM -> longjmp"); longjmp(env, sig); default: ifd_debug(6, "SunRay: workaround_timeout: exit(%d)", sig); exit(sig); } } #endif int ifd_sysdep_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len) { return IFD_ERROR_NOT_SUPPORTED; } int ifd_sysdep_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len, long timeout) { int bytes_to_process = 0; ifd_debug(6, "SunRay: ifd_sysdep_usb_capture: len=%d timeout=%d", len, timeout); #ifdef USB_READ_INTERRUPT_TIMEOUT_WORKAROUND signal(SIGALRM, workaround_timeout); if (setjmp(env) != 0) { ifd_debug(6, "ifd_sysdep_usb_capture: setjmp -> workaround_timeout"); return 0; } ualarm(timeout * 1000, 0); timeout = 0; #endif if ((bytes_to_process = usb_interrupt_read(devices[dev->fd], cap->endpoint, buffer, len, timeout)) < 0) { ualarm(0, 0); ifd_debug(6, "ifd_sysdep_usb_capture: usb_interrupt_read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } #ifdef USB_READ_INTERRUPT_TIMEOUT_WORKAROUND ualarm(0, 0); #endif ct_debug("ifd_sysdep_usb_capture: read buffer[%d]=%s", bytes_to_process, ct_hexdump(buffer, bytes_to_process)); return bytes_to_process; } int ifd_sysdep_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap) { if (cap) free(cap); return 0; } /* * Event fd */ int ifd_sysdep_usb_get_eventfd(ifd_device_t * dev, short *events) { return -1; } /* * USB control command */ int ifd_sysdep_usb_control(ifd_device_t * dev, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len, long timeout) { int rc, val; ct_debug("ifd_sysdep_usb_control: dev->fd=%d handle=0x%x", dev->fd, devices[dev->fd]); if ((rc = usb_control_msg(devices[dev->fd], requesttype, request, value, index, data, len, timeout)) < 0) { ifd_debug(1, "usb_control_msg failed: %d", rc); ct_error("usb_control_msg failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } ct_debug("ifd_sysdep_usb_control: return rc=%d", rc); return rc; } int ifd_sysdep_usb_set_configuration(ifd_device_t * dev, int config) { int rc; if ((rc = usb_set_configuration(devices[dev->fd], config)) < 0) { ifd_debug(1, "usb_set_configuration failed: %d", rc); ct_error("usb_set_configuration failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_set_interface(ifd_device_t * dev, int ifc, int alt) { int rc; if ((rc = usb_set_altinterface(devices[dev->fd], alt)) < 0) { ifd_debug(1, "usb_set_altinterface failed: %d", rc); ct_error("usb_set_interface failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_claim_interface(ifd_device_t * dev, int interface) { int rc; ct_debug("ifd_sysdep_usb_claim_interface: interface=%d", interface); if ((rc = usb_claim_interface(devices[dev->fd], interface)) < 0) { ifd_debug(1, "usb_clain_interface failed: %d", rc); ct_error("usb_release_interface failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_release_interface(ifd_device_t * dev, int interface) { int rc; ct_debug("ifd_sysdep_usb_release_interface: interface=%d", interface); if ((rc = usb_release_interface(devices[dev->fd], interface)) < 0) { ifd_debug(1, "usb_release_interface failed: %d", rc); ct_error("usb_release_interface failed: %s(%d)", strerror(errno), errno); return IFD_ERROR_COMM_ERROR; } return 0; } /* * Open usb device */ int ifd_sysdep_usb_open(const char *name) { struct usb_bus *bus; struct usb_device *dev; ct_debug("ifd_sysdep_usb_open: name=%s", name); ct_debug("ifd_sysdep_usb_open: usb_init()"); usb_init(); ct_debug("ifd_sysdep_usb_open: usb_find_busses()"); usb_find_busses(); ct_debug("ifd_sysdep_usb_open: usb_find_devices()"); usb_find_devices(); ct_debug("ifd_sysdep_usb_open: walk devices"); for (bus = usb_busses; bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { char device[PATH_MAX]; int i; snprintf(device, sizeof(device), "%s/usb/%s/%s", getenv("UTDEVROOT"), bus->dirname, dev->filename); ct_debug("ifd_sysdep_usb_open: check device=%s", device); if (strcmp(device, name) != 0) continue; ct_debug ("ifd_sysdep_usb_open: found match name=%s device=%s", name, device); for (i = 0; i < 128; i++) { if (devices[i] == NULL) { devices[i] = usb_open(dev); ct_debug ("ifd_sysdep_usb_open: usb_open index=%d handle=0x%x", i, devices[i]); return i; } } } } return ENOENT; } int ifd_sysdep_usb_reset(ifd_device_t * dev) { /* not implemented so far */ return -1; } /* * Scan all usb devices to see if there is one we support */ int ifd_scan_usb(void) { struct usb_bus *bus; struct usb_device *dev; ifd_devid_t id; usb_init(); usb_find_busses(); usb_find_devices(); id.type = IFD_DEVICE_TYPE_USB; id.num = 2; for (bus = usb_busses; bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { const char *driver; char typedev[PATH_MAX]; id.val[0] = dev->descriptor.idVendor; id.val[1] = dev->descriptor.idProduct; /* FIXME: if we don't find a driver with vendor/product * then check for the interface type (ccid) and use * driver ccid... */ if (!(driver = ifd_driver_for_id(&id))) continue; snprintf(typedev, sizeof(typedev), "usb:%s/usb/%s/%s", getenv("UTDEVROOT"), bus->dirname, dev->filename); ifd_spawn_handler(driver, typedev, -1); } } return 0; } #endif /* sunray */ openct-0.6.20/src/ifd/ifd-rutoken.c0000644000175000017500000004544311336456617013762 00000000000000/* * driver for Rutoken devices * * Copyright (C) 2007, Pavel Mironchik * Copyright (C) 2007, Eugene Hermann */ #include "internal.h" #include #include #include #define MAX_BUF_T0_LEN 256 #define T0_HDR_LEN 5 #define USB_ICC_POWER_ON 0x62 #define USB_ICC_POWER_OFF 0x63 #define USB_ICC_XFR_BLOCK 0x65 #define USB_ICC_DATA_BLOCK 0x6F #define USB_ICC_GET_STATUS 0xA0 #define ICC_STATUS_IDLE 0x00 #define ICC_STATUS_READY_DATA 0x10 #define ICC_STATUS_READY_SW 0x20 #define ICC_STATUS_BUSY_COMMON 0x40 #define ICC_STATUS_MUTE 0x80 #define OUR_ATR_LEN 19 static int rutoken_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; ifd_debug(6, "rutoken_open - %s", device_name); reader->name = "Rutoken S driver"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("Rutoken: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("Rutoken: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; dev->timeout = 1000; ifd_debug(6, "rutoken_open - %s - successful", device_name); return 0; } static int rutoken_activate(ifd_reader_t * reader) { ifd_debug(6, "called."); return 0; } static int rutoken_deactivate(ifd_reader_t * reader) { ifd_debug(6, "called."); return -1; } static int rutoken_getstatus(ifd_reader_t * reader, unsigned char *status) { if(ifd_usb_control(reader->device, 0xc1, USB_ICC_GET_STATUS, 0, 0, status, 1, 1000) < 0 ) return -1; if((*status & 0xF0) == ICC_STATUS_BUSY_COMMON){ unsigned char prev_status; int i; for(i = 0; i < 200; i++) { // 2 s (200 * 10 ms) do { usleep(10000); // 10 ms prev_status = *status; if(ifd_usb_control(reader->device, 0xc1, USB_ICC_GET_STATUS, 0, 0, status, 1, 1000) < 0 ) return -1; if((*status & 0xF0) != ICC_STATUS_BUSY_COMMON) return *status; } while((((prev_status & 0x0F) + 1) & 0x0F) == (*status & 0x0F)); } return -1; } return *status; } static int rutoken_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t atr_len) { int nLen = 0, i; ifd_debug(6, "rutoken_card_reset, slot = %X", slot); if(ifd_usb_control(reader->device, 0x41, USB_ICC_POWER_OFF, 0, 0, 0, 0, -1) < 0) { ifd_debug(6, "error poweroff"); return -1; } unsigned char status; if( rutoken_getstatus(reader, &status) < 0) { ifd_debug(6, "error get status"); return -1; } if( status == ICC_STATUS_READY_DATA ) { char buf[OUR_ATR_LEN]; memset(buf, 0, OUR_ATR_LEN); nLen = ifd_usb_control(reader->device, 0xc1, USB_ICC_POWER_ON, 0, 0, buf, OUR_ATR_LEN, 1000); if( nLen < 0 ) { ifd_debug(6, "error poewron"); return -1; } ifd_debug(6, "returned len = %d", nLen); for(i = 0; i < OUR_ATR_LEN; i++) ifd_debug(6, "%c", buf[i]); memcpy(atr, buf, nLen); return nLen; } ifd_debug(6, "error bad status"); return -1; } static int rutoken_restart(ifd_reader_t * reader) { char atr[256]; return rutoken_card_reset(reader, 0, atr, 256); } /* * Select a protocol. */ static int rutoken_set_protocol(ifd_reader_t * reader, int nslot, int proto) { ifd_slot_t *slot; ifd_protocol_t *p; ifd_debug(6, "proto=%d", proto); if (proto != IFD_PROTOCOL_T0 && proto != IFD_PROTOCOL_TRANSPARENT) { ct_error("%s: protocol %d not supported", reader->name, proto); return IFD_ERROR_NOT_SUPPORTED; } slot = &reader->slot[nslot]; p = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, reader, slot->dad); if (p == NULL) { ct_error("%s: internal error", reader->name); return IFD_ERROR_GENERIC; } if (slot->proto) { ifd_protocol_free(slot->proto); slot->proto = NULL; } slot->proto = p; ifd_debug(6, "success"); return 0; } static int rutoken_card_status(ifd_reader_t * reader, int slot, int *status) { *status = IFD_CARD_PRESENT; return 0; } static int rutoken_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { int ret; unsigned char status; ifd_debug(3, "usb send %s len %d", ct_hexdump(buffer, len), len); ret = ifd_usb_control(reader->device, 0x41, USB_ICC_XFR_BLOCK, 0, 0, (void *)buffer, len, -1); if (rutoken_getstatus(reader, &status) < 0) { ret = -1; ifd_debug(6, "error get status"); } return ret; } static int rutoken_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { unsigned char status; int ret = len; // USB_ICC_DATA_BLOCK if( (ret = ifd_usb_control(reader->device, 0xc1, USB_ICC_DATA_BLOCK, 0, 0, buffer, len, timeout)) >= 0) if (rutoken_getstatus(reader, &status) < 0) { ret = -1; ifd_debug(6, "error get status, %0x", status); } ifd_debug(3, "usd recv %s len %d", ct_hexdump(buffer, ret), ret); return ret; } static int rutoken_recv_sw(ifd_reader_t * reader, int dad, unsigned char *sw) { unsigned char status; if(rutoken_getstatus(reader, &status) == ICC_STATUS_MUTE) { //If device not responsive ifd_debug(6, "status = ICC_STATUS_MUTE"); return(rutoken_restart(reader)); } if(status == ICC_STATUS_READY_SW) { ifd_debug(6, "status = ICC_STATUS_READY_SW;"); if(rutoken_recv(reader, 0, sw, 2, 10000) < 0) return -5; ifd_debug(6, "Get SW %x %x", sw[0], sw[1]); return 2; } return -1; } // return how mach byte send // sbuf - APDU bufer // slen static int rutoken_send_tpducomand(ifd_reader_t * reader, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen, int iscase4) { ifd_debug(6, "send tpdu command %s, len: %d", ct_hexdump(sbuf, slen), slen); int rrecv = 0; unsigned char status; unsigned char sw[2]; ifd_iso_apdu_t iso; if ( ifd_iso_apdu_parse(sbuf, slen, &iso) < 0) return -1; unsigned char hdr[T0_HDR_LEN]={iso.cla, iso.ins, iso.p1, iso.p2, 0}; switch(iso.cse){ case IFD_APDU_CASE_1: // {cla, ins, p1, p2, 0}; ifd_debug(6, "case 1"); break; case IFD_APDU_CASE_2S: // {cla, ins, p1, p2, le}; // Rutoken Bug!!! ifd_debug(6, "case 2"); /* select file */ if (iso.cla == 0 && iso.ins == 0xa4) iso.le = 0x20; /* get_do_info */ else if (iso.cla == 0x80 && iso.ins == 0x30) iso.le = 0xff; hdr[4] = iso.le; break; case IFD_APDU_CASE_3S: // {cla, ins, p1, p2, lc}; ifd_debug(6, "case 3"); hdr[4] = iso.lc; break; default: break; } //send TPDU header if (rutoken_send(reader, 0, hdr, T0_HDR_LEN) < 0) return -1; // send TPDU data or get answere and sw switch(iso.cse){ case IFD_APDU_CASE_1: // get sw if (rutoken_recv_sw(reader, 0, sw) < 0) return -2; break; case IFD_APDU_CASE_2S: // get answere ifd_debug(6, "Get Data %d", iso.le); if(rutoken_getstatus(reader, &status) == ICC_STATUS_READY_DATA) { rrecv = rutoken_recv(reader, 0, rbuf, iso.le, 10000); if (rrecv < 0) return -2; ifd_debug(6, "Get TPDU Anser %s", ct_hexdump(rbuf, iso.le)); } if (rutoken_recv_sw(reader, 0, sw) < 0) return -2; if ( sw[0] == 0x67) { // Le definitely not accepted break; } if ( (sw[0] == 0x6c) ) { unsigned char sbuftmp[slen]; memcpy(sbuftmp, sbuf, slen); sbuftmp[4] = sw[1]; return rutoken_send_tpducomand(reader, dad, sbuftmp, slen, rbuf, rlen, 0); } break; case IFD_APDU_CASE_3S: // send data ifd_debug(6, "Send Data %d", iso.lc); if(rutoken_getstatus(reader, &status) == ICC_STATUS_READY_DATA) { ifd_debug(6, "Send TPDU Data %s", ct_hexdump(iso.data, iso.lc)); if (rutoken_send(reader, 0, iso.data, iso.lc) < 0) return -4; } else return -3; // get sw if (rutoken_recv_sw(reader, 0, sw) < 0) return -2; // NOT STANDART TPDU!!! BEGIN if ( sw[0]== 0x61){ unsigned char lx = sw[1]; hdr[0] = 0x00; // iso.cla; (ruTokens specific) hdr[1] = 0xc0; // ins get response hdr[2] = 0; // p1 hdr[3] = 0; // p2 hdr[4] = lx ; //lx (case 2) if(iscase4) return rutoken_send_tpducomand(reader, dad, hdr, T0_HDR_LEN, rbuf, rlen, 0); else { int recvtmp = rutoken_send_tpducomand(reader,dad, hdr, T0_HDR_LEN, rbuf, rlen, 0); rrecv = 0; memcpy(sw, (unsigned char*)rbuf+recvtmp-2, 2); break; } } if ( (sw[0] == 0x90) && (sw[1] == 0x00)) { hdr[0] = 0x00; //iso.cla; hdr[1] = 0xc0; // ins get response hdr[2] = 0; // p1 hdr[3] = 0; // p2 hdr[4] = iso.le; // le (case 2) if(iscase4) return rutoken_send_tpducomand(reader, dad, hdr, T0_HDR_LEN, rbuf, rlen, 0); } // NOT STANDART TPDU!!! END break; default: break; } // Add SW to respond memcpy(((char *)rbuf)+rrecv, sw, 2); rrecv+=2; ifd_debug(6, "Recv %d bytes", rrecv); return rrecv; } static void swap_pair(unsigned char *buf, size_t len) { size_t i; unsigned char tmp; for (i = 0; i + 1 < len; i += 2) { tmp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = tmp; } } static void swap_four(unsigned char *buf, size_t len) { size_t i; unsigned char tmp; for (i = 0; i + 3 < len; i += 4) { tmp = buf[i]; buf[i] = buf[i + 3]; buf[i + 3] = tmp; swap_pair(&buf[i + 1], 2); } } static int read_tag(unsigned char *buf, size_t buf_len, unsigned char tag_in, unsigned char *out, size_t out_len) { unsigned char tag; size_t taglen, i = 0; while (i + 2 <= buf_len) { tag = buf[i]; taglen = buf[i + 1]; i += 2; if (taglen + i > buf_len) return -1; if (tag == tag_in) { if (taglen != out_len) return -1; memcpy(out, buf + i, out_len); return 0; } i += taglen; } return -1; } static int convert_doinfo_to_rtprot(void *data, size_t data_len) { unsigned char dohdr[32] = { 0 }; unsigned char secattr[40], data_a5[0xff]; unsigned char *p = data; size_t i, data_a5_len; if (read_tag(p, data_len, 0x80, &dohdr[0], 2) == 0) { swap_pair(&dohdr[0], 2); ifd_debug(6, "tag 0x80 (file size) = %02x %02x", dohdr[0], dohdr[1]); } data_a5_len = dohdr[1] & 0xff; if (read_tag(p, data_len, 0xA5, data_a5, data_a5_len) == 0) ifd_debug(6, "tag 0xA5 = %s", ct_hexdump(data_a5, data_a5_len)); else data_a5_len = 0; if (data_len < sizeof(dohdr) + data_a5_len) { ifd_debug(6, "data_len = %u", data_len); return -1; } if (read_tag(p, data_len, 0x83, &dohdr[2], 2) == 0) ifd_debug(6, "tag 0x83 (Type,ID) = %02x %02x", dohdr[2], dohdr[3]); if (read_tag(p, data_len, 0x85, &dohdr[4], 3) == 0) ifd_debug(6, "tag 0x85 (Opt,Flags,MaxTry) = %02x %02x %02x", dohdr[4], dohdr[5], dohdr[6]); if (read_tag(p, data_len, 0x86, secattr, sizeof(secattr)) == 0) { i = 17; memcpy(dohdr + i, secattr, 8); for (i += 8, p = &secattr[8]; i < sizeof(dohdr); ++i, p += 4) dohdr[i] = *p; ifd_debug(6, "tag 0x86 = %s", ct_hexdump(&dohdr[17], 15)); } memcpy(data, dohdr, sizeof(dohdr)); memcpy((unsigned char*)data + sizeof(dohdr), data_a5, data_a5_len); return sizeof(dohdr) + data_a5_len; } static int convert_fcp_to_rtprot(void *data, size_t data_len) { unsigned char rtprot[32] = { 0 }; unsigned char secattr[40]; unsigned char *p = data; size_t i; if (data_len < sizeof(rtprot)) { ifd_debug(6, "data_len = %u", data_len); return -1; } /* 0x62 - FCP */ if (p[0] != 0x62 || (size_t)p[1] + 2 > data_len) { ifd_debug(6, "Tag = %02x len = %u", p[0], p[1]); return -1; } p += 2; data_len -= 2; /* file type */ if (read_tag(p, data_len, 0x82, &rtprot[4], 2) != 0) return -1; ifd_debug(6, "tag 0x82 (file type) = %02x %02x", rtprot[4], rtprot[5]); /* file id */ if (read_tag(p, data_len, 0x83, &rtprot[6], 2) != 0) return -1; swap_pair(&rtprot[6], 2); ifd_debug(6, "tag 0x83 (file id) = %02x %02x", rtprot[6], rtprot[7]); /* file size */ if (read_tag(p, data_len, 0x81, &rtprot[0], 2) == 0) { swap_pair(&rtprot[0], 2); ifd_debug(6, "tag 0x81 (complete file size) = %02x %02x", rtprot[0], rtprot[1]); } if (read_tag(p, data_len, 0x80, &rtprot[2], 2) == 0) { swap_pair(&rtprot[2], 2); ifd_debug(6, "tag 0x80 (file size) = %02x %02x", rtprot[2], rtprot[3]); } if (read_tag(p, data_len, 0x86, secattr, sizeof(secattr)) == 0) { i = 17; memcpy(rtprot + i, secattr, 8); for (i += 8, p = &secattr[8]; i < sizeof(rtprot); ++i, p += 4) rtprot[i] = *p; ifd_debug(6, "tag 0x86 = %s", ct_hexdump(&rtprot[17], 15)); } memcpy(data, rtprot, sizeof(rtprot)); return sizeof(rtprot); } static int convert_rtprot_to_doinfo(void *data, size_t data_len) { unsigned char doinfo[0xff] = { 0 }; unsigned char *pdata = data; size_t i, doinfo_len = 0; if (data_len < 32) { ifd_debug(6, "data_len = %u", data_len); return -1; } if (pdata[0] != 0 && pdata[0] < sizeof(doinfo) - 4 - 4 - 5 - 42 - 2) { /* Tag 0x80 */ doinfo[doinfo_len++] = 0x80; doinfo[doinfo_len++] = 2; memcpy(doinfo + doinfo_len, pdata, 2); swap_pair(doinfo + doinfo_len, 2); doinfo_len += 2; } /* Tag 0x83 */ doinfo[doinfo_len++] = 0x83; doinfo[doinfo_len++] = 2; doinfo[doinfo_len++] = pdata[2]; doinfo[doinfo_len++] = pdata[3]; /* Tag 0x85 */ doinfo[doinfo_len++] = 0x85; doinfo[doinfo_len++] = 3; doinfo[doinfo_len++] = pdata[4]; doinfo[doinfo_len++] = pdata[5]; doinfo[doinfo_len++] = pdata[6]; /* Tag 0x86 */ doinfo[doinfo_len++] = 0x86; doinfo[doinfo_len++] = 40; memcpy(doinfo + doinfo_len, pdata + 17, 8); doinfo_len += 8; for (i = 0; i < 7 && doinfo_len + 3 < sizeof(doinfo); ++i, doinfo_len += 4) doinfo[doinfo_len] = pdata[17 + 8 + i]; doinfo_len += 4; /* for reserved */ if (pdata[0] != 0 && pdata[0] + doinfo_len + 2 < sizeof(doinfo)) { /* Tag 0xA5 */ if (data_len - 32 < pdata[0]) { ifd_debug(6, "for tag 0xA5 incorrect data_len = %u", data_len); return -1; } doinfo[doinfo_len++] = 0xA5; doinfo[doinfo_len++] = pdata[0]; memcpy(doinfo + doinfo_len, pdata + 32, pdata[0]); doinfo_len += pdata[0]; } ifd_debug(6, "doinfo = %s", ct_hexdump(doinfo, doinfo_len)); memcpy(data, doinfo, doinfo_len); return doinfo_len; } static int convert_rtprot_to_fcp(void *data, size_t data_len) { unsigned char fcp[63] = { 0x62, sizeof(fcp) - 2, 0x81, 2, 0, 0, 0x80, 2, 0, 0, 0x82, 2, 0, 0, 0x83, 2, 0, 0, 0x8A, 1, 0, 0x86, 40 }; unsigned char *p = data; size_t i; if (data_len < sizeof(fcp)) { ifd_debug(6, "data_len = %u", data_len); return -1; } /* Tag 0x81 */ memcpy(fcp + 4, p, 2); swap_pair(fcp + 4, 2); /* Tag 0x80 */ memcpy(fcp + 8, p + 2, 2); swap_pair(fcp + 8, 2); /* Tag 0x82 */ memcpy(fcp + 12, p + 4, 2); /* Tag 0x83 */ memcpy(fcp + 16, p + 6, 2); swap_pair(fcp + 16, 2); /* Tag 0x8A */ fcp[20] = p[8]; /* Tag 0x86 */ memcpy(fcp + 23, p + 17, 8); for (i = 0; i < 7 && sizeof(fcp) > 23 + 8 + i * 4; ++i) fcp[23 + 8 + i * 4] = p[17 + 8 + i]; ifd_debug(6, "fcp = %s", ct_hexdump(fcp, sizeof(fcp))); memcpy(data, fcp, sizeof(fcp)); return sizeof(fcp); } static int rutoken_transparent( ifd_reader_t * reader, int dad, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { unsigned char sw[2], *send_buf_trn = NULL; const void *send_buf = sbuf; int len, rrecv = -1, iscase4 = 0; ifd_iso_apdu_t iso; ifd_debug(6, "buffer %s rlen = %d", ct_hexdump(sbuf, slen), rlen); if ( ifd_iso_apdu_parse(sbuf, slen, &iso) < 0) return -1; ifd_debug(6, "iso.le = %d", iso.le); if (iso.cla == 0 && slen > 5) { send_buf_trn = malloc(slen); if (!send_buf_trn) { ifd_debug(5, "out of memory (slen = %u)", slen); return IFD_ERROR_NO_MEMORY; } memcpy(send_buf_trn, sbuf, slen); /* select file, delete file */ if (iso.ins == 0xa4 || iso.ins == 0xe4) swap_pair(send_buf_trn + 5, slen - 5); /* create file */ else if (iso.ins == 0xe0) { len = convert_fcp_to_rtprot(send_buf_trn + 5, slen - 5); ifd_debug(6, "convert_fcp_to_rtprot = %i", len); if (len > 0) { slen = len + 5; send_buf_trn[4] = len; /* replace le */ } } /* create_do, key_gen */ else if (iso.ins == 0xda && iso.p1 == 1 && (iso.p2 == 0x65 || iso.p2 == 0x62)) { len = convert_doinfo_to_rtprot(send_buf_trn + 5, slen - 5); ifd_debug(6, "convert_doinfo_to_rtprot = %i", len); if (len > 0) { slen = len + 5; send_buf_trn[4] = len; /* replace le */ } } ifd_debug(6, "le = %u", send_buf_trn[4]); send_buf = send_buf_trn; } switch(iso.cse){ case IFD_APDU_CASE_2S: case IFD_APDU_CASE_3S: if (iso.cla == 0 && iso.ins == 0xa4) iscase4 = 1; /* FIXME: */ case IFD_APDU_CASE_1: rrecv = rutoken_send_tpducomand(reader, dad, send_buf, slen, rbuf, rlen, iscase4); break; case IFD_APDU_CASE_4S: // make send case 4 command rrecv = rutoken_send_tpducomand(reader, dad, send_buf, slen-1, rbuf, rlen, 1); break; default: break; } if (send_buf_trn) free(send_buf_trn); if (rrecv > 0 && (size_t)rrecv >= sizeof(sw)) { memcpy(sw, (unsigned char*)rbuf + rrecv - sizeof(sw), sizeof(sw)); if (sw[0] != 0x90 || sw[1] != 0) /* do nothing */; /* select file */ else if (iso.cla == 0 && iso.ins == 0xa4 && rrecv == sizeof(sw) + 32 /* size rtprot */) { len = convert_rtprot_to_fcp(rbuf, rlen); ifd_debug(6, "convert_rtprot_to_fcp = %i", len); if (len > 0) { rrecv = -1; if (rlen >= len + sizeof(sw)) { memcpy((unsigned char*)rbuf+len, sw, sizeof(sw)); rrecv = len + sizeof(sw); } } } /* get_do_info */ else if (iso.cla == 0x80 && iso.ins == 0x30 && (size_t)rrecv >= sizeof(sw) + 32 /* size rtprot */) { len = convert_rtprot_to_doinfo(rbuf, rlen); ifd_debug(6, "convert_rtprot_to_doinfo = %i", len); if (len > 0) { rrecv = -1; if (rlen >= len + sizeof(sw)) { memcpy((unsigned char*)rbuf+len, sw, sizeof(sw)); rrecv = len + sizeof(sw); } } } else if (iso.cla == 0 && iso.ins == 0xca && iso.p1 == 1) { /* get_serial, get_free_mem */ if (iso.p2 == 0x81 || iso.p2 == 0x8a) swap_four(rbuf, rrecv - sizeof(sw)); /* get_current_ef */ else if (iso.p2 == 0x11) swap_pair(rbuf, rrecv - sizeof(sw)); } } return rrecv; } static int rutoken_get_eventfd(ifd_reader_t * reader, short *events) { ifd_debug(6, "called."); return ifd_device_get_eventfd(reader->device, events); } static int rutoken_event(ifd_reader_t * reader, int *status, size_t status_size) { (void)reader; (void)status; (void)status_size; ifd_debug(6, "called."); return 0; } static int rutoken_error(ifd_reader_t * reader) { (void)reader; ifd_debug(6, "called."); return IFD_ERROR_DEVICE_DISCONNECTED; } static struct ifd_driver_ops rutoken_driver; void ifd_rutoken_register(void) { rutoken_driver.open = rutoken_open; rutoken_driver.activate = rutoken_activate; rutoken_driver.deactivate = rutoken_deactivate; rutoken_driver.card_reset = rutoken_card_reset; rutoken_driver.card_status = rutoken_card_status; rutoken_driver.set_protocol = rutoken_set_protocol; rutoken_driver.transparent = rutoken_transparent; rutoken_driver.get_eventfd = rutoken_get_eventfd; rutoken_driver.event = rutoken_event; rutoken_driver.error = rutoken_error; ifd_driver_register("rutoken", &rutoken_driver); } openct-0.6.20/src/ifd/ifd-starkey.c0000644000175000017500000000536410625650421013740 00000000000000/* * starkey driver * * Copyright (C) 2005, Andreas Jellinghaus */ #include "internal.h" #include #include #define STARKEY_TIMEOUT 100000 /* * Initialize the device */ static int starkey_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; reader->name = "G&D Starkey 100"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("starkey: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("starkey: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; return 0; } /* * Power up the reader */ static int starkey_activate(ifd_reader_t * reader) { return 0; } static int starkey_deactivate(ifd_reader_t * reader) { return -1; } /* * Card status - always present */ static int starkey_card_status(ifd_reader_t * reader, int slot, int *status) { *status = IFD_CARD_PRESENT; return 0; } /* * Reset - nothing to be done? * We should do something to make it come back with all state zapped */ static int starkey_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[32]; int rc, atrlen; ifd_usb_capture_t *cap; rc = ifd_usb_begin_capture(dev, IFD_USB_URB_TYPE_INTERRUPT, 0x81, sizeof(buffer), &cap); if (rc < 0) return rc; rc = ifd_usb_capture(dev, cap, buffer, sizeof(buffer), STARKEY_TIMEOUT); if (rc <= 0) { ct_error("starkey: failed to activate token"); return -1; } memcpy(atr, buffer, rc); atrlen = rc; return atrlen; } /* * Send/receive routines */ static int starkey_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { return ifd_usb_control(reader->device, 0x40, 0x06, 0, 0, (void *)buffer, len, -1); } static int starkey_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { return ifd_usb_control(reader->device, 0xc0, 0x86, 0, 0, buffer, len, timeout); } /* * Driver operations */ static struct ifd_driver_ops starkey_driver; /* * Initialize this module */ void ifd_starkey_register(void) { starkey_driver.open = starkey_open; starkey_driver.activate = starkey_activate; starkey_driver.deactivate = starkey_deactivate; starkey_driver.card_status = starkey_card_status; starkey_driver.card_reset = starkey_card_reset; starkey_driver.send = starkey_send; starkey_driver.recv = starkey_recv; ifd_driver_register("starkey", &starkey_driver); } openct-0.6.20/src/ifd/checksum.c0000644000175000017500000000570510422076714013321 00000000000000/* * Checksum handling * * Copyright Matthias Bruestle 1999-2002 * For licensing, see the file LICENCE */ #include "internal.h" #define min( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) ) /* ISO STD 3309 */ /* From: medin@catbyte.b30.ingr.com (Dave Medin) * Subject: CCITT checksums * Newsgroups: sci.electronics * Date: Mon, 7 Dec 1992 17:33:39 GMT */ /* Correct Table? */ static unsigned short crctab[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; /* * Returns LRC of data. */ unsigned int csum_lrc_compute(const uint8_t * in, size_t len, unsigned char *rc) { unsigned char lrc = 0; while (len--) lrc ^= *in++; if (rc) *rc = lrc; return 1; } /* * Compute CRC of data. */ unsigned int csum_crc_compute(const uint8_t * data, size_t len, unsigned char *rc) { unsigned short v = 0xFFFF; while (len--) { v = ((v >> 8) & 0xFF) ^ crctab[(v ^ *data++) & 0xFF]; } if (rc) { rc[0] = (v >> 8) & 0xFF; rc[1] = v & 0xFF; } return 2; } openct-0.6.20/src/ifd/ria.h0000644000175000017500000000304010422076714012265 00000000000000/* * Access to remote IFD handlers * * Copyright (C) 2003, Olaf Kirch */ #ifndef IFD_REMOTE_H #define IFD_REMOTE_H typedef struct ria_client { /* Socket for communication with ifdproxy */ ct_socket_t *sock; uint32_t xid; /* queue for buffering data */ ct_buf_t data; /* application data */ void *user_data; } ria_client_t; #define RIA_NAME_MAX 32 typedef struct ria_device { char address[RIA_NAME_MAX]; char type[RIA_NAME_MAX / 2]; char handle[RIA_NAME_MAX]; char name[RIA_NAME_MAX]; } ria_device_t; typedef struct ria_serial_conf { uint32_t speed; uint8_t bits; uint8_t stopbits; uint8_t parity; uint8_t check_parity; uint8_t dtr; uint8_t rts; } ria_serial_conf_t; enum { /* These are for the manager only */ RIA_MGR_LIST = 0x00, RIA_MGR_INFO, RIA_MGR_CLAIM, RIA_MGR_REGISTER, __RIA_PEER_CMD_BASE = 0x10, RIA_RESET_DEVICE = 0x10, RIA_FLUSH_DEVICE, RIA_SEND_BREAK, RIA_SERIAL_GET_CONFIG, RIA_SERIAL_SET_CONFIG, RIA_DATA = 0x80 }; extern ria_client_t *ria_connect(const char *); extern void ria_free(ria_client_t *); extern int ria_send(ria_client_t *, unsigned char, const void *, size_t); extern int ria_command(ria_client_t *, unsigned char, const void *, size_t, void *, size_t, long timeout); extern int ria_svc_listen(const char *, int); extern ria_client_t *ria_export_device(const char *, const char *); extern int ria_register_device(ria_client_t *, const char *); extern void ria_print_packet(ct_socket_t *, int, const char *, header_t *, ct_buf_t *); #endif /* IFD_REMOTE_H */ openct-0.6.20/src/ifd/ifd-gempc.c0000644000175000017500000004562510625650421013355 00000000000000/* * Reader Drivers for GemPC devices. * Work in progress, entirely untested. * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include #define GPC_ISO_INPUT_MAX 248 #define GPC_ISO_EXCHANGE_MAX 254 #define GPC_MODE_ROS 0x08 #define GPC_MODE_TLP 0x01 typedef struct gpc_status { /* We need a GBP driver to talk to serial readers */ ifd_protocol_t *p; int icc_proto; int card_state; unsigned char cmd_buf[260]; size_t cmd_len; } gpc_status_t; static int gpc_transceive(ifd_reader_t *, unsigned int, const unsigned char *, size_t, unsigned char *, size_t, long); static int gpc_transceive_t0(ifd_reader_t *, unsigned int, const unsigned char *, size_t, unsigned char *, size_t); static int gpc_transceive_t1(ifd_reader_t *, unsigned int, const unsigned char *, size_t, unsigned char *, size_t); static int gpc_iso_output(ifd_reader_t *, const unsigned char *, size_t, unsigned char *, size_t); static int gpc_iso_input(ifd_reader_t *, const unsigned char *, size_t, unsigned char *, size_t); static int gpc_iso_exchange_apdu(ifd_reader_t *, const unsigned char *, size_t, unsigned char *, size_t); static int gpc_set_serial(ifd_reader_t *, unsigned int, int, int); static int gpc_set_mode(ifd_reader_t *, int); static int gpc_get_os_version(ifd_reader_t *, char *, size_t); static int gpc_command(ifd_reader_t *, const void *, size_t, void *, size_t); static int __gpc_command(ifd_reader_t *, const void *, size_t, void *, size_t, int *); static const char *gpc_strerror(int status); /* * Initialize the reader */ static int gpc_open(ifd_reader_t * reader, const char *device_name) { char buffer[256]; gpc_status_t *st; ifd_device_t *dev; int r; ifd_debug(1, "called, device=%s", device_name); reader->name = "Gemplus Reader (pre-alpha, untested)"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return IFD_ERROR_GENERIC; reader->device = dev; st = (gpc_status_t *) calloc(1, sizeof(*st)); if (!st) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } reader->driver_data = st; if (dev->type == IFD_DEVICE_TYPE_SERIAL) { ifd_device_params_t params; if (ifd_device_get_parameters(dev, ¶ms) < 0) return IFD_ERROR_GENERIC; params.serial.speed = 9600; params.serial.bits = 8; params.serial.stopbits = 1; params.serial.parity = IFD_SERIAL_PARITY_NONE; if ((r = ifd_device_set_parameters(dev, ¶ms)) < 0) return r; /* Instantiate a GBP driver for this reader */ if (!(st->p = ifd_protocol_new(IFD_PROTOCOL_GBP, reader, 0))) { /* Something is badly hosed */ ct_error("unable to get GBP protocol handler"); return IFD_ERROR_GENERIC; } /* Tell the reader to switch to 38400 bps * If the reader is already at 38400 bps, this * command will fail, because we're currently * driving the serial line at 9600. So don't even * bother with checking the return value. * Instead, pause for a moment. */ gpc_set_serial(reader, 38400, 8, IFD_SERIAL_PARITY_NONE); usleep(500000); ifd_device_flush(dev); params.serial.speed = 38400; if ((r = ifd_device_set_parameters(dev, ¶ms)) < 0) return r; /* The line should now operate at 38400 */ r = gpc_set_mode(reader, GPC_MODE_ROS); if (r < 0 && r != IFD_ERROR_NOT_SUPPORTED) return r; } else { ct_error("USB devices not yet supported for GemPC readers\n"); return -1; /* sleep(1); ifd_device_flush(dev); */ } r = gpc_get_os_version(reader, buffer, sizeof(buffer)); if (r >= 0) { if (!strcmp(buffer, "OROS-R2.24RM")) reader->name = "GCR 400"; else if (!strcmp(buffer, "OROS-R2.99-R1.10")) reader->name = "GCR 410"; else if (!strcmp(buffer, "OROS-R2.99-R1.11")) reader->name = "GCR 410P"; else if (!strcmp(buffer, "OROS-R2.99-R1.21") || !strcmp(buffer, "GemCore-R1.21-GM")) reader->name = "GemPC 410"; else if (!strcmp(buffer, "OROS-R2.99-R1.32")) reader->name = "GemPC 413"; ifd_debug(1, "OS version \"%s\", reader identified as \"%s\"\n", buffer, reader->name); } return 0; } /* * Activate the reader */ static int gpc_activate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int gpc_deactivate(ifd_reader_t * reader) { return 0; } static int gpc_close(ifd_reader_t * reader) { return 0; } /* * Check card status */ static int gpc_card_status(ifd_reader_t * reader, int slot, int *status) { gpc_status_t *st = (gpc_status_t *) reader->driver_data; unsigned char byte; int r; if (slot != 0) { ct_error("gempc: bad slot index %u", slot); return IFD_ERROR_INVALID_SLOT; } if ((r = gpc_command(reader, "\x17", 1, &byte, 1)) < 0) return r; ifd_debug(4, "card %spresent%s\n", (byte & 0x04) ? "" : "not ", (byte & 0x02) ? ", powered up" : ""); *status = (byte & 0x04) ? IFD_CARD_PRESENT : 0; /* A power up/down transition can be used to detect * a card change. */ if ((st->card_state & 0x02) && !(byte & 0x02)) *status |= IFD_CARD_STATUS_CHANGED; st->card_state = byte; return 0; } /* * Reset the card and get the ATR */ static int gpc_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { static unsigned char reset_auto_pps[] = { 0x12, 0x23 }; static unsigned char reset_no_pps[] = { 0x12, 0x13 }; static unsigned char reset_emv[] = { 0x12 }; static unsigned char set_mode[] = { 0x17, 0x00, 0x47 }; int r, status; ifd_debug(1, "called."); if (slot != 0) { ct_error("gempc: bad slot index %u", slot); return IFD_ERROR_INVALID_SLOT; } /* Get the card status */ if ((r = gpc_card_status(reader, slot, &status)) < 0) return r; if (!(status & IFD_CARD_PRESENT)) return IFD_ERROR_NO_CARD; r = __gpc_command(reader, reset_auto_pps, sizeof(reset_auto_pps), atr, size, &status); if (r < 0 || status == 0x00) return r; /* Try again without PPS */ r = __gpc_command(reader, reset_no_pps, sizeof(reset_no_pps), atr, size, &status); if (r < 0 || status == 0x00) return r; /* Try EMV mode */ r = __gpc_command(reader, reset_emv, sizeof(reset_emv), atr, size, &status); if (r < 0 || status == 0x00) return r; /* Change Operation Mode, and retry EMV reset */ (void)gpc_command(reader, set_mode, sizeof(set_mode), NULL, 0); r = __gpc_command(reader, reset_emv, sizeof(reset_emv), atr, size, &status); if (r < 0 || status == 0x00) return r; return IFD_ERROR_NO_CARD; } /* * Select the card protocol */ static int gpc_set_protocol(ifd_reader_t * reader, int nslot, int proto) { gpc_status_t *st = (gpc_status_t *) reader->driver_data; ifd_slot_t *slot; ifd_debug(1, "called, proto=%d", proto); if (proto != IFD_PROTOCOL_T0 && proto != IFD_PROTOCOL_T1) { /* XXX FIXME - we need to call DEFINE CARD TYPE here */ return IFD_ERROR_NOT_SUPPORTED; } slot = &reader->slot[nslot]; slot->proto = ifd_protocol_new(IFD_PROTOCOL_TRANSPARENT, reader, slot->dad); if (slot->proto == NULL) { ct_error("%s: internal error", reader->name); return IFD_ERROR_GENERIC; } st->icc_proto = proto; return 0; } /* * Change the serial speed */ static int gpc_set_serial(ifd_reader_t * reader, unsigned int speed, int cs, int parity) { unsigned char cmd[] = { 0x0A, 0x00 }; ifd_debug(1, "called, speed=%u, cs=%d, parity=%d\n", speed, cs, parity); if (reader->device->type != IFD_DEVICE_TYPE_SERIAL) return IFD_ERROR_NOT_SUPPORTED; switch (speed) { case 1200: cmd[1] = 0x07; break; case 2400: cmd[1] = 0x06; break; case 4800: cmd[1] = 0x05; break; case 9600: cmd[1] = 0x04; break; case 19200: cmd[1] = 0x03; break; case 38400: cmd[1] = 0x02; break; case 76800: cmd[1] = 0x01; break; default: return IFD_ERROR_NOT_SUPPORTED; } switch (cs) { case 7: cmd[1] |= 0x08; break; case 8: break; default: return IFD_ERROR_NOT_SUPPORTED; } switch (parity) { case IFD_SERIAL_PARITY_EVEN: cmd[1] |= 0x10; break; case IFD_SERIAL_PARITY_NONE: break; default: return IFD_ERROR_NOT_SUPPORTED; } return gpc_command(reader, cmd, sizeof(cmd), NULL, 0); } /* * Set Reader mode */ static int gpc_set_mode(ifd_reader_t * reader, int mode) { unsigned char cmd[] = { 0x01, 0x00, 0x00 }; cmd[2] = mode; return gpc_command(reader, cmd, sizeof(cmd), NULL, 0); } #if 0 /* * Send command to IFD * * FIXME: we really need a better mechanism at the reader driver * API to allow for a "transceive" operation. */ static int gpc_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { gpc_status_t *st = (gpc_status_t *) reader->driver_data; ifd_debug(3, "data:%s", ct_hexdump(buffer, len)); if (len > sizeof(st->cmd_buf)) return IFD_ERROR_BUFFER_TOO_SMALL; memcpy(st->cmd_buf, buffer, len); st->cmd_len = len; return 0; } static int gpc_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *res_buf, size_t res_len, long timeout) { gpc_status_t *st = (gpc_status_t *) reader->driver_data; int rc; rc = gpc_transceive(reader, dad, st->cmd_buf, st->cmd_len, res_buf, res_len, timeout); if (rc > 0) ifd_debug(3, "received:%s", ct_hexdump(res_buf, rc)); return rc; } #endif static int gpc_transparent(ifd_reader_t * reader, int nad, const void *cmd_buf, size_t cmd_len, void *res_buf, size_t res_len) { return gpc_transceive(reader, nad, (const unsigned char *)cmd_buf, cmd_len, (unsigned char *)res_buf, res_len, 0); } /* * Generic transceive function */ static int gpc_transceive(ifd_reader_t * reader, unsigned int dad, const unsigned char *cmd_buf, size_t cmd_len, unsigned char *res_buf, size_t res_len, long timeout) { gpc_status_t *st = (gpc_status_t *) reader->driver_data; ifd_protocol_t *proto = reader->slot[0].proto; long orig_timeout = 0; int rc; if (timeout) { ifd_protocol_get_parameter(proto, IFD_PROTOCOL_RECV_TIMEOUT, &orig_timeout); ifd_protocol_set_parameter(proto, IFD_PROTOCOL_RECV_TIMEOUT, timeout * 1000); } switch (st->icc_proto) { case IFD_PROTOCOL_T0: rc = gpc_transceive_t0(reader, dad, cmd_buf, cmd_len, res_buf, res_len); break; case IFD_PROTOCOL_T1: rc = gpc_transceive_t1(reader, dad, cmd_buf, cmd_len, res_buf, res_len); break; default: ct_error("protocol not supported\n"); rc = IFD_ERROR_NOT_SUPPORTED; } if (orig_timeout) { ifd_protocol_set_parameter(proto, IFD_PROTOCOL_RECV_TIMEOUT, orig_timeout); } return rc; } static int gpc_transceive_t0(ifd_reader_t * reader, unsigned int dad, const unsigned char *cmd_buf, size_t cmd_len, unsigned char *res_buf, size_t res_len) { ifd_iso_apdu_t iso; int rc; if ((rc = ifd_iso_apdu_parse(cmd_buf, cmd_len, &iso)) < 0) return rc; switch (iso.cse) { case IFD_APDU_CASE_1: case IFD_APDU_CASE_3S: rc = gpc_iso_input(reader, cmd_buf, cmd_len, res_buf, res_len); break; case IFD_APDU_CASE_2S: rc = gpc_iso_output(reader, cmd_buf, cmd_len, res_buf, res_len); break; case IFD_APDU_CASE_4S: /* The PC/SC IFD driver does an ISO EXCHANGE APDU here, * but the specs I have say you can do this command only * for T=1 cards. * However, we shouldn't get here anyway for T=1, as the * T=0 protocol driver splits case 4 APDUs. */ rc = gpc_iso_exchange_apdu(reader, cmd_buf, cmd_len, res_buf, res_len); break; default: ifd_debug(1, "Bad APDU (case %d unknown or unsupported)\n", iso.cse); return IFD_ERROR_INVALID_ARG; } return rc; } static int gpc_transceive_t1(ifd_reader_t * reader, unsigned int dad, const unsigned char *cmd_buf, size_t cmd_len, unsigned char *res_buf, size_t res_len) { return gpc_iso_exchange_apdu(reader, cmd_buf, cmd_len, res_buf, res_len); } /* * Send partial APDU to the card */ static int gpc_iso_send_frag(ifd_reader_t * reader, unsigned char cmd, const unsigned char *cmd_buf, size_t cmd_len) { unsigned char buffer[256]; ifd_debug(4, "called, len=%u", cmd_len); if (cmd_len > sizeof(buffer) - 6) return IFD_ERROR_INVALID_ARG; buffer[0] = cmd; buffer[1] = 0xFF; buffer[2] = 0xFF; buffer[3] = 0xFF; buffer[4] = 0xFF; buffer[5] = cmd_len; memcpy(buffer + 6, cmd_buf, cmd_len); return gpc_command(reader, buffer, 6 + cmd_len, buffer, sizeof(buffer)); } /* * Receive (potentially fragmented) response from the card */ static int gpc_iso_recv_frag(ifd_reader_t * reader, unsigned char cmd, const unsigned char *data, size_t data_len, ct_buf_t * bp) { static unsigned char more_data[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; unsigned char buffer[256]; int rc, status; if (!data) { data = more_data; data_len = sizeof(more_data); } else if (data_len > sizeof(buffer) - 1) { return IFD_ERROR_BUFFER_TOO_SMALL; } buffer[0] = cmd; memcpy(buffer + 1, data, data_len); rc = __gpc_command(reader, buffer, 1 + data_len, buffer, sizeof(buffer), &status); if (rc < 0) return rc; ct_buf_put(bp, buffer, rc); if (status != 0x00 /* success */ && status != 0xE7 /* not 9000 */ && status != 0xE5 /* not 9000 */ && status != 0x1B) { /* more data */ ct_error("error 0x%02x in ISO OUPUT/EXCHANGE APDU (%s)", status, gpc_strerror(status)); return IFD_ERROR_COMM_ERROR; } /* so exchange/send stop looping. is 1b right here? */ if (status != 0x00 && status != 0x1B) return 0; return rc; } /* * Send case 2 APDU to card, receive lots of data in response. * Due to the limitations imposed by GBP, the reader may have * to send the response fragmented into several parts. */ static int gpc_iso_output(ifd_reader_t * reader, const unsigned char *cmd_buf, size_t cmd_len, unsigned char *res_buf, size_t res_len) { ct_buf_t res; size_t expect = 0; int rc; ct_buf_init(&res, res_buf, res_len); if (cmd_len > 4) { expect = cmd_buf[4]; if (expect == 0) expect = 256; expect += 2; /* for status word */ if (expect > res_len) expect = res_len; } while (1) { rc = gpc_iso_recv_frag(reader, 0x13, cmd_buf, cmd_len, &res); if (rc <= 0 || ct_buf_avail(&res) >= expect) break; cmd_buf = NULL; cmd_len = 0; } if (rc < 0) return rc; return ct_buf_avail(&res); } /* * Send APDU+data to card */ static int gpc_iso_input(ifd_reader_t * reader, const unsigned char *cmd_buf, size_t cmd_len, unsigned char *res_buf, size_t res_len) { unsigned char buffer[GPC_ISO_INPUT_MAX + 1]; int rc; if (cmd_len > GPC_ISO_INPUT_MAX) { size_t chunk = cmd_len - GPC_ISO_INPUT_MAX; rc = gpc_iso_send_frag(reader, 0x14, cmd_buf + chunk, chunk); if (rc < 0) return rc; cmd_len = GPC_ISO_INPUT_MAX; } buffer[0] = 0x14; memcpy(buffer + 1, cmd_buf, cmd_len); if (cmd_len == 4) buffer[++cmd_len] = 0x00; return gpc_command(reader, buffer, cmd_len + 1, res_buf, 2); } static int gpc_iso_exchange_apdu(ifd_reader_t * reader, const unsigned char *cmd_buf, size_t cmd_len, unsigned char *res_buf, size_t res_len) { ct_buf_t res; size_t expect = 0; int rc; ct_buf_init(&res, res_buf, res_len); if (cmd_len > 4) { expect = cmd_buf[4]; if (expect == 0) expect = 256; expect += 2; /* for status word */ if (expect > res_len) expect = res_len; } if (cmd_len > GPC_ISO_EXCHANGE_MAX) { size_t chunk = cmd_len - GPC_ISO_EXCHANGE_MAX; rc = gpc_iso_send_frag(reader, 0x15, cmd_buf + chunk, chunk); if (rc < 0) return rc; cmd_len = GPC_ISO_EXCHANGE_MAX; } while (1) { rc = gpc_iso_recv_frag(reader, 0x15, cmd_buf, cmd_len, &res); if (rc <= 0 || ct_buf_avail(&res) >= expect) break; /* Added by Chaskiel - I don't understand why */ if (ct_buf_avail(&res) == 2 && expect == 258) break; cmd_buf = NULL; cmd_len = 0; } if (rc < 0) return rc; return ct_buf_avail(&res); } /* * Get the OS version */ static int gpc_get_os_version(ifd_reader_t * reader, char *buf, size_t len) { static unsigned char cmd[] = { 0x22, 0x05, 0x3F, 0xE0, 0x10 }; /* Ensure NUL termination */ memset(buf, 0, len); return gpc_command(reader, cmd, sizeof(cmd), buf, len - 1); } /* * Helper functions */ static int __gpc_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, void *res, size_t res_len, int *gpc_status) { gpc_status_t *st = (gpc_status_t *) reader->driver_data; unsigned char buffer[257]; size_t len; int rc; if (res_len > sizeof(buffer) - 1) return IFD_ERROR_GENERIC; if (st->p == NULL) { ct_error("No host-reader comm protocol selected\n"); return IFD_ERROR_GENERIC; } if (ct_config.debug >= 3) ifd_debug(3, "sending:%s", ct_hexdump(cmd, cmd_len)); rc = ifd_protocol_transceive(st->p, 0, cmd, cmd_len, buffer, sizeof(buffer)); if (rc < 0) return rc; if (rc == 0) { ct_error("zero length response from reader?!\n"); return IFD_ERROR_GENERIC; } if (ct_config.debug >= 3) ifd_debug(3, "received:%s", ct_hexdump(buffer, rc)); len = rc - 1; if (buffer[0] != 0x00) { ifd_debug(2, "reader reports status 0x%02x (%s)\n", buffer[0], gpc_strerror(buffer[0])); } if (gpc_status) *gpc_status = buffer[0]; if (len > res_len) len = res_len; if (len && res) memcpy(res, buffer + 1, len); return len; } static int gpc_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, void *res, size_t res_len) { int rc, status; rc = __gpc_command(reader, cmd, cmd_len, res, res_len, &status); if (rc >= 0 && status == 0x01) rc = IFD_ERROR_NOT_SUPPORTED; if (rc >= 0 && status != 0x00 && status != 0xE5 && status != 0xE7) rc = IFD_ERROR_COMM_ERROR; return rc; } /* * GPC error handling */ static const char *gpc_strerror(int status) { switch (status) { case 0x00: return "Success"; case 0x01: return "Unknown GemCore command"; case 0x02: return "Operation impossible with this driver"; case 0x03: return "Incorrect number of arguments"; case 0x10: return "The first byte of the response (TS) is not valid"; case 0x1b: return "More data available"; case 0x1d: return "Wrong ATR TCK"; case 0xa0: return "Error in card reset response"; case 0xa1: return "Card protocol error"; case 0xa2: return "Card is mute"; case 0xa3: return "Parity error during exchange"; case 0xa4: return "Card has aborted chaining (T=1)"; case 0xa5: return "Reader has aborted chaining (T=1)"; case 0xa6: return "RESYNCH successfully performed by GemCore"; case 0xa7: return "Protocol Type Selection (PTS) error"; case 0xa8: return "Card and reader in EMV mode"; case 0xe5: return "Card interrupted the exchange after SW1"; case 0xe7: return "\"Error\" returned by the card (SW is not 9000)"; case 0xf7: return "Card removed during execution of a command"; case 0xfb: return "Card missing"; } return "Unknown error"; } /* * Driver operations */ static struct ifd_driver_ops gempc_driver; void ifd_gempc_register(void) { gempc_driver.open = gpc_open; gempc_driver.close = gpc_close; gempc_driver.activate = gpc_activate; gempc_driver.deactivate = gpc_deactivate; gempc_driver.set_protocol = gpc_set_protocol; gempc_driver.card_status = gpc_card_status; gempc_driver.card_reset = gpc_card_reset; gempc_driver.transparent = gpc_transparent; ifd_driver_register("gempc", &gempc_driver); } openct-0.6.20/src/ifd/sys-solaris.c0000644000175000017500000003722511151454644014013 00000000000000/* * Solaris specific functions * * Copyright (C) 2004 William Wanders * */ #include "internal.h" #if defined (sun) && !defined (sunray) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * USB Device Setup Packet * Refer to USB 2.0/ 9.3 * * All USB devices respond to requests from the host on the device's * Default Control Pipe. These request are made using control transfers. * The request and the request's parameters are sent to the device in * the Setup packet. Every Setup packet has eight bytes: * * Offset Field Size * ---------------------------------- * 0 bmRequestType 1 * 1 bRequest 1 * 2 wValue 2 * 4 wIndex 2 * 6 wLength 2 * * IMPORTANT: Pay attention to (little) endianness. * */ typedef struct usb_request { uint8_t bmRequestType; /* Request Type */ uint8_t bRequest; /* Setup Request */ uint16_t wValue; /* Request Info */ uint16_t wIndex; /* Index/Offset Info */ uint16_t wLength; /* Number of bytes in transfer */ uint8_t data[1]; /* Outgoing Data */ } usb_request_t; /* * Globals */ static int cntrl0_fd = 0; static int cntrl0stat_fd = 0; static int devstat_fd = 0; typedef struct ep { int ep_fd[2]; int ep_stat_fd[2]; } ep_t; typedef ep_t interface_t[128]; static interface_t interfaces[1]; /* * Defines */ #define USB_DEVICE_ROOT "/dev/usb" #define BYTESWAP(in) (((in & 0xFF) << 8) + ((in & 0xFF00) >> 8)) #define USB_REQUEST_SIZE 8 /* * Open device status interface */ static int open_devstat(char *name) { /* Open devstat to retrieve control pipe status. */ if (!devstat_fd) { char *devstat; if ((devstat = calloc(1, strlen(name) + 2)) == NULL) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } strcpy(devstat, name); strcpy(devstat + strlen(name) - 6, "devstat"); ifd_debug(6, "open_devstat: open device status: \"%s\"", devstat); if ((devstat_fd = open(devstat, O_RDONLY | O_EXCL | O_NONBLOCK)) < 0) { ifd_debug(6, "open_devstat: Error opening \"%s\": %s", devstat, strerror(errno)); free(devstat); return -1; } free(devstat); ifd_debug(6, "open_cntrl0stat: devstat_fd=%d", devstat_fd); } return 0; } /* * Open device control status interface */ static int open_cntrl0stat(char *name) { /* Open cntrl0stat to retrieve control pipe status. */ if (!cntrl0stat_fd) { char *cntrl0stat; if ((cntrl0stat = calloc(1, strlen(name) + 5)) == NULL) { ct_error("out of memory"); return -1; } strcpy(cntrl0stat, name); strcat(cntrl0stat, "stat"); ifd_debug(6, "open_cntrl0stat: open control pipe status: \"%s\"", cntrl0stat); if ((cntrl0stat_fd = open(cntrl0stat, O_RDONLY | O_EXCL)) < 0) { ifd_debug(6, "open_cntrl0stat: Error opening \"%s\": %s", cntrl0stat, strerror(errno)); free(cntrl0stat); return 0; } free(cntrl0stat); ifd_debug(6, "open_cntrl0stat: cntrl0stat_fd=%d", cntrl0stat_fd); } return 1; } /* * Open interface endpoint */ int open_ep(char *name, int interface, int endpoint, int direction, int flags) { char filename[256]; char intdirep[32]; if (interfaces[interface][endpoint].ep_fd[direction]) { ifd_debug(6, "open_ep: endpoint already opened"); return 0; } sprintf((char *)&intdirep, "if%d%s%d", interface, direction ? "in" : "out", endpoint); memset((char *)&filename, 0, strlen(name) + 2); strcpy((char *)&filename, name); filename[strlen(name) - 6] = '\0'; strcat((char *)&filename, (char *)&intdirep); if ((interfaces[interface][endpoint].ep_fd[direction] = open(filename, direction ? O_RDONLY | flags : O_WRONLY | flags)) < 0) { ifd_debug(6, "open_ep: error opening \"%s\": %s", filename, strerror(errno)); interfaces[interface][endpoint].ep_fd[direction] = 0; return -1; } #if 0 strcat((char *)&filename, "stat"); if ((interfaces[interface][endpoint].ep_stat_fd[direction] = open(filename, O_RDONLY | O_NONBLOCK)) < 0) { ifd_debug(6, "open_ep: error opening \"%s\": %s", filename, strerror(errno)); close(interfaces[interface][endpoint].ep_fd[direction]); interfaces[interface][endpoint].ep_fd[direction] = 0; interfaces[interface][endpoint].ep_stat_fd[direction] = 0; return -1; } #endif return 0; } void close_ep(int interface, int endpoint, int direction) { if (interfaces[interface][endpoint].ep_fd[direction]) { close(interfaces[interface][endpoint].ep_fd[direction]); interfaces[interface][endpoint].ep_fd[direction] = 0; } if (interfaces[interface][endpoint].ep_stat_fd[direction]) { close(interfaces[interface][endpoint].ep_stat_fd[direction]); interfaces[interface][endpoint].ep_stat_fd[direction] = 0; } } /* * Prepare a USB control request. Please see USB 2.0 spec section 9.4. */ static void prepare_usb_control_req(usb_request_t * req, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength) { (*req).bmRequestType = bmRequestType; (*req).bRequest = bRequest; #ifdef _BIG_ENDIAN /* Sparc is big endian, USB little endian */ (*req).wValue = BYTESWAP(wValue); (*req).wIndex = BYTESWAP(wIndex); (*req).wLength = BYTESWAP(wLength); #else (*req).wValue = wValue; (*req).wIndex = wIndex; (*req).wLength = wLength; #endif /* _BIG_ENDIAN */ } /* * Poll for presence of USB device */ int ifd_sysdep_usb_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { int devstat = 0; pfd->fd = -1; if (open_devstat(dev->name) < 0) { ifd_debug(1, "ifd_sysdep_usb_poll_presence: cannot open devstat device for %s", dev->name); return 0; } if (read(devstat_fd, &devstat, sizeof(devstat))) { switch (devstat) { case USB_DEV_STAT_ONLINE: ifd_debug(1, "devstat: ONLINE (%d)", devstat); break; case USB_DEV_STAT_DISCONNECTED: ifd_debug(1, "devstat: DISCONNECTED (%d)", devstat); return 0; default: ifd_debug(1, "devstat: %d", devstat); return 0; } } return 1; } /* * Event fd */ int ifd_sysdep_usb_get_eventfd(ifd_device_t * dev, short *events) { return -1; } /* * USB control command */ int ifd_sysdep_usb_control(ifd_device_t * dev, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len, long timeout) { int bytes_to_process; int bytes_processed; int failed = 0; usb_request_t *usb_control_req; char *recv_data; ifd_debug(6, "ifd_sysdep_usb_control:" " requestType = 0x%02x" " request = 0x%02x" " value = 0x%02x" " index = 0x%02x", requesttype, request, value, index); bytes_to_process = USB_REQUEST_SIZE + ((requesttype & USB_EP_DIR_MASK) == USB_EP_DIR_OUT ? len : 0); if ((usb_control_req = calloc(1, bytes_to_process)) == NULL) { ct_error("out of memory"); return -1; } if ((recv_data = calloc(1, len)) == NULL) { ct_error("out of memory"); free(usb_control_req); return -1; } if (!open_cntrl0stat(dev->name)) return -1; /* Initialize the USB control request */ prepare_usb_control_req(usb_control_req, requesttype, request, value, index, len); /* Add any additional */ if (((requesttype & USB_EP_DIR_MASK) == USB_EP_DIR_OUT) && len) { ifd_debug(6, "ifd_sysdep_usb_control: copying output data : %s", ct_hexdump(data, len)); memcpy(usb_control_req->data, data, len); } /* Send request down the control pipe to the device. */ bytes_processed = write(dev->fd, usb_control_req, bytes_to_process); if (bytes_processed != bytes_to_process) { ifd_debug(6, "ifd_sysdep_usb_control: write failed: %s", strerror(errno)); ct_error("usb_control write failed: %s", strerror(errno)); failed = IFD_ERROR_COMM_ERROR; goto cleanup; } /* Read the return data from the device. */ bytes_processed = read(dev->fd, recv_data, len); if (bytes_processed < 0) { ifd_debug(6, "ifd_sysdep_usb_control: read failed: %s", strerror(errno)); ct_error("usb_control read failed: %s", strerror(errno)); failed = IFD_ERROR_COMM_ERROR; goto cleanup; } if (bytes_processed) { ifd_debug(6, "ifd_sysdep_usb_control: input data[%d] : %s", bytes_processed, ct_hexdump(recv_data, bytes_processed)); if ((requesttype & USB_EP_DIR_MASK) == USB_EP_DIR_IN) memcpy(data, recv_data, bytes_processed); } else ifd_debug(6, "ifd_sysdep_usb_control: input data[%d]", bytes_processed); cleanup: if (recv_data) free(recv_data); if (usb_control_req) free(usb_control_req); if (failed) return failed; return bytes_processed; } int ifd_sysdep_usb_set_configuration(ifd_device_t * dev, int config) { ct_debug ("ifd_sysdep_usb_set_configuration: config=%d (not yet implemented)", config); return 0; } int ifd_sysdep_usb_set_interface(ifd_device_t * dev, int ifc, int alt) { ct_debug ("ifd_sysdep_usb_set_interface: alt=%d ifc=%d (not yet implemented)", alt, ifc); return 0; } int ifd_sysdep_usb_claim_interface(ifd_device_t * dev, int interface) { ct_debug ("ifd_sysdep_usb_claim_interface: interface=%d (not yet implented)", interface); return 0; } int ifd_sysdep_usb_release_interface(ifd_device_t * dev, int interface) { ct_debug("ifd_sysdep_usb_release_interface: not implented yet"); return 0; } int ifd_sysdep_usb_bulk(ifd_device_t * dev, int ep, void *buffer, size_t len, long timeout) { int bytes_to_process; int bytes_processed; int direction = (ep & USB_EP_DIR_MASK) == USB_EP_DIR_IN ? 1 : 0; int endpoint = (ep & ~USB_EP_DIR_MASK); ct_debug("ifd_sysdep_usb_bulk: endpoint=%d direction=%d", endpoint, direction); if (open_ep(dev->name, 0, endpoint, direction, 0)) { ct_debug("ifd_sysdep_usb_bulk: opening endpoint failed"); return -1; } if (direction) { if ((bytes_to_process = read(interfaces[0][endpoint].ep_fd[direction], buffer, len)) < 0) { ifd_debug(6, "ifd_sysdep_usb_bulk: read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } ct_debug("ifd_sysdep_usb_bulk: read %d bytes", bytes_to_process); return bytes_to_process; } else { bytes_to_process = len; if ((bytes_processed = write(interfaces[0][endpoint].ep_fd[direction], buffer, bytes_to_process)) != bytes_to_process) { ifd_debug(6, "ifd_sysdep_usb_bulk: write failed: %s", strerror(errno)); ct_error("usb_bulk write failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } ct_debug("ifd_sysdep_usb_bulk: wrote buffer[%d]=%s", bytes_processed, ct_hexdump(buffer, len)); return bytes_processed; } } /* * USB URB capture */ struct ifd_usb_capture { int type; int endpoint; size_t maxpacket; unsigned int interface; }; int ifd_sysdep_usb_begin_capture(ifd_device_t * dev, int type, int ep, size_t maxpacket, ifd_usb_capture_t ** capret) { ifd_usb_capture_t *cap; int direction = (ep & USB_EP_DIR_MASK) == USB_EP_DIR_IN ? 1 : 0; int endpoint = (ep & ~USB_EP_DIR_MASK); if (!(cap = (ifd_usb_capture_t *) calloc(1, sizeof(*cap) + maxpacket))) { ct_error("out of memory"); return -1; } cap->type = type; cap->endpoint = ep; cap->maxpacket = maxpacket; if (!interfaces[0][endpoint].ep_fd[direction]) { if (open_ep(dev->name, 0, endpoint, direction, O_NONBLOCK)) { ct_debug ("ifd_sysdep_usb_begin_capture: opening endpoint failed"); return -1; } } *capret = cap; return 0; } int ifd_sysdep_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len) { return IFD_ERROR_NOT_SUPPORTED; } int ifd_sysdep_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len, long timeout) { struct timeval begin; int bytes_to_process = 0; int direction = (cap->endpoint & USB_EP_DIR_MASK) == USB_EP_DIR_IN ? 1 : 0; int endpoint = (cap->endpoint & ~USB_EP_DIR_MASK); gettimeofday(&begin, NULL); do { struct pollfd pfd; long wait; if ((wait = (timeout - ifd_time_elapsed(&begin))) <= 0) return IFD_ERROR_TIMEOUT; pfd.fd = interfaces[0][endpoint].ep_fd[direction]; pfd.events = POLL_IN; if (poll(&pfd, 1, wait) != 1) continue; if ((bytes_to_process = read(interfaces[0][endpoint].ep_fd[direction], buffer, len)) < 0) { ifd_debug(6, "ifd_sysdep_usb_bulk: read failed: %s", strerror(errno)); ct_error("usb_bulk read failed: %s", strerror(errno)); return IFD_ERROR_COMM_ERROR; } } while (!bytes_to_process); ct_debug("ifd_sysdep_usb_capture: read buffer[%d]=%s", bytes_to_process, ct_hexdump(buffer, bytes_to_process)); return bytes_to_process; } int ifd_sysdep_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap) { int direction = (cap->endpoint & USB_EP_DIR_MASK) == USB_EP_DIR_IN ? 1 : 0; int endpoint = (cap->endpoint & ~USB_EP_DIR_MASK); close_ep(0, endpoint, direction); if (cap) free(cap); return 0; } int ifd_sysdep_usb_open(const char *device) { return open(device, O_RDWR); } int ifd_sysdep_usb_reset(ifd_device_t * dev) { /* not implemented so far */ return -1; } /* * Scan the /dev/usb directory to see if there is any control pipe matching: * * /dev/usb/.//cntrl0 * * If a suitable driver is found for this combination * an ifd handler is spawned for every instance. * */ int ifd_scan_usb(void) { DIR *usb_device_root; struct dirent *device_type; ifd_debug(1, "ifd_scan_usb:"); usb_device_root = opendir(USB_DEVICE_ROOT); do { int vendor = 0, product = 0; char device_type_root_name[256]; DIR *device_type_root; struct dirent *device_instance; ifd_devid_t id; const char *driver; errno = 0; if ((device_type = readdir(usb_device_root)) == NULL) continue; if (strncmp(device_type->d_name, ".", 1) == 0) continue; if (sscanf(device_type->d_name, "%x.%x", &vendor, &product) != 2) continue; ifd_debug(1, "ifd_scan_usb: found device tree usb:%04x/%04x\n", vendor, product); id.type = IFD_DEVICE_TYPE_USB; id.num = 2; id.val[0] = vendor; id.val[1] = product; /* FIXME: if we don't find a driver with vendor/product * then check for the interface type (ccid) and use * driver ccid... */ if (!(driver = ifd_driver_for_id(&id))) continue; ifd_debug(1, "ifd_scan_usb: found driver type \"%s\" for usb:%04x/%04x\n", driver, vendor, product); sprintf(device_type_root_name, "%s/%s", USB_DEVICE_ROOT, device_type->d_name); if (!(device_type_root = opendir(device_type_root_name))) continue; do { int device = -1; char device_instance_cntrl0_name[256]; char typedev[256]; struct stat dummy; errno = 0; if ((device_instance = readdir(device_type_root)) == NULL) continue; if (strncmp(device_instance->d_name, ".", 1) == 0) continue; ifd_debug(1, "ifd_scan_usb: \tfound device %s\n", device_instance->d_name); if (sscanf(device_instance->d_name, "%d", &device) != 1) continue; sprintf(device_instance_cntrl0_name, "%s/%d/cntrl0", device_type_root_name, device); if (stat(device_instance_cntrl0_name, &dummy) == 0) { ifd_debug(1, "ifd_scan_usb: \t\tfound device instance %s\n", device_instance_cntrl0_name); snprintf(typedev, sizeof(typedev), "usb:%s", device_instance_cntrl0_name); ifd_spawn_handler(driver, typedev, -1); } } while (device_instance != NULL); if (errno != 0) perror("error reading directory"); closedir(device_type_root); } while (device_type != NULL); if (errno != 0) ifd_debug(1, "ifd_scan_usb: error reading directory"); closedir(usb_device_root); return 0; } #endif /* sun && !sunray */ openct-0.6.20/src/ifd/ifd-pertosmart1038.c0000644000175000017500000007522011043042742014764 00000000000000/** * PertoSmart card reader driver (for readers using ACS AC-1038 chipset). * * Copyright 2005, Carlos Henrique Bauer */ #include "internal.h" #include #include #include #include "atr.h" #ifndef NULL #define NULL 0 #endif #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE (!FALSE) #endif #ifndef min #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif #ifndef max #define max(a, b) (((a) > (b)) ? (a) : (b)) #endif /** * Reader USB Interface info * * Endpoint Address Function Direction Packet size * Bulk out 0x02 Command host -> reader 64 bytes * Bulk in 0x82 Response host <- reader 64 bytes * Interrupt in 0x81 Card status message host <- reader 8 bytes */ #define PS_USB_INTERFACE_INDEX 0x00 #define PS_USB_BULK_OUTPUT_ENDPOINT_ADDRESS 0x02 #define PS_USB_BULK_INPUT_ENDPOINT_ADDRESS 0x82 #define PS_USB_INTERRUPT_ENDPOINT_ADDRESS 0x81 typedef enum PS_INSTRUCTIION { PS_GET_ACR_STAT = 0x01, PS_SELECT_CARD_TYPE = 0x02, PS_SET_OPTION = 0x07, PS_RESET = 0x80, PS_EXCHANGE_TPDU_T0 = 0xa0, PS_EXCHANGE_TPDU_T1 = 0xa1, PS_POWER_OFF = 0x81, PS_SET_CARD_PPS = 0x0a, PS_SET_READER_PPS = 0x0b, } ps_instruction_t; static const unsigned char PS_CARD_INSERTED_NOTIFICATION[] = { 0x01, 0xc1, 0x00, 0x00 }; static const unsigned char PS_CARD_REMOVED_NOTIFICATION[] = { 0x01, 0xc0, 0x00, 0x00 }; typedef enum PS_CARD_TYPE { PS_AUTO_T0_OR_T1_CARD_TYPE = 0x00, /* automatic T=0 or T=1 protocol selection for MCU cards */ PS_T0_CARD_TYPE = 0x0c, /* T=0 protocol for MCU cards */ PS_T1_CARD_TYPE = 0x0d, /* T=1 protocol for MCU cards */ PS_I2C_CARD_TYPE_1K_16K_CARD_TYPE = 0x01, /* I2C memory card: 1k, 2k, 4k, 8k and 16k */ PS_I2C_CARD_TYPE_32K_1024K_CARD_TYPE = 0x02, /* I2C memory card: 32k, 64k, 128k, 256k, 512k and 1024k */ PS_AT88SC153_CARD_TYPE = 0x03, /* ATMEL AT88SC153 secure memory card */ PS_AT88SC1608_CARD_TYPE = 0x04, /* ATMEL AT88SC1608 secure memory card */ PS_3WIRE_CARD_TYPE = 0x05, /* SLE4418 or SLE4428 card */ PS_2WIRE_CARD_TYPE = 0x06, /* SLE4432 or SLE4442 cards */ } ps_card_type_t; typedef enum PS_RESET_VOLTAGE_SELECTION { PS_RESET_SELECT_AUTO_V = 0x00, PS_RESET_SELECT_5V = 0x01, PS_RESET_SELECT_3V = 0x02, PS_RESET_SELECT_1V8 = 0x03 } ps_reset_voltage_selection_t; typedef enum PS_RESPONSE_STATUS_CODE { PS_SUCCESS = 0x00, PS_SLOTERROR_PROCEDURE_BYTE_CONFLICT = 0xf4, PS_SLOTERROR_BAD_LENGTH = 0xf6, PS_SLOTERROR_BAD_FIDI = 0xf7, PS_SLOTERROR_BAD_ATR_IS = 0xf8, PS_SLOTERROR_ICC_NOT_POWERED_UP = 0xf9, PS_SLOTERROR_ICC_NOT_INSERTED = 0xfa, PS_SLOTERROR_HW_ERROR = 0xfb, PS_SLOTERROR_XFE_OVERRUN = 0xfc, PS_SLOTERROR_XFE_PARITY_ERROR = 0xfd, PS_SLOTERROR_ICC_MUTE = 0xfe, PS_SLOTERROR_CMD_ABORTED = 0xff, } ps_response_status_code_t; typedef enum PS_TRANSMISSION_STATE { IDLE = 0, WAITING_TO_SEND, SENDING, FINISHED, RECEIVING, ERROR } ps_transmission_state_t; typedef enum PS_CARD_STATUS { PS_CARD_UNKNOWN = -1, PS_CARD_NOT_INSERTED = 0, PS_CARD_INSERTED = 1 } ps_card_status_t; typedef struct ps_stat { unsigned char internal[10]; unsigned char max_c; unsigned char max_r; unsigned short c_type; unsigned char c_sel; unsigned char c_stat; } ps_stat_t; typedef struct ps_device_data { /* current card status */ ps_card_status_t card_status; /* state of the serial or usb interface */ ps_transmission_state_t if_state; /* current protocol (negotiated by the reader during card powering up). */ int cur_icc_proto; long dev_timeout; struct timeval begin; long if_timeout; ifd_usb_capture_t *capture; } ps_device_data_t; #define PS_MAX_SEND_LEN 65535 #define PS_HEADER 0x01 #define PS_HEADER_IDX 0 #define PS_INSTRUCTION_IDX 1 #define PS_COMMAND_LENGTH0_IDX 2 #define PS_COMMAND_LENGTH1_IDX 3 #define PS_STATUS_IDX 1 #define PS_RESPONSE_LENGTH0_IDX 2 #define PS_RESPONSE_LENGTH1_IDX 3 #define PS_COMMAND_HEADER_SIZE 4 #define PS_RESPONSE_HEADER_SIZE 4 #define PS_RESPONSE_DATA_IDX PS_RESPONSE_HEADER_SIZE #define PS_INTERRUPT_URB_DATA_SIZE 0x08 #define PS_ENDPOINT 0x81 #define PS_BULK_SEND_PACKET_SIZE 64 #define PS_BULK_RECEIVE_PACKET_SIZE 64 #define PS_OPTION_EMV_MODE_ON (1 << 4) /* done */ #define PS_OPTION_MEMORY_CARD_ON (1 << 5) /* done */ #define PS_DEFAULT_T1_IFSC 0x20 #define PS_MAX_T1_IFSD 0xfe /* read timeout * we must wait enough so that the card can finish its calculation */ static const long PS_BULK_TIMEOUT = 30000; static const long PS_INTERRUPT_TIMEOUT = 100; /* reader names */ static const char PS_USB_READER_NAME[] = "PertoSmart EMV (AC1038, USB)"; typedef int complete_fn_t(const void *, size_t); typedef struct PS_RESPONSE_STATUS_CODE_MAP_ENTRY { ps_response_status_code_t status_code; char *status_str; } ps_response_status_code_map_entry_t; /* * Convert reader status byte to a string. */ static const char *ps_get_status_string(ps_response_status_code_t status_code) { static const ps_response_status_code_map_entry_t ps_response_status_code_map[] = { {PS_SUCCESS, "Success"}, {PS_SLOTERROR_PROCEDURE_BYTE_CONFLICT, "Procedure Byte Conflict"}, {PS_SLOTERROR_BAD_LENGTH, "Bad Length"}, {PS_SLOTERROR_BAD_FIDI, "Bad Fidi"}, {PS_SLOTERROR_BAD_ATR_IS, "Bad Atr IS"}, {PS_SLOTERROR_ICC_NOT_POWERED_UP, "Icc Not Powered Up"}, {PS_SLOTERROR_ICC_NOT_INSERTED, "Icc Not Inserted"}, {PS_SLOTERROR_HW_ERROR, "Hardware Error"}, {PS_SLOTERROR_XFE_OVERRUN, "Transfer Overrun"}, {PS_SLOTERROR_XFE_PARITY_ERROR, "Transfer Parity Error"}, {PS_SLOTERROR_ICC_MUTE, "ICC mute"}, {PS_SLOTERROR_CMD_ABORTED, "Command Aborted"} }; int i; for (i = 0; i < sizeof(ps_response_status_code_map) / sizeof(ps_response_status_code_map[0]); i++) { if (ps_response_status_code_map[i].status_code == status_code) { return ps_response_status_code_map[i].status_str; } } return "Unknown response status code"; } /* * Switch the driver to transmission state. */ static int ps_if_transmission_start(ifd_device_t * dev, long timeout) { ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_start: called"); device_data = (ps_device_data_t *) dev->user_data; if (device_data->if_state != IDLE && device_data->if_state != ERROR) { ct_error("ps_if_transmission_start: can't start " "transmission: device not idle"); return IFD_ERROR_LOCKED; } device_data->if_state = WAITING_TO_SEND; device_data->if_timeout = (timeout < 0) ? dev->timeout : timeout; return IFD_SUCCESS; } /* * Send data to reader. */ static int ps_if_transmission_send(ifd_device_t * dev, const unsigned char *sbuf, size_t slen) { int rc; ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_send: called"); if (ct_config.debug >= 4) ct_debug("ps_if_transmission_send: sending %u bytes: %s", slen, ct_hexdump(sbuf, slen)); device_data = (ps_device_data_t *) dev->user_data; if (device_data->if_state != WAITING_TO_SEND && device_data->if_state != SENDING) { ct_error("ps_if_transmission_send: " "invalid transmission state %i.", device_data->if_state); rc = IFD_ERROR_GENERIC; goto out; } if (device_data->if_state == WAITING_TO_SEND) { gettimeofday(&(device_data->begin), NULL); ifd_device_flush(dev); device_data->if_state = SENDING; } /* complete packet */ rc = ifd_device_send(dev, sbuf, slen); if (slen != rc) { if (rc >= IFD_SUCCESS) { /* if_device_send didn't reported an error, but didn't transmitted a full packet to the reader */ if (ct_config.debug >= 1) ct_debug("ps_if_transmission_send: unexpected " "result from ifd_device_send: %i", rc); rc = IFD_ERROR_COMM_ERROR; } goto out; } out: if (rc < 0) { device_data->if_state = ERROR; ct_error("ps_if_transmission_send: failed: %i", rc); } return rc; } /* * Receive data from reader. */ static int ps_if_transmission_receive(ifd_device_t * dev, unsigned char *rbuf, size_t rlen) { int rc = IFD_SUCCESS; ps_device_data_t *device_data = NULL; unsigned char *chunk_start = NULL; size_t chunk_len = 0; size_t rbuf_offset = 0; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_receive: called"); device_data = (ps_device_data_t *) dev->user_data; if (device_data->if_state != SENDING && device_data->if_state != RECEIVING) { ct_error("ps_if_transmission_receive: " "invalid transmission state %i.", device_data->if_state); rc = IFD_ERROR_GENERIC; goto out; } device_data->if_state = RECEIVING; for (;;) { chunk_len = min(PS_BULK_RECEIVE_PACKET_SIZE, rlen - rbuf_offset); if (chunk_len > 0) { long timeout; chunk_start = &rbuf[rbuf_offset]; timeout = device_data->if_timeout - ifd_time_elapsed(&(device_data->begin)); rc = ifd_device_recv(dev, chunk_start, chunk_len, timeout); if (rc < IFD_SUCCESS) { if(ct_config.debug >= 1) ct_debug("ps_if_transmission_receive: error: %i", rc); goto out; } rbuf_offset += rc; } if (rc < chunk_len || rbuf_offset >= rlen) { break; } } /* return the length of received data */ rc = rbuf_offset; out: if (rc < 0) { device_data->if_state = ERROR; ct_error("ps_if_transmission_receive: failed: %i", rc); } else { if (ct_config.debug >= 4) ct_debug("ps_if_transmission_receive: received %u bytes:%s", rc, ct_hexdump(rbuf, rc)); } return rc; } /* * Receive all data reader want to send us. Reader will * switch to receive state after sending the last packet. */ static int ps_if_transmission_flush_reader_output_buffer(ifd_device_t * dev) { unsigned char buffer[PS_BULK_RECEIVE_PACKET_SIZE]; int rc = IFD_SUCCESS; ps_device_data_t *device_data = NULL; const size_t buffer_len = sizeof(buffer); const long timeout = 100; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_flush_reader_output_buffer: called"); device_data = (ps_device_data_t *) dev->user_data; do { rc = ifd_device_recv(dev, buffer, buffer_len, timeout); } while (rc > 0); /* clear possible sensitive information */ memset(buffer, 0, buffer_len); return IFD_SUCCESS; } /* * Switch driver state to non transmission state. */ static int ps_if_transmission_end(ifd_device_t * dev) { ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_end: called"); device_data = (ps_device_data_t *) dev->user_data; if (device_data->if_state != IDLE) { device_data->if_state = IDLE; } return IFD_SUCCESS; } /* * Send command to reader. */ static int ps_send_to_ifd(ifd_reader_t * reader, ps_instruction_t instruction, const unsigned char *sbuf, size_t slen) { unsigned char good_buffer[5 * PS_BULK_SEND_PACKET_SIZE]; unsigned char *buffer = good_buffer; size_t buffer_len = sizeof(good_buffer); int rc = IFD_SUCCESS; ifd_device_t *dev = NULL; ps_device_data_t *device_data = NULL; size_t command_size = PS_COMMAND_HEADER_SIZE + slen; if (ct_config.debug >= 1) ct_debug("ps_send_to_ifd: called"); if (ct_config.debug >= 3) ct_debug("ps_send_to_ifd: sending %u bytes:%s", rc, ct_hexdump(sbuf, slen)); /* needs padding? */ if (command_size % PS_BULK_SEND_PACKET_SIZE) { /* calculate padding */ command_size = PS_BULK_SEND_PACKET_SIZE * (1 + (command_size / PS_BULK_SEND_PACKET_SIZE)); } dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; if (PS_MAX_SEND_LEN < slen) { ct_error("ps_apdu_send: transmission is " "larger than maximum allowed: %i", slen); goto out; } if (buffer_len < command_size) { buffer = (unsigned char *)malloc(command_size); if (buffer == NULL) { rc = IFD_ERROR_NO_MEMORY; goto out; } buffer_len = command_size; } /* build command */ /* header */ buffer[PS_HEADER_IDX] = PS_HEADER; buffer[PS_INSTRUCTION_IDX] = instruction; buffer[PS_COMMAND_LENGTH0_IDX] = (unsigned char)((slen >> 8) & 0xff); buffer[PS_COMMAND_LENGTH1_IDX] = (unsigned char)(slen & 0xff); /* data */ memcpy(&buffer[PS_COMMAND_HEADER_SIZE], sbuf, slen); /* padding */ if (buffer_len > slen) { const size_t pad_start = slen + PS_COMMAND_HEADER_SIZE; memset(&buffer[pad_start], 0, buffer_len - pad_start); } /* send the first packet to reader */ rc = ps_if_transmission_send(dev, buffer, command_size); if (command_size != rc) { /* something is wrong */ if (rc >= 0) { /* didn't sent all the data to the reader */ rc = IFD_ERROR_COMM_ERROR; } goto out; } /* return the length of data sent to reader */ rc = slen; out: if (buffer != NULL) { /* clear possible sensitive information */ memset(buffer, 0, buffer_len); } if (buffer != good_buffer) { free(buffer); } if (rc < 0 ) { device_data->if_state = ERROR; ct_error("ps_send_to_ifd: failed: %i", rc); } else { if (ct_config.debug >= 4) ct_debug("ps_send_to_ifd: sent %u bytes:%s", slen, ct_hexdump(sbuf, slen)); } return rc; } /* * Receive a response from reader * * (rbuf == NULL && rlen == 0) means caller wants no data, * just the reader status */ static int ps_receive_from_ifd(ifd_reader_t * reader, unsigned char *rbuf, size_t rlen) { int rc = IFD_SUCCESS; ifd_device_t *dev = NULL; ps_device_data_t *device_data = NULL; ps_response_status_code_t status = PS_SUCCESS; size_t data_len = 0; size_t received = 0; unsigned char buffer[PS_BULK_RECEIVE_PACKET_SIZE]; const size_t buffer_len = sizeof(buffer); if (ct_config.debug >= 1) ct_debug("ps_receive_from_ifd: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; if (rbuf == NULL && rlen > 0) { ct_error("ps_receive_from_ifd: rbuf == NULL"); rc = IFD_ERROR_GENERIC; goto out; } /* receive the response header */ rc = ps_if_transmission_receive(dev, buffer, buffer_len); if (rc < 0 ) goto out; if (rc < PS_RESPONSE_HEADER_SIZE) { /* response header too small to contain a valid response header */ rc = IFD_ERROR_COMM_ERROR; goto out; } /* interpret the response header */ if (PS_HEADER != buffer[PS_HEADER_IDX]) { /* receive error */ rc = IFD_ERROR_COMM_ERROR; goto out; } /* decode status word */ status = buffer[PS_STATUS_IDX]; if (ct_config.debug >= 1) ct_debug("ps_receive_from_ifd: status = %#02x, %s\n", status, ps_get_status_string(status)); switch (status) { case PS_SUCCESS: break; case PS_SLOTERROR_ICC_NOT_INSERTED: rc = IFD_ERROR_NO_CARD; goto out; case PS_SLOTERROR_XFE_OVERRUN: case PS_SLOTERROR_XFE_PARITY_ERROR: rc = IFD_ERROR_COMM_ERROR; goto out; default: rc = IFD_ERROR_GENERIC; goto out; } /* decode data length */ data_len = (buffer[PS_RESPONSE_LENGTH0_IDX] << 8) | buffer[PS_RESPONSE_LENGTH1_IDX]; if (data_len > rlen) { rc = IFD_ERROR_BUFFER_TOO_SMALL; goto out; } if (data_len > 0) { size_t remaining; /* copy data from first packet */ received = rc - PS_RESPONSE_DATA_IDX; if (received > 0) { memcpy(rbuf, &buffer[PS_RESPONSE_DATA_IDX], received); } /* receive the remaining data */ remaining = data_len - received; rc = ps_if_transmission_receive(dev, &rbuf[received], remaining); if (rc < 0) goto out; received += rc; if (received != data_len) { rc = IFD_ERROR_COMM_ERROR; goto out; } } /* return the length of received data */ rc = received; out: memset(buffer, 0, buffer_len); if (rc < 0) { ps_if_transmission_flush_reader_output_buffer(dev); device_data->if_state = ERROR; ct_error("ps_receive_from_ifd: failed: %i", rc); } else { if (ct_config.debug >= 3) ct_debug("ps_if_transmission_receive: " "received %u bytes:%s", rc, ct_hexdump(rbuf, rc)); } return rc; } /* * Send an command and receive the response. */ static int ps_transceive_instruction(ifd_reader_t * reader, ps_instruction_t instruction, const unsigned char *sbuf, size_t slen, unsigned char *rbuf, size_t rlen) { int rc = IFD_SUCCESS; ifd_device_t *dev = NULL; if (ct_config.debug >= 1) ct_debug("ps_transceive_instruction: called"); dev = reader->device; if (rc == IFD_SUCCESS) { /* start the transmission */ rc = ps_if_transmission_start(dev, dev->timeout); if (IFD_SUCCESS == rc) { /* send the data */ rc = ps_send_to_ifd(reader, instruction, sbuf, slen); if (rc >= 0) { /* receive the data from the reader */ rc = ps_receive_from_ifd(reader, rbuf, rlen); } ps_if_transmission_end(dev); } } if (rc < 0) ct_error("ps_transceive_instruction: failed: %i", rc); return rc; } /* * Activate the reader. */ static int ps_activate(ifd_reader_t * reader) { if (ct_config.debug >= 1) ct_debug("ps_activate: called"); return IFD_SUCCESS; } /* * Deactivate the reader. */ static int ps_deactivate(ifd_reader_t * reader) { int rc; if (ct_config.debug >= 1) ct_debug("ps_deactivate: called"); rc = ps_transceive_instruction(reader, PS_POWER_OFF, NULL, 0, NULL, 0); if (rc < 0) { ct_error("ps_deactivate: failed: %i", rc); } return rc; } /* * Get the current reader status. */ static int ps_get_stat(ifd_reader_t * reader, ps_stat_t * stat) { int rc; unsigned char buffer[16]; unsigned char *p; if (ct_config.debug >= 1) ct_debug("ps_get_stat: called"); rc = ps_transceive_instruction(reader, PS_GET_ACR_STAT, NULL, 0, buffer, sizeof(buffer)); if (rc < 0 ) goto failed; if (rc < sizeof(buffer)) { rc = IFD_ERROR_COMM_ERROR; goto failed; } for (p = buffer; p < (buffer + sizeof(stat->internal)); p++) { stat->internal[p - buffer] = *p; } stat->max_c = *p++; stat->max_r = *p++; stat->c_type = *p++ << 8; stat->c_type |= *p++; stat->c_sel = *p++; stat->c_stat = *p++; return IFD_SUCCESS; failed: ct_error("ps_get_stat: failed: %i", rc); return rc; } /* * Get the current card status. */ static int ps_card_status(ifd_reader_t * reader, int slot, int *status) { int rc; ifd_device_t *dev; ps_device_data_t *device_data; ps_card_status_t card_status; int status_tmp = 0; if (ct_config.debug >= 1) ct_debug("ps_card_status: called"); if (slot != 0) { ct_error("ps_card_status: bad slot index %u", slot); return IFD_ERROR_INVALID_SLOT; } dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; card_status = device_data->card_status; if (card_status == PS_CARD_UNKNOWN) { ps_stat_t stat; /* ask the current status to the reader */ memset(&stat, 0, sizeof(stat)); rc = ps_get_stat(reader, &stat); if (rc >= 0) { if (stat.c_stat) { device_data->card_status = PS_CARD_INSERTED; status_tmp = IFD_CARD_STATUS_CHANGED; } else { device_data->card_status = PS_CARD_NOT_INSERTED; } } } else { unsigned char packet_buf[PS_INTERRUPT_URB_DATA_SIZE]; const size_t packet_buf_len = sizeof(packet_buf); /* read notifications received from the reader */ for (;;) { int inserted = FALSE; rc = ifd_usb_capture(dev, device_data->capture, packet_buf, packet_buf_len, PS_INTERRUPT_TIMEOUT); if (IFD_ERROR_TIMEOUT == rc) { rc = IFD_SUCCESS; break; } if (rc < 0) break; if (0 == memcmp(packet_buf, PS_CARD_INSERTED_NOTIFICATION, sizeof(PS_CARD_INSERTED_NOTIFICATION))) { inserted = TRUE; } else if (0 != memcmp(packet_buf, PS_CARD_REMOVED_NOTIFICATION, sizeof (PS_CARD_REMOVED_NOTIFICATION))) { continue; } if (inserted) { if (device_data->card_status != PS_CARD_INSERTED) { device_data->card_status = PS_CARD_INSERTED; status_tmp = IFD_CARD_STATUS_CHANGED; } } else { if (device_data->card_status != PS_CARD_NOT_INSERTED) { device_data->card_status = PS_CARD_NOT_INSERTED; status_tmp = IFD_CARD_STATUS_CHANGED; } } } } if (rc < 0) { if (ct_config.debug >= 1) ct_debug("ps_card_status: failed: %i", rc); } else { if (device_data->card_status == PS_CARD_INSERTED) { status_tmp |= IFD_CARD_PRESENT; } *status = status_tmp; } return rc; } /* * Reset card and select the protocol */ static int ps_card_reset_select_protocol(ifd_reader_t * reader, int nslot, void *atr, size_t size, int new_icc_proto) { int rc; int atr_len; unsigned char sbuf[1]; ifd_device_t *dev; ps_device_data_t *device_data; ifd_slot_t *slot; ifd_atr_info_t atr_info; if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: called"); if (nslot != 0) { ct_error("ps_card_reset_select_protocol: bad slot index %u", nslot); return IFD_ERROR_INVALID_SLOT; } dev = reader->device; slot = &reader->slot[nslot]; device_data = (ps_device_data_t *) dev->user_data; /* protocol changed? */ if (NULL == slot->proto || device_data->cur_icc_proto != new_icc_proto) { switch (new_icc_proto) { case IFD_PROTOCOL_DEFAULT: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "using automatic protocol selection"); sbuf[0] = PS_AUTO_T0_OR_T1_CARD_TYPE; break; case IFD_PROTOCOL_T0: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "selecting protocol T0"); sbuf[0] = PS_T0_CARD_TYPE; break; case IFD_PROTOCOL_T1: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "selecting protocol T1"); sbuf[0] = PS_T1_CARD_TYPE; break; default: ct_error("ps_card_reset_select_protocol: unknow or " "unsupported protocol %i", new_icc_proto); return IFD_ERROR_NOT_SUPPORTED; } /* power off the card, the reader does PPS negotiation after the next power up */ rc = ps_transceive_instruction(reader, PS_POWER_OFF, NULL, 0, NULL, 0); if (IFD_SUCCESS != rc) { ct_error("ps_card_reset_select_protocol: " "failed (PS_POWER_OF): %i", rc); return rc; } rc = ps_transceive_instruction(reader, PS_SELECT_CARD_TYPE, sbuf, sizeof(sbuf), NULL, 0); if (IFD_SUCCESS != rc) { ct_error("ps_card_reset_select_protocol: " "error selecting card type %#02x", sbuf[0]); return rc; } } /* power up the card */ rc = ps_transceive_instruction(reader, PS_RESET, NULL, 0, atr, size); if (rc < 0) { ct_error("ps_card_reset_select_protocol: failed (PS_RESET): %i", rc); return rc; } atr_len = rc; { int status; ps_card_status(reader, nslot, &status); } /* the reader did PPS negotiation with the card parse the atr to check the protocol negotiated by the reader */ rc = ifd_atr_parse(&atr_info, atr, atr_len); if (rc < 0) { ct_error("ps_card_reset_select_protocol: %s: Bad ATR", reader->name); return rc; } if (-1 != atr_info.TA[1]) { /* specific mode */ if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "card in specific mode %#02x", atr_info.TA[1] & 0x0f); new_icc_proto = atr_info.TA[1] & 0x0f; } else if (IFD_PROTOCOL_DEFAULT == new_icc_proto) { new_icc_proto = atr_info.default_protocol; } else if (!(atr_info.supported_protocols & (1 << new_icc_proto))) { ct_error("Protocol not supported by card (according to ATR)"); return IFD_ERROR_NOT_SUPPORTED; } if (NULL == slot->proto || device_data->cur_icc_proto != new_icc_proto) { if (NULL != slot->proto) { ifd_protocol_free(slot->proto); } slot->proto = ifd_protocol_new(new_icc_proto, reader, slot->dad); if (slot->proto == NULL) { ct_error("ps_cart_reset_select_protocol: " "ifd_protocol_new"); return IFD_ERROR_GENERIC; } /* set protocol parameters */ switch (new_icc_proto) { case IFD_PROTOCOL_T0: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "using protocol T0"); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 1); break; case IFD_PROTOCOL_T1: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "using protocol T1"); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 1); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSC, (atr_info.TA[2] != -1) ? atr_info. TA[2] : PS_DEFAULT_T1_IFSC); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSD, PS_MAX_T1_IFSD); break; default: ct_error("ps_card_reset_select_protocol: " "protocol not supported %#02x", atr_info.default_protocol); return IFD_ERROR_NOT_SUPPORTED; } /* save protocol info */ device_data->cur_icc_proto = new_icc_proto; } return atr_len; } /* * Reset card */ static int ps_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev; ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_card_reset: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; return ps_card_reset_select_protocol(reader, slot, atr, size, device_data->cur_icc_proto); } /* * Select a protocol for communication with the ICC. */ static int ps_set_protocol(ifd_reader_t * reader, int nslot, int proto) { int rc; ifd_device_t *dev; ps_device_data_t *device_data; ifd_slot_t *slot; if (ct_config.debug >= 1) ct_debug("ps_set_protocol: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; slot = &reader->slot[nslot]; if (NULL == slot->proto || device_data->cur_icc_proto != proto) { /* the reader negotiates the protocol during the card power up must power down and reset the card to change it */ rc = ps_card_reset_select_protocol(reader, nslot, slot->atr, sizeof(slot->atr), proto); if (rc >= IFD_SUCCESS) { slot->atr_len = rc; rc = IFD_SUCCESS; } else { memset(slot->atr, 0, sizeof(slot->atr)); slot->atr_len = 0; } } else { rc = IFD_SUCCESS; } return rc; } /* * Send an apdu to reader. */ static int ps_apdu_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *sbuf, size_t slen) { int rc; ifd_device_t *dev; ps_device_data_t *device_data; ps_instruction_t instruction; if (ct_config.debug >= 1) ct_debug("ps_apdu_send: called"); if (ct_config.debug >= 3) ct_debug("ps_apdu_send: sending %i: %s", slen, ct_hexdump(sbuf, slen)); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; switch (device_data->cur_icc_proto) { case IFD_PROTOCOL_T0: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: using EXCHANGE_TPDU_T0"); instruction = PS_EXCHANGE_TPDU_T0; break; case IFD_PROTOCOL_T1: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: using EXCHANGE_TPDU_T1"); instruction = PS_EXCHANGE_TPDU_T1; break; default: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: unknow protocol"); return IFD_ERROR_GENERIC; } /* start the transmission */ rc = ps_if_transmission_start(dev, dev->timeout); if (IFD_SUCCESS == rc) { rc = ps_send_to_ifd(reader, instruction, sbuf, slen); } if (0 > rc) { ct_error("ps_apdu_send: error %i", rc); } return rc; } /* * Receive an apdu from reader. */ static int ps_apdu_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { int rc = IFD_SUCCESS; ifd_device_t *dev = NULL; ps_device_data_t *dev_data = NULL; if (ct_config.debug >= 1) ct_debug("ps_apdu_recv: called"); dev = reader->device; dev_data = (ps_device_data_t *) dev->user_data; rc = ps_receive_from_ifd(reader, buffer, len); if (rc < 0) { ct_error("ps_apdu_recv: failed"); } else { if (ct_config.debug >= 3) ct_debug("ps_apdu_recv: received %i bytes: %s", rc, ct_hexdump(buffer, rc)); } ps_if_transmission_end(dev); return rc; } /* * Initialize the device */ static int ps_open(ifd_reader_t * reader, const char *device_name) { int rc = IFD_SUCCESS; ifd_device_t *dev = NULL; ps_device_data_t *device_data = NULL; ifd_device_params_t params; unsigned char sbuf[1]; if (ct_config.debug >= 1) ct_debug("ps_open: called: device name =%s", device_name); dev = ifd_device_open(device_name); if (NULL == dev) { ct_error("ps_open: failed to open device: %", device_name); rc = IFD_ERROR_GENERIC; goto out; } switch (dev->type) { case IFD_DEVICE_TYPE_USB: reader->name = PS_USB_READER_NAME; break; default: ct_error("ps_open: unknow device type %i", dev->type); rc = IFD_ERROR_GENERIC; goto out; } /* set usb interface parameters */ params = dev->settings; params.usb.interface = PS_USB_INTERFACE_INDEX; params.usb.ep_intr = PS_USB_INTERRUPT_ENDPOINT_ADDRESS; params.usb.ep_o = PS_USB_BULK_OUTPUT_ENDPOINT_ADDRESS; params.usb.ep_i = PS_USB_BULK_INPUT_ENDPOINT_ADDRESS; rc = ifd_device_set_parameters(dev, ¶ms); if (IFD_SUCCESS > rc) { ct_error("ps_open: ifd_device_set_parameters returned error %i", rc); goto out; } device_data = (ps_device_data_t *) calloc(1, sizeof(*device_data)); if (NULL == device_data) { ct_error("ps_open: not enough memory"); rc = IFD_ERROR_NO_MEMORY; goto out; } memset(device_data, 0, sizeof(*device_data)); device_data->if_state = IDLE; device_data->card_status = PS_CARD_UNKNOWN; device_data->cur_icc_proto = IFD_PROTOCOL_DEFAULT; reader->nslots = 1; reader->device = dev; reader->device->user_data = device_data; reader->device->timeout = PS_BULK_TIMEOUT; /* set reader mode */ sbuf[0] = PS_OPTION_EMV_MODE_ON; rc = ps_transceive_instruction(reader, PS_SET_OPTION, sbuf, 1, NULL, 0); if (IFD_SUCCESS > rc) { ct_error("ps_open: error setting reader option"); goto out; } rc = ifd_usb_begin_capture(dev, IFD_USB_URB_TYPE_INTERRUPT, params.usb.ep_intr, PS_INTERRUPT_URB_DATA_SIZE, &(device_data->capture)); out: if (IFD_SUCCESS > rc && NULL != dev) { ifd_device_close(dev); } return rc; } /* * Free resources used by reader. */ static int ps_close(ifd_reader_t * reader) { ifd_device_t *dev; ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_close: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; ps_deactivate(reader); if (NULL != device_data->capture) { ifd_usb_end_capture(dev, device_data->capture); device_data->capture = NULL; } free(device_data); ifd_device_close(dev); return 0; } /* * Initialize this module */ void ifd_pertosmart_ac1038_register(void) { static struct ifd_driver_ops perto_smart_driver; perto_smart_driver.open = ps_open; perto_smart_driver.close = ps_close; perto_smart_driver.activate = ps_activate; perto_smart_driver.deactivate = ps_deactivate; perto_smart_driver.card_status = ps_card_status; perto_smart_driver.card_reset = ps_card_reset; perto_smart_driver.set_protocol = ps_set_protocol; perto_smart_driver.send = ps_apdu_send; perto_smart_driver.recv = ps_apdu_recv; ifd_driver_register("pertosmart1038", &perto_smart_driver); } openct-0.6.20/src/ifd/proto-gbp.c0000644000175000017500000002313510625650421013423 00000000000000/* * Implementation of the Gemplus Block Protocol. * This is a simpified version of T=1. The major * difference is that any command sends just *one* * block of data to the reader, and receives *one* * block only. * * Beware, entirely untested! * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include typedef struct { ifd_protocol_t base; int state; int block_oriented; unsigned char ns; unsigned int timeout, wtx; unsigned int retries; } gbp_state_t; #define GBP_I_BLOCK 0x00 #define GBP_R_BLOCK 0x80 #define GBP_S_BLOCK 0xC0 #define GBP_MORE_BLOCKS 0x20 /* I block */ #define GBP_I_SEQ_SHIFT 6 /* R block */ #define GBP_IS_ERROR(pcb) ((pcb) & 0x0F) #define GBP_EDC_ERROR 0x01 #define GBP_OTHER_ERROR 0x02 #define GBP_R_SEQ_SHIFT 4 /* S block stuff */ #define GBP_S_IS_RESPONSE(pcb) ((pcb) & GBP_S_RESPONSE) #define GBP_S_TYPE(pcb) ((pcb) & 0x0F) #define GBP_S_RESPONSE 0x20 #define GBP_S_RESYNC 0x00 #define GBP_S_IFS 0x01 #define GBP_S_ABORT 0x02 #define GBP_S_WTX 0x03 #define GBP_BUFFER_SIZE (3 + 256 + 2) /* internal state, do not mess with it. */ /* should be != DEAD after reset/init */ enum { ALIVE, RESYNCH, DEAD }; static unsigned int gbp_block_type(unsigned char); static unsigned int gbp_seq(unsigned char); static unsigned int gbp_build(gbp_state_t *, unsigned char *, unsigned char, ct_buf_t *); static unsigned int gbp_compute_checksum(gbp_state_t *, unsigned char *, size_t); static int gbp_verify_checksum(gbp_state_t *, unsigned char *, size_t); static int gbp_xcv(gbp_state_t *, unsigned char *, size_t, size_t); /* * Set default GBP protocol parameters */ static void gbp_set_defaults(gbp_state_t * gp) { gp->retries = 3; /* This timeout is rather insane, but we need this right now * to support cryptoflex keygen */ gp->timeout = 20000; gp->ns = 0; } /* * Attach GBP protocol */ static int gbp_init(ifd_protocol_t * prot) { gbp_state_t *gp = (gbp_state_t *) prot; gbp_set_defaults(gp); /* If the device is attached through USB etc, assume the * device will do the framing for us */ if (prot->reader->device->type != IFD_DEVICE_TYPE_SERIAL) gp->block_oriented = 1; return 0; } /* * Detach gp protocol */ static void gbp_release(ifd_protocol_t * prot) { /* NOP */ } /* * Get/set parmaters for T1 protocol */ static int gbp_set_param(ifd_protocol_t * prot, int type, long value) { gbp_state_t *gp = (gbp_state_t *) prot; switch (type) { case IFD_PROTOCOL_RECV_TIMEOUT: gp->timeout = value; break; case IFD_PROTOCOL_BLOCK_ORIENTED: gp->block_oriented = value; break; default: ct_error("Unsupported parameter %d", type); return -1; } return 0; } static int gbp_get_param(ifd_protocol_t * prot, int type, long *result) { gbp_state_t *gp = (gbp_state_t *) prot; long value; switch (type) { case IFD_PROTOCOL_RECV_TIMEOUT: value = gp->timeout; break; case IFD_PROTOCOL_BLOCK_ORIENTED: value = gp->block_oriented; break; default: ct_error("Unsupported parameter %d", type); return -1; } if (result) *result = value; return 0; } /* * Send an APDU through GBP */ static int gbp_transceive(ifd_protocol_t * prot, int dad, const void *snd_buf, size_t snd_len, void *rcv_buf, size_t rcv_len) { gbp_state_t *gp = (gbp_state_t *) prot; ct_buf_t sbuf, rbuf; unsigned char sdata[GBP_BUFFER_SIZE]; unsigned int slen, retries, resyncs; unsigned char send_seq; if (snd_len == 0 || snd_len > 255) { ct_error("GBP: invalid packet length %u\n", snd_len); return -1; } retries = gp->retries; resyncs = 3; /* Initialize send/recv buffer */ ct_buf_set(&sbuf, (void *)snd_buf, snd_len); ct_buf_init(&rbuf, rcv_buf, rcv_len); /* Send the first block */ slen = gbp_build(gp, sdata, GBP_I_BLOCK, &sbuf); send_seq = gp->ns; if (gp->state == DEAD) { gp->ns = 0; slen = gbp_build(gp, sdata, GBP_S_BLOCK | GBP_S_RESYNC, NULL); gp->state = RESYNCH; } while (1) { unsigned char pcb; int n; if (retries-- == 0) goto resync; if ((n = gbp_xcv(gp, sdata, slen, sizeof(sdata))) < 0) { ifd_debug(1, "fatal: transmit/receive failed"); gp->state = DEAD; goto error; } if (!gbp_verify_checksum(gp, sdata, n)) { ifd_debug(1, "checksum failed"); slen = gbp_build(gp, sdata, GBP_R_BLOCK | GBP_EDC_ERROR, NULL); continue; } pcb = sdata[1]; switch (gbp_block_type(pcb)) { case GBP_I_BLOCK: /* I-Block means "Information" - this is the response from * the card. */ if (gbp_seq(pcb) != send_seq) { /* If the block sent by the card doesn't match * what we expected it to send, reply with * an R block */ slen = gbp_build(gp, sdata, GBP_R_BLOCK | GBP_OTHER_ERROR, NULL); continue; } /* Advance to next seq nr */ gp->ns ^= 1; if (ct_buf_put(&rbuf, sdata + 3, sdata[2]) < 0) goto error; goto done; case GBP_R_BLOCK: /* R-Block means "Repeat" */ if (gbp_seq(pcb) != gp->ns) { slen = gbp_build(gp, sdata, GBP_R_BLOCK | GBP_OTHER_ERROR, NULL); continue; } ifd_debug(1, "received R block%s%s", (pcb & GBP_EDC_ERROR) ? ", EDC error" : "", (pcb & GBP_OTHER_ERROR) ? ", other error" : ""); /* Retransmit block */ slen = gbp_build(gp, sdata, GBP_I_BLOCK, &sbuf); break; case GBP_S_BLOCK: if (GBP_S_IS_RESPONSE(pcb) && gp->state == RESYNCH) { gp->state = ALIVE; resyncs = 3; retries = gp->retries; slen = gbp_build(gp, sdata, GBP_I_BLOCK, &sbuf); continue; } ifd_debug(1, "unexpected S block from reader\n"); goto resync; } /* Everything went just splendid */ retries = gp->retries; continue; resync: /* the number or resyncs is limited, too */ if (resyncs == 0) goto error; resyncs--; gp->ns = 0; slen = gbp_build(gp, sdata, GBP_S_BLOCK | GBP_S_RESYNC, NULL); gp->state = RESYNCH; continue; } done: return ct_buf_avail(&rbuf); error: gp->state = DEAD; return -1; } static int gbp_resynchronize(ifd_protocol_t * p, int nad) { gbp_state_t *gp = (gbp_state_t *) p; unsigned char block[4]; unsigned int retries = 3; if (p->reader && p->reader->device) ifd_device_flush(p->reader->device); while (retries--) { gp->ns = 0; block[0] = nad; block[1] = GBP_S_BLOCK | GBP_S_RESYNC; block[2] = 0; gbp_compute_checksum(gp, block, 3); if (gbp_xcv(gp, block, 4, sizeof(block)) != 4) { ifd_debug(1, "fatal: transmit/receive failed"); break; } if (!gbp_verify_checksum(gp, block, 4)) { ifd_debug(1, "checksum failed"); continue; } if (block[1] == (GBP_S_BLOCK | GBP_S_RESPONSE | GBP_S_RESYNC)) { gp->state = ALIVE; return 0; } } gp->state = DEAD; return -1; } static unsigned gbp_block_type(unsigned char pcb) { switch (pcb & 0xC0) { case GBP_R_BLOCK: return GBP_R_BLOCK; case GBP_S_BLOCK: return GBP_S_BLOCK; default: return GBP_I_BLOCK; } } static unsigned int gbp_seq(unsigned char pcb) { switch (pcb & 0xC0) { case GBP_R_BLOCK: return (pcb >> GBP_R_SEQ_SHIFT) & 1; case GBP_S_BLOCK: return 0; default: return (pcb >> GBP_I_SEQ_SHIFT) & 1; } } static unsigned int gbp_build(gbp_state_t * gp, unsigned char *block, unsigned char pcb, ct_buf_t * bp) { unsigned int len; len = bp ? ct_buf_avail(bp) : 0; /* Add the sequence number */ switch (gbp_block_type(pcb)) { case GBP_R_BLOCK: pcb |= gp->ns << GBP_R_SEQ_SHIFT; break; case GBP_I_BLOCK: pcb |= gp->ns << GBP_I_SEQ_SHIFT; break; } block[0] = 0x42; block[1] = pcb; block[2] = len; if (len) memcpy(block + 3, ct_buf_head(bp), len); return gbp_compute_checksum(gp, block, len + 3); } /* * Protocol struct */ struct ifd_protocol_ops ifd_protocol_gbp = { IFD_PROTOCOL_GBP, /* id */ "GBP", /* name */ sizeof(gbp_state_t), /* size */ gbp_init, /* init */ gbp_release, /* release */ gbp_set_param, /* set_param */ gbp_get_param, /* get_param */ gbp_resynchronize, /* resynchronize */ gbp_transceive, /* transceive */ NULL, /* sync_read */ NULL, /* sync_write */ }; /* * Build/verify checksum */ static unsigned int gbp_compute_checksum(gbp_state_t * gp, unsigned char *data, size_t len) { csum_lrc_compute(data, len, data + len); return len + 1; } static int gbp_verify_checksum(gbp_state_t * gp, unsigned char *rbuf, size_t len) { unsigned char csum; csum_lrc_compute(rbuf, len, &csum); return csum == 0; } /* * Send/receive block */ static int gbp_xcv(gbp_state_t * gp, unsigned char *block, size_t slen, size_t rmax) { ifd_protocol_t *prot = &gp->base; ifd_device_t *dev = prot->reader->device; unsigned int rlen, timeout; int n, m; if (ct_config.debug >= 3) ifd_debug(3, "sending %s", ct_hexdump(block, slen)); n = ifd_device_send(dev, block, slen); if (n < 0) return n; rlen = 3 + 256 + 1; /* timeout. For now our WTX treatment is very dumb */ timeout = gp->timeout + 1000 * gp->wtx; gp->wtx = 0; if (gp->block_oriented) { /* Note - Linux USB seems to have an off by one error, you * actually need the + 1 to get the RC byte */ rlen++; if (rlen < rmax) rmax = rlen; /* Get the response en bloc */ n = ifd_device_recv(dev, block, rmax, timeout); if (n >= 0) { m = block[2] + 3 + 1; if (m < n) n = m; } } else { /* Get the header */ if (ifd_device_recv(dev, block, 3, timeout) < 0) return -1; n = block[2] + 1; if (n + 3 > rmax || block[2] >= 254) { ct_error("receive buffer too small"); return -1; } /* Now get the rest */ if (ifd_device_recv(dev, block + 3, n, gp->timeout) < 0) return -1; n += 3; } if (n >= 0 && ct_config.debug >= 3) ifd_debug(3, "received %s", ct_hexdump(block, n)); return n; } openct-0.6.20/src/ifd/ifd-ikey2k.c0000644000175000017500000001117310625650421013447 00000000000000/* * driver for Rainbow iKey 2032 devices * * Copyright (C) 2003, Andreas Jellinghaus * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include /* * Initialize the device */ static int ikey2k_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; reader->name = "Rainbow iKey 2032"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("ikey2k: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("ikey2k: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; return 0; } /* * Power up the reader */ static int ikey2k_activate(ifd_reader_t * reader) { return 0; } static int ikey2k_deactivate(ifd_reader_t * reader) { return -1; } /* * Card status - always present */ static int ikey2k_card_status(ifd_reader_t * reader, int slot, int *status) { *status = IFD_CARD_PRESENT; return 0; } /* * Reset - nothing to be done? * We should do something to make it come back with all state zapped */ static int ikey2k_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[256]; int rc, atrlen; static unsigned char expect5[] = { 0x0d, 0x63, 0x00, 0x00, 0x2d, 0x2d, 0xc0, 0x80, 0x80, 0x60, 0x80, 0x01, 0x19 }; if (ifd_usb_control(dev, 0xc1, 0x00, 0, 0, buffer, 0x40, -1) != 13) goto failed; /* we've seen values of 0x03, 0x05 and 0x06 in position 3, and * since we don't know what they mean, we mask them here. */ buffer[3] &= 0xF0; if (memcmp(buffer, expect5, sizeof(expect5)) != 0 || ifd_usb_control(dev, 0x41, 0x16, 0, 0, buffer, 00, -1) != 0 || ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 02, -1) != 1 || buffer[0] != 00) goto failed; rc = ifd_usb_control(dev, 0x41, 0x16, 0x1901, 0, buffer, 0, 1000); if (rc < 0) goto failed; rc = ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 0x19, 1000); if (rc != 25) goto failed; rc = ifd_usb_control(dev, 0x41, 0x16, 0, 0, buffer, 0x0, 1000); if (rc != 0) goto failed; rc = ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 0x02, 1000); if (rc != 1 || buffer[0] != 0) goto failed; rc = ifd_usb_control(dev, 0x41, 0x16, 0, 0, buffer, 0x0, 1000); if (rc != 0) goto failed; rc = ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 0x20, 1000); if (rc != 1 || buffer[0] != 0) goto failed; rc = ifd_usb_control(dev, 0x41, 0x16, 0x1901, 0, buffer, 0, 1000); if (rc < 0) goto failed; rc = ifd_usb_control(dev, 0xc1, 0x01, 0, 0, buffer, 0x19, 1000); if (rc != 25) goto failed; /* yes, this is _currently_ dead code, as IFD_MAX_ATR_LEN * is higher than 25 ... */ if (rc > IFD_MAX_ATR_LEN) goto failed; atrlen = rc; memcpy(atr, buffer, atrlen); return atrlen; failed: ct_error("ikey2k: failed to activate token"); return -1; } /* * Select a protocol. We override this function to be able to set the T=1 IFSC */ static int ikey2k_set_protocol(ifd_reader_t * reader, int nslot, int proto) { ifd_slot_t *slot = &reader->slot[nslot]; int r; if (!(slot->proto = ifd_protocol_new(proto, reader, slot->dad))) return -1; if (proto == IFD_PROTOCOL_T1) { r = ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSC, 256); if (r < 0) return r; } return 0; } /* * Send/receive routines */ static int ikey2k_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { int value, idx; value = buffer[1] << 8 | buffer[0]; idx = buffer[3] << 8 | buffer[2]; return ifd_usb_control(reader->device, 0x41, 0x17, value, idx, (void *)&buffer[4], len - 4, -1); } static int ikey2k_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { return ifd_usb_control(reader->device, 0xc1, 0x01, 0, 0, buffer, 255, timeout); } /* * Driver operations */ static struct ifd_driver_ops ikey2k_driver; /* * Initialize this module */ void ifd_ikey2k_register(void) { ikey2k_driver.open = ikey2k_open; ikey2k_driver.activate = ikey2k_activate; ikey2k_driver.deactivate = ikey2k_deactivate; ikey2k_driver.card_status = ikey2k_card_status; ikey2k_driver.card_reset = ikey2k_card_reset; ikey2k_driver.set_protocol = ikey2k_set_protocol; ikey2k_driver.send = ikey2k_send; ikey2k_driver.recv = ikey2k_recv; ifd_driver_register("ikey2k", &ikey2k_driver); } openct-0.6.20/src/ifd/sys-null.c0000644000175000017500000000446411151454644013310 00000000000000/* * A void implementation for any platform * * Copyright (C) 2003 Olaf Kirch * * These functions need to be re-implemented for every * new platform. */ #include "internal.h" #if !defined(sun) && !defined (__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__FreeBSD_kernel__) && !defined(__linux__) && !defined(__APPLE__) && !defined(__DragonFly__) #include #include #include /* * USB handling */ int ifd_sysdep_usb_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { #if 0 if (pfd->revents & POLLHUP) return 0; pfd->fd = dev->fd; pfd->events = POLLHUP; return 1; #else return -1; #endif } int ifd_sysdep_usb_get_eventfd(ifd_device_t * dev, short *events) { return -1; } int ifd_sysdep_usb_control(ifd_device_t * dev, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len, long timeout) { return -1; } int ifd_sysdep_usb_set_configuration(ifd_device_t * dev, int config) { return -1; } int ifd_sysdep_usb_set_interface(ifd_device_t * dev, int ifc, int alt) { return -1; } int ifd_sysdep_usb_claim_interface(ifd_device_t * dev, int interface) { return -1; } int ifd_sysdep_usb_release_interface(ifd_device_t * dev, int interface) { return -1; } /* * USB bulk transfer */ int ifd_sysdep_usb_bulk(ifd_device_t * dev, int ep, void *buffer, size_t len, long timeout) { return -1; } /* * USB URB capture */ struct ifd_usb_capture { int type; int endpoint; size_t maxpacket; unsigned int interface; }; int ifd_sysdep_usb_begin_capture(ifd_device_t * dev, int type, int endpoint, size_t maxpacket, ifd_usb_capture_t ** capret) { return -1; } int ifd_sysdep_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len) { return IFD_ERROR_NOT_SUPPORTED; } int ifd_sysdep_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len, long timeout) { return -1; } int ifd_sysdep_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap) { return -1; } int ifd_sysdep_usb_open(const char *device) { return -1; } int ifd_sysdep_usb_reset(ifd_device_t * dev) { return -1; } /* * Scan all usb devices to see if there is one we support */ int ifd_scan_usb(void) { return 0; } #endif openct-0.6.20/src/ifd/locks.c0000644000175000017500000000530210422076714012623 00000000000000/* * Locking functions - these are somewhat simplified * by the fact that we have one manager process per reader, * so we don't have to worry about different readers here, * just different slots. * * Copyright (C) 2003 Olaf Kirch * * FIXME - prevent denial of service from clients allocating * huge numbers of locks. There should be a maximum of one shared * and one exclusive lock per client. */ #include "internal.h" #include #include "ifdhandler.h" typedef struct ct_lock { struct ct_lock *next; unsigned int slot; uid_t uid; ct_lock_handle handle; ct_socket_t *owner; int exclusive; } ct_lock_t; static ct_lock_t *locks; static unsigned int lock_handle = 0; /* * Try to establish a lock */ int ifdhandler_lock(ct_socket_t * sock, int slot, int type, ct_lock_handle * res) { ct_lock_t *l; int rc; /* See if we have a locking conflict */ if ((rc = ifdhandler_check_lock(sock, slot, type)) < 0) return rc; /* No conflict - grant lock and record this fact */ l = (ct_lock_t *) calloc(1, sizeof(*l)); if (!l) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } l->exclusive = (type == IFD_LOCK_EXCLUSIVE); l->uid = sock->client_uid; l->handle = lock_handle++; l->owner = sock; l->slot = slot; l->next = locks; locks = l; ifd_debug(1, "granted %s lock %u for slot %u by uid=%u", l->exclusive ? "excl" : "shared", l->handle, l->slot, l->uid); *res = l->handle; return 0; } /* * Check if a slot is locked by someone else */ int ifdhandler_check_lock(ct_socket_t * sock, int slot, int type) { ct_lock_t *l; for (l = locks; l; l = l->next) { if (l->slot != slot) continue; if (l->owner == sock) continue; if (l->exclusive || type == IFD_LOCK_EXCLUSIVE || l->uid != sock->client_uid) return IFD_ERROR_LOCKED; } return 0; } /* * Release a lock */ int ifdhandler_unlock(ct_socket_t * sock, int slot, ct_lock_handle handle) { ct_lock_t *l, **lp; for (lp = &locks; (l = *lp) != NULL; lp = &l->next) { if (l->owner == sock && l->slot == slot && l->handle == handle) { ifd_debug(1, "released %s lock %u for slot %u by uid=%u", l->exclusive ? "excl" : "shared", l->handle, l->slot, l->uid); *lp = l->next; free(l); return 0; } } return IFD_ERROR_NOLOCK; } /* * Release all locks held by a client * (called when the client socket is closed) */ void ifdhandler_unlock_all(ct_socket_t * sock) { ct_lock_t *l, **lp; lp = &locks; while ((l = *lp) != NULL) { if (l->owner == sock) { ifd_debug(1, "released %s lock %u for slot %u by uid=%u", l->exclusive ? "excl" : "shared", l->handle, l->slot, l->uid); *lp = l->next; free(l); } else { lp = &l->next; } } } openct-0.6.20/src/ifd/init.c0000644000175000017500000000507611125447432012463 00000000000000/* * Initialize the library * * Copyright (C) 2003 Olaf Kirch */ #include "internal.h" #include #include static int configure_driver(ifd_conf_node_t * cf); int ifd_init(void) { unsigned int ival; char *sval; ifd_conf_node_t **nodes; int i, n; /* initialize ltdl */ i = lt_dlinit(); if (i != 0) ct_error("lt_dlinit returned %d", i); /* Register built-in drivers */ ifd_acr30u_register(); ifd_cardman_register(); ifd_cm4000_register(); ifd_egate_register(); ifd_epass3k_register(); ifd_etoken_register(); ifd_etoken64_register(); ifd_eutron_register(); ifd_gempc_register(); ifd_ikey2k_register(); ifd_ikey3k_register(); ifd_kaan_register(); ifd_pertosmart_ac1030_register(); ifd_pertosmart_ac1038_register(); ifd_smartboard_register(); ifd_smph_register(); ifd_starkey_register(); ifd_towitoko_register(); ifd_rutoken_register(); /* ifd_wbeiuu_register(); driver not working yet */ ifd_cyberjack_register(); /* ccid last */ ifd_ccid_register(); /* Register all builtin protocols */ ifd_protocol_register(&ifd_protocol_t0); ifd_protocol_register(&ifd_protocol_t1); ifd_protocol_register(&ifd_protocol_gbp); ifd_protocol_register(&ifd_protocol_trans); ifd_protocol_register(&ifd_protocol_i2c_short); ifd_protocol_register(&ifd_protocol_i2c_long); ifd_protocol_register(&ifd_protocol_2wire); ifd_protocol_register(&ifd_protocol_3wire); ifd_protocol_register(&ifd_protocol_eurochip); ifd_protocol_register(&ifd_protocol_esc); if (ifd_conf_get_integer("debug", &ival) >= 0 && ival > ct_config.debug) ct_config.debug = ival; if (ifd_conf_get_string("ifdhandler.program", &sval) >= 0) ct_config.ifdhandler = sval; /* Register all driver information (use hotplug ids) */ n = ifd_conf_get_nodes("driver", NULL, 0); if (n >= 0) { nodes = (ifd_conf_node_t **) calloc(n, sizeof(*nodes)); if (!nodes) { ct_error("out of memory"); return 1; } n = ifd_conf_get_nodes("driver", nodes, n); for (i = 0; i < n; i++) { if (configure_driver(nodes[i])) { free(nodes); return 1; } } free(nodes); } return 0; } /* * Configure a reader driver */ static int configure_driver(ifd_conf_node_t * cf) { const char *driver; char **ids; int j, n; if (!(driver = cf->value)) return 1; if ((n = ifd_conf_node_get_string_list(cf, "ids", NULL, 0)) >= 0) { ids = (char **)calloc(n, sizeof(char *)); if (!ids) { ct_error("out of memory"); return 1; } n = ifd_conf_node_get_string_list(cf, "ids", ids, n); for (j = 0; j < n; j++) ifd_driver_add_id(ids[j], driver); free(ids); } return 0; } openct-0.6.20/src/ifd/internal.h0000644000175000017500000001551711233772200013334 00000000000000/* * Core functions of the IFD handler library * * Copyright (C) 2003, Olaf Kirch */ #ifndef IFD_INTERNAL_H #define IFD_INTERNAL_H #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #include #include #include #include #include #include #include #include struct ifd_device { char *name; int type; long timeout; unsigned int hotplug:1; int fd; void *dev; /* use instead of fd, if no fd available for implementation */ ifd_device_params_t settings; struct ifd_device_ops *ops; void *user_data; /* per-device data may follow */ unsigned int etu; /* XXX: unnecessary? */ }; struct ifd_device_ops { /* Reset device */ int (*reset) (ifd_device_t *); int (*set_params) (ifd_device_t *, const ifd_device_params_t *); int (*get_params) (ifd_device_t *, ifd_device_params_t *); /* Flush any pending input */ void (*flush) (ifd_device_t *); void (*send_break) (ifd_device_t *, unsigned int); /* * Send/receive data. Some devices such as USB will support * the transceive command, others such as serial devices will * need to use send/recv */ int (*transceive) (ifd_device_t *, const void *, size_t, void *, size_t, long); int (*send) (ifd_device_t *, const unsigned char *, size_t); int (*recv) (ifd_device_t *, unsigned char *, size_t, long); int (*control) (ifd_device_t *, void *, size_t); void (*close) (ifd_device_t *); int (*get_eventfd) (ifd_device_t *, short *events); /* Poll for device presence. This function is called * prior to the poll call (with revents == 0), in this * case poll_presence is supposed to set up the poll * structure. * Then, it is called after poll() returns - in this case * it should check the contents of pollfd to find out * whether the device got removed. * * This is pretty much tailored for USB support, so * the addition of PCMCIA devices may cause this * to change. */ int (*poll_presence) (ifd_device_t *, struct pollfd *); }; struct ifd_protocol_ops { int id; const char *name; size_t size; int (*init) (ifd_protocol_t *); void (*release) (ifd_protocol_t *); int (*set_param) (ifd_protocol_t *, int, long); int (*get_param) (ifd_protocol_t *, int, long *); int (*resynchronize) (ifd_protocol_t *, int dad); int (*transceive) (ifd_protocol_t *, int dad, const void *, size_t, void *, size_t); int (*sync_read) (ifd_protocol_t *, int, unsigned short, unsigned char *, size_t); int (*sync_write) (ifd_protocol_t *, int, unsigned short, const unsigned char *, size_t); }; struct ifd_protocol { ifd_reader_t *reader; unsigned int dad; struct ifd_protocol_ops *ops; }; extern struct ifd_protocol_ops ifd_protocol_t1; extern struct ifd_protocol_ops ifd_protocol_t0; extern struct ifd_protocol_ops ifd_protocol_gbp; extern struct ifd_protocol_ops ifd_protocol_trans; extern struct ifd_protocol_ops ifd_protocol_i2c_short; extern struct ifd_protocol_ops ifd_protocol_i2c_long; extern struct ifd_protocol_ops ifd_protocol_2wire; extern struct ifd_protocol_ops ifd_protocol_3wire; extern struct ifd_protocol_ops ifd_protocol_eurochip; extern struct ifd_protocol_ops ifd_protocol_esc; extern void ifd_acr30u_register(void); extern void ifd_cardman_register(void); extern void ifd_ccid_register(void); extern void ifd_cm4000_register(void); extern void ifd_egate_register(void); extern void ifd_epass3k_register(void); extern void ifd_etoken_register(void); extern void ifd_etoken64_register(void); extern void ifd_eutron_register(void); extern void ifd_gempc_register(void); extern void ifd_ikey2k_register(void); extern void ifd_ikey3k_register(void); extern void ifd_kaan_register(void); extern void ifd_pertosmart_ac1030_register(void); extern void ifd_pertosmart_ac1038_register(void); extern void ifd_smartboard_register(void); extern void ifd_smph_register(void); extern void ifd_starkey_register(void); extern void ifd_towitoko_register(void); /* extern void ifd_wbeiuu_register(void); driver not working yet */ extern void ifd_cyberjack_register(void); extern void ifd_rutoken_register(void); /* reader.c */ extern int ifd_error(ifd_reader_t *); extern int ifd_event(ifd_reader_t *); extern int ifd_send_command(ifd_protocol_t *, const void *, size_t); extern int ifd_recv_response(ifd_protocol_t *, void *, size_t, long); /* driver.c */ extern unsigned int ifd_drivers_list(const char **, size_t); /* device.c */ extern ifd_device_t *ifd_open_pcmcia_block(const char *); extern ifd_device_t *ifd_open_pcmcia(const char *); extern ifd_device_t *ifd_open_psaux(const char *); extern ifd_device_t *ifd_open_remote(const char *); extern ifd_device_t *ifd_open_serial(const char *); extern ifd_device_t *ifd_open_usb(const char *); extern ifd_device_t *ifd_device_new(const char *, struct ifd_device_ops *, size_t); extern void ifd_device_free(ifd_device_t *); /* checksum.c */ extern unsigned int csum_lrc_compute(const uint8_t *, size_t, unsigned char *); extern unsigned int csum_crc_compute(const uint8_t *, size_t, unsigned char *); /* Internal system dependent device functions */ extern int ifd_sysdep_usb_poll_presence(ifd_device_t *, struct pollfd *); extern int ifd_sysdep_usb_get_eventfd(ifd_device_t *, short *events); extern int ifd_sysdep_usb_control(ifd_device_t *, unsigned int, unsigned int, unsigned int, unsigned int, void *, size_t, long); extern int ifd_sysdep_usb_bulk(ifd_device_t *, int, void *, size_t, long); extern int ifd_sysdep_usb_set_configuration(ifd_device_t *, int); extern int ifd_sysdep_usb_set_interface(ifd_device_t *, int, int); extern int ifd_sysdep_usb_claim_interface(ifd_device_t *, int); extern int ifd_sysdep_usb_release_interface(ifd_device_t *, int); extern int ifd_sysdep_usb_begin_capture(ifd_device_t *, int, int, size_t, ifd_usb_capture_t **); extern int ifd_sysdep_usb_capture_event(ifd_device_t *, ifd_usb_capture_t *, void *, size_t); extern int ifd_sysdep_usb_capture(ifd_device_t *, ifd_usb_capture_t *, void *, size_t, long); extern int ifd_sysdep_usb_end_capture(ifd_device_t *, ifd_usb_capture_t * cap); extern int ifd_sysdep_usb_open(const char *device); extern int ifd_sysdep_usb_reset(ifd_device_t *); /* module.c */ extern int ifd_load_module(const char *, const char *); /* utils.c */ extern void ifd_revert_bits(unsigned char *, size_t); extern unsigned int ifd_count_bits(unsigned int); extern long ifd_time_elapsed(struct timeval *); #ifndef HAVE_DAEMON extern int daemon(int, int); #endif /* protocol.c */ extern int ifd_protocol_register(struct ifd_protocol_ops *); extern int ifd_sync_detect_icc(ifd_reader_t *, int, void *, size_t); extern unsigned int ifd_protocols_list(const char **, unsigned int); /* proto-t1.c */ extern int t1_negotiate_ifsd(ifd_protocol_t *, unsigned int, int); #endif /* IFD_INTERNAL_H */ openct-0.6.20/src/ifd/driver.c0000644000175000017500000000720210422076714013004 00000000000000/** * @file * Generic driver functions. * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include struct ifd_driver_info { struct ifd_driver_info *next; ifd_driver_t driver; unsigned int nids; ifd_devid_t *id; }; static struct ifd_driver_info *list; /* * Find registered driver by name */ static struct ifd_driver_info *find_by_name(const char *name, int create) { struct ifd_driver_info *ip; for (ip = list; ip; ip = ip->next) { if (!strcmp(ip->driver.name, name)) return ip; } if (!create) return NULL; ip = (struct ifd_driver_info *)calloc(1, sizeof(*ip)); if (!ip) { ct_error("out of memory"); return NULL; } ip->driver.name = strdup(name); ip->next = list; list = ip; return ip; } /** * Register a driver. * * @param name Driver name. * @param ops Driver operations. */ void ifd_driver_register(const char *name, struct ifd_driver_ops *ops) { struct ifd_driver_info *ip; ip = find_by_name(name, 1); if (ip->driver.ops == NULL) ip->driver.ops = ops; } /** * Add a device ID to a driver. * * @param id Device ID. * @param name Driver name. * * Device which support plug-and-play can be mapped to drivers based on the * device ID. This function adds a device ID to a driver, so that the driver * can be looked-up at device detection time. The driver doesn't have to be * registered before calling this function. * * Device IDs start with the device type followed by a semi-colon and by a * device type specific ID. The following device types are supported: * * @li USB usb:vendor_id/device_id * * @return Error code <0 if failure. */ int ifd_driver_add_id(const char *id, const char *name) { struct ifd_driver_info *ip; ifd_debug(3, "ifd_driver_add_id(%s, %s)", id, name); ip = find_by_name(name, 1); if (!ip) return -1; ip->id = (ifd_devid_t *) realloc(ip->id, (ip->nids + 1) * sizeof(ifd_devid_t)); if (!ip->id) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } if (ifd_device_id_parse(id, &ip->id[ip->nids]) >= 0) ip->nids++; return 0; } /** * Get the driver name for a given device ID. * * @param id Device ID. * * @sa ifd_driver_add_id * @return Driver name or NULL if no driver is found. */ const char *ifd_driver_for_id(ifd_devid_t * id) { struct ifd_driver_info *ip; unsigned int n; for (ip = list; ip; ip = ip->next) { for (n = 0; n < ip->nids; n++) { if (ifd_device_id_match(&ip->id[n], id)) return ip->driver.name; } } return NULL; } /** * Lookup a driver by name. * * @param name Driver name. * * If the configuration parameter @a autoload is set, OpenCT will try to load * an external module for the requested driver. * * @return Pointer the the driver structure, or NULL if no driver is found. */ const ifd_driver_t *ifd_driver_get(const char *name) { struct ifd_driver_info *ip; int retries = 2; while (retries--) { ip = find_by_name(name, ct_config.autoload); if (ip == NULL) break; if (ip->driver.ops != NULL) return &ip->driver; if (!ct_config.autoload || ifd_load_module("driver", name) < 0) break; } return NULL; } /** * Get a list of registered drivers. * * @param names Name array. * @param max Size of the name array. * * This function fills the array pointed by @a names with pointers to the * driver names. At most @a max entries are returned. The names must @b not * be freed by the caller. * * @return Number of driver names. */ unsigned int ifd_drivers_list(const char **names, size_t max) { struct ifd_driver_info *ip; unsigned int n; for (ip = list, n = 0; ip && n < max; ip = ip->next, n++) { names[n] = ip->driver.name; } return n; } openct-0.6.20/src/ifd/ifd-cm4000.c0000644000175000017500000000662611143001716013154 00000000000000/* * OMNIKEY CardMan Mobile PCMCIA 4000 Driver * * This driver is not yet complete, but at least it * spits out the ATR already. * * Copyright (C) 2005, Harald Welte * * Based on information from the cm4000 driver by Omnikey AG. */ /* only available on linux */ #ifdef linux #include "internal.h" #include "cardman.h" #include #include #include #include #include /* * Initialize the device */ static int cm_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; reader->name = "OMNIKEY CardMan 4000"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_PCMCIA) { ct_error("cm4000: device %s is not a PCMCIA device", device_name); ifd_device_close(dev); return -1; } reader->driver_data = NULL; reader->device = dev; dev->timeout = 2000; params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("cm4000: setting parameters failed", device_name); ifd_device_close(dev); return -1; } return 0; } /* * Power up the card slot */ static int cm_activate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } static int cm_deactivate(ifd_reader_t * reader) { ifd_debug(1, "called."); return 0; } /* * Card status */ static int cm_card_status(ifd_reader_t * reader, int slot, int *status) { ifd_device_t *dev = reader->device; unsigned int cm_status = 0; int rc; *status = 0; ifd_debug(1, "called."); rc = ioctl(dev->fd, CM_IOCGSTATUS, &cm_status); if (rc != 0) { ifd_debug(1, "error during ioctl(CM_IOCGSTATUS): %d=%s", rc, strerror(errno)); return -1; } if (cm_status & CM_ATR_PRESENT) *status = IFD_CARD_PRESENT; /* Hardware doesn't tell us about status change */ ifd_debug(1, "card %spresent", *status ? "" : "not "); return 0; } /* * Reset */ static int cm_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; struct atreq cmatr; int len; ioctl(dev->fd, 0x6304, 1); /* propriatary driver doesn't check return value here, too */ /* CM_IOCGATR */ if (ioctl(dev->fd, CM_IOCGATR, &cmatr) != 0) { ifd_debug(1, "error during ioctl(CM_IOCGATR)\n"); return -1; } if (cmatr.atr_len == -1) { ifd_debug(1, "atr_len == -1\n"); return -1; } len = cmatr.atr_len; if ((size_t) len > size) len = size; memcpy(atr, &cmatr.atr, len); return len; } static int cm_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { ifd_device_t *dev = reader->device; return write(dev->fd, buffer, len); } static int cm_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { ifd_device_t *dev = reader->device; return read(dev->fd, buffer, len); } /* * Driver operations */ static struct ifd_driver_ops cm4000_driver; /* * Initialize this module */ void ifd_cm4000_register(void) { cm4000_driver.open = cm_open; cm4000_driver.activate = cm_activate; cm4000_driver.deactivate = cm_deactivate; cm4000_driver.card_reset = cm_card_reset; cm4000_driver.card_status = cm_card_status; cm4000_driver.send = cm_send; cm4000_driver.recv = cm_recv; ifd_driver_register("cm4000", &cm4000_driver); } #else /* * Initialize this module */ void ifd_cm4000_register(void) { } #endif openct-0.6.20/src/ifd/ifd-cyberjack.c0000644000175000017500000005661111125447432014216 00000000000000/*____________________________________________________________________________ Cyberjack reader. Tested with USBID 0c4b:0100. These are red readers: one with LCD, another one without. Supports PIN-pad authentication. One advantage of this implementaiton is that everything needed to support cyberjack is in this single file, as it is done for other OpenCT reader drivers. This code doesn't unload cyberjack kernel module, with which it will conflict. To do this call "rmmod cyberjack" after the device is plugged in, or better add "blacklist cyberjack" to modprobe.conf. TODO: cleanup improvised T=1 communication with the reader. Written by Andrey Jivsov in 2006. opensc@brainhub.org or ajivsov@pgp.com $Id: $ ____________________________________________________________________________*/ #include "internal.h" #include "usb-descriptors.h" #include #include #include #include #include #include "ctbcs.h" static const unsigned T1_I_SEQ_SHIFT=6; static const unsigned T1_R_SEQ_SHIFT=4; static const unsigned DATA_NAD = (0<<4/*card*/) | 2/*host*/; /* Pseudo-slot referencing the reader. The reader exposes only * one slot corresponding to the card and is at index 0. */ static const int cyberjack_reader_slot = (OPENCT_MAX_SLOTS-1); static const int cyberjack_card_slot = 0; struct cyberjack_t1_state { unsigned ns; ifd_device_t * dev; ifd_protocol_t *proto; int verify_initiated; int verify_timeout; // in seconds }; #if !defined(ifd_msleep) && !defined(BG_MODULE) #define ifd_msleep(x) usleep(x * 1000) #endif #if 1 #define cyberjack_ct_error(max_len, fmt, args... ) \ ct_error( fmt, ##args ); #else /* define your own here for testing */ #define cyberjack_ct_error(max_len, fmt, args...) \ ct_error( max_len, fmt, ##args ); #endif #if 1 #define cyberjack_ifd_debug( level, max_len, args... ) \ ifd_debug( level, ##args ) #else /* define your own here for testing */ #define cyberjack_ifd_debug( level, max_len, args... ) \ ifd_debug( level, max_len, ##args ) #endif static unsigned int get_checksum( void *p, int len ) { int i; unsigned char *pp = p; unsigned ret=0; for( i=0; i>4)); } static int cyberjack_init_proto( ifd_reader_t *reader, struct cyberjack_t1_state *state ) { ifd_protocol_t *p; if( state->proto==NULL ) { p = ifd_protocol_new(IFD_PROTOCOL_T1, reader, DATA_NAD); if (p == NULL) { cyberjack_ct_error( 40, "cyberjack: internal error: cannot allocate protocol object" ); return -1; } state->proto = p; } else { cyberjack_ct_error( 40, "cyberjack: internal error: protocol already initialized" ); return -1; } return 0; } static void cyberjack_free_proto( struct cyberjack_t1_state *state ) { if( state->proto ) ifd_protocol_free( state->proto ); } /* * Initialize the device */ static int cyberjack_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; struct ifd_usb_device_descriptor de; ifd_device_params_t params; const int device_name_len = strlen(device_name); int ret; (void)device_name_len; cyberjack_ifd_debug(1, 40+device_name_len, "device=%s", device_name); reader->name = "cyberjack reader"; reader->nslots = cyberjack_card_slot + 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) == IFD_DEVICE_TYPE_USB) { if (ifd_usb_get_device(dev, &de)) { cyberjack_ct_error(80, "cyberjack: device descriptor not found"); ifd_device_close(dev); return -1; } if( de.idProduct == 0x100 ) { cyberjack_ct_error(80+device_name_len, "detected e-com/pp at %s, max packet %d\n", device_name, de.bMaxPacketSize0); params = dev->settings; // doesn't seem to make the difference: params.usb.interface = 0; params.usb.altsetting = 0; params.usb.configuration = 1; cyberjack_ifd_debug(1, 80, "trying to claim interface %d on device, config %d", params.usb.interface, params.usb.configuration ); // for send params.usb.ep_o = 0x02; params.usb.ep_i = 0x82; if (ifd_device_set_parameters(dev, ¶ms) < 0) { cyberjack_ct_error(80+device_name_len, "cyberjack: setting parameters failed. Try /sbin/rmmod cyberjack first"); ifd_device_close(dev); return -1; } cyberjack_ifd_debug(1, 80, "successfully claimed interface" ); } else ret = -1; } else { cyberjack_ct_error( 80+device_name_len, "cyberjack: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } ifd_msleep( 200 ); cyberjack_ifd_debug(1, 80, "cyberjack: returning device %p", dev ); reader->device = dev; // yes, it is definitely needed to reliably power-up the card ifd_device_reset( dev ); return 0; } static int cyberjack_close(ifd_reader_t *reader) { free( reader->driver_data ); reader->driver_data = NULL; return 0; } // everything is fine, except first byte of T=1 indicates wrong sender or recipient #define CJ_RCV_OTHER -1 // convenience function to send T=1 datagram to the reader // t1_data_no_checksum is nad pcb len [body], i.e. T=1 datagram without the checksum // so we can calculate it depending on ns static int cyberjack_send_t1( struct cyberjack_t1_state *state, char *t1_data, int send_len ) { unsigned char send_buffer[64]; int ret; if( send_len > sizeof(send_buffer)-3 ) return -1; memcpy( send_buffer+3, t1_data, send_len ); send_len++; // for checksum send_buffer[0] = 0; send_buffer[1] = send_len & 0xff; send_buffer[2] = send_len >> 8; send_buffer[3+1] |= (state->ns << T1_I_SEQ_SHIFT); // set the toggle send_buffer[3+send_len-1] = get_checksum( send_buffer+3, send_len-1 ); ret = ifd_device_send( state->dev, send_buffer, send_len+3 ); if( ret < 0 ) return ret; return ret-4; } /* send special S-Block reply */ static int cyberjack_resync_t1(struct cyberjack_t1_state *state, unsigned char nad, unsigned cmd) { ifd_device_t * const dev = state->dev; unsigned char send_buffer[64]; int ret; send_buffer[0] = 0; send_buffer[1] = 4; send_buffer[2] = 0; send_buffer[3] = get_nad_mirrow(nad); // NAD for device communication send_buffer[4] = cmd; send_buffer[5] = 0; send_buffer[6] = get_checksum(send_buffer+3, 3); ret = ifd_device_send( dev, send_buffer, 7 ); if( ret > 0 ) state->ns = 0; return ret; } /* doesn't seem to make the difference which values I put in timeouts, * but the reply itself is necessary */ static int cyberjack_extend_t1(struct cyberjack_t1_state *state, const unsigned char *t1_in) { ifd_device_t * const dev = state->dev; unsigned char send_buffer[64]; int len; send_buffer[0] = 0; send_buffer[2] = 0; send_buffer[3] = get_nad_mirrow(t1_in[0]); if( t1_in[2]==0 ) { send_buffer[1] = 4; send_buffer[4] = 0xe3; send_buffer[5] = 0; send_buffer[6] = get_checksum(send_buffer+3, 3); len = 3+4; } else { send_buffer[1] = 5; send_buffer[4] = 0xe3; send_buffer[5] = 1; send_buffer[6] = t1_in[3]; send_buffer[7] = get_checksum(send_buffer+3, 4); len = 3+5; } return ifd_device_send( dev, send_buffer, len ); } // the nad os for the previous send command static int cyberjack_recv_t1( struct cyberjack_t1_state *state, unsigned nad, unsigned char t1_out[64]) { unsigned char read_buffer[64]; ifd_device_t * const dev = state->dev; int ret=-1; start: if( (ret=ifd_device_recv( dev, read_buffer, 64, 8000 )) < 7 ) { cyberjack_ct_error(80, "cyberjack: failed to activate 2"); return -1; } cyberjack_ifd_debug(1, 80+ret*3, "cyberjack: response %s", ct_hexdump( read_buffer, ret )); if( read_buffer[0]!=0 || read_buffer[1]!=ret-3 || read_buffer[2]!=0 ) { cyberjack_ifd_debug(1, 80, "cyberjack: wrong header"); return CJ_RCV_OTHER; } if( get_checksum( read_buffer+3, ret-3 ) ) { cyberjack_ifd_debug(1, 80, "cyberjack: checksum mismatch"); return CJ_RCV_OTHER; } ret -= 3; memcpy( t1_out, read_buffer+3, ret ); cyberjack_ifd_debug(1, 80+ret*3, "cyberjack: returning %s", ct_hexdump( t1_out, ret )); if( (t1_out[1]&0xC0)==0x80 ) { cyberjack_ifd_debug(1, 40, "R-BLOCK"); if( ((t1_out[1] >> T1_R_SEQ_SHIFT) & 1) != state->ns ) { state->ns ^= 1; cyberjack_ifd_debug(1, 80, "*** cyberjack: switching ns to %d", state->ns); } } if( (t1_out[1]&0x80)==0x00 ) { cyberjack_ifd_debug(1, 40, "I-BLOCK"); state->ns ^= 1; cyberjack_ifd_debug(1, 80, "*** cyberjack: switching ns to %d", state->ns); } // S-BLOCK is (t1_out[1]&0xC0)==0xC0 switch( t1_out[1] ) { case 0xc1: cyberjack_ifd_debug(1, 40, "S-BLOCK IFD request"); break; case 0xc2: cyberjack_ifd_debug(1, 40, "S-BLOCK Abort request"); break; case 0xc3: cyberjack_ifd_debug(1, 40, "S-BLOCK WTX request"); ret = cyberjack_extend_t1( state, t1_out ); if( ret < 0 ) return ret; goto start; break; case 0xe0: cyberjack_ifd_debug(1, 40, "S-BLOCK Resync response 2"); break; case 0xc0: cyberjack_ifd_debug(1, 40, "S-BLOCK Resync request"); break; case 0xc4: case 0xf4: cyberjack_ifd_debug(1, 40, "S-BLOCK key pressed request"); // reply ret = cyberjack_send_t1( state, "\xe2\xe4\x00", 3 ); if( ret < 0 ) return ret; goto start; break; case 0xe6: case 0xf6: cyberjack_ifd_debug(1, 40, "S-BLOCK to throw away"); break; case 0xe5: case 0xf5: cyberjack_ifd_debug(1, 40, "S-BLOCK card (not) present"); ret = cyberjack_resync_t1( state, t1_out[0], 0xd5 ); if( ret < 0 ) return ret; goto start; break; default: if( (t1_out[1]&0xC0)==0xC0 ) { cyberjack_ifd_debug(1, 40, "unknown S-BLOCK"); } break; } return ret; } /* * Power up the reader */ static int cyberjack_activate(ifd_reader_t *reader) { unsigned char read_buffer[64]; ifd_device_t * const dev = reader->device; int ret; int result = -1; struct cyberjack_t1_state *state = NULL; cyberjack_ifd_debug(1, 40, "called (dev = 0x%x).", reader->device); if( reader->driver_data ) { cyberjack_free_proto( reader->driver_data ); free( reader->driver_data ); reader->driver_data = NULL; } state = calloc( 1, sizeof(struct cyberjack_t1_state) ); if( state == NULL ) goto cleanup; state->dev = dev; if( ifd_device_send( dev, (unsigned char*)"\x00\x04\x00" "\xe2\xc1\x00\x23", 7 ) != 7 || ifd_device_send( dev, (unsigned char*)"\x00\x04\x00" "\xe2\xc0\x00\x22", 7 ) != 7 ) { cyberjack_ct_error(80, "cyberjack: failed to activate 1"); goto cleanup; } ifd_msleep( 100 ); if( (ret=cyberjack_recv_t1( state, 0xe2, read_buffer ))!=4 || memcmp( read_buffer, "\x2e\xe0\x00\xce", 4 )!=0 ) { cyberjack_ct_error(80, "cyberjack: failed to activate 2: no cookie"); goto cleanup; } // send 20 11 00 00 if( cyberjack_send_t1( state, "\x12\x00\x04" "\x20\x11\x00\x00", 7 ) != 7 ) { cyberjack_ct_error(80, "cyberjack: failed to activate 5"); goto cleanup; } ret = cyberjack_recv_t1( state, 0x12, read_buffer ); if( ret < 0 ) { cyberjack_ct_error(80, "cyberjack: failed to activate 5.1"); goto cleanup; } cyberjack_ifd_debug(1, 80+ret*3, "cyberjack: t1 response is : %s", ct_hexdump( read_buffer, ret )); if( ret < 6 ) { cyberjack_ifd_debug(1, 80, "cyberjack: response is short 6.1"); goto cleanup; } if( ret != 6 || read_buffer[3]!=0x90 || read_buffer[4]!=0 ) { cyberjack_ifd_debug(1, 80, "cyberjack: response to 20 11 00 00: %s", ct_hexdump( read_buffer, 6 )); // could neever recover from this cyberjack_ct_error(80, "cyberjack: failed to activate: failed to reset the reader"); goto cleanup; } // The following is needed to transition from our protocol to // CT's protocol object. What we want here is state->ns to turn 0 // so CT's T=1 protocol object can take over from here ret = cyberjack_resync_t1( state, 0x2e, 0xc0/*request to resync*/ ); if( ret < 0 ) { cyberjack_ct_error(80, "cyberjack: failed to activate in resync"); } ret = cyberjack_recv_t1( state, 0x2e, read_buffer ); if( ret < 3 || memcmp(read_buffer, "\x2e\xe0\x00", 3 )!=0 ) { cyberjack_ct_error(80, "cyberjack: failed to activate 7.1"); goto cleanup; } reader->driver_data = state; state = NULL; cyberjack_init_proto( reader, (struct cyberjack_t1_state *)reader->driver_data ); cyberjack_ifd_debug(1, 80, "cyberjack: activated OK, ns=%d", ((struct cyberjack_t1_state *)reader->driver_data)->ns); result = 0; cleanup: if (state != NULL) { free(state); } return result; } static int cyberjack_deactivate(ifd_reader_t * reader) { struct cyberjack_t1_state *state = reader->driver_data; cyberjack_ifd_debug(1, 40, "called."); cyberjack_free_proto( state ); free( state ); reader->driver_data = NULL; /* if there are some cards that are powered on, power them off */ return 0; } /* * Card status - always present */ static int cyberjack_card_status(ifd_reader_t * reader, int slot, int *status) { struct cyberjack_t1_state *state = reader->driver_data; unsigned char response[64]; ifd_slot_t *pslot; ifd_protocol_t *proto; int ret; unsigned stat; cyberjack_ifd_debug(1, 40, "slot=%d", slot); if( state==NULL || slot != cyberjack_card_slot ) return -1; pslot = &reader->slot[slot]; if( pslot->proto ) proto = pslot->proto; else proto = state->proto; // cyberjack_ifd_debug(1, 80, "proto=%p, pslot=%p, state=%p", proto, pslot, state); ret = ifd_protocol_transceive( proto, 0x12, "\x20\x13\x00\x80\x00", 5, response, sizeof(response) ); if( ret < 0 ) { cyberjack_ct_error(80, "cyberjack: failed to get status"); return ret; } cyberjack_ifd_debug(1, 80+ret*3, "cyberjack: response to get status: %s", ct_hexdump( response, ret )); // saw this: 80 01 03 90 00 for inserted card // 80 01 00 90 00 for removed stat = (( ret > 3 && response[ret-2]==0x90 && response[ret-1]==0 && response[ret-3]!=0 ) ? IFD_CARD_PRESENT : 0); if( !(stat & IFD_CARD_PRESENT) && pslot->proto ) { cyberjack_ifd_debug(1, 80, "cyberjack: card removed"); /* hide protocol object from openct, or we will not be able to reset * re-inserted card. */ state->proto = pslot->proto; pslot->proto = NULL; stat |= IFD_CARD_STATUS_CHANGED; } *status = stat; return 0; } /* this is when the light on the reader goes on */ static int cyberjack_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { unsigned char response[64]; struct cyberjack_t1_state * const state = (struct cyberjack_t1_state *)reader->driver_data; ifd_slot_t *pslot; ifd_protocol_t *proto; int ret; cyberjack_ifd_debug(1, 40, "called."); if( slot != cyberjack_card_slot ) return -1; pslot = &reader->slot[slot]; if( pslot->proto ) proto = pslot->proto; else proto = state->proto; if( proto==NULL ) { cyberjack_ifd_debug(1, 40, "cannot obtain protocol object, slot=%d", slot); return -1; } // 0x14 here is timeout in secs. ret = ifd_protocol_transceive( proto, 0x12, "\x20\x12\x01\x01\x01\x14\x00", 7, response, sizeof(response) ); if( ret < 0 ) { cyberjack_ct_error(80, "cyberjack: failed to get ATR: err=%d", ret); return ret; } cyberjack_ifd_debug(1, 80+ret*3, "cyberjack: response to get ATR: %s", ct_hexdump( response, ret )); memcpy( atr, response, ret ); return ret; } static int cyberjack_set_protocol(ifd_reader_t * reader, int slot, int proto) { ifd_slot_t *pslot; struct cyberjack_t1_state * const state = (struct cyberjack_t1_state *)reader->driver_data; cyberjack_ifd_debug(1, 40, "slot=%d", slot); if( slot != cyberjack_card_slot ) return -1; if (proto != IFD_PROTOCOL_T1 && proto != IFD_PROTOCOL_T0 ) { cyberjack_ct_error(80+strlen(reader->name), "%s: protocol %d not supported", reader->name, proto); return IFD_ERROR_NOT_SUPPORTED; } pslot = &reader->slot[slot]; // this is actually used as (dad<<4 | sad) inside // the reply is never checked and is expected to be the 4 bit flipped version pslot->dad = DATA_NAD; /* Protocol is already allocated. Detach it from the state and attach to the slot * for CT to use it. */ if( state->proto == NULL ) { cyberjack_ct_error( 40+strlen(reader->name), "%s: internal error", reader->name); return IFD_ERROR_GENERIC; } if (pslot->proto) { ifd_protocol_free(pslot->proto); pslot->proto = NULL; } pslot->proto = state->proto; state->proto = NULL; // To simulate communication stall (not USB stall) comment these out. // You will get S-BLOCK T=1 response that the core cannot handle... ifd_protocol_set_parameter(pslot->proto, IFD_PROTOCOL_T1_IFSD, 254); cyberjack_ifd_debug(1, 80, "set protocol's IFSd size to %d", 254); ifd_protocol_set_parameter(pslot->proto, IFD_PROTOCOL_T1_IFSC, 254); cyberjack_ifd_debug(1, 80, "set protocol's IFSc size to %d",254); return 0; } static int cyberjack_send(ifd_reader_t *reader, unsigned int dad, const unsigned char *buffer, size_t len) { unsigned char request[512]; ifd_device_t * const dev = reader->device; int ret; cyberjack_ifd_debug(1, 40, "called with dad=%02x, len=%d", dad, len); if( len > sizeof(request)-3 ) { cyberjack_ct_error(80+strlen(reader->name), "%s: request length too large: %d", reader->name, len); return -1; } request[0] = 0; request[1] = len & 0xff; request[2] = len >> 8; len+=3; memcpy( request+3, buffer, len ); ret = ifd_device_send( dev, request, len ); return ret; } /* TODO: working on generatlization of time with ifd_time, ifd_get_current_time, ifd_time_elapsed2 */ struct ifd_time { unsigned p1; unsigned p2; /* These must be opaque */ }; /* a wrapper so both are in one place */ static void ifd_get_current_time( struct ifd_time *now ) { struct timeval now_tv; gettimeofday(&now_tv, NULL); now->p1 = now_tv.tv_sec; now->p2 = now_tv.tv_usec; } static long ifd_time_elapsed2( struct ifd_time *then ) { struct timeval now, delta, then_tv; long l; //ct_debug(40, "ifd_time_elapsed2"); then_tv.tv_sec = then->p1; then_tv.tv_usec = then->p2; gettimeofday(&now, NULL); timersub(&now, &then_tv, &delta); l = delta.tv_sec * 1000 + (delta.tv_usec / 1000); //ct_debug(40, "ifd_time_elapsed2 returns %ld", l); return l; } /* TODO: we need to loop here to make sure we are buffering the whole response * before parsing it. */ static int cyberjack_recv(ifd_reader_t *reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { unsigned char response[512]; unsigned response_size=0; ifd_device_t * const dev = reader->device; struct cyberjack_t1_state * const state = (struct cyberjack_t1_state *)reader->driver_data; int tries; int ret; struct ifd_time time_start; long deadline; cyberjack_ifd_debug(1, 40, "called with dad=%02x, len=%d", dad, len); if( len > sizeof(response)-3 ) { cyberjack_ct_error(80, "cyberjack: response length too large: %d", len); return -1; } /* some upper bound number that we hope we will not hit: * more for operations involving user interaction */ tries = (state->verify_initiated ? 100 : 20); ifd_get_current_time( &time_start ); /* in ms; 110% of requested time to let the reader fail instead of us */ deadline = state->verify_timeout*1100; while( tries-- ) { response_size = len+3; if( state->verify_initiated && ifd_time_elapsed2( &time_start ) > deadline ) { cyberjack_ct_error(80, "cyberjack: cannot complete verify operation in %d seconds", deadline/1000 ); return IFD_ERROR_TIMEOUT; } ret = ifd_device_recv( dev, response, response_size, timeout ); if( ret < 0 ) return ret; // cyberjack_ifd_debug(1, 80, "cyberjack: response %s", ct_hexdump( response, ret ) ); if( ret < 3+4 || response[0] != 0 ) { cyberjack_ct_error(80, "cyberjack: response %s is too short", ct_hexdump( response, ret ) ); break; // pass through // return IFD_ERROR_GENERIC; } response_size = response[1] | (response[2]<<8); if( response_size != ret-3 ) { cyberjack_ifd_debug(1, 80+ret*3, "cyberjack: inconsistent length in response %s", ct_hexdump( response, ret )); break; // pass through } /* This is urgly. We need to watch for a few proprietary S-BLOCKS that * core CT protocol handler cannot handle. Fortunately, we don't neet to * maintain the nabble for these. */ switch( response[3+1] ) { case 0xf4: // key pressed (OK key) case 0xc4: // key pressed (digit keys) cyberjack_ifd_debug(1, 80, "cyberjack: key pressed"); ret = cyberjack_send_t1( state, "\xe2\xe4\x00", 3 ); if( ret < 0 ) return ret; continue; /* re-read again */ case 0xc3: // WTX cyberjack_ifd_debug(1, 80, "timeout, grant extension, %d tries remains", tries); ret = cyberjack_extend_t1( state, response+3 ); if( ret < 0 ) return ret; continue; /* re-read again */ } break; // pass through } memcpy( buffer, response+3, response_size ); return response_size; } /* * Perform a PIN verification. * Timeout in seconds. */ static int cyberjack_perform_verify(ifd_reader_t * reader, int slot, unsigned int timeout, const char *prompt, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len) { unsigned char buffer[256]; unsigned short sw; ifd_slot_t *pslot; struct cyberjack_t1_state * const state = (struct cyberjack_t1_state *)reader->driver_data; int err; if( slot != cyberjack_card_slot || state==NULL ) return -1; pslot = &reader->slot[slot]; cyberjack_ifd_debug(1, 40, "cyberjack: perform_verify timeout=%d", timeout); if( timeout==0 ) timeout = 30; #if 1 err = ctbcs_build_perform_verify_apdu(buffer, sizeof(buffer), slot + 1, prompt, timeout, data, data_len); if (err < 0) return err; #else { ct_buf_t buf; ct_buf_init(&buf, buffer, sizeof(buffer)); ctbcs_begin(&buf, 0x18, slot+1, 0x00); ct_buf_putc(&buf, 0x52); ct_buf_putc(&buf, data_len); ct_buf_put(&buf, data, data_len); ctbcs_add_timeout(&buf, 0x80 /*timeout*/); if (ct_buf_overrun(&buf)) return IFD_ERROR_BUFFER_TOO_SMALL; buffer[4] = ct_buf_avail(&buf) - 5; /* lc */ err = ct_buf_avail(&buf); } #endif state->verify_initiated = 1; state->verify_timeout = timeout; /* fetch the protocol object directly because we want to use another NAD */ err = ifd_protocol_transceive(pslot->proto, 0x12, buffer, err, resp, resp_len); state->verify_initiated = 0; if (err < 0) { cyberjack_ct_error(80, "perform_verify failed with err=%d", err); return err; } if( err < 2 ) return IFD_ERROR_COMM_ERROR; sw = (resp[err-2] << 8) | resp[err-1]; cyberjack_ct_error(80, "perform_verify: err=%d sw=%04x", err, (unsigned)sw); if( sw >= 0x6300 && sw < 0x63cf ) sw &= 0xff00; ifd_msleep(500); switch (sw) { case 0x6400: cyberjack_ct_error(80, "perform_verify failed: timeout"); return IFD_ERROR_USER_TIMEOUT; case 0x6401: cyberjack_ct_error(80, "perform_verify failed: user pressed cancel"); return IFD_ERROR_USER_ABORT; case 0x6300: cyberjack_ct_error(80, "perform_verify failed: PIN mismatch"); return IFD_ERROR_PIN_MISMATCH; } return 2; } /* * Driver operations */ static struct ifd_driver_ops cyberjack_driver; /* * Initialize this module */ void ifd_cyberjack_register(void) { cyberjack_driver.open = cyberjack_open; cyberjack_driver.activate = cyberjack_activate; cyberjack_driver.deactivate = cyberjack_deactivate; cyberjack_driver.card_status = cyberjack_card_status; cyberjack_driver.card_reset = cyberjack_card_reset; cyberjack_driver.set_protocol = cyberjack_set_protocol; cyberjack_driver.send = cyberjack_send; cyberjack_driver.recv = cyberjack_recv; cyberjack_driver.close = cyberjack_close; cyberjack_driver.perform_verify = cyberjack_perform_verify; ifd_driver_register("cyberjack", &cyberjack_driver); } openct-0.6.20/src/ifd/ifdhandler.h0000644000175000017500000000112510422076714013614 00000000000000/* * Internal ifdhandler functions * * Copyright (C) 2003 Olaf Kirch */ #ifndef IFD_IFDHANDLER_H #define IFD_IFDHANDLER_H #include #include #include extern int ifdhandler_process(ct_socket_t *, ifd_reader_t *, ct_buf_t *, ct_buf_t *); extern int ifdhandler_lock(ct_socket_t *, int, int, ct_lock_handle *); extern int ifdhandler_check_lock(ct_socket_t *, int, int); extern int ifdhandler_unlock(ct_socket_t *, int, ct_lock_handle); extern void ifdhandler_unlock_all(ct_socket_t *); #endif /* IFD_IFDHANDLER_H */ openct-0.6.20/src/ifd/ifd-towitoko.c0000644000175000017500000003570610625650421014140 00000000000000/* * Driver for Towitoko readers * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include static int twt_led(ifd_reader_t *, int); static int twt_try_reset(ifd_reader_t *, const void *, size_t, void *, size_t); static int twt_command(ifd_reader_t *, const void *, size_t, void *, size_t); static int twt_recv_checksum(const unsigned char *, size_t); static size_t twt_send_checksum(unsigned char *, size_t); enum { TWT_LED_OFF = 0, TWT_LED_RED, TWT_LED_GREEN, TWT_LED_YELLOW }; #define TWT_PAGESIZE 15 /* * Initialize the reader */ static int twt_open(ifd_reader_t * reader, const char *device_name) { ifd_device_params_t params; ifd_device_t *dev; unsigned char buffer[256]; ifd_debug(1, "called, device=%s", device_name); reader->name = "Towitoko Reader"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; reader->device = dev; if (dev->type == IFD_DEVICE_TYPE_SERIAL) { if (ifd_device_get_parameters(dev, ¶ms) < 0) return -1; params.serial.speed = 9600; params.serial.bits = 8; params.serial.stopbits = 2; params.serial.parity = IFD_SERIAL_PARITY_EVEN; params.serial.dtr = 1; params.serial.rts = 1; if (ifd_device_set_parameters(dev, ¶ms) < 0) return -1; } sleep(1); ifd_device_flush(dev); if (twt_command(reader, "\x00", 1, buffer, 2) < 0) goto failed; ifd_debug(1, "towitoko reader type 0x%02x", buffer[0]); /* Special handling for some towitoko readers * (according to SCEZ) */ switch (buffer[0]) { case 0x61: reader->name = "Towitoko Chipdrive Micro"; break; case 0x80: /* Kartenzwerg */ reader->name = "Towitoko Kartenzwerg"; params.serial.stopbits = 1; params.serial.parity = IFD_SERIAL_PARITY_NONE; /* XXX - Kartenzwerg is for synchronous cards * only. Should we have a flag for this? */ break; case 0x64: reader->name = "Towitoko Kartenzwerg II"; params.serial.stopbits = 1; params.serial.parity = IFD_SERIAL_PARITY_NONE; break; case 0x84: reader->name = "Towitoko Chipdrive External"; break; case 0x88: /* Twin */ reader->name = "Towitoko Chipdrive Twin"; reader->nslots = 2; params.serial.rts = 0; break; case 0x90: reader->name = "Towitoko Chipdrive Internal"; break; default: reader->name = "Towitoko"; } if (ifd_device_set_parameters(dev, ¶ms) < 0) return -1; return 0; failed: ct_error("towitoko: failed to initialize device"); return -1; } /* * Activate the reader */ static int twt_activate(ifd_reader_t * reader) { unsigned char cmd[2] = { 0x60, 0x0F }; ifd_debug(1, "called."); if (twt_command(reader, cmd, sizeof(cmd), NULL, 0) < 0) return -1; return 0; } static int twt_deactivate(ifd_reader_t * reader) { unsigned char cmd[2] = { 0x61, 0x0F }; ifd_debug(1, "called."); if (twt_command(reader, cmd, sizeof(cmd), NULL, 0) < 0) return -1; return 0; } static int twt_close(ifd_reader_t * reader) { twt_led(reader, TWT_LED_OFF); return 0; } /* * Check card status */ static int twt_card_status(ifd_reader_t * reader, int slot, int *status) { unsigned char byte; int r; if (slot != 0) { ct_error("towitoko: bad slot index %u", slot); return IFD_ERROR_INVALID_SLOT; } if ((r = twt_command(reader, "\x03", 1, &byte, 1)) < 0) return r; *status = 0; if (byte & 0x40) *status |= IFD_CARD_PRESENT; if (byte & 0x80) *status |= IFD_CARD_STATUS_CHANGED; twt_led(reader, (byte & 0x40) ? TWT_LED_RED : TWT_LED_OFF); return 0; } /* * Reset the card and get the ATR */ static int twt_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { static unsigned char reset1[] = { 0x80, 0x6F, 0x00, 0x05, 0x76 }; static unsigned char reset2[] = { 0xA0, 0x6F, 0x00, 0x05, 0x74 }; int r, i, n = 0, status; ifd_debug(1, "called."); if (slot != 0) { ct_error("towitoko: bad slot index %u", slot); return IFD_ERROR_INVALID_SLOT; } /* Activate the reader */ if ((r = twt_activate(reader)) < 0) return r; /* Get the card status */ if ((r = twt_card_status(reader, slot, &status)) < 0) return r; if (!(status & IFD_CARD_PRESENT)) return IFD_ERROR_NO_CARD; /* SCEZ does this three times - I have no clue why */ for (i = 0; i < 1; i++) { n = twt_try_reset(reader, reset1, sizeof(reset1), atr, size); if (n != 0) return n; n = twt_try_reset(reader, reset2, sizeof(reset2), atr, size); if (n != 0) return n; } /* See if this is a synchronous card */ return ifd_sync_detect_icc(reader, slot, atr, size); } static int twt_try_reset(ifd_reader_t * reader, const void *cmd, size_t cmd_len, void *atr, size_t atr_len) { ifd_device_t *dev = reader->device; int rc; ifd_debug(2, "sending %s", ct_hexdump(cmd, cmd_len)); ct_config.suppress_errors++; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_SERIAL) { rc = ifd_device_transceive(dev, cmd, cmd_len, atr, atr_len, 1000); } else { if (ifd_device_send(dev, (const unsigned char *)cmd, cmd_len) < 0) return -1; rc = ifd_device_recv(dev, (unsigned char *)atr, 1, 1000); } ct_config.suppress_errors--; if (rc == IFD_ERROR_TIMEOUT) return 0; if (rc == 1) { unsigned char c = *(unsigned char *)atr; ifd_debug(1, "received first ATR byte: 0x%02x", c); if (c != 0x3f && c != 0x3b && c != 0x03) return 0; } return rc; } /* * Change the parity */ static int twt_change_parity(ifd_reader_t * reader, int parity) { unsigned char cmd[] = { 0x6F, 0x00, 0x6A, 0x0F }; ifd_device_t *dev = reader->device; ifd_device_params_t params; int r; if (dev->type != IFD_DEVICE_TYPE_SERIAL) return IFD_ERROR_NOT_SUPPORTED; if (ifd_device_get_parameters(dev, ¶ms) < 0) return -1; switch (parity) { case IFD_SERIAL_PARITY_EVEN: cmd[1] = 0x40; break; case IFD_SERIAL_PARITY_ODD: cmd[1] = 0x80; break; default: ct_error("towitoko: parity NONE not supported"); return IFD_ERROR_NOT_SUPPORTED; } if ((r = twt_command(reader, cmd, 4, NULL, 0)) < 0) { ct_error("towitoko: failed to change parity"); return r; } params.serial.parity = parity; return ifd_device_set_parameters(dev, ¶ms); } /* * Change the serial speed */ static struct twt_speed { unsigned int value; unsigned char c1, c2; } twt_speed[] = { { 1200, 0x60, 0x07}, { 2400, 0x2E, 0x03}, { 4800, 0x17, 0x05}, { 9600, 0x0B, 0x02}, { 14400, 0x07, 0x01}, { 19200, 0x05, 0x02}, { 28800, 0x03, 0x00}, { 38400, 0x02, 0x00}, { 57600, 0x01, 0x00}, { 115200, 0x80, 0x00}, { 0} }; static int twt_change_speed(ifd_reader_t * reader, unsigned int speed) { unsigned char cmd[] = { 0x6E, 0x00, 0x00, 0x00, 0x08 }; ifd_device_t *dev = reader->device; struct twt_speed *spd; ifd_device_params_t params; int r; if (dev->type != IFD_DEVICE_TYPE_SERIAL) return IFD_ERROR_NOT_SUPPORTED; if ((r = ifd_device_get_parameters(dev, ¶ms)) < 0) return r; for (spd = twt_speed; spd->value; spd++) { if (speed <= spd->value) break; } if (spd->value == 0) return IFD_ERROR_NOT_SUPPORTED; params.serial.speed = spd->value; cmd[1] = spd->c1; cmd[3] = spd->c2; if ((r = twt_command(reader, cmd, sizeof(cmd), NULL, 0)) < 0) { ct_error("towitoko: failed to change speed"); return r; } return ifd_device_set_parameters(dev, ¶ms); } /* * Send command to IFD */ static int twt_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { unsigned char cmd[] = { 0x6F, 0x00, 0x05, 0x00 }; unsigned int count; ifd_device_t *dev; if (!(dev = reader->device)) return -1; ifd_debug(3, "data:%s", ct_hexdump(buffer, len)); while (len) { if ((count = len) > 255) count = 255; cmd[1] = count; twt_send_checksum(cmd, 3); if (ifd_device_send(dev, cmd, 4) < 0 || ifd_device_send(dev, buffer, count) < 0) return -1; buffer += count; len -= count; } return 0; } /* * Receive data from IFD */ static int twt_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { int n; n = ifd_device_recv(reader->device, buffer, len, timeout); if (n < 0) return -1; ifd_debug(3, "data:%s", ct_hexdump(buffer, len)); return n; } /* * Read synchronous card */ static int twt_sync_read_buffer(ifd_reader_t * reader, int slot, int proto, unsigned char *buffer, size_t len) { size_t total = 0; int r; while (total < len) { unsigned char cmd; size_t cnt; if ((cnt = len - total) > TWT_PAGESIZE) cnt = TWT_PAGESIZE; cmd = (cnt - 1) | 0x10; r = twt_command(reader, &cmd, 1, buffer + total, cnt); if (r < 0) { if (total) return total; return r; } total += cnt; } return total; } static int twt_sync_set_read_address(ifd_reader_t * reader, int slot, int proto, unsigned short addr) { unsigned char cmd_i2c_short[] = { 0x7C, 0x64, 0x41, 0x00, 0x00, 0x64, 0x40, 0x00, 0x0F }; unsigned char cmd_i2c_long[] = { 0x7C, 0x64, 0x42, 0xA0, 0x00, 0x00, 0x64, 0x40, 0xA1, 0x0F }; unsigned char cmd_2wire[] = { 0x70, 0x64, 0x42, 0x30, 0x00, 0x00, 0x65, 0x0F }; unsigned char cmd_3wire[] = { 0x70, 0xA0, 0x42, 0x00, 0x00, 0x00, 0x80, 0x50, 0x0F }; unsigned char hi, lo, *cmd; size_t len; hi = addr >> 8; lo = addr & 0xFF; switch (proto) { case IFD_PROTOCOL_I2C_SHORT: cmd = cmd_i2c_short; len = sizeof(cmd_i2c_short); cmd[3] = (hi << 1) | 0xA0; cmd[4] = lo; cmd[7] = (hi << 1) | 0xA1; break; case IFD_PROTOCOL_I2C_LONG: cmd = cmd_i2c_long; len = sizeof(cmd_i2c_long); cmd[4] = hi; cmd[5] = lo; break; case IFD_PROTOCOL_2WIRE: cmd = cmd_2wire; len = sizeof(cmd_2wire); cmd[4] = lo; break; case IFD_PROTOCOL_3WIRE: cmd = cmd_3wire; len = sizeof(cmd_3wire); cmd[3] = (hi << 6) | 0x0e; cmd[4] = lo; break; default: return IFD_ERROR_NOT_SUPPORTED; } return twt_command(reader, cmd, len, NULL, 0); } static int twt_sync_read(ifd_reader_t * reader, int slot, int proto, unsigned short addr, unsigned char *buffer, size_t len) { int r; if ((r = twt_sync_set_read_address(reader, slot, proto, addr)) < 0) return r; return twt_sync_read_buffer(reader, slot, proto, buffer, len); } /* * Write synchronous card */ static int twt_sync_write_buffer(ifd_reader_t * reader, int slot, int proto, const unsigned char *buffer, size_t len) { size_t total = 0; int r; while (total < len) { unsigned char cmd[TWT_PAGESIZE + 2]; size_t cnt; if ((cnt = len - total) > TWT_PAGESIZE) cnt = TWT_PAGESIZE; cmd[0] = (cnt - 1) | 0x40; memcpy(cmd + 1, buffer + total, cnt); cmd[cnt + 1] = 0x0F; r = twt_command(reader, cmd, cnt + 2, NULL, 0); if (r < 0) { if (total) return total; return r; } total += cnt; } return total; } static int twt_sync_set_write_address(ifd_reader_t * reader, int slot, int proto, unsigned short addr) { unsigned char cmd_i2c_short1[] = { 0x7C, 0x64, 0x41, 0xA0, 0x00, 0x64, 0x40, 0xA1, 0x0F }; unsigned char cmd_i2c_short2[] = { 0x7E, 0x10 }; unsigned char cmd_i2c_short3[] = { 0x7E, 0x66, 0x6E, 0x00, 0x00, 0x10, 0x0F }; unsigned char cmd_i2c_long1[] = { 0x7C, 0x64, 0x42, 0xA0, 0x00, 0x00, 0x64, 0x40, 0xA1, 0x0F }; unsigned char cmd_i2c_long2[] = { 0x7E, 0x10 }; unsigned char cmd_i2c_long3[] = { 0x7F, 0x66, 0x6E, 0x00, 0x00, 0xA0, 0x0F }; unsigned char cmd_2wire[] = { 0x72, 0x6E, 0x00, 0x38, 0x03, 0x0F }; unsigned char cmd_3wire[] = { 0x73, 0x67, 0x6E, 0x00, 0x00, 0x02, 0x0F }; unsigned char hi, lo, *cmd, status; size_t len; int r; hi = addr >> 8; lo = addr & 0xFF; switch (proto) { case IFD_PROTOCOL_I2C_SHORT: if ((r = twt_command(reader, cmd_i2c_short1, sizeof(cmd_i2c_short1), NULL, 0)) < 0) return r; if ((r = twt_command(reader, cmd_i2c_short2, sizeof(cmd_i2c_short2), &status, 1)) < 0) return r; cmd = cmd_i2c_short3; len = sizeof(cmd_i2c_short3); cmd[3] = lo; cmd[4] = (hi << 1) | 0xA0; cmd[5] = 0x00 /* pagemode */ ; break; case IFD_PROTOCOL_I2C_LONG: if ((r = twt_command(reader, cmd_i2c_long1, sizeof(cmd_i2c_long1), NULL, 0)) < 0) return r; if ((r = twt_command(reader, cmd_i2c_long2, sizeof(cmd_i2c_long2), &status, 1)) < 0) return r; cmd = cmd_i2c_long3; len = sizeof(cmd_i2c_long3); cmd[3] = lo; cmd[4] = hi; break; case IFD_PROTOCOL_2WIRE: cmd = cmd_2wire; len = sizeof(cmd_2wire); cmd[2] = lo; break; case IFD_PROTOCOL_3WIRE: cmd = cmd_3wire; len = sizeof(cmd_3wire); cmd[3] = lo; cmd[4] = (hi << 6) | 0x33; break; default: return IFD_ERROR_NOT_SUPPORTED; } return twt_command(reader, cmd, len, NULL, 0); } static int twt_sync_write(ifd_reader_t * reader, int slot, int proto, unsigned short addr, const unsigned char *buffer, size_t len) { int r; if ((r = twt_sync_set_write_address(reader, slot, proto, addr)) < 0) return r; return twt_sync_write_buffer(reader, slot, proto, buffer, len); } /* * Turn LED on/off */ static int twt_led(ifd_reader_t * reader, int what) { unsigned char cmd[] = { 0x6F, 0x00, 0x6A, 0x0F }; cmd[1] = what; return twt_command(reader, cmd, sizeof(cmd), NULL, 0); } /* * Helper functions */ static int twt_command(ifd_reader_t * reader, const void *cmd, size_t cmd_len, void *res, size_t res_len) { unsigned char buffer[254]; int rc; if (res_len > sizeof(buffer) - 1 || cmd_len > sizeof(buffer) - 1) return IFD_ERROR_BUFFER_TOO_SMALL; memcpy(buffer, cmd, cmd_len); cmd_len = twt_send_checksum(buffer, cmd_len); if (ct_config.debug > 1) ifd_debug(3, "sending:%s", ct_hexdump(buffer, cmd_len)); rc = ifd_device_transceive(reader->device, buffer, cmd_len, buffer, res_len + 1, -1); if (rc < 0) { ct_error("towitoko: transceive error: %s", ct_strerror(rc)); return rc; } if (ct_config.debug > 1) ifd_debug(3, "received:%s", ct_hexdump(buffer, res_len + 1)); if (!twt_recv_checksum(buffer, res_len + 1)) { ct_error("towitoko: command failed (bad checksum)"); return -1; } if (res && res_len) memcpy(res, buffer, res_len); return 0; } static unsigned char twt_checksum(unsigned char cs, const unsigned char *data, size_t len) { unsigned char b; while (len--) { b = cs ^ *data++; /* rotate left one bit and toggle LSB */ cs = ((b << 1) | (b >> 7)) ^ 0x01; } return cs; } static int twt_recv_checksum(const unsigned char *data, size_t len) { if (len == 0) return 0; return data[len - 1] == twt_checksum(0x01, data, len - 1); } static size_t twt_send_checksum(unsigned char *data, size_t len) { data[len] = twt_checksum(0x00, data, len); return len + 1; } /* * Driver operations */ static struct ifd_driver_ops towitoko_driver; void ifd_towitoko_register(void) { towitoko_driver.open = twt_open; towitoko_driver.close = twt_close; towitoko_driver.change_parity = twt_change_parity; towitoko_driver.change_speed = twt_change_speed; towitoko_driver.activate = twt_activate; towitoko_driver.deactivate = twt_deactivate; towitoko_driver.card_status = twt_card_status; towitoko_driver.card_reset = twt_card_reset; towitoko_driver.send = twt_send; towitoko_driver.recv = twt_recv; towitoko_driver.sync_read = twt_sync_read; towitoko_driver.sync_write = twt_sync_write; ifd_driver_register("towitoko", &towitoko_driver); } openct-0.6.20/src/ifd/Makefile.am0000644000175000017500000000301311125447432013375 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libifd.la sbin_PROGRAMS = ifdhandler ifdproxy noinst_HEADERS = atr.h ctbcs.h ifdhandler.h internal.h ria.h usb-descriptors.h libifd_la_SOURCES = \ apdu.c atr.c checksum.c conf.c ctbcs.c device.c driver.c \ init.c locks.c manager.c modules.c pcmcia.c pcmcia-block.c process.c protocol.c \ reader.c serial.c usb.c usb-descriptors.c utils.c \ \ ifd-acr30u.c ifd-cardman.c ifd-ccid.c ifd-cm4000.c ifd-egate.c \ ifd-etoken.c ifd-etoken64.c ifd-eutron.c ifd-gempc.c ifd-ikey2k.c \ ifd-ikey3k.c ifd-kaan.c ifd-pertosmart1030.c ifd-pertosmart1038.c \ ifd-smartboard.c ifd-smph.c ifd-starkey.c ifd-towitoko.c cardman.h \ ifd-cyberjack.c ifd-rutoken.c ifd-epass3k.c \ \ proto-gbp.c proto-sync.c proto-t0.c proto-t1.c \ proto-trans.c proto-escape.c \ \ sys-sunray.c sys-solaris.c sys-bsd.c sys-linux.c sys-null.c sys-osx.c \ \ ria.c # new driver not working yet: ifd-wbeiuu.c libifd_la_LIBADD = $(top_builddir)/src/ct/libopenct.la $(LTLIB_LIBS) $(OPTIONAL_LIBUSB_LIBS) libifd_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include \ $(OPTIONAL_PCSC_CFLAGS) $(OPTIONAL_LIBUSB_CFLAGS) $(LTLIB_CFLAGS) ifdhandler_SOURCES = ifdhandler.c ifdhandler_LDADD = libifd.la ifdhandler_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include ifdproxy_SOURCES = ifdproxy.c ria-device.c ria-server.c ifdproxy_LDADD = libifd.la ifdproxy_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include openct-0.6.20/src/ifd/ria-device.c0000644000175000017500000001351210625650421013520 00000000000000/* * Remote device access - debugging utility that allows to * test smart card readers on remote hosts. * * Copyright (C) 2003, Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "internal.h" #include "ria.h" static int ria_devsock_process(ct_socket_t *, header_t *, ct_buf_t *, ct_buf_t *); static void ria_devsock_close(ct_socket_t *); static int ria_poll_device(ct_socket_t *, struct pollfd *); static void ria_close_device(ct_socket_t *); /* * Handle device side of things */ ria_client_t *ria_export_device(const char *address, const char *device) { ifd_device_t *dev; ria_client_t *ria; ct_socket_t *sock; /* Open device */ if (!(dev = ifd_device_open(device))) { ct_error("Unable to open device %s\n", device); exit(1); } if (dev->type != IFD_DEVICE_TYPE_SERIAL) { ct_error("Unable to handle devices other that serial"); exit(1); } /* Connect to ifd proxy */ if (!(ria = ria_connect(address))) exit(1); ria->user_data = dev; ria->sock->process = ria_devsock_process; ria->sock->close = ria_devsock_close; ria->sock->user_data = ria; ct_mainloop_add_socket(ria->sock); /* Set up the fake socket encapsulating the device */ sock = ct_socket_new(0); sock->fd = 0x7FFFFFFF; sock->user_data = ria; sock->poll = ria_poll_device; sock->close = ria_close_device; sock->recv = NULL; sock->send = NULL; ct_mainloop_add_socket(sock); return ria; } int ria_register_device(ria_client_t * ria, const char *name) { ifd_device_t *dev = (ifd_device_t *) ria->user_data; ria_device_t devinfo; memset(&devinfo, 0, sizeof(devinfo)); strncpy(devinfo.name, name, RIA_NAME_MAX - 1); if (dev->type == IFD_DEVICE_TYPE_SERIAL) strcpy(devinfo.type, "serial"); else if (dev->type == IFD_DEVICE_TYPE_USB) strcpy(devinfo.type, "usb"); else strcpy(devinfo.type, "other"); return ria_command(ria, RIA_MGR_REGISTER, &devinfo, sizeof(devinfo), NULL, 0, -1); } static int ria_devsock_process(ct_socket_t * sock, header_t * hdr, ct_buf_t * args, ct_buf_t * resp) { ria_client_t *ria = (ria_client_t *) sock->user_data; ifd_device_t *dev = (ifd_device_t *) ria->user_data; unsigned char cmd; int rc, count; ria_print_packet(sock, 2, "ria_devsock_process", hdr, args); /* Unexpected reply on this socket - simply drop */ if (hdr->dest != 0) { hdr->xid = 0; return 0; } if ((rc = ct_buf_get(args, &cmd, 1)) < 0) return rc; switch (cmd) { case RIA_FLUSH_DEVICE: ifd_device_flush(dev); return 0; case RIA_SEND_BREAK: { unsigned int usec; if ((rc = ct_buf_get(args, &usec, sizeof(usec))) < 0) return rc; ifd_device_send_break(dev, ntohl(usec)); return 0; } case RIA_SERIAL_GET_CONFIG: { ifd_device_params_t parms; ria_serial_conf_t conf; if (dev->type != IFD_DEVICE_TYPE_SERIAL) return IFD_ERROR_INCOMPATIBLE_DEVICE; if ((rc = ifd_device_get_parameters(dev, &parms)) < 0) return rc; conf.speed = htonl(parms.serial.speed); conf.bits = parms.serial.bits; conf.stopbits = parms.serial.stopbits; conf.parity = parms.serial.parity; conf.check_parity = parms.serial.check_parity; conf.rts = parms.serial.rts; conf.dtr = parms.serial.dtr; return ct_buf_put(resp, &conf, sizeof(conf)); } case RIA_SERIAL_SET_CONFIG: { ifd_device_params_t parms; ria_serial_conf_t conf; if (dev->type != IFD_DEVICE_TYPE_SERIAL) return IFD_ERROR_INCOMPATIBLE_DEVICE; if ((rc = ct_buf_get(args, &conf, sizeof(conf))) < 0) return rc; parms.serial.speed = ntohl(conf.speed); parms.serial.bits = conf.bits; parms.serial.stopbits = conf.stopbits; parms.serial.parity = conf.parity; parms.serial.check_parity = conf.check_parity; parms.serial.rts = conf.rts; parms.serial.dtr = conf.dtr; if ((rc = ifd_device_set_parameters(dev, &parms)) < 0) return rc; return 0; } case RIA_DATA: hdr->xid = 0; /* no reponse */ count = ct_buf_avail(args); rc = ct_buf_put(&ria->data, ct_buf_head(args), count); if (rc < 0) { ct_buf_compact(&ria->data); rc = ct_buf_put(&ria->data, ct_buf_head(args), count); } if (rc < 0) ifd_debug(1, "unable to queue %u bytes for device", count); return 0; default: ct_error("Unexpected command 0x02%x\n", cmd); return IFD_ERROR_INVALID_CMD; } } static void ria_devsock_close(ct_socket_t * sock) { ct_error("Network connection closed, exiting\n"); exit(0); } static int ria_poll_device(ct_socket_t * sock, struct pollfd *pfd) { unsigned char buffer[512]; ria_client_t *ria = (ria_client_t *) sock->user_data; ifd_device_t *dev = (ifd_device_t *) ria->user_data; int n, rc; pfd->fd = dev->fd; if (pfd->revents & POLLIN) { n = read(dev->fd, buffer, sizeof(buffer)); if (n < 0) { ct_error("error reading from device: %m"); return -1; } ifd_debug(2, "read%s", ct_hexdump(buffer, n)); if ((rc = ria_send(ria, RIA_DATA, buffer, n)) < 0) return rc; } if (pfd->revents & POLLOUT) { n = write(dev->fd, ct_buf_head(&ria->data), ct_buf_avail(&ria->data)); if (n < 0) { ct_error("error writing to device: %m"); return -1; } ifd_debug(2, "wrote%s", ct_hexdump(ct_buf_head(&ria->data), n)); ct_buf_get(&ria->data, NULL, n); } if (ifd_device_poll_presence(dev, pfd) == 0) { ifd_debug(1, "Device detached, exiting"); exit(0); } pfd->events |= POLLIN; if (ct_buf_avail(&ria->data)) pfd->events |= POLLOUT; if (1 /* hotplug */ ) pfd->events |= POLLHUP; return 1; } static void ria_close_device(ct_socket_t * sock) { ct_error("Dispatcher requests that device is closed, abort"); exit(1); } openct-0.6.20/src/ifd/apdu.c0000644000175000017500000000253310422076714012444 00000000000000/* * APDU handling * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include /* * Check the APDU type and length */ static int __ifd_apdu_check(const void *sbuf, size_t len, ifd_iso_apdu_t * iso) { unsigned char *data = (unsigned char *)sbuf; unsigned int b; memset(iso, 0, sizeof(*iso)); if (len < 5) { iso->cse = IFD_APDU_CASE_1; return 0; } b = data[4]; len -= 5; /* APDU + Le */ if (len == 0) { iso->cse = IFD_APDU_CASE_2S; iso->le = b ? b : 256; return 0; } data += 5; if (b == 0) b = 256; iso->lc = b; iso->len = len; iso->data = data; /* APDU + Lc + data */ if (len == b) { iso->cse = IFD_APDU_CASE_3S; return 0; } /* APDU + Lc + data + Le */ if (len == b + 1) { iso->cse = IFD_APDU_CASE_4S; iso->le = data[b] ? data[b] : 256; iso->len--; return 0; } return -1; } int ifd_apdu_case(const void *buf, size_t len) { ifd_iso_apdu_t iso; if (__ifd_apdu_check(buf, len, &iso) < 0) return -1; return iso.cse; } /* * Convert internal APDU type to an ISO-7816-4 APDU */ int ifd_iso_apdu_parse(const void *data, size_t len, ifd_iso_apdu_t * iso) { unsigned char *p; if (len < 4) return -1; if (__ifd_apdu_check(data, len, iso) < 0) return -1; p = (unsigned char *)data; iso->cla = *p++; iso->ins = *p++; iso->p1 = *p++; iso->p2 = *p++; return 0; } openct-0.6.20/src/ifd/Makefile.in0000644000175000017500000024773611336457520013437 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = ifdhandler$(EXEEXT) ifdproxy$(EXEEXT) subdir = src/ifd DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libifd_la_DEPENDENCIES = $(top_builddir)/src/ct/libopenct.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libifd_la_OBJECTS = libifd_la-apdu.lo libifd_la-atr.lo \ libifd_la-checksum.lo libifd_la-conf.lo libifd_la-ctbcs.lo \ libifd_la-device.lo libifd_la-driver.lo libifd_la-init.lo \ libifd_la-locks.lo libifd_la-manager.lo libifd_la-modules.lo \ libifd_la-pcmcia.lo libifd_la-pcmcia-block.lo \ libifd_la-process.lo libifd_la-protocol.lo libifd_la-reader.lo \ libifd_la-serial.lo libifd_la-usb.lo \ libifd_la-usb-descriptors.lo libifd_la-utils.lo \ libifd_la-ifd-acr30u.lo libifd_la-ifd-cardman.lo \ libifd_la-ifd-ccid.lo libifd_la-ifd-cm4000.lo \ libifd_la-ifd-egate.lo libifd_la-ifd-etoken.lo \ libifd_la-ifd-etoken64.lo libifd_la-ifd-eutron.lo \ libifd_la-ifd-gempc.lo libifd_la-ifd-ikey2k.lo \ libifd_la-ifd-ikey3k.lo libifd_la-ifd-kaan.lo \ libifd_la-ifd-pertosmart1030.lo \ libifd_la-ifd-pertosmart1038.lo libifd_la-ifd-smartboard.lo \ libifd_la-ifd-smph.lo libifd_la-ifd-starkey.lo \ libifd_la-ifd-towitoko.lo libifd_la-ifd-cyberjack.lo \ libifd_la-ifd-rutoken.lo libifd_la-ifd-epass3k.lo \ libifd_la-proto-gbp.lo libifd_la-proto-sync.lo \ libifd_la-proto-t0.lo libifd_la-proto-t1.lo \ libifd_la-proto-trans.lo libifd_la-proto-escape.lo \ libifd_la-sys-sunray.lo libifd_la-sys-solaris.lo \ libifd_la-sys-bsd.lo libifd_la-sys-linux.lo \ libifd_la-sys-null.lo libifd_la-sys-osx.lo libifd_la-ria.lo libifd_la_OBJECTS = $(am_libifd_la_OBJECTS) libifd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libifd_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_ifdhandler_OBJECTS = ifdhandler-ifdhandler.$(OBJEXT) ifdhandler_OBJECTS = $(am_ifdhandler_OBJECTS) ifdhandler_DEPENDENCIES = libifd.la ifdhandler_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(ifdhandler_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_ifdproxy_OBJECTS = ifdproxy-ifdproxy.$(OBJEXT) \ ifdproxy-ria-device.$(OBJEXT) ifdproxy-ria-server.$(OBJEXT) ifdproxy_OBJECTS = $(am_ifdproxy_OBJECTS) ifdproxy_DEPENDENCIES = libifd.la ifdproxy_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(ifdproxy_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libifd_la_SOURCES) $(ifdhandler_SOURCES) \ $(ifdproxy_SOURCES) DIST_SOURCES = $(libifd_la_SOURCES) $(ifdhandler_SOURCES) \ $(ifdproxy_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in noinst_LTLIBRARIES = libifd.la noinst_HEADERS = atr.h ctbcs.h ifdhandler.h internal.h ria.h usb-descriptors.h libifd_la_SOURCES = \ apdu.c atr.c checksum.c conf.c ctbcs.c device.c driver.c \ init.c locks.c manager.c modules.c pcmcia.c pcmcia-block.c process.c protocol.c \ reader.c serial.c usb.c usb-descriptors.c utils.c \ \ ifd-acr30u.c ifd-cardman.c ifd-ccid.c ifd-cm4000.c ifd-egate.c \ ifd-etoken.c ifd-etoken64.c ifd-eutron.c ifd-gempc.c ifd-ikey2k.c \ ifd-ikey3k.c ifd-kaan.c ifd-pertosmart1030.c ifd-pertosmart1038.c \ ifd-smartboard.c ifd-smph.c ifd-starkey.c ifd-towitoko.c cardman.h \ ifd-cyberjack.c ifd-rutoken.c ifd-epass3k.c \ \ proto-gbp.c proto-sync.c proto-t0.c proto-t1.c \ proto-trans.c proto-escape.c \ \ sys-sunray.c sys-solaris.c sys-bsd.c sys-linux.c sys-null.c sys-osx.c \ \ ria.c # new driver not working yet: ifd-wbeiuu.c libifd_la_LIBADD = $(top_builddir)/src/ct/libopenct.la $(LTLIB_LIBS) $(OPTIONAL_LIBUSB_LIBS) libifd_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include \ $(OPTIONAL_PCSC_CFLAGS) $(OPTIONAL_LIBUSB_CFLAGS) $(LTLIB_CFLAGS) ifdhandler_SOURCES = ifdhandler.c ifdhandler_LDADD = libifd.la ifdhandler_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include ifdproxy_SOURCES = ifdproxy.c ria-device.c ria-server.c ifdproxy_LDADD = libifd.la ifdproxy_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ifd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/ifd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libifd.la: $(libifd_la_OBJECTS) $(libifd_la_DEPENDENCIES) $(libifd_la_LINK) $(libifd_la_OBJECTS) $(libifd_la_LIBADD) $(LIBS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ifdhandler$(EXEEXT): $(ifdhandler_OBJECTS) $(ifdhandler_DEPENDENCIES) @rm -f ifdhandler$(EXEEXT) $(ifdhandler_LINK) $(ifdhandler_OBJECTS) $(ifdhandler_LDADD) $(LIBS) ifdproxy$(EXEEXT): $(ifdproxy_OBJECTS) $(ifdproxy_DEPENDENCIES) @rm -f ifdproxy$(EXEEXT) $(ifdproxy_LINK) $(ifdproxy_OBJECTS) $(ifdproxy_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifdhandler-ifdhandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifdproxy-ifdproxy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifdproxy-ria-device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifdproxy-ria-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-apdu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-atr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-checksum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-conf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ctbcs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-acr30u.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-cardman.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-ccid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-cm4000.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-cyberjack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-egate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-epass3k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-etoken.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-etoken64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-eutron.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-gempc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-ikey2k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-ikey3k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-kaan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-pertosmart1030.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-pertosmart1038.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-rutoken.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-smartboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-smph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-starkey.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ifd-towitoko.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-locks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-modules.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-pcmcia-block.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-pcmcia.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-process.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-proto-escape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-proto-gbp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-proto-sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-proto-t0.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-proto-t1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-proto-trans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-reader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-ria.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-serial.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-sys-bsd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-sys-linux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-sys-null.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-sys-osx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-sys-solaris.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-sys-sunray.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-usb-descriptors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-usb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libifd_la-utils.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libifd_la-apdu.lo: apdu.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-apdu.lo -MD -MP -MF $(DEPDIR)/libifd_la-apdu.Tpo -c -o libifd_la-apdu.lo `test -f 'apdu.c' || echo '$(srcdir)/'`apdu.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-apdu.Tpo $(DEPDIR)/libifd_la-apdu.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='apdu.c' object='libifd_la-apdu.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-apdu.lo `test -f 'apdu.c' || echo '$(srcdir)/'`apdu.c libifd_la-atr.lo: atr.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-atr.lo -MD -MP -MF $(DEPDIR)/libifd_la-atr.Tpo -c -o libifd_la-atr.lo `test -f 'atr.c' || echo '$(srcdir)/'`atr.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-atr.Tpo $(DEPDIR)/libifd_la-atr.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='atr.c' object='libifd_la-atr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-atr.lo `test -f 'atr.c' || echo '$(srcdir)/'`atr.c libifd_la-checksum.lo: checksum.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-checksum.lo -MD -MP -MF $(DEPDIR)/libifd_la-checksum.Tpo -c -o libifd_la-checksum.lo `test -f 'checksum.c' || echo '$(srcdir)/'`checksum.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-checksum.Tpo $(DEPDIR)/libifd_la-checksum.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='checksum.c' object='libifd_la-checksum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-checksum.lo `test -f 'checksum.c' || echo '$(srcdir)/'`checksum.c libifd_la-conf.lo: conf.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-conf.lo -MD -MP -MF $(DEPDIR)/libifd_la-conf.Tpo -c -o libifd_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-conf.Tpo $(DEPDIR)/libifd_la-conf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='conf.c' object='libifd_la-conf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c libifd_la-ctbcs.lo: ctbcs.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ctbcs.lo -MD -MP -MF $(DEPDIR)/libifd_la-ctbcs.Tpo -c -o libifd_la-ctbcs.lo `test -f 'ctbcs.c' || echo '$(srcdir)/'`ctbcs.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ctbcs.Tpo $(DEPDIR)/libifd_la-ctbcs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ctbcs.c' object='libifd_la-ctbcs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ctbcs.lo `test -f 'ctbcs.c' || echo '$(srcdir)/'`ctbcs.c libifd_la-device.lo: device.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-device.lo -MD -MP -MF $(DEPDIR)/libifd_la-device.Tpo -c -o libifd_la-device.lo `test -f 'device.c' || echo '$(srcdir)/'`device.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-device.Tpo $(DEPDIR)/libifd_la-device.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='device.c' object='libifd_la-device.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-device.lo `test -f 'device.c' || echo '$(srcdir)/'`device.c libifd_la-driver.lo: driver.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-driver.lo -MD -MP -MF $(DEPDIR)/libifd_la-driver.Tpo -c -o libifd_la-driver.lo `test -f 'driver.c' || echo '$(srcdir)/'`driver.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-driver.Tpo $(DEPDIR)/libifd_la-driver.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='driver.c' object='libifd_la-driver.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-driver.lo `test -f 'driver.c' || echo '$(srcdir)/'`driver.c libifd_la-init.lo: init.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-init.lo -MD -MP -MF $(DEPDIR)/libifd_la-init.Tpo -c -o libifd_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-init.Tpo $(DEPDIR)/libifd_la-init.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='init.c' object='libifd_la-init.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-init.lo `test -f 'init.c' || echo '$(srcdir)/'`init.c libifd_la-locks.lo: locks.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-locks.lo -MD -MP -MF $(DEPDIR)/libifd_la-locks.Tpo -c -o libifd_la-locks.lo `test -f 'locks.c' || echo '$(srcdir)/'`locks.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-locks.Tpo $(DEPDIR)/libifd_la-locks.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='locks.c' object='libifd_la-locks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-locks.lo `test -f 'locks.c' || echo '$(srcdir)/'`locks.c libifd_la-manager.lo: manager.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-manager.lo -MD -MP -MF $(DEPDIR)/libifd_la-manager.Tpo -c -o libifd_la-manager.lo `test -f 'manager.c' || echo '$(srcdir)/'`manager.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-manager.Tpo $(DEPDIR)/libifd_la-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='manager.c' object='libifd_la-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-manager.lo `test -f 'manager.c' || echo '$(srcdir)/'`manager.c libifd_la-modules.lo: modules.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-modules.lo -MD -MP -MF $(DEPDIR)/libifd_la-modules.Tpo -c -o libifd_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-modules.Tpo $(DEPDIR)/libifd_la-modules.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='modules.c' object='libifd_la-modules.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c libifd_la-pcmcia.lo: pcmcia.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-pcmcia.lo -MD -MP -MF $(DEPDIR)/libifd_la-pcmcia.Tpo -c -o libifd_la-pcmcia.lo `test -f 'pcmcia.c' || echo '$(srcdir)/'`pcmcia.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-pcmcia.Tpo $(DEPDIR)/libifd_la-pcmcia.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pcmcia.c' object='libifd_la-pcmcia.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-pcmcia.lo `test -f 'pcmcia.c' || echo '$(srcdir)/'`pcmcia.c libifd_la-pcmcia-block.lo: pcmcia-block.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-pcmcia-block.lo -MD -MP -MF $(DEPDIR)/libifd_la-pcmcia-block.Tpo -c -o libifd_la-pcmcia-block.lo `test -f 'pcmcia-block.c' || echo '$(srcdir)/'`pcmcia-block.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-pcmcia-block.Tpo $(DEPDIR)/libifd_la-pcmcia-block.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pcmcia-block.c' object='libifd_la-pcmcia-block.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-pcmcia-block.lo `test -f 'pcmcia-block.c' || echo '$(srcdir)/'`pcmcia-block.c libifd_la-process.lo: process.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-process.lo -MD -MP -MF $(DEPDIR)/libifd_la-process.Tpo -c -o libifd_la-process.lo `test -f 'process.c' || echo '$(srcdir)/'`process.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-process.Tpo $(DEPDIR)/libifd_la-process.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='process.c' object='libifd_la-process.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-process.lo `test -f 'process.c' || echo '$(srcdir)/'`process.c libifd_la-protocol.lo: protocol.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-protocol.lo -MD -MP -MF $(DEPDIR)/libifd_la-protocol.Tpo -c -o libifd_la-protocol.lo `test -f 'protocol.c' || echo '$(srcdir)/'`protocol.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-protocol.Tpo $(DEPDIR)/libifd_la-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='protocol.c' object='libifd_la-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-protocol.lo `test -f 'protocol.c' || echo '$(srcdir)/'`protocol.c libifd_la-reader.lo: reader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-reader.lo -MD -MP -MF $(DEPDIR)/libifd_la-reader.Tpo -c -o libifd_la-reader.lo `test -f 'reader.c' || echo '$(srcdir)/'`reader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-reader.Tpo $(DEPDIR)/libifd_la-reader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reader.c' object='libifd_la-reader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-reader.lo `test -f 'reader.c' || echo '$(srcdir)/'`reader.c libifd_la-serial.lo: serial.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-serial.lo -MD -MP -MF $(DEPDIR)/libifd_la-serial.Tpo -c -o libifd_la-serial.lo `test -f 'serial.c' || echo '$(srcdir)/'`serial.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-serial.Tpo $(DEPDIR)/libifd_la-serial.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='serial.c' object='libifd_la-serial.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-serial.lo `test -f 'serial.c' || echo '$(srcdir)/'`serial.c libifd_la-usb.lo: usb.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-usb.lo -MD -MP -MF $(DEPDIR)/libifd_la-usb.Tpo -c -o libifd_la-usb.lo `test -f 'usb.c' || echo '$(srcdir)/'`usb.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-usb.Tpo $(DEPDIR)/libifd_la-usb.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usb.c' object='libifd_la-usb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-usb.lo `test -f 'usb.c' || echo '$(srcdir)/'`usb.c libifd_la-usb-descriptors.lo: usb-descriptors.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-usb-descriptors.lo -MD -MP -MF $(DEPDIR)/libifd_la-usb-descriptors.Tpo -c -o libifd_la-usb-descriptors.lo `test -f 'usb-descriptors.c' || echo '$(srcdir)/'`usb-descriptors.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-usb-descriptors.Tpo $(DEPDIR)/libifd_la-usb-descriptors.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='usb-descriptors.c' object='libifd_la-usb-descriptors.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-usb-descriptors.lo `test -f 'usb-descriptors.c' || echo '$(srcdir)/'`usb-descriptors.c libifd_la-utils.lo: utils.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-utils.lo -MD -MP -MF $(DEPDIR)/libifd_la-utils.Tpo -c -o libifd_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-utils.Tpo $(DEPDIR)/libifd_la-utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='libifd_la-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c libifd_la-ifd-acr30u.lo: ifd-acr30u.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-acr30u.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-acr30u.Tpo -c -o libifd_la-ifd-acr30u.lo `test -f 'ifd-acr30u.c' || echo '$(srcdir)/'`ifd-acr30u.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-acr30u.Tpo $(DEPDIR)/libifd_la-ifd-acr30u.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-acr30u.c' object='libifd_la-ifd-acr30u.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-acr30u.lo `test -f 'ifd-acr30u.c' || echo '$(srcdir)/'`ifd-acr30u.c libifd_la-ifd-cardman.lo: ifd-cardman.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-cardman.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-cardman.Tpo -c -o libifd_la-ifd-cardman.lo `test -f 'ifd-cardman.c' || echo '$(srcdir)/'`ifd-cardman.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-cardman.Tpo $(DEPDIR)/libifd_la-ifd-cardman.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-cardman.c' object='libifd_la-ifd-cardman.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-cardman.lo `test -f 'ifd-cardman.c' || echo '$(srcdir)/'`ifd-cardman.c libifd_la-ifd-ccid.lo: ifd-ccid.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-ccid.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-ccid.Tpo -c -o libifd_la-ifd-ccid.lo `test -f 'ifd-ccid.c' || echo '$(srcdir)/'`ifd-ccid.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-ccid.Tpo $(DEPDIR)/libifd_la-ifd-ccid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-ccid.c' object='libifd_la-ifd-ccid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-ccid.lo `test -f 'ifd-ccid.c' || echo '$(srcdir)/'`ifd-ccid.c libifd_la-ifd-cm4000.lo: ifd-cm4000.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-cm4000.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-cm4000.Tpo -c -o libifd_la-ifd-cm4000.lo `test -f 'ifd-cm4000.c' || echo '$(srcdir)/'`ifd-cm4000.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-cm4000.Tpo $(DEPDIR)/libifd_la-ifd-cm4000.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-cm4000.c' object='libifd_la-ifd-cm4000.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-cm4000.lo `test -f 'ifd-cm4000.c' || echo '$(srcdir)/'`ifd-cm4000.c libifd_la-ifd-egate.lo: ifd-egate.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-egate.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-egate.Tpo -c -o libifd_la-ifd-egate.lo `test -f 'ifd-egate.c' || echo '$(srcdir)/'`ifd-egate.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-egate.Tpo $(DEPDIR)/libifd_la-ifd-egate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-egate.c' object='libifd_la-ifd-egate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-egate.lo `test -f 'ifd-egate.c' || echo '$(srcdir)/'`ifd-egate.c libifd_la-ifd-etoken.lo: ifd-etoken.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-etoken.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-etoken.Tpo -c -o libifd_la-ifd-etoken.lo `test -f 'ifd-etoken.c' || echo '$(srcdir)/'`ifd-etoken.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-etoken.Tpo $(DEPDIR)/libifd_la-ifd-etoken.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-etoken.c' object='libifd_la-ifd-etoken.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-etoken.lo `test -f 'ifd-etoken.c' || echo '$(srcdir)/'`ifd-etoken.c libifd_la-ifd-etoken64.lo: ifd-etoken64.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-etoken64.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-etoken64.Tpo -c -o libifd_la-ifd-etoken64.lo `test -f 'ifd-etoken64.c' || echo '$(srcdir)/'`ifd-etoken64.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-etoken64.Tpo $(DEPDIR)/libifd_la-ifd-etoken64.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-etoken64.c' object='libifd_la-ifd-etoken64.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-etoken64.lo `test -f 'ifd-etoken64.c' || echo '$(srcdir)/'`ifd-etoken64.c libifd_la-ifd-eutron.lo: ifd-eutron.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-eutron.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-eutron.Tpo -c -o libifd_la-ifd-eutron.lo `test -f 'ifd-eutron.c' || echo '$(srcdir)/'`ifd-eutron.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-eutron.Tpo $(DEPDIR)/libifd_la-ifd-eutron.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-eutron.c' object='libifd_la-ifd-eutron.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-eutron.lo `test -f 'ifd-eutron.c' || echo '$(srcdir)/'`ifd-eutron.c libifd_la-ifd-gempc.lo: ifd-gempc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-gempc.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-gempc.Tpo -c -o libifd_la-ifd-gempc.lo `test -f 'ifd-gempc.c' || echo '$(srcdir)/'`ifd-gempc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-gempc.Tpo $(DEPDIR)/libifd_la-ifd-gempc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-gempc.c' object='libifd_la-ifd-gempc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-gempc.lo `test -f 'ifd-gempc.c' || echo '$(srcdir)/'`ifd-gempc.c libifd_la-ifd-ikey2k.lo: ifd-ikey2k.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-ikey2k.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-ikey2k.Tpo -c -o libifd_la-ifd-ikey2k.lo `test -f 'ifd-ikey2k.c' || echo '$(srcdir)/'`ifd-ikey2k.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-ikey2k.Tpo $(DEPDIR)/libifd_la-ifd-ikey2k.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-ikey2k.c' object='libifd_la-ifd-ikey2k.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-ikey2k.lo `test -f 'ifd-ikey2k.c' || echo '$(srcdir)/'`ifd-ikey2k.c libifd_la-ifd-ikey3k.lo: ifd-ikey3k.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-ikey3k.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-ikey3k.Tpo -c -o libifd_la-ifd-ikey3k.lo `test -f 'ifd-ikey3k.c' || echo '$(srcdir)/'`ifd-ikey3k.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-ikey3k.Tpo $(DEPDIR)/libifd_la-ifd-ikey3k.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-ikey3k.c' object='libifd_la-ifd-ikey3k.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-ikey3k.lo `test -f 'ifd-ikey3k.c' || echo '$(srcdir)/'`ifd-ikey3k.c libifd_la-ifd-kaan.lo: ifd-kaan.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-kaan.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-kaan.Tpo -c -o libifd_la-ifd-kaan.lo `test -f 'ifd-kaan.c' || echo '$(srcdir)/'`ifd-kaan.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-kaan.Tpo $(DEPDIR)/libifd_la-ifd-kaan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-kaan.c' object='libifd_la-ifd-kaan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-kaan.lo `test -f 'ifd-kaan.c' || echo '$(srcdir)/'`ifd-kaan.c libifd_la-ifd-pertosmart1030.lo: ifd-pertosmart1030.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-pertosmart1030.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-pertosmart1030.Tpo -c -o libifd_la-ifd-pertosmart1030.lo `test -f 'ifd-pertosmart1030.c' || echo '$(srcdir)/'`ifd-pertosmart1030.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-pertosmart1030.Tpo $(DEPDIR)/libifd_la-ifd-pertosmart1030.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-pertosmart1030.c' object='libifd_la-ifd-pertosmart1030.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-pertosmart1030.lo `test -f 'ifd-pertosmart1030.c' || echo '$(srcdir)/'`ifd-pertosmart1030.c libifd_la-ifd-pertosmart1038.lo: ifd-pertosmart1038.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-pertosmart1038.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-pertosmart1038.Tpo -c -o libifd_la-ifd-pertosmart1038.lo `test -f 'ifd-pertosmart1038.c' || echo '$(srcdir)/'`ifd-pertosmart1038.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-pertosmart1038.Tpo $(DEPDIR)/libifd_la-ifd-pertosmart1038.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-pertosmart1038.c' object='libifd_la-ifd-pertosmart1038.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-pertosmart1038.lo `test -f 'ifd-pertosmart1038.c' || echo '$(srcdir)/'`ifd-pertosmart1038.c libifd_la-ifd-smartboard.lo: ifd-smartboard.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-smartboard.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-smartboard.Tpo -c -o libifd_la-ifd-smartboard.lo `test -f 'ifd-smartboard.c' || echo '$(srcdir)/'`ifd-smartboard.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-smartboard.Tpo $(DEPDIR)/libifd_la-ifd-smartboard.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-smartboard.c' object='libifd_la-ifd-smartboard.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-smartboard.lo `test -f 'ifd-smartboard.c' || echo '$(srcdir)/'`ifd-smartboard.c libifd_la-ifd-smph.lo: ifd-smph.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-smph.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-smph.Tpo -c -o libifd_la-ifd-smph.lo `test -f 'ifd-smph.c' || echo '$(srcdir)/'`ifd-smph.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-smph.Tpo $(DEPDIR)/libifd_la-ifd-smph.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-smph.c' object='libifd_la-ifd-smph.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-smph.lo `test -f 'ifd-smph.c' || echo '$(srcdir)/'`ifd-smph.c libifd_la-ifd-starkey.lo: ifd-starkey.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-starkey.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-starkey.Tpo -c -o libifd_la-ifd-starkey.lo `test -f 'ifd-starkey.c' || echo '$(srcdir)/'`ifd-starkey.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-starkey.Tpo $(DEPDIR)/libifd_la-ifd-starkey.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-starkey.c' object='libifd_la-ifd-starkey.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-starkey.lo `test -f 'ifd-starkey.c' || echo '$(srcdir)/'`ifd-starkey.c libifd_la-ifd-towitoko.lo: ifd-towitoko.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-towitoko.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-towitoko.Tpo -c -o libifd_la-ifd-towitoko.lo `test -f 'ifd-towitoko.c' || echo '$(srcdir)/'`ifd-towitoko.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-towitoko.Tpo $(DEPDIR)/libifd_la-ifd-towitoko.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-towitoko.c' object='libifd_la-ifd-towitoko.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-towitoko.lo `test -f 'ifd-towitoko.c' || echo '$(srcdir)/'`ifd-towitoko.c libifd_la-ifd-cyberjack.lo: ifd-cyberjack.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-cyberjack.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-cyberjack.Tpo -c -o libifd_la-ifd-cyberjack.lo `test -f 'ifd-cyberjack.c' || echo '$(srcdir)/'`ifd-cyberjack.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-cyberjack.Tpo $(DEPDIR)/libifd_la-ifd-cyberjack.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-cyberjack.c' object='libifd_la-ifd-cyberjack.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-cyberjack.lo `test -f 'ifd-cyberjack.c' || echo '$(srcdir)/'`ifd-cyberjack.c libifd_la-ifd-rutoken.lo: ifd-rutoken.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-rutoken.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-rutoken.Tpo -c -o libifd_la-ifd-rutoken.lo `test -f 'ifd-rutoken.c' || echo '$(srcdir)/'`ifd-rutoken.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-rutoken.Tpo $(DEPDIR)/libifd_la-ifd-rutoken.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-rutoken.c' object='libifd_la-ifd-rutoken.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-rutoken.lo `test -f 'ifd-rutoken.c' || echo '$(srcdir)/'`ifd-rutoken.c libifd_la-ifd-epass3k.lo: ifd-epass3k.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ifd-epass3k.lo -MD -MP -MF $(DEPDIR)/libifd_la-ifd-epass3k.Tpo -c -o libifd_la-ifd-epass3k.lo `test -f 'ifd-epass3k.c' || echo '$(srcdir)/'`ifd-epass3k.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ifd-epass3k.Tpo $(DEPDIR)/libifd_la-ifd-epass3k.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifd-epass3k.c' object='libifd_la-ifd-epass3k.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ifd-epass3k.lo `test -f 'ifd-epass3k.c' || echo '$(srcdir)/'`ifd-epass3k.c libifd_la-proto-gbp.lo: proto-gbp.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-proto-gbp.lo -MD -MP -MF $(DEPDIR)/libifd_la-proto-gbp.Tpo -c -o libifd_la-proto-gbp.lo `test -f 'proto-gbp.c' || echo '$(srcdir)/'`proto-gbp.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-proto-gbp.Tpo $(DEPDIR)/libifd_la-proto-gbp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proto-gbp.c' object='libifd_la-proto-gbp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-proto-gbp.lo `test -f 'proto-gbp.c' || echo '$(srcdir)/'`proto-gbp.c libifd_la-proto-sync.lo: proto-sync.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-proto-sync.lo -MD -MP -MF $(DEPDIR)/libifd_la-proto-sync.Tpo -c -o libifd_la-proto-sync.lo `test -f 'proto-sync.c' || echo '$(srcdir)/'`proto-sync.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-proto-sync.Tpo $(DEPDIR)/libifd_la-proto-sync.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proto-sync.c' object='libifd_la-proto-sync.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-proto-sync.lo `test -f 'proto-sync.c' || echo '$(srcdir)/'`proto-sync.c libifd_la-proto-t0.lo: proto-t0.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-proto-t0.lo -MD -MP -MF $(DEPDIR)/libifd_la-proto-t0.Tpo -c -o libifd_la-proto-t0.lo `test -f 'proto-t0.c' || echo '$(srcdir)/'`proto-t0.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-proto-t0.Tpo $(DEPDIR)/libifd_la-proto-t0.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proto-t0.c' object='libifd_la-proto-t0.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-proto-t0.lo `test -f 'proto-t0.c' || echo '$(srcdir)/'`proto-t0.c libifd_la-proto-t1.lo: proto-t1.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-proto-t1.lo -MD -MP -MF $(DEPDIR)/libifd_la-proto-t1.Tpo -c -o libifd_la-proto-t1.lo `test -f 'proto-t1.c' || echo '$(srcdir)/'`proto-t1.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-proto-t1.Tpo $(DEPDIR)/libifd_la-proto-t1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proto-t1.c' object='libifd_la-proto-t1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-proto-t1.lo `test -f 'proto-t1.c' || echo '$(srcdir)/'`proto-t1.c libifd_la-proto-trans.lo: proto-trans.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-proto-trans.lo -MD -MP -MF $(DEPDIR)/libifd_la-proto-trans.Tpo -c -o libifd_la-proto-trans.lo `test -f 'proto-trans.c' || echo '$(srcdir)/'`proto-trans.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-proto-trans.Tpo $(DEPDIR)/libifd_la-proto-trans.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proto-trans.c' object='libifd_la-proto-trans.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-proto-trans.lo `test -f 'proto-trans.c' || echo '$(srcdir)/'`proto-trans.c libifd_la-proto-escape.lo: proto-escape.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-proto-escape.lo -MD -MP -MF $(DEPDIR)/libifd_la-proto-escape.Tpo -c -o libifd_la-proto-escape.lo `test -f 'proto-escape.c' || echo '$(srcdir)/'`proto-escape.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-proto-escape.Tpo $(DEPDIR)/libifd_la-proto-escape.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proto-escape.c' object='libifd_la-proto-escape.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-proto-escape.lo `test -f 'proto-escape.c' || echo '$(srcdir)/'`proto-escape.c libifd_la-sys-sunray.lo: sys-sunray.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-sys-sunray.lo -MD -MP -MF $(DEPDIR)/libifd_la-sys-sunray.Tpo -c -o libifd_la-sys-sunray.lo `test -f 'sys-sunray.c' || echo '$(srcdir)/'`sys-sunray.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-sys-sunray.Tpo $(DEPDIR)/libifd_la-sys-sunray.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sys-sunray.c' object='libifd_la-sys-sunray.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-sys-sunray.lo `test -f 'sys-sunray.c' || echo '$(srcdir)/'`sys-sunray.c libifd_la-sys-solaris.lo: sys-solaris.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-sys-solaris.lo -MD -MP -MF $(DEPDIR)/libifd_la-sys-solaris.Tpo -c -o libifd_la-sys-solaris.lo `test -f 'sys-solaris.c' || echo '$(srcdir)/'`sys-solaris.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-sys-solaris.Tpo $(DEPDIR)/libifd_la-sys-solaris.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sys-solaris.c' object='libifd_la-sys-solaris.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-sys-solaris.lo `test -f 'sys-solaris.c' || echo '$(srcdir)/'`sys-solaris.c libifd_la-sys-bsd.lo: sys-bsd.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-sys-bsd.lo -MD -MP -MF $(DEPDIR)/libifd_la-sys-bsd.Tpo -c -o libifd_la-sys-bsd.lo `test -f 'sys-bsd.c' || echo '$(srcdir)/'`sys-bsd.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-sys-bsd.Tpo $(DEPDIR)/libifd_la-sys-bsd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sys-bsd.c' object='libifd_la-sys-bsd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-sys-bsd.lo `test -f 'sys-bsd.c' || echo '$(srcdir)/'`sys-bsd.c libifd_la-sys-linux.lo: sys-linux.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-sys-linux.lo -MD -MP -MF $(DEPDIR)/libifd_la-sys-linux.Tpo -c -o libifd_la-sys-linux.lo `test -f 'sys-linux.c' || echo '$(srcdir)/'`sys-linux.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-sys-linux.Tpo $(DEPDIR)/libifd_la-sys-linux.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sys-linux.c' object='libifd_la-sys-linux.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-sys-linux.lo `test -f 'sys-linux.c' || echo '$(srcdir)/'`sys-linux.c libifd_la-sys-null.lo: sys-null.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-sys-null.lo -MD -MP -MF $(DEPDIR)/libifd_la-sys-null.Tpo -c -o libifd_la-sys-null.lo `test -f 'sys-null.c' || echo '$(srcdir)/'`sys-null.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-sys-null.Tpo $(DEPDIR)/libifd_la-sys-null.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sys-null.c' object='libifd_la-sys-null.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-sys-null.lo `test -f 'sys-null.c' || echo '$(srcdir)/'`sys-null.c libifd_la-sys-osx.lo: sys-osx.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-sys-osx.lo -MD -MP -MF $(DEPDIR)/libifd_la-sys-osx.Tpo -c -o libifd_la-sys-osx.lo `test -f 'sys-osx.c' || echo '$(srcdir)/'`sys-osx.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-sys-osx.Tpo $(DEPDIR)/libifd_la-sys-osx.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sys-osx.c' object='libifd_la-sys-osx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-sys-osx.lo `test -f 'sys-osx.c' || echo '$(srcdir)/'`sys-osx.c libifd_la-ria.lo: ria.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -MT libifd_la-ria.lo -MD -MP -MF $(DEPDIR)/libifd_la-ria.Tpo -c -o libifd_la-ria.lo `test -f 'ria.c' || echo '$(srcdir)/'`ria.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libifd_la-ria.Tpo $(DEPDIR)/libifd_la-ria.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ria.c' object='libifd_la-ria.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libifd_la_CFLAGS) $(CFLAGS) -c -o libifd_la-ria.lo `test -f 'ria.c' || echo '$(srcdir)/'`ria.c ifdhandler-ifdhandler.o: ifdhandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdhandler_CFLAGS) $(CFLAGS) -MT ifdhandler-ifdhandler.o -MD -MP -MF $(DEPDIR)/ifdhandler-ifdhandler.Tpo -c -o ifdhandler-ifdhandler.o `test -f 'ifdhandler.c' || echo '$(srcdir)/'`ifdhandler.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdhandler-ifdhandler.Tpo $(DEPDIR)/ifdhandler-ifdhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifdhandler.c' object='ifdhandler-ifdhandler.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdhandler_CFLAGS) $(CFLAGS) -c -o ifdhandler-ifdhandler.o `test -f 'ifdhandler.c' || echo '$(srcdir)/'`ifdhandler.c ifdhandler-ifdhandler.obj: ifdhandler.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdhandler_CFLAGS) $(CFLAGS) -MT ifdhandler-ifdhandler.obj -MD -MP -MF $(DEPDIR)/ifdhandler-ifdhandler.Tpo -c -o ifdhandler-ifdhandler.obj `if test -f 'ifdhandler.c'; then $(CYGPATH_W) 'ifdhandler.c'; else $(CYGPATH_W) '$(srcdir)/ifdhandler.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdhandler-ifdhandler.Tpo $(DEPDIR)/ifdhandler-ifdhandler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifdhandler.c' object='ifdhandler-ifdhandler.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdhandler_CFLAGS) $(CFLAGS) -c -o ifdhandler-ifdhandler.obj `if test -f 'ifdhandler.c'; then $(CYGPATH_W) 'ifdhandler.c'; else $(CYGPATH_W) '$(srcdir)/ifdhandler.c'; fi` ifdproxy-ifdproxy.o: ifdproxy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -MT ifdproxy-ifdproxy.o -MD -MP -MF $(DEPDIR)/ifdproxy-ifdproxy.Tpo -c -o ifdproxy-ifdproxy.o `test -f 'ifdproxy.c' || echo '$(srcdir)/'`ifdproxy.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdproxy-ifdproxy.Tpo $(DEPDIR)/ifdproxy-ifdproxy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifdproxy.c' object='ifdproxy-ifdproxy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -c -o ifdproxy-ifdproxy.o `test -f 'ifdproxy.c' || echo '$(srcdir)/'`ifdproxy.c ifdproxy-ifdproxy.obj: ifdproxy.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -MT ifdproxy-ifdproxy.obj -MD -MP -MF $(DEPDIR)/ifdproxy-ifdproxy.Tpo -c -o ifdproxy-ifdproxy.obj `if test -f 'ifdproxy.c'; then $(CYGPATH_W) 'ifdproxy.c'; else $(CYGPATH_W) '$(srcdir)/ifdproxy.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdproxy-ifdproxy.Tpo $(DEPDIR)/ifdproxy-ifdproxy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifdproxy.c' object='ifdproxy-ifdproxy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -c -o ifdproxy-ifdproxy.obj `if test -f 'ifdproxy.c'; then $(CYGPATH_W) 'ifdproxy.c'; else $(CYGPATH_W) '$(srcdir)/ifdproxy.c'; fi` ifdproxy-ria-device.o: ria-device.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -MT ifdproxy-ria-device.o -MD -MP -MF $(DEPDIR)/ifdproxy-ria-device.Tpo -c -o ifdproxy-ria-device.o `test -f 'ria-device.c' || echo '$(srcdir)/'`ria-device.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdproxy-ria-device.Tpo $(DEPDIR)/ifdproxy-ria-device.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ria-device.c' object='ifdproxy-ria-device.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -c -o ifdproxy-ria-device.o `test -f 'ria-device.c' || echo '$(srcdir)/'`ria-device.c ifdproxy-ria-device.obj: ria-device.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -MT ifdproxy-ria-device.obj -MD -MP -MF $(DEPDIR)/ifdproxy-ria-device.Tpo -c -o ifdproxy-ria-device.obj `if test -f 'ria-device.c'; then $(CYGPATH_W) 'ria-device.c'; else $(CYGPATH_W) '$(srcdir)/ria-device.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdproxy-ria-device.Tpo $(DEPDIR)/ifdproxy-ria-device.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ria-device.c' object='ifdproxy-ria-device.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -c -o ifdproxy-ria-device.obj `if test -f 'ria-device.c'; then $(CYGPATH_W) 'ria-device.c'; else $(CYGPATH_W) '$(srcdir)/ria-device.c'; fi` ifdproxy-ria-server.o: ria-server.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -MT ifdproxy-ria-server.o -MD -MP -MF $(DEPDIR)/ifdproxy-ria-server.Tpo -c -o ifdproxy-ria-server.o `test -f 'ria-server.c' || echo '$(srcdir)/'`ria-server.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdproxy-ria-server.Tpo $(DEPDIR)/ifdproxy-ria-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ria-server.c' object='ifdproxy-ria-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -c -o ifdproxy-ria-server.o `test -f 'ria-server.c' || echo '$(srcdir)/'`ria-server.c ifdproxy-ria-server.obj: ria-server.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -MT ifdproxy-ria-server.obj -MD -MP -MF $(DEPDIR)/ifdproxy-ria-server.Tpo -c -o ifdproxy-ria-server.obj `if test -f 'ria-server.c'; then $(CYGPATH_W) 'ria-server.c'; else $(CYGPATH_W) '$(srcdir)/ria-server.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ifdproxy-ria-server.Tpo $(DEPDIR)/ifdproxy-ria-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ria-server.c' object='ifdproxy-ria-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ifdproxy_CFLAGS) $(CFLAGS) -c -o ifdproxy-ria-server.obj `if test -f 'ria-server.c'; then $(CYGPATH_W) 'ria-server.c'; else $(CYGPATH_W) '$(srcdir)/ria-server.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-sbinPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-sbinPROGRAMS # 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: openct-0.6.20/src/ifd/ifd-pertosmart1030.c0000644000175000017500000010533111043042742014751 00000000000000/** * PertoSmart card reader driver (for readers using ACS AC-1030 chipset). * * Copyright 2005, Carlos Henrique Bauer */ #include "internal.h" #include #include #include #include "atr.h" #include "usb-descriptors.h" #ifndef NULL #define NULL 0 #endif #ifndef USB_RECIP_ENDPOINT #define USB_RECIP_ENDPOINT 0x02 #endif #ifndef USB_TYPE_VENDOR #define USB_TYPE_VENDOR (0x02 << 5) #endif #ifndef min #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif typedef enum PS_INSTRUCTIION { PS_GET_ACR_STAT = 0x01, PS_SELECT_CARD_TYPE = 0x02, PS_SET_PROTOCOL = 0x03, PS_SET_NOTIFICATION = 0x06, PS_SET_OPTION = 0x07, PS_RESET = 0x80, PS_EXCHANGE_APDU = 0xa0, PS_EXCHANGE_T1_FRAME = 0xa1, PS_POWER_OFF = 0x81 } ps_instruction_t; typedef enum PS_TRANSMISSION_STATE { IDLE = 0, WAITING_TO_SEND, WAITING_TO_RECEIVE, FINISHED, ERROR } ps_transmission_state_t; typedef enum PS_CARD_TYPE { PS_DEFAULT_CARD_TYPE = 0x00, PS_T0_CARD_TYPE = 0x0c, PS_T1_CARD_TYPE = 0x0d, PS_2WIRE_CARD_TYPE = 0x06, PS_3WIRE_CARD_TYPE = 0x05, PS_I2C_CARD_TYPE = 0x02 } ps_card_type_t; typedef struct ps_stat { unsigned char internal[10]; unsigned char max_c; unsigned char max_r; unsigned short c_type; unsigned char c_sel; unsigned char c_stat; } ps_stat_t; typedef struct ps_device_data { /* current reader status */ ps_stat_t stat; /* state of the serial or usb interface */ ps_transmission_state_t if_state; /* current protocol (negotiated by the reader during card powering up). */ int cur_icc_proto; long dev_timeout; /* for USB readers */ ifd_usb_capture_t *capture; struct timeval begin; long if_timeout; } ps_device_data_t; typedef struct ps_baud_rate { unsigned int bps; unsigned char code; } ps_baudrate_t; static const ps_baudrate_t ps_baudrate_table[] = { {9600, 0x12}, {14400, 0x03}, {19200, 0x11}, {28800, 0x02}, {38400, 0x10}, {57600, 0x01}, {115200, 0x00} }; #define PS_MAX_SEND_LEN 65535 #define PS_HEADER_IDX 0 #define PS_INSTRUCTION_IDX 1 #define PS_HEADER 0x01 #define PS_COMMAND_LENGTH0_IDX 2 #define PS_COMMAND_LENGTH1_IDX 3 #define PS_COMMAND_LENGTH2_IDX 4 #define PS_RESPONSE_LENGTH0_IDX 3 #define PS_RESPONSE_LENGTH1_IDX 4 #define PS_RESPONSE_LENGTH2_IDX 5 #define PS_SW1_IDX 1 #define PS_SW2_IDX 2 #define PS_USB_INTERFACE_INDEX 0x00 #define PS_USB_INTERRUPT_ENDPOINT_ADDRESS 0x81 #define PS_USB_INTERRUPT_URB_DATA_SIZE 0x08 #define PS_STX 0x02 #define PS_ETX 0x03 #define PS_SET_NOTIFICATION_TRANSMIT 1 #define PS_SET_NOTIFICATION_DONT_TRANSMIT 2 #define PS_OPTION_9600_TO_96000 0 #define PS_OPTION_9600_ONLY 1 #define PS_OPTION_EMV_MODE_OFF 0 #define PS_OPTION_EMV_MODE_ON (1 << 4) /* read timeout * we must wait enough so that the card can finish its calculation */ static const long PS_TIMEOUT = 30000; /* reader names */ static const char PS_USB_READER_NAME[] = "PertoSmart (AC1030, USB)"; static const char PS_SERIAL_READER_NAME[] = "PertoSmart (AC1030, Serial)"; typedef int complete_fn_t(const void *, size_t); static size_t ps_calculate_tx_len(int proto, size_t slen) { /* be didactic */ size_t tx_len = 1 /* STX */ + 2 * (1 /* header */ + 1 /* command */ + 1 /* len */ + 1 /* checksum */ ) + 1 /* ETX */ ; /* room for more 2 len bytes */ tx_len += 2 * (slen >= 0xff); tx_len += 2 * slen; return tx_len; } /* * Look for ETX. * * Return 0 if the transmission is not complete or the number of the bytes * in the packet which are part of the transmission, including the ETX. */ static int ps_complete_transmission(const void *p, size_t size) { size_t i; for (i = 0; i < size; i++) { if (((unsigned char *)p)[i] == PS_ETX) { if (ct_config.debug >= 4) ct_debug("ps_complete_transmission: ETX found"); return i + 1; } } return 0; } #ifdef not_yet static unsigned char ps_if_get_baudrate_code(int baudrate) { int i; for (i = 0; i < (sizeof(ps_baudrate_table) / sizeof(ps_baudrate_table)[0]); i++) { if (ps_baudrate_table[i].bps == baudrate) { return ps_baudrate_table[i].code; } } return ps_baudrate_table[0].code; } #endif /* * Send USB control message, and receive data via * Interrupt URBs. */ static int ps_if_transmission_start(ifd_device_t * dev, long timeout) { int rc; ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_start: called"); device_data = (ps_device_data_t *) dev->user_data; if (device_data->if_state != IDLE && device_data->if_state != ERROR) { ct_error("ps_if_transmission_start: can't start " "transmission: device not idle"); return IFD_ERROR_LOCKED; } device_data->if_timeout = (timeout < 0) ? dev->timeout : timeout; if (dev->type == IFD_DEVICE_TYPE_USB) { rc = ifd_usb_begin_capture(dev, IFD_USB_URB_TYPE_INTERRUPT, PS_USB_INTERRUPT_ENDPOINT_ADDRESS, PS_USB_INTERRUPT_URB_DATA_SIZE, &(device_data->capture)); if (rc != IFD_SUCCESS) { ct_error("ps_if_transmission_start: failed: %i", rc); device_data->capture = NULL; device_data->if_state = ERROR; } } else { rc = IFD_SUCCESS; } device_data->if_state = (rc == IFD_SUCCESS) ? WAITING_TO_SEND : ERROR; return rc; } static int ps_if_transmission_send(ifd_device_t * dev, const void *sbuf, size_t slen) { int rc; ps_device_data_t *device_data; device_data = (ps_device_data_t *) dev->user_data; if (ct_config.debug >= 4) ct_debug("ps_if_transmission_send: sent %u bytes: %s", slen, ct_hexdump(sbuf, slen)); else if (ct_config.debug >= 1) ct_debug("ps_if_transmission_send: called"); if (device_data->if_state != WAITING_TO_SEND) { ct_error ("ps_if_transmission_send: invalid transmission state %i.", device_data->if_state); return IFD_ERROR_GENERIC; } gettimeofday(&(device_data->begin), NULL); if (dev->type == IFD_DEVICE_TYPE_USB) { rc = ifd_usb_control(dev, IFD_USB_ENDPOINT_OUT | IFD_USB_TYPE_VENDOR | IFD_USB_RECIP_DEVICE, 0, 0, 0, (void *)sbuf, slen, device_data->if_timeout); } else { ifd_device_flush(dev); rc = ifd_device_send(dev, sbuf, slen); } if (rc < 0) { ct_error("ps_if_transmission_send: failed: %i", rc); } device_data->if_state = (rc < 0) ? ERROR : WAITING_TO_RECEIVE; return rc; } static int ps_if_transmission_receive(ifd_device_t * dev, const void *rbuf, size_t rlen) { int rc = IFD_SUCCESS; ps_device_data_t *device_data; size_t received; device_data = (ps_device_data_t *) dev->user_data; received = 0; if (device_data->if_state != WAITING_TO_RECEIVE) { ct_error ("ps_if_transmission_receive: invalid transmission state %i.", device_data->if_state); return IFD_ERROR_GENERIC; } if (rlen < PS_USB_INTERRUPT_URB_DATA_SIZE) { ct_error("ps_if_transmission_receive: buffer too small for " "receiving interrupt urbs: %i", rlen); return IFD_ERROR_GENERIC; } if (rlen % PS_USB_INTERRUPT_URB_DATA_SIZE) { rlen = (rlen / PS_USB_INTERRUPT_URB_DATA_SIZE) * PS_USB_INTERRUPT_URB_DATA_SIZE; } /* Capture URBs or read from the serial until we have a complete answer */ for (;;) { unsigned char packet_buf[PS_USB_INTERRUPT_URB_DATA_SIZE]; const int packet_buf_len = sizeof(packet_buf); long wait; wait = device_data->if_timeout - ifd_time_elapsed(&(device_data->begin)); if (wait <= 0) { ct_error("ps_if_transmission_receive: timeout"); rc = IFD_ERROR_TIMEOUT; } else { if (IFD_DEVICE_TYPE_USB == dev->type) { rc = ifd_usb_capture(dev, device_data->capture, packet_buf, packet_buf_len, wait); } else { ct_config.suppress_errors++; rc = ifd_device_recv(dev, packet_buf, 1, wait); ct_config.suppress_errors--; } } if (rc > 0) { int last_packet_len = 0; last_packet_len = ps_complete_transmission(packet_buf, rc); if (last_packet_len) { rc = last_packet_len; } memcpy((caddr_t) rbuf + received, packet_buf, rc); received += rc; if (last_packet_len) { device_data->if_state = FINISHED; break; } if (received >= rlen) { break; } } else if (rc < 0) { device_data->if_state = ERROR; break; } } if (rc >= 0) { rc = received; if (ct_config.debug >= 4) ct_debug("ps_if_transmission_receive: received %u bytes:%s", rc, ct_hexdump(rbuf, rc)); } else { ct_error("ps_if_transmission_receive: failed: %i", rc); } return rc; } static int ps_if_transmission_flush_reader_output_buffer(ifd_device_t * dev) { int rc = 0; ps_device_data_t *device_data; unsigned char packet_buf[256]; const size_t packet_buf_len = sizeof(packet_buf); const long timeout = 20; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_flush_reader_output_buffer: called"); device_data = (ps_device_data_t *) dev->user_data; do { memset(packet_buf, 0, packet_buf_len); if (dev->type == IFD_DEVICE_TYPE_USB) { rc = ifd_usb_capture(dev, device_data->capture, packet_buf, packet_buf_len, timeout); } else { ct_config.suppress_errors++; rc = ifd_device_recv(dev, packet_buf, packet_buf_len, timeout); ct_config.suppress_errors--; } if (rc <= 0) { break; } } while (!ps_complete_transmission(packet_buf, rc)); return IFD_SUCCESS; } static int ps_if_transmission_end(ifd_device_t * dev) { ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_if_transmission_end: called"); device_data = (ps_device_data_t *) dev->user_data; switch (device_data->if_state) { case WAITING_TO_RECEIVE: case WAITING_TO_SEND: case FINISHED: case ERROR: if (dev->type == IFD_DEVICE_TYPE_USB) { ifd_usb_end_capture(dev, device_data->capture); device_data->capture = NULL; } device_data->if_state = IDLE; break; default: case IDLE: break; } return IFD_SUCCESS; } static unsigned char PS_ASCII_TO_HEX(unsigned char a) { return ((a) + (((a) >= 0x0a) ? 'A' - 0x0a : '0')); } static unsigned char PS_HEX_TO_ASCII(unsigned char h) { return h - ((h >= 'A') ? (((h >= 'a') ? 'a' : 'A') - (unsigned char)0x0a) : '0'); } static unsigned char PS_VALID_HEX(unsigned char h) { return (('0' <= (h) && (h) <= '9') || ('A' <= (h) && (h) <= 'F') || ('a' <= (h) && (h) <= 'f')); } /* * Encode a buffer to will be sent to the reader (to ASCII-HEX) */ static int ps_encode_ascii_hex(unsigned char *out, size_t out_len, const unsigned char *in, size_t in_len) { int i, k; if (ct_config.debug >= 4) ct_debug("ps_encode_ascii_hex: called"); if (out_len < (2 * in_len)) { ct_error("ps_encode_ascii_hex: output buffer too small."); return -1; } for (i = 0, k = 0; i < in_len; i++) { /* convert the most significant nibble */ out[k++] = PS_ASCII_TO_HEX(in[i] >> 4); /* convert the less significant nibble */ out[k++] = PS_ASCII_TO_HEX(in[i] & 0x0f); } /* return the number of byte copied to output buffer */ return k; } /* * Decode a buffer received from the reader (from ASCII-HEX) */ static int ps_decode_ascii_hex(unsigned char *out, size_t out_len, const unsigned char *in, size_t in_len) { size_t i, k; if (ct_config.debug >= 4) ct_debug("ps_decode_ascii_hex: called"); if (in_len % 2) { ct_error ("ps_decode_ascii_hex: input buffer len is not a power of 2."); return IFD_ERROR_GENERIC; } if (out_len < (in_len > 1)) { ct_error("ps_decode_ascii_hex: output buffer too small."); return IFD_ERROR_BUFFER_TOO_SMALL; } for (i = 0, k = 0; (i + 1) < in_len && k < out_len; k++) { if (!(PS_VALID_HEX(in[i]))) { ct_error ("ps_decode_ascii_hex: invalid ascii code hex value: %#x = %c.", i, in[i]); return IFD_ERROR_GENERIC; } if (!(PS_VALID_HEX(in[i + 1]))) { ct_error ("ps_decode_ascii_hex: invalid ascii code hex value: %#x = %c.", i + 1, in[i + 1]); return IFD_ERROR_GENERIC; } out[k] = PS_HEX_TO_ASCII(in[i++]) << 4; out[k] |= PS_HEX_TO_ASCII(in[i++]); } return k; } static unsigned char ps_checksum(unsigned char iv, const unsigned char *buf, size_t len) { unsigned char checksum = iv; int mylen = len; if (buf != NULL) { while (mylen) { checksum ^= buf[--mylen]; } } return checksum; } /* * Send command to IFD */ static int ps_send_to_ifd(ifd_reader_t * reader, ps_instruction_t instruction, const unsigned char *sbuf, size_t slen) { int rc; unsigned char buffer[1024]; unsigned char protocol_bytes[5]; /* 1 header byte + 1 instruction byte + 3 size bytes */ unsigned char *buffer_start = buffer; unsigned char *p; unsigned char checksum; size_t buffer_len = sizeof(buffer); size_t size_tmp; ifd_device_t *dev; ps_device_data_t *device_data; size_t tx_len; if (ct_config.debug >= 4) ct_debug("ps_send_to_ifd: sending %u bytes:%s", slen, ct_hexdump(sbuf, slen)); else if (ct_config.debug >= 1) ct_debug("ps_send_to_ifd: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; if (slen > PS_MAX_SEND_LEN) { ct_error ("ps_apdu_send: transmission is larger " "than maximum allowed: %i", slen); return IFD_ERROR_GENERIC; } tx_len = ps_calculate_tx_len(device_data->cur_icc_proto, slen); if (tx_len > sizeof(buffer)) { ct_error ("ps_send_to_ifd: failed: transmission is too large (%i bytes) " "for drivers's transmission buffer (%i bytes)", (int)tx_len, sizeof(buffer)); return IFD_ERROR_NO_MEMORY; } p = buffer; /* add STX */ *p++ = PS_STX; /* add protocol bytes */ protocol_bytes[PS_HEADER_IDX] = PS_HEADER; protocol_bytes[PS_INSTRUCTION_IDX] = instruction; /* add data length */ if (slen < 0xff) { /* normal command */ protocol_bytes[PS_COMMAND_LENGTH0_IDX] = (unsigned char)slen; size_tmp = PS_COMMAND_LENGTH0_IDX + 1; } else { /* extended command */ protocol_bytes[PS_COMMAND_LENGTH0_IDX] = 0xff; protocol_bytes[PS_COMMAND_LENGTH1_IDX] = (unsigned char)(slen >> 8); protocol_bytes[PS_COMMAND_LENGTH2_IDX] = (unsigned char)(slen & 0xff); size_tmp = PS_COMMAND_LENGTH2_IDX + 1; } rc = ps_encode_ascii_hex(p, buffer_len - (p - buffer_start), protocol_bytes, size_tmp); checksum = ps_checksum(0, protocol_bytes, size_tmp); if (rc < 0) goto out; p += rc; /* add data */ rc = ps_encode_ascii_hex(p, buffer_len - (p - buffer_start), sbuf, slen); if (rc < 0) goto out; p += rc; checksum = ps_checksum(checksum, sbuf, slen); /* add checksum */ rc = ps_encode_ascii_hex(p, buffer_len - (p - buffer_start), &checksum, sizeof(checksum)); p += rc; /* add ETX */ *p++ = PS_ETX; /* start the transmission */ rc = ps_if_transmission_start(dev, dev->timeout); if (rc != IFD_SUCCESS) goto out; rc = ps_if_transmission_flush_reader_output_buffer(dev); if (rc != IFD_SUCCESS) goto out; /* send the data */ rc = ps_if_transmission_send(dev, buffer_start, p - buffer_start); out: if (buffer != buffer_start && buffer != NULL) { free(buffer_start); } if (rc < 0) { ct_error("ps_send_to_ifd: failed: %i", rc); ps_if_transmission_end(dev); } return rc; } static int ps_receive_from_ifd(ifd_reader_t * reader, unsigned char *rbuf, size_t rlen) { int rc; unsigned char protocol_bytes[6]; /* 1 STX byte + 2 status bytes + 3 size bytes */ unsigned char checksum; unsigned char expected_checksum; unsigned char sw1 = 0; unsigned char sw2 = 0; unsigned char buffer[536]; unsigned char *p = buffer; const size_t buffer_len = sizeof(buffer); size_t tmp_length; size_t data_length; size_t remaining_data_length; size_t rbuf_offset; size_t encoded_data_slice_len; int rcvd_len; ifd_device_t *dev; ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_receive_from_ifd: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; data_length = 0; /** * rbuf == NULL && rlen == 0 IS VALID, * it means receive the reader status, but no data */ if(rbuf == NULL && rlen > 0) { ct_error("ps_receive_from_ifd: NULL == rbuf && rlen > 0"); rc = IFD_ERROR_GENERIC; goto out; } memset(rbuf, 0, rlen); /* receive transmission */ rc = ps_if_transmission_receive(dev, buffer, buffer_len); if (rc < 0) goto out; rcvd_len = rc; p = buffer; /* must start with a STX, send error? */ if (*p != PS_STX) { ct_error("ps_receive_from_ifd: missing STX"); rc = IFD_ERROR_COMM_ERROR; goto out; } p++; /* decode the "protocol bytes", i.e. header, SW1, SW1 and data length */ /* 8 = 2 * (header + sw1 + sw2 + data_length) */ /* make sure it's even size */ rc = ps_decode_ascii_hex(protocol_bytes, sizeof(protocol_bytes), p, min(8,(rcvd_len - (p - buffer)) & ~((size_t) 1))); if (rc < 0) goto out; /* calculate checksum of the decoded data */ checksum = ps_checksum(0, protocol_bytes, rc); /* header is present */ if (protocol_bytes[PS_HEADER_IDX] != PS_HEADER) { /* receive error */ rc = IFD_ERROR_COMM_ERROR; goto out; } /* status word */ sw1 = protocol_bytes[PS_SW1_IDX]; sw2 = protocol_bytes[PS_SW2_IDX]; if (ct_config.debug >= 4) ct_debug("ps_receive_from_ifd: sw1 = %#02x, sw2 = %#02x", sw1, sw2); if (sw1 != 0x90) { if (sw1 == 0x60 && sw2 == 0x02) { rc = IFD_ERROR_NO_CARD; } else { rc = IFD_ERROR_GENERIC; } goto out; } /* skip already decoded data */ p += 2 * rc; if (ct_config.debug >= 4) ct_debug("ps_receive_from_ifd: " "protocol_bytes[PS_RESPONSE_LENGTH0_IDX]: %i", protocol_bytes[PS_RESPONSE_LENGTH0_IDX]); /* decode the length of the received data */ if (protocol_bytes[PS_RESPONSE_LENGTH0_IDX] == 0xff) { /* it's an extended response... next two encoded bytes are the data length */ if ((rcvd_len - (p - buffer)) < 4) { /* did't read enough bytes for size data */ rc = IFD_ERROR_COMM_ERROR; goto out; } rc = ps_decode_ascii_hex(&protocol_bytes [PS_RESPONSE_LENGTH1_IDX], sizeof(protocol_bytes) - PS_RESPONSE_LENGTH1_IDX + 1, p, 4); if (rc < 0 ) goto out; /* calculate checksum of the decoded data */ checksum = ps_checksum(checksum, &protocol_bytes[PS_RESPONSE_LENGTH1_IDX], rc); if (ct_config.debug >= 4) { ct_debug("ps_receive_from_ifd: " "protocol_bytes[PS_RESPONSE_LENGTH1_IDX]: %i", protocol_bytes[PS_RESPONSE_LENGTH1_IDX]); ct_debug("ps_receive_from_ifd: " "protocol_bytes[PS_RESPONSE_LENGTH2_IDX]: %i", protocol_bytes[PS_RESPONSE_LENGTH2_IDX]); } data_length = protocol_bytes[PS_RESPONSE_LENGTH1_IDX] << 8; data_length |= protocol_bytes[PS_RESPONSE_LENGTH2_IDX]; /* skip decoded data */ p += 2 * rc; } else { /* one byte for data length */ data_length = protocol_bytes[PS_RESPONSE_LENGTH0_IDX]; } if (rlen < data_length) { ct_error("ps_receive_from_ifd: output buffer too small (%i), " "%i bytes are needed", rlen, data_length); return IFD_ERROR_GENERIC; } rbuf_offset = 0; remaining_data_length = data_length; /* while has data to decode */ while (1) { tmp_length = rcvd_len - (p - buffer); /* if has data to send to the output */ if (remaining_data_length > 0) { /* must be even number */ encoded_data_slice_len = min(remaining_data_length, tmp_length >> 1) << 1; if (device_data->if_state == FINISHED) { if ((remaining_data_length << 1) != encoded_data_slice_len) { /* something got wrong */ ct_error ("ps_receive_from_ifd: data length is diferent " "from data length reported by reader."); goto out; } } /* decode slice */ rc = ps_decode_ascii_hex(rbuf + rbuf_offset, rlen - rbuf_offset, p, encoded_data_slice_len); if (rc < 0) goto out; /* calculate checksum of the decode data */ checksum = ps_checksum(checksum, rbuf + rbuf_offset, rc); p += 2 * rc; remaining_data_length -= rc; rbuf_offset = data_length - remaining_data_length; } if (device_data->if_state == FINISHED) break; /* move buffer tail to beginning */ tmp_length = rcvd_len - (p - buffer); if (tmp_length > 0) memmove(buffer, p, tmp_length); /* point p to end of data */ p = buffer + tmp_length; /* append the next slice */ rc = ps_if_transmission_receive(dev, p, buffer_len); if (rc < 0) { goto out; } /* point p to the beginning of the buffer */ p = buffer; rcvd_len = tmp_length + rc; } /* decode checksum */ rc = ps_decode_ascii_hex(&expected_checksum, sizeof(expected_checksum), p, 2); if (checksum != expected_checksum) { ct_error("ps_receive_from_ifd: failed checksum."); rc = IFD_ERROR_COMM_ERROR; goto out; } p += 2 * rc; /* last byte is a ETX? */ if (*p != PS_ETX) { ct_error("ps_receive_from_ifd: missing ETX."); rc = IFD_ERROR_COMM_ERROR; goto out; } rc = data_length; out: ps_if_transmission_end(dev); if (rc < 0) { ct_error("ps_receive_from_ifd: failed: %i", rc); } else { if (ct_config.debug >= 4) { ct_debug("ps_receive_from_ifd: received: %i: %s", rc, ct_hexdump(rbuf, rc)); } } return rc; } static int ps_transceive_instruction(ifd_reader_t * reader, ps_instruction_t instruction, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { int rc; if (ct_config.debug >= 1) ct_debug("ps_transceive_instruction: called"); rc = ps_send_to_ifd(reader, instruction, sbuf, slen); if (rc < 0) { ct_error("ps_transceive_instruction: failed: %i", rc); } else { rc = ps_receive_from_ifd(reader, rbuf, rlen); } return rc; } /* * Power up the card slot */ static int ps_activate(ifd_reader_t * reader) { if (ct_config.debug >= 1) ct_debug("ps_activate: called"); return IFD_SUCCESS; } static int ps_deactivate(ifd_reader_t * reader) { int rc; if (ct_config.debug >= 1) ct_debug("ps_deactivate: called"); rc = ps_transceive_instruction(reader, PS_POWER_OFF, NULL, 0, NULL, 0); if (rc < 0) ct_error("ps_deactivate: failed: %i", rc); return rc; } static int ps_get_stat(ifd_reader_t * reader, ps_stat_t * stat) { int rc; unsigned char buffer[16]; unsigned char *p; if (ct_config.debug >= 1) ct_debug("ps_get_stat: called"); rc = ps_transceive_instruction(reader, PS_GET_ACR_STAT, NULL, 0, buffer, sizeof(buffer)); if (rc < 0) goto out; if (sizeof(buffer) > rc) { rc = IFD_ERROR_COMM_ERROR; goto out; } for (p = buffer; p < (buffer + sizeof(stat->internal)); p++) { stat->internal[p - buffer] = *p; } stat->max_c = *p++; stat->max_r = *p++; stat->c_type = *p++ << 8; stat->c_type |= *p++; stat->c_sel = *p++; stat->c_stat = *p++; out: if (rc < 0) ct_error("ps_get_stat: failed: %i", rc); return (0 <= rc) ? IFD_SUCCESS : rc; } static int ps_card_status(ifd_reader_t * reader, int slot, int *status) { int rc; ifd_device_t *dev; ps_device_data_t *device_data; unsigned char c_stat; if (ct_config.debug >= 1) ct_debug("ps_card_status: called"); if (slot != 0) { ct_error("ps_card_status: bad slot index %u", slot); return IFD_ERROR_INVALID_SLOT; } dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; c_stat = device_data->stat.c_stat; rc = ps_get_stat(reader, &(device_data->stat)); if (rc == IFD_SUCCESS) { *status = (device_data->stat.c_stat) ? IFD_CARD_PRESENT : 0; if (c_stat != device_data->stat.c_stat) { *status |= IFD_CARD_STATUS_CHANGED; } } else { ct_error("ps_card_status: failed: %i", rc); } return rc; } /* * Reset and reset the protocol */ static int ps_card_reset_select_protocol(ifd_reader_t * reader, int nslot, void *atr, size_t size, int new_icc_proto) { int rc; int atr_len; unsigned char sbuf[1]; ifd_device_t *dev; ps_device_data_t *device_data; ifd_slot_t *slot; ifd_atr_info_t atr_info; if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: called"); if (nslot != 0) { ct_error("ps_card_reset_select_protocol: bad slot index %u", nslot); return IFD_ERROR_INVALID_SLOT; } dev = reader->device; slot = &reader->slot[nslot]; device_data = (ps_device_data_t *) dev->user_data; /* power of the card */ rc = ps_transceive_instruction(reader, PS_POWER_OFF, NULL, 0, NULL, 0); if (rc != IFD_SUCCESS) { ct_error ("ps_card_reset_select_protocol: failed (PS_POWER_OF): %i", rc); return rc; } if (slot->proto == NULL || device_data->cur_icc_proto != new_icc_proto) { switch (new_icc_proto) { case IFD_PROTOCOL_DEFAULT: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "using automatic protocol selecting"); sbuf[0] = PS_DEFAULT_CARD_TYPE; break; case IFD_PROTOCOL_T0: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "selecting protocol T0"); sbuf[0] = PS_T0_CARD_TYPE; break; case IFD_PROTOCOL_T1: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "selecting protocol T1"); sbuf[0] = PS_T1_CARD_TYPE; break; default: ct_error("ps_card_reset_select_protocol: " "unknow protocol %i", new_icc_proto); return IFD_ERROR_NOT_SUPPORTED; } rc = ps_transceive_instruction(reader, PS_SELECT_CARD_TYPE, sbuf, sizeof(sbuf), NULL, 0); if (rc != IFD_SUCCESS) { ct_error("ps_card_reset_select_protocol: " "error selecting card type %#02x", sbuf[0]); return rc; } } /* power up the card */ rc = ps_transceive_instruction(reader, PS_RESET, NULL, 0, atr, size); if (rc < 0) { ct_error("ps_card_reset_select_protocol: failed (PS_RESET): %i", rc); return rc; } atr_len = rc; /* the reader does PPS negotiation with the card parse the atr to check the protocol negotiated by the reader */ rc = ifd_atr_parse(&atr_info, atr, atr_len); if (rc < 0) { ct_error("ps_card_reset_select_protocol: %s: Bad ATR", reader->name); return rc; } if (atr_info.TA[1] != -1) { /* specific mode */ if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "card in specific mode %#02x", atr_info.TA[1] & 0x0f); new_icc_proto = atr_info.TA[1] & 0x0f; } else { if (new_icc_proto == IFD_PROTOCOL_DEFAULT) { new_icc_proto = atr_info.default_protocol; } } if (slot->proto == NULL || device_data->cur_icc_proto != new_icc_proto) { if (slot->proto != NULL) { ifd_protocol_free(slot->proto); } slot->proto = ifd_protocol_new(new_icc_proto, reader, slot->dad); if (slot->proto == NULL) { ct_error("ps_cart_reset_select_protocol: " "ifd_protocol_new"); return IFD_ERROR_GENERIC; } /* set protocol parameters */ switch (new_icc_proto) { case IFD_PROTOCOL_T0: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "using protocol T0"); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 1); break; case IFD_PROTOCOL_T1: if (ct_config.debug >= 1) ct_debug("ps_card_reset_select_protocol: " "using protocol T1"); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_BLOCK_ORIENTED, 1); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSC, (atr_info.TA[2] != -1) ? atr_info. TA[2] : 0x20); ifd_protocol_set_parameter(slot->proto, IFD_PROTOCOL_T1_IFSD, 254); break; default: ct_error("ps_card_reset_select_protocol: " "protocol not supported %#02x", atr_info.default_protocol); return IFD_ERROR_NOT_SUPPORTED; } /* save protocol info */ device_data->cur_icc_proto = new_icc_proto; } return atr_len; } static int ps_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev; ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_card_reset: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; return ps_card_reset_select_protocol(reader, slot, atr, size, device_data->cur_icc_proto); } /* * Select a protocol for communication with the ICC. * */ static int ps_set_protocol(ifd_reader_t * reader, int nslot, int proto) { int rc; ifd_device_t *dev; ps_device_data_t *device_data; ifd_slot_t *slot; if (ct_config.debug >= 1) ct_debug("ps_set_protocol: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; slot = &reader->slot[nslot]; if (slot->proto == NULL || device_data->cur_icc_proto != proto) { /* the reader negotiates the protocol during the card power up must power down and reset the card to change it */ rc = ps_card_reset_select_protocol(reader, nslot, slot->atr, sizeof(slot->atr), proto); if (rc >= IFD_SUCCESS) { slot->atr_len = rc; rc = IFD_SUCCESS; } else { memset(slot->atr, 0, sizeof(slot->atr)); slot->atr_len = 0; } } else { rc = IFD_SUCCESS; } return rc; } static int ps_apdu_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *sbuf, size_t slen) { int rc; int cse; ifd_device_t *dev; ps_device_data_t *device_data; ps_instruction_t instruction; unsigned char t0_buffer[260]; if (ct_config.debug >= 3) ct_debug("ps_apdu_send: sending %i: %s", slen, ct_hexdump(sbuf, slen)); else if (ct_config.debug >= 1) ct_debug("ps_apdu_send: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; switch (device_data->cur_icc_proto) { case IFD_PROTOCOL_T0: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: using EXCHANGE_APDU"); instruction = PS_EXCHANGE_APDU; /* must have room for le=0 or lc=0 */ if (sizeof(t0_buffer) <= slen) { ct_error("ps_apdu_send: apdu size not supported: " "%i bytes (max: %i)", slen, sizeof(t0_buffer) - 1); return IFD_ERROR_NO_MEMORY; } cse = ifd_apdu_case(sbuf, slen); switch (cse) { case IFD_APDU_CASE_1: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: T0 case 1"); /* lc = 0 at the end of sbuf must add le = 0 at end */ /* fall through */ case IFD_APDU_CASE_3S: if (ct_config.debug >= 1 && IFD_APDU_CASE_3S == cse) ct_debug("ps_apdu_send: T0 case 3S"); /* lc is in the expected placed must add le = 0 at end */ memcpy(t0_buffer, sbuf, slen); t0_buffer[slen] = 0; break; case IFD_APDU_CASE_2S: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: T0 case 2S"); /* le is at the end of sbuf must insert lc = 0 before le */ memcpy(t0_buffer, sbuf, slen); t0_buffer[slen] = sbuf[slen - 1]; t0_buffer[slen - 1] = 0; break; case IFD_ERROR_GENERIC: ct_error("ps_apdu_send: ifd_apdu_case failed"); return IFD_ERROR_GENERIC; default: ct_error("ps_apdu_send: apdu case not supported %i", cse); return IFD_ERROR_NOT_SUPPORTED; } rc = ps_send_to_ifd(reader, instruction, t0_buffer, slen + 1); break; case IFD_PROTOCOL_T1: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: using EXCHANGE_T1 FRAME"); instruction = PS_EXCHANGE_T1_FRAME; rc = ps_send_to_ifd(reader, instruction, sbuf, slen); break; default: if (ct_config.debug >= 1) ct_debug("ps_apdu_send: unknow protocol"); return IFD_ERROR_GENERIC; } if (rc < 0) ct_error("ps_apdu_send: error %i", rc); return rc; } static int ps_apdu_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { int rc; if (ct_config.debug >= 1) ct_debug("ps_apdu_recv: called"); rc = ps_receive_from_ifd(reader, buffer, len); if (rc < 0) { ct_error("ps_apdu_recv: failed"); } else { if (ct_config.debug >= 3) ct_debug("ps_apdu_recv: received %i bytes: %s", rc, ct_hexdump(buffer, rc)); } return rc; } /* * Initialize the device */ static int ps_open(ifd_reader_t * reader, const char *device_name) { int rc; ifd_device_t *dev; ps_device_data_t *device_data; ifd_device_params_t params; unsigned char sbuf[2]; if (ct_config.debug >= 1) ct_debug("ps_open: called: device name =%s", device_name); dev = ifd_device_open(device_name); if (dev == NULL) { ct_error("ps_open: failed to open device: %", device_name); return IFD_ERROR_GENERIC; } switch (dev->type) { case IFD_DEVICE_TYPE_USB: reader->name = PS_USB_READER_NAME; params = dev->settings; params.usb.interface = PS_USB_INTERFACE_INDEX; params.usb.ep_intr = PS_USB_INTERRUPT_ENDPOINT_ADDRESS; rc = ifd_device_set_parameters(dev, ¶ms); if (rc != IFD_SUCCESS) { ct_error("ps_open: ifd_device_set_parameters " "returned error %i", rc); return rc; } break; case IFD_DEVICE_TYPE_SERIAL: reader->name = PS_SERIAL_READER_NAME; break; default: ifd_device_close(dev); ct_error("ps_open: unknow device type %i", dev->type); return IFD_ERROR_GENERIC; } sleep(1); ifd_device_flush(dev); device_data = (ps_device_data_t *) calloc(1, sizeof(*device_data)); if (NULL == device_data) { ifd_device_close(dev); ct_error("ps_open: not enough memory"); return IFD_ERROR_NO_MEMORY; } memset(device_data, 0, sizeof(*device_data)); device_data->if_state = IDLE; device_data->cur_icc_proto = IFD_PROTOCOL_DEFAULT; reader->nslots = 1; reader->device = dev; reader->device->user_data = device_data; reader->device->timeout = PS_TIMEOUT; sbuf[0] = PS_SET_NOTIFICATION_DONT_TRANSMIT; /* disable reader notifications */ ps_transceive_instruction(reader, PS_SET_NOTIFICATION, sbuf, 1, NULL, 0); #ifdef not_yet if (dev->type == IFD_DEVICE_TYPE_SERIAL) { int rc; ifd_device_params_t params; unsigned char rbuf[2]; /* try to to use 115200 */ rc = ifd_device_get_parameters(dev, ¶ms); if (0 > rc) { return rc; } sbuf[0] = 0; /* delay */ sbuf[1] = ps_if_get_baudrate_code(115200); rc = ps_transceive_instruction(reader, PS_SET_PROTOCOL, sbuf, 2, rbuf, sizeof(rbuf)); if (rc => 0) { params.serial.speed = 115200; rc = ifd_device_set_parameters(dev, ¶ms); if (rc < 0) return rc; if (ct_config.debug >= 1) ct_debug("ps_open: baudrate changed to 115200"); } } #endif sbuf[0] = PS_OPTION_9600_TO_96000 | PS_OPTION_EMV_MODE_OFF; rc = ps_transceive_instruction(reader, PS_SET_OPTION, sbuf, 1, NULL, 0); if (rc != IFD_SUCCESS) { ct_error("ps_open: error setting reader option"); return rc; } return IFD_SUCCESS; } static int ps_close(ifd_reader_t * reader) { ifd_device_t *dev; ps_device_data_t *device_data; if (ct_config.debug >= 1) ct_debug("ps_open: called"); dev = reader->device; device_data = (ps_device_data_t *) dev->user_data; ps_deactivate(reader); free(device_data); ifd_device_close(dev); return 0; } /* * Initialize this module */ void ifd_pertosmart_ac1030_register(void) { static struct ifd_driver_ops perto_smart_driver; perto_smart_driver.open = ps_open; perto_smart_driver.close = ps_close; perto_smart_driver.activate = ps_activate; perto_smart_driver.deactivate = ps_deactivate; perto_smart_driver.card_status = ps_card_status; perto_smart_driver.card_reset = ps_card_reset; perto_smart_driver.set_protocol = ps_set_protocol; perto_smart_driver.send = ps_apdu_send; perto_smart_driver.recv = ps_apdu_recv; ifd_driver_register("pertosmart1030", &perto_smart_driver); } openct-0.6.20/src/ifd/reader.c0000644000175000017500000003537311151454644012767 00000000000000/* * IFD reader * * Copyright (C) 2003, Olaf Kirch */ #include "internal.h" #include #include #include #include static int ifd_recv_atr(ifd_device_t *, ct_buf_t *, unsigned int, int); /* * Initialize a reader and open the device */ ifd_reader_t *ifd_open(const char *driver_name, const char *device_name) { const ifd_driver_t *driver; ifd_reader_t *reader; ifd_debug(1, "trying to open %s@%s", driver_name, device_name); driver = ifd_driver_get(driver_name); if (driver == NULL) { ct_error("%s: driver not available", driver_name); return NULL; } reader = (ifd_reader_t *) calloc(1, sizeof(*reader)); if (!reader) { ct_error("out of memory"); return NULL; } reader->driver = driver; if (driver->ops->open && driver->ops->open(reader, device_name) < 0) { ct_error("%s: initialization failed (driver %s)", device_name, driver->name); free(reader); return NULL; } return reader; } /* * Select a different protocol for this reader */ int ifd_set_protocol(ifd_reader_t * reader, unsigned int idx, int prot) { const ifd_driver_t *drv = reader->driver; ifd_slot_t *slot; ifd_protocol_t *p; if (idx > reader->nslots) return -1; if (drv && drv->ops && drv->ops->set_protocol) return drv->ops->set_protocol(reader, idx, prot); if (drv && drv->ops && prot == IFD_PROTOCOL_DEFAULT) prot = drv->ops->default_protocol; slot = &reader->slot[idx]; if (slot->proto && slot->proto->ops->id == prot) return 0; if (!(p = ifd_protocol_new(prot, reader, slot->dad))) return -1; if (slot->proto) { ifd_protocol_free(slot->proto); slot->proto = NULL; } slot->proto = p; return 0; } #if 0 /* * Set the serial speed at which we communicate with the * reader */ int ifd_set_speed(ifd_reader_t * reader, unsigned int speed) { const ifd_driver_t *drv = reader->driver; int rc = 0; if (drv && drv->ops && drv->ops->change_speed) rc = drv->ops->change_speed(reader, speed); else rc = IFD_ERROR_NOT_SUPPORTED; return rc; } #endif /* * Activate/Deactivate the reader */ int ifd_activate(ifd_reader_t * reader) { const ifd_driver_t *drv = reader->driver; int rc = 0; if (drv && drv->ops && drv->ops->activate) rc = drv->ops->activate(reader); reader->flags |= IFD_READER_ACTIVE; return rc; } int ifd_deactivate(ifd_reader_t * reader) { const ifd_driver_t *drv = reader->driver; int rc = 0; if (drv && drv->ops && drv->ops->deactivate) rc = drv->ops->deactivate(reader); reader->flags &= ~IFD_READER_ACTIVE; return rc; } /* * Output to reader's display */ int ifd_output(ifd_reader_t * reader, const char *message) { const ifd_driver_t *drv = reader->driver; if (!drv || !drv->ops || !drv->ops->output) return IFD_ERROR_NOT_SUPPORTED; return drv->ops->output(reader, message); } /* * Detect card status */ int ifd_card_status(ifd_reader_t * reader, unsigned int idx, int *status) { const ifd_driver_t *drv = reader->driver; int rc; if (idx > reader->nslots) { ct_error("%s: invalid slot number %u", reader->name, idx); return -1; } *status = 0; if (!drv || !drv->ops || !drv->ops->card_status) return IFD_ERROR_NOT_SUPPORTED; if ((rc = drv->ops->card_status(reader, idx, status)) < 0) return rc; if (*status & IFD_CARD_STATUS_CHANGED) reader->slot[idx].atr_len = 0; reader->slot[idx].status = *status; return 0; } /* * Reset card and obtain ATR */ int ifd_card_reset(ifd_reader_t * reader, unsigned int idx, void *atr, size_t size) { return ifd_card_request(reader, idx, 0, NULL, atr, size); } /* * Request ICC */ int ifd_card_request(ifd_reader_t * reader, unsigned int idx, time_t timeout, const char *message, void *atr, size_t size) { const ifd_driver_t *drv = reader->driver; ifd_device_t *dev = reader->device; ifd_slot_t *slot; unsigned int count; int n, parity; if (idx > reader->nslots) { ct_error("%s: invalid slot number %u", reader->name, idx); return IFD_ERROR_INVALID_ARG; } if (dev == NULL) return IFD_ERROR_INVALID_ARG; if (!drv || !drv->ops || !drv->ops->card_reset) return IFD_ERROR_NOT_SUPPORTED; slot = &reader->slot[idx]; slot->atr_len = 0; if (slot->proto) { ifd_protocol_free(slot->proto); slot->proto = NULL; } /* Do the reset thing - if the driver supports * request ICC, call the function if needed. * Otherwise fall back to ordinary reset. * * For asynchronous cards, the driver's card_reset * function should perform the reset, and start to * read the ATR. It should either read the first byte * of the ATR, and leave it to the caller to read * the remaining bytes of it, or it should read the * whole ATR (as done by the B1 driver, for instance). * * When receiving the complete ATR, we will select * the default protocol as specified by the card. * * If the driver was unable to receive the ATR * (e.g. because the command timed out) it should * return IFD_ERROR_NO_ATR. This will allow us * to retry with different parity. * * For synchronous cards, the driver can call * ifd_sync_detect_icc to detect whether the card * is synchronous. This will also set the slot's * protocol. * * If the card driver does it's own handling of sync * ICCs, it should call ifd_set_protocol to signal * that card detection was successful. */ if (drv->ops->card_request && (timeout || message)) { n = drv->ops->card_request(reader, idx, timeout, message, slot->atr, sizeof(slot->atr)); if (n <= 0) return n; count = n; } else if (dev->type != IFD_DEVICE_TYPE_SERIAL || !drv->ops->change_parity) { n = drv->ops->card_reset(reader, idx, slot->atr, sizeof(slot->atr)); if (n <= 0) return n; count = n; } else { parity = IFD_SERIAL_PARITY_EVEN; if ((n = drv->ops->change_parity(reader, parity)) < 0) return n; /* Reset the card */ n = drv->ops->card_reset(reader, idx, slot->atr, sizeof(slot->atr)); /* If there was no ATR, try again with odd parity */ if (n == IFD_ERROR_NO_ATR) { parity = IFD_SERIAL_PARITY_TOGGLE(parity); if (drv->ops->change_parity(reader, parity) < 0) return -1; n = drv->ops->card_reset(reader, idx, slot->atr, sizeof(slot->atr)); } /* Bail out in case of general error */ if (n < 0) return -1; count = n; /* If we got just the first byte of the (async) ATR, * get the rest now */ if (count == 1) { ct_buf_t rbuf; unsigned char c; unsigned int num, proto = 0; int revert_bits = 0; if (slot->atr[0] == 0x03) { revert_bits = 1; slot->atr[0] = 0x3F; } ct_buf_init(&rbuf, slot->atr, sizeof(slot->atr)); rbuf.tail++; if (ifd_recv_atr(dev, &rbuf, 1, revert_bits) < 0) return -1; c = rbuf.base[1]; while (1) { num = ifd_count_bits(c & 0xF0); if (ifd_recv_atr(dev, &rbuf, num, revert_bits) < 0) return -1; if (!(c & 0x80)) break; c = rbuf.base[rbuf.tail - 1]; proto = c & 0xF; } /* Historical bytes */ c = rbuf.base[1] & 0xF; if (ifd_recv_atr(dev, &rbuf, c, revert_bits) < 0) return -1; /* If a protocol other than T0 was specified, * read check byte */ if (proto && ifd_recv_atr(dev, &rbuf, 1, revert_bits) < 0) return -1; if (slot->atr[0] == 0x3F) parity = IFD_SERIAL_PARITY_TOGGLE(parity); count = rbuf.tail - rbuf.head; } ifd_debug(1, "received atr:%s", ct_hexdump(slot->atr, count)); /* Set the parity in case it was toggled */ if (drv->ops->change_parity(reader, parity) < 0) return -1; } slot->atr_len = count; if (count > size) size = count; if (atr) memcpy(atr, slot->atr, count); /* For synchronous cards, the slot's protocol will already * be set when we get here. */ if (slot->proto == NULL) { if (!ifd_protocol_select(reader, idx, IFD_PROTOCOL_DEFAULT)) ct_error("Protocol selection failed"); } return count; } static int ifd_recv_atr(ifd_device_t * dev, ct_buf_t * bp, unsigned int count, int revert_bits) { unsigned char *buf; unsigned int n; if (count > ct_buf_tailroom(bp)) { ct_error("ATR buffer too small"); return -1; } buf = (unsigned char *)ct_buf_tail(bp); for (n = 0; n < count; n++) { if (ifd_device_recv(dev, buf + n, 1, 1000) < 0) { ct_error("failed to receive ATR"); return -1; } } if (revert_bits) ifd_revert_bits(buf, count); /* Advance tail pointer */ ct_buf_put(bp, NULL, count); return count; } /* * Check ATR for completeness */ int ifd_atr_complete(const unsigned char *atr, size_t len) { unsigned int j = 2, c; int proto = 0; do { if (j > len) return 0; c = atr[j - 1]; if (j > 2) proto = c & 0xF; j += ifd_count_bits(c & 0xF0); } while (c & 0x80); /* Historical bytes */ if ((j += (atr[1] & 0xF)) > len) return 0; /* If a protocol other than T0 was specified, * read check byte */ if (proto && j + 1 > len) return 0; return 1; } /* * Eject the card */ int ifd_card_eject(ifd_reader_t * reader, unsigned int idx, time_t timeout, const char *message) { const ifd_driver_t *drv = reader->driver; if (idx > reader->nslots) { ct_error("%s: invalid slot number %u", reader->name, idx); return -1; } if (!drv || !drv->ops || !drv->ops->card_eject) return 0; return drv->ops->card_eject(reader, idx, timeout, message); } /* * Perform a PIN verification, using the reader's pin pad */ int ifd_card_perform_verify(ifd_reader_t * reader, unsigned int idx, time_t timeout, const char *message, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len) { const ifd_driver_t *drv = reader->driver; if (idx > reader->nslots) { ct_error("%s: invalid slot number %u", reader->name, idx); return -1; } if (!drv || !drv->ops || !drv->ops->perform_verify) return IFD_ERROR_NOT_SUPPORTED; return drv->ops->perform_verify(reader, idx, timeout, message, data, data_len, resp, resp_len); } /* * Send/receive APDU to the ICC */ int ifd_card_command(ifd_reader_t * reader, unsigned int idx, const void *sbuf, size_t slen, void *rbuf, size_t rlen) { ifd_slot_t *slot; if (idx > reader->nslots) return -1; /* XXX handle driver specific methods of transmitting * commands */ slot = &reader->slot[idx]; if (slot->proto == NULL) { ct_error("No communication protocol selected"); return -1; } /* An application is talking to the card. Prevent * automatic card status updates from slowing down * things */ slot->next_update = time(NULL) + 1; return ifd_protocol_transceive(slot->proto, slot->dad, sbuf, slen, rbuf, rlen); } /* * Read/write synchronous ICCs */ int ifd_card_read_memory(ifd_reader_t * reader, unsigned int idx, unsigned short addr, unsigned char *rbuf, size_t rlen) { ifd_slot_t *slot; if (idx > reader->nslots) return -1; slot = &reader->slot[idx]; if (slot->proto == NULL) { ct_error("No communication protocol selected"); return -1; } /* An application is talking to the card. Prevent * automatic card status updates from slowing down * things */ slot->next_update = time(NULL) + 1; return ifd_protocol_read_memory(slot->proto, idx, addr, rbuf, rlen); } int ifd_card_write_memory(ifd_reader_t * reader, unsigned int idx, unsigned short addr, const unsigned char *sbuf, size_t slen) { ifd_slot_t *slot; if (idx > reader->nslots) return -1; slot = &reader->slot[idx]; if (slot->proto == NULL) { ct_error("No communication protocol selected"); return -1; } /* An application is talking to the card. Prevent * automatic card status updates from slowing down * things */ slot->next_update = time(NULL) + 1; return ifd_protocol_write_memory(slot->proto, idx, addr, sbuf, slen); } /* * Transfer/receive APDU using driver specific mechanisms * This functions is called from the protocol (T=0,1,...) layer */ int ifd_send_command(ifd_protocol_t * prot, const void *buffer, size_t len) { const ifd_driver_t *drv; if (!prot || !prot->reader || !(drv = prot->reader->driver) || !drv->ops || !drv->ops->send) return -1; return drv->ops->send(prot->reader, prot->dad, (const unsigned char *)buffer, len); } int ifd_recv_response(ifd_protocol_t * prot, void *buffer, size_t len, long timeout) { const ifd_driver_t *drv; if (!prot || !prot->reader || !(drv = prot->reader->driver) || !drv->ops || !drv->ops->recv) return -1; return drv->ops->recv(prot->reader, prot->dad, (unsigned char *)buffer, len, timeout); } /* * Shut down reader */ void ifd_close(ifd_reader_t * reader) { ifd_detach(reader); if (reader->driver->ops->close) reader->driver->ops->close(reader); if (reader->device) ifd_device_close(reader->device); memset(reader, 0, sizeof(*reader)); free(reader); } /* * Before command */ int ifd_before_command(ifd_reader_t *reader) { if (reader->driver->ops->before_command) return reader->driver->ops->before_command(reader); else return 0; } /* * After command */ int ifd_after_command(ifd_reader_t *reader) { if (reader->driver->ops->after_command) return reader->driver->ops->after_command(reader); else return 0; } /* * Get eventfd */ int ifd_get_eventfd(ifd_reader_t *reader, short *events) { if (reader->driver->ops->get_eventfd) { return reader->driver->ops->get_eventfd(reader, events); } else { return -1; } } static void ifd_slot_status_update(ifd_reader_t *reader, int slot, int status) { static unsigned int card_seq = 1; ct_info_t *info = reader->status; unsigned int prev_seq, new_seq; new_seq = prev_seq = info->ct_card[slot]; if (!(status & IFD_CARD_PRESENT)) { new_seq = 0; } else if (!prev_seq || (status & IFD_CARD_STATUS_CHANGED)) { new_seq = card_seq++; } if (prev_seq != new_seq) { ifd_debug(1, "card status change slot %d: %u -> %u", slot, prev_seq, new_seq); info->ct_card[slot] = new_seq; ct_status_update(info); } } void ifd_poll(ifd_reader_t *reader) { unsigned slot; /* Check if the card status changed */ for (slot = 0; slot < reader->nslots; slot++) { time_t now; int status; time(&now); if (now < reader->slot[slot].next_update) continue; /* Poll card status at most once a second * XXX: make this configurable */ reader->slot[slot].next_update = now + 1; if (ifd_card_status(reader, slot, &status) < 0) { /* Don't return error; let the hotplug test * pick up the detach if (rc == IFD_ERROR_DEVICE_DISCONNECTED) return rc; */ continue; } ifd_slot_status_update(reader, slot, status); } } int ifd_error(ifd_reader_t *reader) { if (reader->driver->ops->error == NULL) { return IFD_ERROR_NOT_SUPPORTED; } return reader->driver->ops->error(reader); } int ifd_event(ifd_reader_t *reader) { int status[OPENCT_MAX_SLOTS]; unsigned slot; int rc; if (reader->driver->ops->event == NULL) { return IFD_ERROR_NOT_SUPPORTED; } rc = reader->driver->ops->event(reader, status, reader->nslots); for (slot=0;slotnslots;slot++) { ifd_slot_status_update(reader, slot, status[slot]); } return rc; } openct-0.6.20/src/ifd/serial.c0000644000175000017500000002313710625640312012771 00000000000000/* * I/O routines for serial devices * * Copyright (C) 2003 Olaf Kirch */ #include "internal.h" #include #include #include #include #include #include #include #include #include static unsigned int termios_to_speed(unsigned int bits); static unsigned int speed_to_termios(unsigned int speed); /* * Reset the device */ static int ifd_serial_reset(ifd_device_t * dev) { ifd_device_params_t params, orig_params; int rc; if ((rc = ifd_device_get_parameters(dev, &orig_params)) < 0) return rc; /* Drop DTR */ params = orig_params; params.serial.speed = 0; params.serial.dtr = 0; if ((rc = ifd_device_set_parameters(dev, ¶ms)) < 0) return rc; usleep(500000); /* Change back to original config */ if ((rc = ifd_device_set_parameters(dev, &orig_params)) < 0) return rc; return 0; } /* * Get the current configuration */ static int ifd_serial_get_params(ifd_device_t * dev, ifd_device_params_t * params) { int control; unsigned int bits; struct termios t; memset(params, 0, sizeof(*params)); if (tcgetattr(dev->fd, &t) < 0) { ct_error("%s: tcgetattr: %m", dev->name); return -1; } switch (t.c_cflag & CSIZE) { case CS5: bits = 5; break; case CS6: bits = 6; break; case CS7: bits = 7; break; case CS8: bits = 8; break; default: bits = 8; /* hmmm */ } params->serial.speed = termios_to_speed(cfgetospeed(&t)); params->serial.bits = bits; params->serial.stopbits = (t.c_cflag & CSTOPB) ? 2 : 1; if (!(t.c_cflag & PARENB)) params->serial.parity = IFD_SERIAL_PARITY_NONE; else if (t.c_cflag & PARODD) params->serial.parity = IFD_SERIAL_PARITY_ODD; else params->serial.parity = IFD_SERIAL_PARITY_EVEN; if ((t.c_iflag & (INPCK | PARMRK)) == (INPCK | PARMRK)) params->serial.check_parity = 1; if (ioctl(dev->fd, TIOCMGET, &control) < 0) { ct_error("%s: TIOCMGET: %m", dev->name); return -1; } if (control & TIOCM_RTS) params->serial.rts = 1; if (control & TIOCM_DTR) params->serial.dtr = 1; dev->settings = *params; return 0; } /* * Set serial line params */ static int ifd_serial_set_params(ifd_device_t * dev, const ifd_device_params_t * params) { unsigned int speed; int control, ocontrol; struct termios t; if (tcgetattr(dev->fd, &t) < 0) { ct_error("%s: tcgetattr: %m", dev->name); return -1; } if (ct_config.debug) { char parity = 'N'; if (params->serial.parity == IFD_SERIAL_PARITY_EVEN) parity = 'E'; else if (params->serial.parity == IFD_SERIAL_PARITY_ODD) parity = 'O'; ifd_debug(1, "setting serial line to %u, %u%c%u, " "dtr=%d, rts=%d", params->serial.speed, params->serial.bits, parity, params->serial.stopbits, params->serial.dtr, params->serial.rts); } cfsetospeed(&t, speed_to_termios(params->serial.speed)); cfsetispeed(&t, speed_to_termios(params->serial.speed)); t.c_cflag &= ~CSIZE; switch (params->serial.bits) { case 5: t.c_cflag |= CS5; break; case 6: t.c_cflag |= CS6; break; case 7: t.c_cflag |= CS7; break; default: t.c_cflag |= CS8; break; } t.c_cflag &= ~(PARENB | PARODD); switch (params->serial.parity) { case IFD_SERIAL_PARITY_EVEN: t.c_cflag |= PARENB; break; case IFD_SERIAL_PARITY_ODD: t.c_cflag |= PARENB | PARODD; break; } t.c_cflag &= ~CSTOPB; if (params->serial.stopbits > 1) t.c_cflag |= CSTOPB; t.c_iflag = IGNBRK; if (params->serial.check_parity) t.c_iflag = INPCK | PARMRK; else t.c_iflag |= IGNPAR; #ifdef CRTSCTS t.c_cflag &= ~CRTSCTS; #endif t.c_cflag |= HUPCL | CREAD | CLOCAL; t.c_oflag = 0; t.c_lflag = 0; if (tcsetattr(dev->fd, TCSANOW, &t) < 0) { ct_error("%s: tcsetattr: %m", dev->name); return -1; } if ((speed = termios_to_speed(cfgetospeed(&t))) != 0) dev->etu = 1000000 / speed; if (ioctl(dev->fd, TIOCMGET, &ocontrol) < 0) { ct_error("%s: TIOCMGET: %m", dev->name); return -1; } control = ocontrol & ~(TIOCM_DTR | TIOCM_RTS); if (params->serial.rts) control |= TIOCM_RTS; if (params->serial.dtr) control |= TIOCM_DTR; if (((control ^ ocontrol) & (TIOCM_DTR | TIOCM_RTS)) && ioctl(dev->fd, TIOCMSET, &control) < 0) { ct_error("%s: TIOCMGET: %m", dev->name); return -1; } dev->settings = *params; return 0; } /* * Flush pending input */ static void ifd_serial_flush(ifd_device_t * dev) { tcflush(dev->fd, TCIFLUSH); } /* * Send a BREAK command */ void ifd_serial_send_break(ifd_device_t * dev, unsigned int usec) { ioctl(dev->fd, TIOCSBRK); usleep(usec); ioctl(dev->fd, TIOCCBRK); } /* * Input/output routines */ static int ifd_serial_send(ifd_device_t * dev, const unsigned char *buffer, size_t len) { size_t total = len; int n; while (len) { n = write(dev->fd, buffer, len); if (n < 0) { ct_error("Error writing to %s: %m", dev->name); return -1; } buffer += n; len -= n; } return total; } static int ifd_serial_recv(ifd_device_t * dev, unsigned char *buffer, size_t len, long timeout) { size_t total = len, to_read; struct timeval begin; int n, last_ff = 0; gettimeofday(&begin, NULL); while (len) { struct pollfd pfd; long wait; if ((wait = timeout - ifd_time_elapsed(&begin)) < 0) goto timeout; pfd.fd = dev->fd; pfd.events = POLLIN; n = poll(&pfd, 1, wait); if (n < 0) { ct_error("%s: error while waiting for input: %m", dev->name); return -1; } if (n == 0) continue; to_read = len; if (dev->settings.serial.check_parity) to_read = 1; n = read(dev->fd, buffer, to_read); if (n < 0) { ct_error("%s: failed to read from device: %m", dev->name); return -1; } if (ct_config.debug >= 9) ifd_debug(9, "serial recv:%s", ct_hexdump(buffer, n)); /* Check for parity errors and 0xFF */ if (dev->settings.serial.check_parity) { if (last_ff) { if (buffer[0] == 0x00) { ct_error("%s: parity error on input", dev->name); return -1; } if (buffer[0] != 0xFF) { ifd_debug(1, "%s: unexpected character pair FF %02x", dev->name, buffer[0]); } last_ff = 0; } else if (buffer[0] == 0xFF) { last_ff = 1; continue; } } buffer += n; len -= n; } return total; timeout: /* Timeouts are a little special; they may happen e.g. * when trying to obtain the ATR */ if (!ct_config.suppress_errors) ct_error("%s: timed out while waiting for input", dev->name); ifd_debug(9, "(%u bytes received so far)", total - len); return IFD_ERROR_TIMEOUT; } /* * Get status of modem lines */ int ifd_serial_get_dtr(ifd_device_t * dev) { int status; if (ioctl(dev->fd, TIOCMGET, &status) < 0) { ct_error("%s: ioctl(TIOCMGET) failed: %m", dev->name); return -1; } return (status & TIOCM_DTR) ? 1 : 0; } int ifd_serial_get_dsr(ifd_device_t * dev) { int status; if (ioctl(dev->fd, TIOCMGET, &status) < 0) { ct_error("%s: ioctl(TIOCMGET) failed: %m", dev->name); return -1; } return (status & TIOCM_DSR) ? 1 : 0; } int ifd_serial_get_cts(ifd_device_t * dev) { int status; if (ioctl(dev->fd, TIOCMGET, &status) < 0) { ct_error("%s: ioctl(TIOCMGET) failed: %m", dev->name); return -1; } return (status & TIOCM_CTS) ? 1 : 0; } /* * Close the device */ static void ifd_serial_close(ifd_device_t * dev) { if (dev->fd >= 0) close(dev->fd); dev->fd = -1; } static struct ifd_device_ops ifd_serial_ops; /* * Open serial device */ ifd_device_t *ifd_open_serial(const char *name) { ifd_device_params_t params; ifd_device_t *dev; int fd; if ((fd = open(name, O_RDWR | O_NDELAY)) < 0) { ct_error("Unable to open %s: %m", name); return NULL; } /* Clear the NDELAY flag */ fcntl(fd, F_SETFL, 0); ifd_serial_ops.reset = ifd_serial_reset; ifd_serial_ops.set_params = ifd_serial_set_params; ifd_serial_ops.get_params = ifd_serial_get_params; ifd_serial_ops.flush = ifd_serial_flush; ifd_serial_ops.send_break = ifd_serial_send_break; ifd_serial_ops.send = ifd_serial_send; ifd_serial_ops.recv = ifd_serial_recv; ifd_serial_ops.close = ifd_serial_close; dev = ifd_device_new(name, &ifd_serial_ops, sizeof(*dev)); dev->timeout = 1000; /* acceptable? */ dev->type = IFD_DEVICE_TYPE_SERIAL; dev->fd = fd; memset(¶ms, 0, sizeof(params)); params.serial.speed = 9600; params.serial.bits = 8; params.serial.parity = IFD_SERIAL_PARITY_NONE; params.serial.stopbits = 1; params.serial.rts = 1; params.serial.dtr = 1; ifd_serial_set_params(dev, ¶ms); return dev; } /* * Map termios speed flags to speed */ static struct { unsigned int bits, speed; } termios_speed[] = { #ifdef B0 { B0, 0 }, #endif #ifdef B50 { B50, 50 }, #endif #ifdef B75 { B75, 75 }, #endif #ifdef B110 { B110, 110 }, #endif #ifdef B134 { B134, 134 }, #endif #ifdef B150 { B150, 150 }, #endif #ifdef B200 { B200, 200 }, #endif #ifdef B300 { B300, 300 }, #endif #ifdef B600 { B600, 600 }, #endif #ifdef B1200 { B1200, 1200 }, #endif #ifdef B1800 { B1800, 1800 }, #endif #ifdef B2400 { B2400, 2400 }, #endif #ifdef B4800 { B4800, 4800 }, #endif #ifdef B9600 { B9600, 9600 }, #endif #ifdef B19200 { B19200, 19200 }, #endif #ifdef B38400 { B38400, 38400 }, #endif #ifdef B57600 { B57600, 57600 }, #endif #ifdef B115200 { B115200, 115200 }, #endif #ifdef B230400 { B230400, 230400 }, #endif { -1, -1 } }; static unsigned int speed_to_termios(unsigned int speed) { unsigned int n; for (n = 0; termios_speed[n].bits >= 0; n++) { if (termios_speed[n].speed >= speed) { return termios_speed[n].bits; } } return B9600; } static unsigned int termios_to_speed(unsigned int bits) { unsigned int n; for (n = 0; termios_speed[n].bits >= 0; n++) { if (termios_speed[n].bits == bits) { return termios_speed[n].speed; } } return 0; } openct-0.6.20/src/ifd/usb-descriptors.h0000644000175000017500000001023310422076714014644 00000000000000/* * USB Descriptor parsing functions * * Copyright (c) 2000-2001 Johannes Erdfelt * Copyright 2003, Chaskiel Grundman * * This header file is purely internal to OpenCT. */ #ifndef __USB_DESCRIPTORS_H__ #define __USB_DESCRIPTORS_H__ #include /* * Descriptor types */ #define IFD_USB_DT_DEVICE 0x01 #define IFD_USB_DT_CONFIG 0x02 #define IFD_USB_DT_STRING 0x03 #define IFD_USB_DT_INTERFACE 0x04 #define IFD_USB_DT_ENDPOINT 0x05 /* * Descriptor sizes per descriptor type */ #define IFD_USB_DT_DEVICE_SIZE 18 #define IFD_USB_DT_CONFIG_SIZE 9 #define IFD_USB_DT_INTERFACE_SIZE 9 #define IFD_USB_DT_ENDPOINT_SIZE 7 #define IFD_USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ #define IFD_USB_DT_HUB_NONVAR_SIZE 7 struct ifd_usb_descriptor_header { uint8_t bLength; uint8_t bDescriptorType; }; /* String descriptor */ struct ifd_usb_string_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t wData[1]; }; /* Endpoint descriptor */ #define IFD_USB_MAXENDPOINTS 32 struct ifd_usb_endpoint_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint8_t bEndpointAddress; uint8_t bmAttributes; uint16_t wMaxPacketSize; uint8_t bInterval; uint8_t bRefresh; uint8_t bSynchAddress; unsigned char *extra; /* Extra descriptors */ int extralen; }; #define IFD_USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ #define IFD_USB_ENDPOINT_DIR_MASK 0x80 #define IFD_USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ #define IFD_USB_ENDPOINT_TYPE_CONTROL 0 #define IFD_USB_ENDPOINT_TYPE_ISOCHRONOUS 1 #define IFD_USB_ENDPOINT_TYPE_BULK 2 #define IFD_USB_ENDPOINT_TYPE_INTERRUPT 3 /* Interface descriptor */ #define IFD_USB_MAXINTERFACES 32 struct ifd_usb_interface_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint8_t bInterfaceNumber; uint8_t bAlternateSetting; uint8_t bNumEndpoints; uint8_t bInterfaceClass; uint8_t bInterfaceSubClass; uint8_t bInterfaceProtocol; uint8_t iInterface; struct ifd_usb_endpoint_descriptor *endpoint; unsigned char *extra; /* Extra descriptors */ int extralen; }; #define IFD_USB_MAXALTSETTING 128 /* Hard limit */ struct ifd_usb_interface { struct ifd_usb_interface_descriptor *altsetting; int num_altsetting; }; /* Configuration descriptor information.. */ #define IFD_USB_MAXCONFIG 8 struct ifd_usb_config_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t wTotalLength; uint8_t bNumInterfaces; uint8_t bConfigurationValue; uint8_t iConfiguration; uint8_t bmAttributes; uint8_t MaxPower; struct ifd_usb_interface *interface; unsigned char *extra; /* Extra descriptors */ int extralen; }; /* Device descriptor */ struct ifd_usb_device_descriptor { uint8_t bLength; uint8_t bDescriptorType; uint16_t bcdUSB; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; uint8_t bMaxPacketSize0; uint16_t idVendor; uint16_t idProduct; uint16_t bcdDevice; uint8_t iManufacturer; uint8_t iProduct; uint8_t iSerialNumber; uint8_t bNumConfigurations; }; #define IFD_USB_REQ_GET_DESCRIPTOR 0x06 #define IFD_USB_TYPE_STANDARD (0x00 << 5) #define IFD_USB_TYPE_CLASS (0x01 << 5) #define IFD_USB_TYPE_VENDOR (0x02 << 5) #define IFD_USB_TYPE_RESERVED (0x03 << 5) #define IFD_USB_RECIP_DEVICE 0x00 #define IFD_USB_RECIP_INTERFACE 0x01 #define IFD_USB_RECIP_ENDPOINT 0x02 #define IFD_USB_RECIP_OTHER 0x03 #define IFD_USB_ENDPOINT_IN 0x80 #define IFD_USB_ENDPOINT_OUT 0x00 #define IFD_USB_LE16_TO_CPU(x) do { unsigned char *y=(unsigned char *)(&x); x = (y[1] << 8) | y[0] ; } while(0) extern int ifd_usb_get_device(ifd_device_t * dev, struct ifd_usb_device_descriptor *d); extern int ifd_usb_get_config(ifd_device_t * dev, int n, struct ifd_usb_config_descriptor *c); extern void ifd_usb_free_configuration(struct ifd_usb_config_descriptor *c); #endif openct-0.6.20/src/ifd/sys-osx.c0000644000175000017500000000372111151454644013142 00000000000000/* * Mac OS X specific implementation - TO BE DONE * * Copyright (C) 2003 Olaf Kirch * */ #include "internal.h" #if defined(__APPLE__) #include #include #include /* * USB handling */ int ifd_sysdep_usb_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { return -1; } int ifd_sysdep_usb_get_eventfd(ifd_device_t * dev, short *events) { return -1; } int ifd_sysdep_usb_control(ifd_device_t * dev, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len, long timeout) { return -1; } int ifd_sysdep_usb_set_configuration(ifd_device_t * dev, int config) { return -1; } int ifd_sysdep_usb_set_interface(ifd_device_t * dev, int ifc, int alt) { return -1; } int ifd_sysdep_usb_claim_interface(ifd_device_t * dev, int interface) { return -1; } int ifd_sysdep_usb_release_interface(ifd_device_t * dev, int interface) { return -1; } /* * USB bulk transfer */ int ifd_sysdep_usb_bulk(ifd_device_t * dev, int ep, void *buffer, size_t len, long timeout) { return -1; } /* * USB URB capture */ struct ifd_usb_capture { int type; int endpoint; size_t maxpacket; unsigned int interface; }; int ifd_sysdep_usb_begin_capture(ifd_device_t * dev, int type, int endpoint, size_t maxpacket, ifd_usb_capture_t ** capret) { return -1; } int ifd_sysdep_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len) { return IFD_ERROR_NOT_SUPPORTED; } int ifd_sysdep_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len, long timeout) { return -1; } int ifd_sysdep_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap) { return -1; } int ifd_sysdep_usb_open(const char *device) { return -1; } int ifd_sysdep_usb_reset(ifd_device_t * dev) { return -1; } /* * Scan all usb devices to see if there is one we support */ int ifd_scan_usb(void) { return 0; } #endif openct-0.6.20/src/ifd/ifd-etoken.c0000644000175000017500000001004311151454644013535 00000000000000/* * eToken driver * * Copyright (C) 2003, Olaf Kirch * * Based on information from the etoken driver by * Andreas Jellinghaus . */ #include "internal.h" #include #include #define ET_TIMEOUT 1000 static int et_magic(ifd_device_t *); /* * Initialize the device */ static int et_open(ifd_reader_t * reader, const char *device_name) { ifd_device_t *dev; ifd_device_params_t params; reader->name = "Aladdin eToken PRO"; reader->nslots = 1; if (!(dev = ifd_device_open(device_name))) return -1; if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) { ct_error("etoken: device %s is not a USB device", device_name); ifd_device_close(dev); return -1; } params = dev->settings; params.usb.interface = 0; if (ifd_device_set_parameters(dev, ¶ms) < 0) { ct_error("etoken: setting parameters failed", device_name); ifd_device_close(dev); return -1; } reader->device = dev; return 0; } /* Some magic incantations copied from Andreas * Jellinghaus' eToken driver * */ static int et_magic(ifd_device_t * dev) { unsigned char cookie[] = { 0x00, 0x00, 0x01, 0x00, 0x88, 0x13 }; unsigned char buffer[256]; if (ifd_usb_control(dev, 0x40, 0x03, 0, 0, NULL, 0, -1) < 0 || ifd_usb_control(dev, 0xc0, 0x83, 0, 0, buffer, 13, -1) != 13 || ifd_usb_control(dev, 0x40, 0x02, 0, 0, cookie, sizeof(cookie), -1) < 0 || ifd_usb_control(dev, 0xc0, 0x82, 0, 0, buffer, 1, -1) != 1 || buffer[0] != 0) return -1; return 0; } /* * Power up the reader */ static int et_activate(ifd_reader_t * reader) { return 0; } static int et_deactivate(ifd_reader_t * reader) { return -1; } /* * Card status - always present */ static int et_card_status(ifd_reader_t * reader, int slot, int *status) { *status = IFD_CARD_PRESENT; return 0; } /* * Reset - nothing to be done? * We should do something to make it come back with all state zapped */ static int et_card_reset(ifd_reader_t * reader, int slot, void *atr, size_t size) { ifd_device_t *dev = reader->device; unsigned char buffer[256]; int rc, n, atrlen; /* Request the ATR */ rc = ifd_usb_control(dev, 0x40, 0x01, 0, 0, NULL, 0, ET_TIMEOUT); if (rc < 0) goto failed; /* Receive the ATR */ rc = ifd_usb_control(dev, 0xc0, 0x81, 0, 0, buffer, 0x23, ET_TIMEOUT); if (rc <= 0) goto failed; n = buffer[0]; if (n + 1 > rc) goto failed; if (n > IFD_MAX_ATR_LEN) goto failed; if (n > size) n = size; atrlen = n; memcpy(atr, buffer + 1, atrlen); if (et_magic(dev) < 0) goto failed; return atrlen; failed: ct_error("etoken: failed to activate token"); return -1; } /* * Send/receive routines */ static int et_send(ifd_reader_t * reader, unsigned int dad, const unsigned char *buffer, size_t len) { return ifd_usb_control(reader->device, 0x40, 0x06, 0, 0, (void *)buffer, len, -1); } static int et_recv(ifd_reader_t * reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout) { return ifd_usb_control(reader->device, 0xc0, 0x86, 0, 0, buffer, len, timeout); } static int et_get_eventfd(ifd_reader_t * reader, short *events) { ifd_debug(1, "called."); return ifd_device_get_eventfd(reader->device, events); } static int et_event(ifd_reader_t * reader, int *status, size_t status_size) { (void)reader; (void)status; (void)status_size; ifd_debug(1, "called."); return 0; } static int et_error(ifd_reader_t * reader) { (void)reader; ifd_debug(1, "called."); return IFD_ERROR_DEVICE_DISCONNECTED; } /* * Driver operations */ static struct ifd_driver_ops etoken_driver; /* * Initialize this module */ void ifd_etoken_register(void) { etoken_driver.open = et_open; etoken_driver.activate = et_activate; etoken_driver.deactivate = et_deactivate; etoken_driver.card_status = et_card_status; etoken_driver.card_reset = et_card_reset; etoken_driver.send = et_send; etoken_driver.recv = et_recv; etoken_driver.get_eventfd = et_get_eventfd; etoken_driver.event = et_event; etoken_driver.error = et_error; ifd_driver_register("etoken", &etoken_driver); } openct-0.6.20/src/ifd/process.c0000644000175000017500000002724111141256300013162 00000000000000/* * IFD resource manager protocol handling * * Copyright (C) 2003 Olaf Kirch */ #include "internal.h" #ifdef HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "ifdhandler.h" static struct cmd_name { unsigned int value; const char *str; } cmd_name[] = { { CT_CMD_STATUS, "CT_CMD_STATUS"}, { CT_CMD_LOCK, "CT_CMD_LOCK"}, { CT_CMD_UNLOCK, "CT_CMD_UNLOCK"}, { CT_CMD_RESET, "CT_CMD_RESET"}, { CT_CMD_REQUEST_ICC, "CT_CMD_REQUEST_ICC"}, { CT_CMD_EJECT_ICC, "CT_CMD_EJECT_ICC"}, { CT_CMD_OUTPUT, "CT_CMD_OUTPUT"}, { CT_CMD_INPUT, "CT_CMD_INPUT"}, { CT_CMD_PERFORM_VERIFY, "CT_CMD_PERFORM_VERIFY"}, { CT_CMD_CHANGE_PIN, "CT_CMD_CHANGE_PIN"}, { CT_CMD_MEMORY_READ, "CT_CMD_MEMORY_READ"}, { CT_CMD_MEMORY_WRITE, "CT_CMD_MEMORY_WRITE"}, { CT_CMD_TRANSACT_OLD, "CT_CMD_TRANSACT_OLD"}, { CT_CMD_TRANSACT, "CT_CMD_TRANSACT"}, { CT_CMD_SET_PROTOCOL, "CT_CMD_SET_PROTOCOL"}, { 0, NULL},}; static const char *get_cmd_name(unsigned int cmd) { struct cmd_name *c; for (c = cmd_name; c->str; c++) { if (c->value == cmd) return c->str; } return ""; } static int do_before_command(ifd_reader_t *); static int do_after_command(ifd_reader_t *); static int do_status(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_output(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_lock(ct_socket_t *, ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_unlock(ct_socket_t *, ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_reset(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_eject(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_verify(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_transact(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_memory_read(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_memory_write(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); static int do_transact_old(ifd_reader_t *, int, ct_buf_t *, ct_buf_t *); static int do_set_protocol(ifd_reader_t *, int, ct_tlv_parser_t *, ct_tlv_builder_t *); int ifdhandler_process(ct_socket_t * sock, ifd_reader_t * reader, ct_buf_t * argbuf, ct_buf_t * resbuf) { unsigned char cmd, unit; ct_tlv_parser_t args; ct_tlv_builder_t resp; int rc; /* Get command and target unit */ if (ct_buf_get(argbuf, &cmd, 1) < 0 || ct_buf_get(argbuf, &unit, 1) < 0) return IFD_ERROR_INVALID_MSG; ifd_debug(1, "ifdhandler_process(cmd=%s, unit=%u)", get_cmd_name(cmd), unit); /* First, handle commands that don't do TLV encoded * arguments - currently this is only CT_CMD_TRANSACT. */ if (cmd == CT_CMD_TRANSACT_OLD) { /* Security - deny any APDUs if there's an * exclusive lock held by some other client. */ if ((rc = ifdhandler_check_lock(sock, unit, IFD_LOCK_EXCLUSIVE)) < 0) return rc; return do_transact_old(reader, unit, argbuf, resbuf); } if ((rc = do_before_command(reader)) < 0) { return rc; } memset(&args, 0, sizeof(args)); if (ct_tlv_parse(&args, argbuf) < 0) return IFD_ERROR_INVALID_MSG; if (args.use_large_tags) sock->use_large_tags = 1; ct_tlv_builder_init(&resp, resbuf, sock->use_large_tags); switch (cmd) { case CT_CMD_STATUS: rc = do_status(reader, unit, &args, &resp); break; case CT_CMD_OUTPUT: rc = do_output(reader, unit, &args, &resp); break; case CT_CMD_RESET: case CT_CMD_REQUEST_ICC: rc = do_reset(reader, unit, &args, &resp); break; case CT_CMD_EJECT_ICC: rc = do_eject(reader, unit, &args, &resp); break; case CT_CMD_PERFORM_VERIFY: rc = do_verify(reader, unit, &args, &resp); break; case CT_CMD_LOCK: rc = do_lock(sock, reader, unit, &args, &resp); break; case CT_CMD_UNLOCK: rc = do_unlock(sock, reader, unit, &args, &resp); break; case CT_CMD_MEMORY_READ: rc = do_memory_read(reader, unit, &args, &resp); break; case CT_CMD_MEMORY_WRITE: rc = do_memory_write(reader, unit, &args, &resp); break; case CT_CMD_TRANSACT: rc = do_transact(reader, unit, &args, &resp); break; case CT_CMD_SET_PROTOCOL: rc = do_set_protocol(reader, unit, &args, &resp); break; default: return IFD_ERROR_INVALID_CMD; } if (rc >= 0) rc = resp.error; /* * TODO consider checking error */ do_after_command(reader); return rc; } /* * Before command */ static int do_before_command(ifd_reader_t * reader) { return ifd_before_command(reader); } /* * After command */ static int do_after_command(ifd_reader_t * reader) { return ifd_after_command(reader); } /* * Status query */ static int do_status(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { int n, rc, status; switch (unit) { case CT_UNIT_READER: ct_tlv_put_string(resp, CT_TAG_READER_NAME, reader->name); ct_tlv_put_tag(resp, CT_TAG_READER_UNITS); for (n = 0; n < reader->nslots; n++) ct_tlv_add_byte(resp, n); if (reader->flags & IFD_READER_DISPLAY) ct_tlv_add_byte(resp, CT_UNIT_DISPLAY); if (reader->flags & IFD_READER_KEYPAD) ct_tlv_add_byte(resp, CT_UNIT_KEYPAD); break; default: if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; if ((rc = ifd_activate(reader)) < 0 || (rc = ifd_card_status(reader, unit, &status)) < 0) return rc; ct_tlv_put_int(resp, CT_TAG_CARD_STATUS, status); break; } return 0; } /* * Output string to reader's display */ static int do_output(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { char msgbuf[128]; const char *message = NULL; if (unit > CT_UNIT_READER) return IFD_ERROR_INVALID_ARG; /* See if we have message parameter */ if (ct_tlv_get_string(args, CT_TAG_MESSAGE, msgbuf, sizeof(msgbuf)) > 0) message = msgbuf; return ifd_output(reader, message); } /* * Lock/unlock card */ static int do_lock(ct_socket_t * sock, ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { unsigned int lock_type; ct_lock_handle lock; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; if (ct_tlv_get_int(args, CT_TAG_LOCKTYPE, &lock_type) == 0) return IFD_ERROR_MISSING_ARG; if ((rc = ifdhandler_lock(sock, unit, lock_type, &lock)) < 0) return rc; /* Return the lock handle */ ct_tlv_put_int(resp, CT_TAG_LOCK, lock); return 0; } static int do_unlock(ct_socket_t * sock, ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { ct_lock_handle lock; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; if (ct_tlv_get_int(args, CT_TAG_LOCK, &lock) == 0) return IFD_ERROR_MISSING_ARG; if ((rc = ifdhandler_unlock(sock, unit, lock)) < 0) return rc; return 0; } /* * Reset card */ static int do_reset(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { unsigned char atr[64]; char msgbuf[128]; const char *message = NULL; unsigned int timeout = 0; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; /* See if we have timeout and/or message parameters */ ct_tlv_get_int(args, CT_TAG_TIMEOUT, &timeout); if (ct_tlv_get_string(args, CT_TAG_MESSAGE, msgbuf, sizeof(msgbuf)) > 0) message = msgbuf; rc = ifd_card_request(reader, unit, timeout, message, atr, sizeof(atr)); if (rc < 0) return rc; /* Add the ATR to the response */ if (rc != 0) { ct_tlv_put_tag(resp, CT_TAG_ATR); ct_tlv_add_bytes(resp, atr, rc); } return 0; } /* * Eject card */ static int do_eject(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { char msgbuf[128]; const char *message = NULL; unsigned int timeout = 0; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; /* See if we have timeout and/or message parameters */ ct_tlv_get_int(args, CT_TAG_TIMEOUT, &timeout); if (ct_tlv_get_string(args, CT_TAG_MESSAGE, msgbuf, sizeof(msgbuf)) > 0) message = msgbuf; rc = ifd_card_eject(reader, unit, timeout, message); if (rc < 0) return rc; return 0; } /* * Request PIN through key pad and have card verify it */ static int do_verify(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { char msgbuf[128]; unsigned char *data; size_t data_len; const char *message = NULL; unsigned int timeout = 0; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; /* See if we have timeout and/or message parameters */ ct_tlv_get_int(args, CT_TAG_TIMEOUT, &timeout); if (ct_tlv_get_string(args, CT_TAG_MESSAGE, msgbuf, sizeof(msgbuf)) > 0) message = msgbuf; if (!ct_tlv_get_opaque(args, CT_TAG_PIN_DATA, &data, &data_len)) return IFD_ERROR_MISSING_ARG; rc = ifd_card_perform_verify(reader, unit, timeout, message, data, data_len, (unsigned char *)msgbuf, sizeof(msgbuf)); if (rc < 0) return rc; ct_tlv_put_tag(resp, CT_TAG_CARD_RESPONSE); ct_tlv_add_bytes(resp, (const unsigned char *)msgbuf, rc); return 0; } /* * Transceive APDU */ static int do_transact(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { unsigned char replybuf[258]; unsigned char *data; size_t data_len; unsigned int timeout = 0; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; ct_tlv_get_int(args, CT_TAG_TIMEOUT, &timeout); if (!ct_tlv_get_opaque(args, CT_TAG_CARD_REQUEST, &data, &data_len)) return IFD_ERROR_MISSING_ARG; rc = ifd_card_command(reader, unit, data, data_len, replybuf, sizeof(replybuf)); if (rc < 0) return rc; ct_tlv_put_tag(resp, CT_TAG_CARD_RESPONSE); ct_tlv_add_bytes(resp, replybuf, rc); return 0; } static int do_transact_old(ifd_reader_t * reader, int unit, ct_buf_t * args, ct_buf_t * resp) { int rc; rc = ifd_card_command(reader, unit, ct_buf_head(args), ct_buf_avail(args), ct_buf_tail(resp), ct_buf_tailroom(resp)); if (rc < 0) return rc; ct_buf_put(resp, NULL, rc); return 0; } static int do_set_protocol(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { unsigned int protocol = 0xFF; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; if (ct_tlv_get_int(args, CT_TAG_PROTOCOL, &protocol) == 0) return IFD_ERROR_MISSING_ARG; rc = ifd_set_protocol(reader, unit, protocol); if (rc < 0) return rc; return 0; } /* * Synchronous ICC read/write */ static int do_memory_write(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { unsigned char *data; unsigned int data_len; unsigned int address; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; if (ct_tlv_get_int(args, CT_TAG_ADDRESS, &address) == 0 || !ct_tlv_get_opaque(args, CT_TAG_DATA, &data, &data_len)) return IFD_ERROR_MISSING_ARG; rc = ifd_card_write_memory(reader, unit, address, data, data_len); if (rc < 0) return rc; return 0; } static int do_memory_read(ifd_reader_t * reader, int unit, ct_tlv_parser_t * args, ct_tlv_builder_t * resp) { unsigned char data[CT_SOCKET_BUFSIZ]; unsigned int data_len; unsigned int address; int rc; if (unit > reader->nslots) return IFD_ERROR_INVALID_SLOT; if (ct_tlv_get_int(args, CT_TAG_ADDRESS, &address) == 0 || !ct_tlv_get_int(args, CT_TAG_COUNT, &data_len)) return IFD_ERROR_MISSING_ARG; if (data_len > sizeof(data)) data_len = sizeof(data); rc = ifd_card_read_memory(reader, unit, address, data, data_len); if (rc < 0) return rc; ct_tlv_put_opaque(resp, CT_TAG_DATA, data, rc); return 0; } openct-0.6.20/src/ifd/pcmcia.c0000644000175000017500000000523211143001716012735 00000000000000/* * I/O routines for pcmcia devices * * Copyright (C) 2003 Olaf Kirch * Copyright (C) 2005 Harald Welte */ #include "internal.h" #include #include #include #include #include #include #include #include /* * Input/output routines */ static int ifd_pcmcia_send(ifd_device_t * dev, const unsigned char *buffer, size_t len) { size_t total = len; int n; while (len) { n = write(dev->fd, buffer, len); if (n < 0) { ct_error("Error writing to %s: %m", dev->name); return -1; } buffer += n; len -= n; } return total; } static int ifd_pcmcia_recv(ifd_device_t * dev, unsigned char *buffer, size_t len, long timeout) { size_t total = len, to_read; struct timeval begin; int n; gettimeofday(&begin, NULL); while (len) { struct pollfd pfd; long wait; if ((wait = timeout - ifd_time_elapsed(&begin)) < 0) goto timeout; pfd.fd = dev->fd; pfd.events = POLLIN; n = poll(&pfd, 1, wait); if (n < 0) { ct_error("%s: error while waiting for input: %m", dev->name); return -1; } if (n == 0) continue; to_read = len; n = read(dev->fd, buffer, to_read); if (n < 0) { ct_error("%s: failed to read from device: %m", dev->name); return -1; } if (ct_config.debug >= 9) ifd_debug(9, "pcmcia recv:%s", ct_hexdump(buffer, n)); buffer += n; len -= n; } return total; timeout: /* Timeouts are a little special; they may happen e.g. * when trying to obtain the ATR */ if (!ct_config.suppress_errors) ct_error("%s: timed out while waiting for input", dev->name); ifd_debug(9, "(%u bytes received so far)", total - len); return IFD_ERROR_TIMEOUT; } /* * Set pcmcia params */ static int ifd_pcmcia_set_params(ifd_device_t * dev, const ifd_device_params_t * params) { /* nothing to do so far */ dev->settings = *params; return 0; } /* * Close the device */ static void ifd_pcmcia_close(ifd_device_t * dev) { if (dev->fd >= 0) close(dev->fd); dev->fd = -1; } static struct ifd_device_ops ifd_pcmcia_ops; /* * Open serial device */ ifd_device_t *ifd_open_pcmcia(const char *name) { ifd_device_t *dev; int fd; if ((fd = open(name, O_RDWR)) < 0) { ct_error("Unable to open %s: %m", name); return NULL; } ifd_pcmcia_ops.send = ifd_pcmcia_send; ifd_pcmcia_ops.recv = ifd_pcmcia_recv; ifd_pcmcia_ops.set_params = ifd_pcmcia_set_params; ifd_pcmcia_ops.close = ifd_pcmcia_close; dev = ifd_device_new(name, &ifd_pcmcia_ops, sizeof(*dev)); dev->timeout = 1000; /* acceptable? */ dev->type = IFD_DEVICE_TYPE_PCMCIA; dev->fd = fd; return dev; } openct-0.6.20/src/ifd/sys-linux.c0000644000175000017500000003451111233772200013461 00000000000000/* * Linux specific functions * * Copyright (C) 2003 Olaf Kirch * * These functions need to be re-implemented for every * new platform. */ #include "internal.h" #if defined (__linux__) && !defined (sunray) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef ENABLE_LIBUSB #include #endif #include /* imported from linux kernel header include/linux/usbdevice_fs.h */ #define USBDEVICE_SUPER_MAGIC 0x9fa2 /* usbdevfs ioctl codes */ struct usbdevfs_ctrltransfer { uint8_t bRequestType; uint8_t bRequest; uint16_t wValue; uint16_t wIndex; uint16_t wLength; uint32_t timeout; /* in milliseconds */ void *data; }; struct usbdevfs_bulktransfer { unsigned int ep; unsigned int len; unsigned int timeout; /* in milliseconds */ void *data; }; struct usbdevfs_setinterface { unsigned int interface; unsigned int altsetting; }; struct usbdevfs_disconnectsignal { unsigned int signr; void *context; }; #define USBDEVFS_MAXDRIVERNAME 255 struct usbdevfs_getdriver { unsigned int interface; char driver[USBDEVFS_MAXDRIVERNAME + 1]; }; struct usbdevfs_connectinfo { unsigned int devnum; unsigned char slow; }; #define USBDEVFS_URB_SHORT_NOT_OK 1 #define USBDEVFS_URB_ISO_ASAP 2 #define USBDEVFS_URB_TYPE_ISO 0 #define USBDEVFS_URB_TYPE_INTERRUPT 1 #define USBDEVFS_URB_TYPE_CONTROL 2 #define USBDEVFS_URB_TYPE_BULK 3 struct usbdevfs_iso_packet_desc { unsigned int length; unsigned int actual_length; unsigned int status; }; struct usbdevfs_urb { unsigned char type; unsigned char endpoint; int status; unsigned int flags; void *buffer; int buffer_length; int actual_length; int start_frame; int number_of_packets; int error_count; unsigned int signr; /* signal to be sent on error, -1 if none should be sent */ void *usercontext; struct usbdevfs_iso_packet_desc iso_frame_desc[0]; }; /* ioctls for talking directly to drivers */ struct usbdevfs_ioctl { int ifno; /* interface 0..N ; negative numbers reserved */ int ioctl_code; /* MUST encode size + direction of data so the * macros in give correct values */ void *data; /* param buffer (in, or out) */ }; /* You can do most things with hubs just through control messages, * except find out what device connects to what port. */ struct usbdevfs_hub_portinfo { char nports; /* number of downstream ports in this hub */ char port [127]; /* e.g. port 3 connects to device 27 */ }; #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) #define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver) #define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb) #define USBDEVFS_DISCARDURB _IO('U', 11) #define USBDEVFS_REAPURB _IOW('U', 12, void *) #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) #define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) #define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) #define USBDEVFS_RESET _IO('U', 20) #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) #define USBDEVFS_DISCONNECT _IO('U', 22) #define USBDEVFS_CONNECT _IO('U', 23) /* end of import from usbdevice_fs.h */ #define USB_DISCONNECT_SIGNAL (SIGRTMIN) /* * Poll for presence of USB device */ int ifd_sysdep_usb_poll_presence(ifd_device_t * dev, struct pollfd *pfd) { if (pfd->revents & POLLHUP) return 0; pfd->fd = dev->fd; pfd->events = POLLHUP; return 1; } /* * Event fd to use. */ int ifd_sysdep_usb_get_eventfd(ifd_device_t * dev, short *events) { *events = POLLOUT; return dev->fd; } /* * USB control command */ int ifd_sysdep_usb_control(ifd_device_t * dev, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int idx, void *data, size_t len, long timeout) { struct usbdevfs_ctrltransfer ctrl; int rc; ctrl.bRequestType = requesttype; ctrl.bRequest = request; ctrl.wValue = value; ctrl.wIndex = idx; ctrl.wLength = len; ctrl.data = data; ctrl.timeout = timeout; if ((rc = ioctl(dev->fd, USBDEVFS_CONTROL, &ctrl)) < 0) { ct_error("usb_control failed: %m"); return IFD_ERROR_COMM_ERROR; } return rc; } int ifd_sysdep_usb_set_configuration(ifd_device_t * dev, int config) { if (ioctl(dev->fd, USBDEVFS_SETCONFIGURATION, &config) < 0) { ct_error("usb_setconfig failed: %m"); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_set_interface(ifd_device_t * dev, int ifc, int alt) { struct usbdevfs_setinterface set; set.interface = ifc; set.altsetting = alt; if (ioctl(dev->fd, USBDEVFS_SETINTERFACE, &set) < 0) { ct_error("usb_setinterface failed: %m"); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_claim_interface(ifd_device_t * dev, int interface) { if (ioctl(dev->fd, USBDEVFS_CLAIMINTERFACE, &interface) < 0) { ct_error("usb_claiminterface failed: %m"); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_release_interface(ifd_device_t * dev, int interface) { if (ioctl(dev->fd, USBDEVFS_RELEASEINTERFACE, &interface) < 0) { ct_error("usb_releaseinterface failed: %m"); return IFD_ERROR_COMM_ERROR; } return 0; } int ifd_sysdep_usb_reset(ifd_device_t * dev) { if (ioctl(dev->fd, USBDEVFS_RESET, NULL) < 0) { ct_error("usb_reset failed: %m"); return IFD_ERROR_COMM_ERROR; } return 0; } /* * USB bulk transfer */ int ifd_sysdep_usb_bulk(ifd_device_t * dev, int ep, void *buffer, size_t len, long timeout) { struct usbdevfs_bulktransfer bulk; int rc; bulk.ep = ep; bulk.data = buffer; bulk.len = len; bulk.timeout = timeout; if ((rc = ioctl(dev->fd, USBDEVFS_BULK, &bulk)) < 0) { ct_error("usb_bulk failed: %m"); return IFD_ERROR_COMM_ERROR; } return rc; } /* * USB URB capture */ struct ifd_usb_capture { struct usbdevfs_urb urb; int type; int endpoint; size_t maxpacket; }; static int usb_submit_urb(int fd, struct ifd_usb_capture *cap) { /* Fill in the URB details */ ifd_debug(6, "submit urb %p", &cap->urb); memset(&cap->urb, 0, sizeof(cap->urb)); cap->urb.type = cap->type; cap->urb.endpoint = cap->endpoint; cap->urb.buffer = (caddr_t) (cap + 1); cap->urb.buffer_length = cap->maxpacket; return ioctl(fd, USBDEVFS_SUBMITURB, &cap->urb); } int ifd_sysdep_usb_begin_capture(ifd_device_t * dev, int type, int endpoint, size_t maxpacket, ifd_usb_capture_t ** capret) { ifd_usb_capture_t *cap; cap = (ifd_usb_capture_t *) calloc(1, sizeof(*cap) + maxpacket); if (!cap) { ct_error("out of memory"); return IFD_ERROR_NO_MEMORY; } cap->type = type; cap->endpoint = endpoint; cap->maxpacket = maxpacket; if (usb_submit_urb(dev->fd, cap) < 0) { ct_error("usb_submiturb failed: %m"); ifd_sysdep_usb_end_capture(dev, cap); return IFD_ERROR_COMM_ERROR; } *capret = cap; return 0; } int ifd_sysdep_usb_capture_event(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len) { struct usbdevfs_urb *purb; size_t copied = 0; int rc = 0; purb = NULL; rc = ioctl(dev->fd, USBDEVFS_REAPURBNDELAY, &purb); if (rc < 0) { if (errno == EAGAIN) return 0; ct_error("usb_reapurb failed: %m"); return IFD_ERROR_COMM_ERROR; } if (purb != &cap->urb) { ifd_debug(2, "reaped usb urb %p", purb); return 0; } if (purb->status == -1) { return IFD_ERROR_COMM_ERROR; } if (purb->actual_length) { ifd_debug(6, "usb reapurb: len=%u", purb->actual_length); if ((copied = purb->actual_length) > len) copied = len; if (copied && buffer) memcpy(buffer, purb->buffer, copied); } else { usleep(10000); } /* Re-submit URB */ usb_submit_urb(dev->fd, cap); return copied; } int ifd_sysdep_usb_capture(ifd_device_t * dev, ifd_usb_capture_t * cap, void *buffer, size_t len, long timeout) { struct timeval begin; size_t copied; int rc = 0; /* Loop until we've reaped the response to the * URB we sent */ copied = 0; gettimeofday(&begin, NULL); do { struct pollfd pfd; long wait; if ((wait = timeout - ifd_time_elapsed(&begin)) <= 0) return IFD_ERROR_TIMEOUT; pfd.fd = dev->fd; pfd.events = POLLOUT; if (poll(&pfd, 1, wait) != 1) continue; rc = ifd_sysdep_usb_capture_event(dev, cap, buffer, len); if (rc < 0) { return rc; } copied = (size_t)rc; } while (!copied); return copied; } int ifd_sysdep_usb_end_capture(ifd_device_t * dev, ifd_usb_capture_t * cap) { int rc = 0; if (ioctl(dev->fd, USBDEVFS_DISCARDURB, &cap->urb) < 0 && errno != EINVAL) { ct_error("usb_discardurb failed: %m"); rc = IFD_ERROR_COMM_ERROR; } /* Discarding an URB will place it in the queue of completed * request, with urb->status == -1. So if we don't reap this * URB now, the next call to REAPURB will return this one, * clobbering random memory. */ (void)ioctl(dev->fd, USBDEVFS_REAPURBNDELAY, &cap->urb); free(cap); return rc; } int ifd_sysdep_usb_open(const char *device) { struct usbdevfs_disconnectsignal ds; struct sigaction act; int fd = -1; int ret = -1; fd = open(device, O_RDWR); if (fd == -1) { goto cleanup; } /* * The following will send signal * to the process when device is disconnected * even if the signal is ignored the blocking * call will exit. * =linux-2.6.29 - works. */ memset(&act, 0, sizeof(act)); act.sa_handler = SIG_IGN; if (sigaction(USB_DISCONNECT_SIGNAL, &act, NULL) == -1) { goto cleanup; } memset(&ds, 0, sizeof(ds)); ds.signr = USB_DISCONNECT_SIGNAL; if (ioctl(fd, USBDEVFS_DISCSIGNAL, &ds) == -1) { goto cleanup; } ret = fd; fd = -1; cleanup: if (fd != -1) { close(fd); } return ret; } #ifndef ENABLE_LIBUSB static int read_number (const char *read_format, const char *format, ...) { va_list args; char full[PATH_MAX]; FILE *fp = NULL; int n = -1; va_start(args, format); vsnprintf (full, sizeof(full), format, args); va_end(args); if ((fp = fopen (full, "r")) == NULL) { goto out; } fscanf (fp, read_format, &n); out: if (fp != NULL) { fclose (fp); } return n; } #endif /* * Scan all usb devices to see if there is one we support */ int ifd_scan_usb(void) { #ifdef ENABLE_LIBUSB ifd_devid_t id; struct usb_bus *bus; struct usb_device *dev; usb_init(); usb_find_busses(); usb_find_devices(); id.type = IFD_DEVICE_TYPE_USB; id.num = 2; for (bus = usb_busses; bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { const char *driver = NULL; char typedev[PATH_MAX]; struct stat buf; id.val[0] = dev->descriptor.idVendor; id.val[1] = dev->descriptor.idProduct; /* if we don't find a driver with vendor/product * then check for the interface type (ccid) and use * driver ccid... */ if (!(driver = ifd_driver_for_id(&id))) { /* no driver found, check for interface class */ int conf; for (conf = 0; conf < dev->descriptor.bNumConfigurations; conf++) { int interf; for (interf = 0; interf < dev->config[conf].bNumInterfaces; interf++) { int alt; for (alt = 0; alt < dev->config[conf].interface[interf].num_altsetting; alt++) { if (dev->config[conf].interface[interf].altsetting[alt].bInterfaceClass == 0x0b) { driver = "ccid"; } } } } } if (driver != NULL) { snprintf(typedev, sizeof(typedev), "/dev/bus/usb/%s/%s", bus->dirname, dev->filename); if (stat(typedev, &buf) == 0) { snprintf(typedev, sizeof(typedev), "usb:/dev/bus/usb/%s/%s", bus->dirname, dev->filename); ifd_spawn_handler(driver, typedev, -1); } else { snprintf(typedev, sizeof(typedev), "usb:/proc/bus/usb/%s/%s", bus->dirname, dev->filename); ifd_spawn_handler(driver, typedev, -1); } } } } #else const char *base = "/sys/bus/usb/devices"; DIR *dir = NULL; struct dirent *ent; if ((dir = opendir (base)) == NULL) { goto out; } while ((ent = readdir (dir)) != NULL) { if (ent->d_name[0] != '.') { int idProduct = -1; int idVendor = -1; int busnum = -1; int devnum = -1; idProduct = read_number ("%x", "%s/%s/%s", base, ent->d_name, "idProduct"); idVendor = read_number ("%x", "%s/%s/%s", base, ent->d_name, "idVendor"); busnum = read_number ("%d", "%s/%s/%s", base, ent->d_name, "busnum"); devnum = read_number ("%d", "%s/%s/%s", base, ent->d_name, "devnum"); ifd_debug (6, "coldplug: %s usb: %04x:%04x bus: %03d:%03d\n", ent->d_name, idProduct, idVendor, busnum, devnum); if (idProduct != -1 && idVendor != -1 && busnum != -1 && devnum != -1) { const char *driver = NULL; ifd_devid_t id; id.type = IFD_DEVICE_TYPE_USB; id.num = 2; id.val[0] = idVendor; id.val[1] = idProduct; if ((driver = ifd_driver_for_id(&id)) == NULL) { DIR *dir1 = NULL; struct dirent *ent1; if ((dir1 = opendir (base)) != NULL) { while ((ent1 = readdir (dir1)) != NULL && driver == NULL) { /* skip all none bus elements */ if (strncmp (ent->d_name, ent1->d_name, strlen (ent->d_name))) { continue; } if ( read_number ( "%x", "%s/%s/%s/%s", base, ent->d_name, ent1->d_name, "bInterfaceClass" ) == 0x0b ) { driver = "ccid"; } } closedir (dir1); } } if (driver != NULL) { char typedev[1024]; snprintf(typedev, sizeof(typedev), "usb:/dev/bus/usb/%03d/%03d", busnum, devnum); ifd_spawn_handler(driver, typedev, -1); } } } } out: if (dir != NULL) { closedir (dir); } #endif return 0; } #endif /* __linux__ */ openct-0.6.20/src/include/0000777000175000017500000000000011336457577012330 500000000000000openct-0.6.20/src/include/openct/0000777000175000017500000000000011336457577013620 500000000000000openct-0.6.20/src/include/openct/openct.h0000644000175000017500000000546211043042742015157 00000000000000/* * Main OpenCT include file * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_OPENCT_H #define OPENCT_OPENCT_H #ifdef __cplusplus extern "C" { #endif #include /* Various implementation limits */ #define OPENCT_MAX_READERS 16 #define OPENCT_MAX_SLOTS 8 typedef struct ct_info { char ct_name[64]; unsigned int ct_slots; unsigned int ct_card[OPENCT_MAX_SLOTS]; unsigned ct_display : 1, ct_keypad : 1; pid_t ct_pid; } ct_info_t; typedef struct ct_handle ct_handle; #define IFD_CARD_PRESENT 0x0001 #define IFD_CARD_STATUS_CHANGED 0x0002 /* Lock types * - shared locks allow concurrent access from * other applications run by the same user. * Used e.g. by pkcs11 login. * - exclusive locks deny any access by other * applications. * * When a lock is granted, a lock handle is passed * to the client, which it must present in the * subsequent unlock call. */ typedef unsigned int ct_lock_handle; enum { IFD_LOCK_SHARED, IFD_LOCK_EXCLUSIVE }; /* * PIN encoding types */ enum { IFD_PIN_ENCODING_BCD, IFD_PIN_ENCODING_ASCII }; extern int ct_status(const ct_info_t **); extern int ct_reader_info(unsigned int, ct_info_t *); extern ct_handle * ct_reader_connect(unsigned int); extern void ct_reader_disconnect(ct_handle *); extern int ct_reader_status(ct_handle *, ct_info_t *); extern int ct_card_status(ct_handle *h, unsigned int slot, int *status); extern int ct_card_set_protocol(ct_handle *h, unsigned int slot, unsigned int protocol); extern int ct_card_reset(ct_handle *h, unsigned int slot, void *atr, size_t atr_len); extern int ct_card_request(ct_handle *h, unsigned int slot, unsigned int timeout, const char *message, void *atr, size_t atr_len); extern int ct_card_lock(ct_handle *h, unsigned int slot, int type, ct_lock_handle *); extern int ct_card_unlock(ct_handle *h, unsigned int slot, ct_lock_handle); extern int ct_card_transact(ct_handle *h, unsigned int slot, const void *apdu, size_t apdu_len, void *recv_buf, size_t recv_len); extern int ct_card_verify(ct_handle *h, unsigned int slot, unsigned int timeout, const char *prompt, unsigned int pin_encoding, unsigned int pin_length, unsigned int pin_offset, const void *send_buf, size_t send_len, void *recv_buf, size_t recv_len); extern int ct_card_read_memory(ct_handle *, unsigned int slot, unsigned short address, void *recv_buf, size_t recv_len); extern int ct_card_write_memory(ct_handle *, unsigned int slot, unsigned short address, const void *send_buf, size_t send_len); extern int ct_status_destroy(void); extern int ct_status_clear(unsigned int, const char *); extern ct_info_t * ct_status_alloc_slot(int *); extern int ct_status_update(ct_info_t *); #ifdef __cplusplus } #endif #endif /* OPENCT_OPENCT_H */ openct-0.6.20/src/include/openct/device.h0000644000175000017500000000660311151454644015134 00000000000000/* * Device functions of the IFD handler library * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_DEVICE_H #define OPENCT_DEVICE_H #ifdef __cplusplus extern "C" { #endif #include struct pollfd; /* for poll_presence */ /* Types of devices supported by libifd */ enum { IFD_DEVICE_TYPE_SERIAL = 0, IFD_DEVICE_TYPE_USB, IFD_DEVICE_TYPE_PS2, IFD_DEVICE_TYPE_PCMCIA, IFD_DEVICE_TYPE_PCMCIA_BLOCK, IFD_DEVICE_TYPE_OTHER }; union ifd_device_params { struct { unsigned int speed; int bits; int stopbits; int parity; int check_parity; unsigned int rts : 1, dtr : 1; } serial; struct { int configuration; int interface; int altsetting; int ep_o; int ep_i; int ep_intr; } usb; }; enum { IFD_SERIAL_PARITY_NONE = 0, IFD_SERIAL_PARITY_ODD = 1, IFD_SERIAL_PARITY_EVEN = 2 }; #define IFD_SERIAL_PARITY_TOGGLE(n) ((n)? ((n) ^ 3) : 0) #define IFD_MAX_DEVID_PARTS 5 typedef struct ifd_devid { int type; unsigned int num; unsigned int val[IFD_MAX_DEVID_PARTS]; } ifd_devid_t; /* * Control messages to be sent through * ifd_device_control must always have a guard word * that contains the device type. */ enum { IFD_USB_URB_TYPE_ISO = 0, IFD_USB_URB_TYPE_INTERRUPT = 1, IFD_USB_URB_TYPE_CONTROL = 2, IFD_USB_URB_TYPE_BULK = 3 }; typedef struct ifd_usb_capture ifd_usb_capture_t; extern ifd_device_t * ifd_device_open(const char *); extern void ifd_device_close(ifd_device_t *); extern int ifd_device_type(ifd_device_t *); extern int ifd_device_reset(ifd_device_t *); extern void ifd_device_flush(ifd_device_t *); extern void ifd_device_send_break(ifd_device_t *, unsigned int); extern int ifd_device_identify(const char *, char *, size_t); extern int ifd_device_get_parameters(ifd_device_t *, ifd_device_params_t *); extern int ifd_device_set_parameters(ifd_device_t *, const ifd_device_params_t *); extern int ifd_device_transceive(ifd_device_t *, const void *, size_t, void *, size_t, long); extern int ifd_device_send(ifd_device_t *, const unsigned char *, size_t); extern int ifd_device_recv(ifd_device_t *, unsigned char *, size_t, long); extern int ifd_device_control(ifd_device_t *, void *, size_t); extern void ifd_device_set_hotplug(ifd_device_t *, int); extern int ifd_device_get_eventfd(ifd_device_t *, short *events); extern int ifd_device_poll_presence(ifd_device_t *, struct pollfd *); extern int ifd_device_id_parse(const char *, ifd_devid_t *); extern int ifd_device_id_match(const ifd_devid_t *, const ifd_devid_t *); extern int ifd_usb_control(ifd_device_t *, unsigned int requesttype, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len, long timeout); extern int ifd_usb_begin_capture(ifd_device_t *, int type, int endpoint, size_t maxpacket, ifd_usb_capture_t **); extern int ifd_usb_capture_event(ifd_device_t *, ifd_usb_capture_t *, void *buffer, size_t len); extern int ifd_usb_capture(ifd_device_t *, ifd_usb_capture_t *, void *buffer, size_t len, long timeout); extern int ifd_usb_end_capture(ifd_device_t *, ifd_usb_capture_t *); extern void ifd_serial_send_break(ifd_device_t *, unsigned int usec); extern int ifd_serial_get_cts(ifd_device_t *); extern int ifd_serial_get_dsr(ifd_device_t *); extern int ifd_serial_get_dtr(ifd_device_t *); #ifdef __cplusplus } #endif #endif /* OPENCT_DEVICE_H */ openct-0.6.20/src/include/openct/buffer.h0000644000175000017500000000227210422076714015142 00000000000000/* * Buffer handling functions of the IFD handler library * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_BUFFER_H #define OPENCT_BUFFER_H #ifdef __cplusplus extern "C" { #endif #include typedef struct ct_buf { unsigned char * base; unsigned int head, tail, size; unsigned int overrun; } ct_buf_t; extern void ct_buf_init(ct_buf_t *, void *, size_t); extern void ct_buf_set(ct_buf_t *, void *, size_t); extern void ct_buf_clear(ct_buf_t *); extern int ct_buf_get(ct_buf_t *, void *, size_t); extern int ct_buf_gets(ct_buf_t *, char *, size_t); extern int ct_buf_put(ct_buf_t *, const void *, size_t); extern int ct_buf_putc(ct_buf_t *, int); extern int ct_buf_puts(ct_buf_t *, const char *); extern int ct_buf_push(ct_buf_t *, const void *, size_t); extern unsigned int ct_buf_avail(ct_buf_t *); extern unsigned int ct_buf_tailroom(ct_buf_t *); extern unsigned int ct_buf_size(ct_buf_t *); extern void * ct_buf_head(ct_buf_t *); extern void * ct_buf_tail(ct_buf_t *); extern int ct_buf_read(ct_buf_t *, int); extern void ct_buf_compact(ct_buf_t *); extern int ct_buf_overrun(ct_buf_t *); #ifdef __cplusplus } #endif #endif /* OPENCT_BUFFER_H */ openct-0.6.20/src/include/openct/logging.h0000644000175000017500000000064310422076714015317 00000000000000/* * Logging functions * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_LOGGING_H #define OPENCT_LOGGING_H #ifdef __cplusplus extern "C" { #endif extern void ct_log_destination(const char *); extern void ct_error(const char *, ...); extern void ct_debug(const char *, ...); extern const char * ct_hexdump(const void *, size_t); #ifdef __cplusplus } #endif #endif /* OPENCT_LOGGING_H */ openct-0.6.20/src/include/openct/protocol.h0000644000175000017500000000340210422076714015526 00000000000000/* * Protocol for communication between application and * resource manager * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_PROTOCOL_H #define OPENCT_PROTOCOL_H #ifdef __cplusplus extern "C" { #endif /* * A protocol message from client to server * consists of * - command byte * - unit byte * - optional data, TLV encoded */ #define CT_CMD_STATUS 0x00 #define CT_CMD_LOCK 0x01 /* prevent concurrent access */ #define CT_CMD_UNLOCK 0x02 #define CT_CMD_RESET 0x10 #define CT_CMD_REQUEST_ICC 0x11 #define CT_CMD_EJECT_ICC 0x12 #define CT_CMD_OUTPUT 0x13 #define CT_CMD_PERFORM_VERIFY 0x14 #define CT_CMD_CHANGE_PIN 0x15 #define CT_CMD_MEMORY_READ 0x16 #define CT_CMD_MEMORY_WRITE 0x17 #define CT_CMD_INPUT 0x18 #define CT_CMD_TRANSACT_OLD 0x20 /* transceive APDU */ #define CT_CMD_TRANSACT 0x21 /* transceive APDU */ #define CT_CMD_SET_PROTOCOL 0x22 #define CT_UNIT_ICC1 0x00 #define CT_UNIT_ICC2 0x01 #define CT_UNIT_ICC3 0x02 #define CT_UNIT_ICC4 0x03 #define CT_UNIT_READER 0x10 #define CT_UNIT_DISPLAY 0x11 #define CT_UNIT_KEYPAD 0x12 /* * TLV items. */ #define CT_TAG_READER_NAME 0x00 /* ASCII string */ #define CT_TAG_READER_UNITS 0x01 /* list CT_UNIT_* bytes */ #define CT_TAG_CARD_STATUS 0x02 /* IFD_CARD_* byte */ #define CT_TAG_ATR 0x03 /* Answer to reset */ #define CT_TAG_LOCK 0x04 #define CT_TAG_CARD_RESPONSE 0x05 /* Card response to VERIFY etc */ #define CT_TAG_TIMEOUT 0x80 #define CT_TAG_MESSAGE 0x81 #define CT_TAG_LOCKTYPE 0x82 #define CT_TAG_PIN_DATA 0x83 /* CTBCS verify APDU */ #define CT_TAG_CARD_REQUEST 0x84 #define CT_TAG_ADDRESS 0x85 #define CT_TAG_DATA 0x86 #define CT_TAG_COUNT 0x87 #define CT_TAG_PROTOCOL 0x88 #define __CT_TAG_LARGE 0x40 #ifdef __cplusplus } #endif #endif /* OPENCT_PROTOCOL_H */ openct-0.6.20/src/include/openct/ifd.h0000644000175000017500000001220311151454644014430 00000000000000/* * Core functions of the IFD handler library * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_IFD_H #define OPENCT_IFD_H #ifdef __cplusplus extern "C" { #endif #include #include #include typedef struct ifd_device ifd_device_t; typedef union ifd_device_params ifd_device_params_t; enum { IFD_PROTOCOL_DEFAULT = -1, IFD_PROTOCOL_T0 = 0, IFD_PROTOCOL_T1, IFD_PROTOCOL_2WIRE = 16, IFD_PROTOCOL_3WIRE, IFD_PROTOCOL_I2C_SHORT, IFD_PROTOCOL_I2C_LONG, IFD_PROTOCOL_TLP, /* older Gemplus protocol */ IFD_PROTOCOL_GBP, /* Gemplus block protocol */ IFD_PROTOCOL_EUROCHIP, /* Eurochip Countercard */ IFD_PROTOCOL_TCL, /* ISO 14443-4 T=CL */ IFD_PROTOCOL_ESCAPE, /* Virtual 'escape' protocol */ IFD_PROTOCOL_TRANSPARENT = 128 }; typedef struct ifd_protocol ifd_protocol_t; typedef struct ifd_driver { const char * name; struct ifd_driver_ops * ops; } ifd_driver_t; #define IFD_MAX_ATR_LEN 64 typedef struct ifd_slot { unsigned int handle; int status; time_t next_update; unsigned char dad; /* address when using T=1 */ unsigned int atr_len; unsigned char atr[IFD_MAX_ATR_LEN]; ifd_protocol_t * proto; void * reader_data; } ifd_slot_t; typedef struct ifd_reader { unsigned int num; unsigned int handle; const char * name; unsigned int flags; unsigned int nslots; ifd_slot_t slot[OPENCT_MAX_SLOTS]; const ifd_driver_t * driver; ifd_device_t * device; ct_info_t * status; /* In case the IFD needs to keep state */ void * driver_data; } ifd_reader_t; #define IFD_READER_ACTIVE 0x0001 #define IFD_READER_HOTPLUG 0x0002 #define IFD_READER_DISPLAY 0x0100 #define IFD_READER_KEYPAD 0x0200 enum { IFD_PROTOCOL_RECV_TIMEOUT = 0x0000, IFD_PROTOCOL_BLOCK_ORIENTED, /* T=0 specific parameters */ __IFD_PROTOCOL_T0_PARAM_BASE = IFD_PROTOCOL_T0 << 16, /* T=1 specific parameters */ __IFD_PROTOCOL_T1_PARAM_BASE = IFD_PROTOCOL_T1 << 16, IFD_PROTOCOL_T1_BLOCKSIZE, IFD_PROTOCOL_T1_CHECKSUM_CRC, IFD_PROTOCOL_T1_CHECKSUM_LRC, IFD_PROTOCOL_T1_IFSC, IFD_PROTOCOL_T1_IFSD, IFD_PROTOCOL_T1_STATE, IFD_PROTOCOL_T1_MORE }; enum { IFD_DAD_HOST = 0, IFD_DAD_IFD, IFD_DAD_ICC1, IFD_DAD_ICC2 }; extern int ifd_init(void); extern ifd_reader_t * ifd_open(const char *driver_name, const char *device_name); extern void ifd_close(ifd_reader_t *); extern int ifd_reader_count(void); extern int ifd_attach(ifd_reader_t *); extern void ifd_detach(ifd_reader_t *); extern ifd_reader_t * ifd_reader_by_handle(unsigned int handle); extern ifd_reader_t * ifd_reader_by_index(unsigned int index); extern int ifd_spawn_handler(const char *, const char *, int); extern int ifd_scan_usb(void); extern int ifd_activate(ifd_reader_t *); extern int ifd_deactivate(ifd_reader_t *); extern int ifd_output(ifd_reader_t *, const char *); extern int ifd_atr_complete(const unsigned char *, size_t); extern int ifd_set_protocol(ifd_reader_t *reader, unsigned int slot, int id); extern int ifd_card_command(ifd_reader_t *reader, unsigned int slot, const void *sbuf, size_t slen, void *rbuf, size_t rlen); extern int ifd_card_status(ifd_reader_t *reader, unsigned int slot, int *status); extern int ifd_card_reset(ifd_reader_t *reader, unsigned int slot, void *atr_buf, size_t atr_len); extern int ifd_card_request(ifd_reader_t *reader, unsigned int slot, time_t timeout, const char *message, void *atr_buf, size_t atr_len); extern int ifd_card_eject(ifd_reader_t *reader, unsigned int slot, time_t timeout, const char *message); extern int ifd_card_perform_verify(ifd_reader_t *reader, unsigned int slot, time_t timeout, const char *message, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len); extern int ifd_card_read_memory(ifd_reader_t *, unsigned int, unsigned short, unsigned char *, size_t); extern int ifd_card_write_memory(ifd_reader_t *, unsigned int, unsigned short, const unsigned char *, size_t); extern ifd_protocol_t * ifd_protocol_new(int id, ifd_reader_t *reader, unsigned int dad); extern int ifd_protocol_set_parameter(ifd_protocol_t *p, int type, long value); extern int ifd_protocol_get_parameter(ifd_protocol_t *p, int type, long *value); extern int ifd_protocol_read_memory(ifd_protocol_t *, int, unsigned short, unsigned char *, size_t); extern int ifd_protocol_write_memory(ifd_protocol_t *, int, unsigned short, const unsigned char *, size_t); extern void ifd_protocol_free(ifd_protocol_t *); extern int ifd_before_command(ifd_reader_t *); extern int ifd_after_command(ifd_reader_t *); extern int ifd_get_eventfd(ifd_reader_t *, short *); extern void ifd_poll(ifd_reader_t *); extern int id_event(ifd_reader_t *); /* Debugging macro */ #ifdef __GNUC__ #define ifd_debug(level, fmt, args...) \ do { \ if ((level) <= ct_config.debug) \ ct_debug("%s: " fmt, __FUNCTION__ , ##args); \ } while (0) #else extern void ifd_debug(int level, const char *fmt, ...); #endif #ifdef __cplusplus } #endif #endif /* OPENCT_IFD_H */ openct-0.6.20/src/include/openct/driver.h0000644000175000017500000003460211151454644015170 00000000000000/** * @file * Internal driver API. * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_DRIVER_H #define OPENCT_DRIVER_H #ifdef __cplusplus extern "C" { #endif #include /** * Driver operations. */ struct ifd_driver_ops { int default_protocol; /** * Open the reader. * * This function opens the device named @a name and initialize the reader * structure. The slots' dad should be set here. * * OpenCT calls the open function once at startup. * * Called by: ifd_open. * @return Error code <0 if failure. */ int (*open)(ifd_reader_t *reader, const char *name); /** * Close the reader. * * This function frees all the resources allocated by *open. If made possible by * the hardware, the reader and all its slots must be powered off. * * The device will be closed by ifd_close, and must not be closed by this * function. * * OpenCT currently never calls ifd_close, so the close function if not used. * * Called by: ifd_close. * @return Error code <0 if failure. */ int (*close)(ifd_reader_t * reader); /** * Change the communication protocol parity. * * This function is only used for asynchronous smart cards with serial readers, * and only if the reader doesn't auto-detect the protocol parity. * * Depending on the smart card communication protocol convention (either direct * or inverse, see ISO-7816-3, 6.4), the communication between the reader and the * smart card uses odd or even parity. If most readers handle smart card protocol * convention transparently, the most simple ones map the smart card lines * directly on the serial port or require the user to configure the reader * according smart card communication protocol parity. For those readers, OpenCT * will try both parities (starting with even) when reading the ATR. * * This function, if available, configures the reader and/or the serial port * according to the smart card communication protocol parity. It is used by * ifd_card_request only. * * Accepted values for @a parity are * * @arg @c IFD_SERIAL_PARITY_ODD (1) * @arg @c IFD_SERIAL_PARITY_EVEN (2) * * Called by: ifd_card_request. * @return Error code <0 if failure. */ int (*change_parity)(ifd_reader_t *reader, int parity); /** * Change the communication protocol speed. * * It is not clear if this function was intended to change the communication * speed between the host and the reader, the reader and the smart card, or * both, as it is currently not used (ifd_set_speed is never called). * * Called by: ifd_set_speed. * @return Error code <0 if failure. */ int (*change_speed)(ifd_reader_t *reader, unsigned int speed); /** * Activate the smart card reader. * * This function performs all necessary operations to activate the smart card * reader. After activation, the reader must be able to accept card status * commands (card_status). * * Reader activation is currently performed once at startup, before calling * card_status in response to CT_CMD_STATUS (is it really needed, as the reader * was activated at startup ?), and when probing for synchronous cards. * * Called by: ifd_activate. * @return Error code <0 if failure. */ int (*activate)(ifd_reader_t *reader); /** * Deactivate the smart card reader. * * Reader deactivation is currently performed only when probing for synchronous * cards. OpenCT deactivates and reactivates the reader before trying to access * the card. * * Called by: ifd_deactivate. * @return Error code <0 if failure. */ int (*deactivate)(ifd_reader_t *reader); /** * Fetch the card status. * * This function returns the current card status for a given slot. status is a * bitfield which currently accepts the following flags: * * @arg @c IFD_CARD_PRESENT (1) A card is present in the slot. * @arg @c IFD_CARD_STATUS_CHANGED (2) The slot status has changed since last call. * * Beside using IFD_CARD_STATUS_CHANGED, OpenCT checks if the card status has * changed by comparing the current status value with the previous status value. * If the value of the IFD_CARD_PRESENT has changed, OpenCT will set the * IFD_CARD_STATUS_CHANGED on the client side. * * On the server side, setting IFD_CARD_STATUS_CHANGED will also set atr_len to 0 * for the given slot. As atr_len is only checked in ifd_protocol_select, and as * that function is only called in ifd_card_request right after assigning a value * to atr_len, this is currently pointless and a reader driver should not set * IFD_CARD_STATUS_CHANGED if its only source of information is a change of * the IFD_CARD_PRESENT flag between the current call and the previous one. * * Called by: ifd_card_status. * @return Error code <0 if failure. */ int (*card_status)(ifd_reader_t *reader, int slot, int *status); /** * Reset the card and fetch the ATR. * * This function resets the smart card and reads the Answer To Reset (ATR). The * ATR will be stored in the slot structure by OpenCT, so the driver must not * store the ATR itself in the slot structure. * * When resetting the card, the driver is allowed to select a protocol. If no * protocol is selected when this function returns (assuming it returns * successfully), OpenCT will try to select the protocol automatically (see * set_protocol). * * Called by: ifd_card_request. * @return Error code <0 if failure, length of the ATR if success. */ int (*card_reset)(ifd_reader_t *reader, int slot, void *atr, size_t atr_len); /** * Prompts the insertion of a smart card in the reader and performs a card reset. * * This function prompts the user to insert a smart card in the reader. For card * readers equipped with a display, the optional message message should be * displayed to the user. The optional parameter timeout, if not equal to zero, * gives the prompt timeout in seconds. * * If a card is inserted before the timeout elapses, the card is reset and the * ATR is fetched. See card_reset for more information. * * Called by: ifd_card_request * @return Error code <0 if failure, length of the ATR if success. */ int (*card_request)(ifd_reader_t *reader, int slot, time_t timeout, const char *message, void *atr, size_t atr_len); /** * Eject the smart card. * * This function ejects the smart card or prompt the user to remove the card by * displaying the message @a message. The optional parameter @a timeout, if not equal * to zero, gives the card removal timeout in seconds. * * It is not clear if this function should deactivate the smart card first, or * if the caller must deactivate the card before calling card_eject. * * Called by: ifd_card_eject. * @return Error code <0 if failure. */ int (*card_eject)(ifd_reader_t *reader, int slot, time_t timeout, const char *message); /** * Output a message on the reader's display. * * Called by: ifd_output. * @return Error code <0 if failure. */ int (*output)(ifd_reader_t *reader, const char *message); /** * Request the PIN and have the card verify it. * * This function prompts the user to enter his PIN code and have the smart card * verify the code. The optional parameter @a timeout, if not equal to zero, gives * the PIN request timeout. * * The two bytes status (SW1-SW2) is copied in the @a resp buffer. If the status * indicates a known error (IFD_ERROR_USER_TIMEOUT, IFD_ERROR_USER_ABORT, * IFD_ERROR_PIN_MISMATCH) the error code is returned. Otherwise the length * of the response (2) is returned. * * Called by: ifd_perform_verify. * @return Error code <0 if failure, size of the response (2) if success or unknown error. */ int (*perform_verify)(ifd_reader_t *reader, int slot, unsigned int timeout, const char *prompt, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len); /** * Send an APDU using the currently selected protocol. * * This function is called by all non-transparent protocols to send an APDU to a * device. The device address is set by the @a dad parameter which is one of * * @arg @c IFD_DAD_HOST (0) Host (PC) - what's the point ? * @arg @c IFD_DAD_IFD (1) The APDU is sent to the reader * @arg @c IFD_DAD_ICC1 (2) The APDU is sent to the first smart card * @arg @c IFD_DAD_ICC2 (3) The APDU is sent to the second smart card * * The @a dad parameter is currently unused by all drivers, even the Kaan driver * which takes care to initialize it correctly in the open function. * * Called by: ifd_send_command. * @return Error code <0 if failure, number of bytes sent if success. */ int (*send)(ifd_reader_t *reader, unsigned int dad, const unsigned char *buffer, size_t len); /** * Receive an APDU response using the currently selected protocol. * * This function is called by all non-transparent protocols to receive an APDU * response from a device. The device address is set by the @a dad parameter which * takes the same values as for the send function. * * The @a dad parameter is currently unused by all drivers, even the Kaan driver * which takes care to initialize it correctly in the open function. * * Called by: ifd_recv_response. * @return Error code <0 if failure, number of bytes received if success. */ int (*recv)(ifd_reader_t *reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout); /** * Select the smart card communication protocol. * * The smart card communication protocol is selected by OpenCT when the card is * reset (either by reset_card or request_card), and can be overriden by the * user by sending a CT_CMD_SET_PROTOCOL command. * * OpenCT doesn't perform a PPS exchange with the card itself, but selects the * first protocol offered by the ATR at reset time by calling set_protocol. If * the reader performs the PPS exchange with the card, the selected protocol can * be set manually by the driver (by setting slot->proto) and set_protocol will * not be called. * * It is not clear what the side effects of CT_CMD_SET_PROTOCOL (should it reset * the card ?) should be and if that function is used at all by applications. * Isn't the default protocol good enough ? I would have thought that * set_protocol was meant to be called only right after reset, to select the * protocol and instruct the driver to perform a PPS exchange. * * Called by: ifd_set_protocol, ifd_select_protocol. * @return Error code <0 if failure. */ int (*set_protocol)(ifd_reader_t *reader, int slot, int protocol); /** * Transceive a protocol data unit. * * This function is used by the transparent protocol, when the driver and/or the * reader accepts raw PDUs directly. When using the transparent protocol, the * PDUs sent by the client are forwarded directly to the driver without being * mangled by OpenCT. If the driver and/or the reader can't accept the PDUs * directly (for instance when the reader doesn't support Case 4 APDUs in T=0 * protocol), the driver should instanciate the appropriate protocol handler * to pre-process the PDUs. In that case, the send and recv functions will be * used instead of the transparent function. * * Called by: trans_transceive at proto-trans.c * @return Error code <0 if failure, size of the response if success. */ int (*transparent)(ifd_reader_t *reader, int slot, const void *sbuf, size_t slen, void *rbuf, size_t rlen); /** * Read data from a synchronous smart card. * * This function writes @a rlen bytes to the smart card, starting at address @a addr. * The @a proto parameter specifies the desired communication protocol. The driver * must set the protocol before reading data, or return an error if the protocol * is not supported. * * Called by: sync_read at proto-sync.c, sync_write at proto-sync.c. * @return Error code <0 if failure, number of bytes read if success. */ int (*sync_read)(ifd_reader_t *reader, int slot, int proto, unsigned short addr, unsigned char *rbuf, size_t rlen); /** * Write data to a synchronous smart card. * * This function reads @a slen bytes from the smart card, starting at address @a addr. * The @a proto parameter specifies the desired communication protocol. The driver * must set the protocol before writing data, or return an error if the protocol * is not supported. * * Called by: sync_write at proto-sync.c. * @return Error code <0 if failure, number of bytes written if success. */ int (*sync_write)(ifd_reader_t *reader, int slot, int proto, unsigned short addr, const unsigned char *sbuf, size_t slen); /*Support for transparent access to "escape" */ int (*escape)(ifd_reader_t *reader, int slot, const void *sbuf, const size_t slen, void *rbuf, size_t rlen); /** * Execute before command. * * Provides a chance to setup device to accept new commands. * * @return Error code <0 if failure, 0 if success. */ int (*before_command) (ifd_reader_t *); /** * Execute after command. * * Provides a chance to setup device to accept events. * * @return Error code <0 if failure, 0 if success. */ int (*after_command) (ifd_reader_t *); /** * Get event fd. * * This will allow the mainloop to wait for event instead of polling. * May be NULL if unsupported. * * @return fd. */ int (*get_eventfd) (ifd_reader_t *, short *events); /** * Event callback. * * Will be called if an event is set. * May be NULL if unsupported. * * @return Error code <0 if failure, 0 if success. */ int (*event) (ifd_reader_t *, int *status, size_t status_size); /** * Error callback. * * Will be called if an error is set on event fd. * May be NULL if unsupported. * * @return Error code <0 if failure, 0 if success. If reader * should be freed, return an error. */ int (*error) (ifd_reader_t *); }; extern void ifd_driver_register(const char *, struct ifd_driver_ops *); extern const ifd_driver_t *ifd_driver_get(const char *); extern int ifd_driver_add_id(const char *, const char *); extern const char * ifd_driver_for_id(ifd_devid_t *); /* * Protocol handling for card terminal drivers */ extern ifd_protocol_t * ifd_protocol_select(ifd_reader_t *, int, int); extern int ifd_protocol_transceive(ifd_protocol_t *proto, int dad, const void *, size_t, void *, size_t); extern int ifd_protocol_resynchronize(ifd_protocol_t *, int); #ifdef __cplusplus } #endif #endif /* OPENCT_DRIVER_H */ openct-0.6.20/src/include/openct/error.h0000644000175000017500000000234310422076714015021 00000000000000/* * Error codes * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_ERROR_H #define OPENCT_ERROR_H #ifdef __cplusplus extern "C" { #endif #define IFD_SUCCESS 0 #define IFD_ERROR_GENERIC -1 #define IFD_ERROR_TIMEOUT -2 #define IFD_ERROR_INVALID_SLOT -3 #define IFD_ERROR_NOT_SUPPORTED -4 #define IFD_ERROR_COMM_ERROR -5 #define IFD_ERROR_NO_CARD -6 #define IFD_ERROR_LOCKED -7 #define IFD_ERROR_NOLOCK -8 #define IFD_ERROR_INVALID_ARG -9 #define IFD_ERROR_NO_MEMORY -10 #define IFD_ERROR_BUFFER_TOO_SMALL -11 #define IFD_ERROR_USER_TIMEOUT -12 #define IFD_ERROR_USER_ABORT -13 #define IFD_ERROR_PIN_MISMATCH -14 #define IFD_ERROR_NO_ATR -15 #define IFD_ERROR_INCOMPATIBLE_DEVICE -16 #define IFD_ERROR_DEVICE_DISCONNECTED -17 #define IFD_ERROR_INVALID_ATR -18 /* for application/resource manager protocol */ #define IFD_ERROR_INVALID_MSG -100 #define IFD_ERROR_INVALID_CMD -101 #define IFD_ERROR_MISSING_ARG -102 #define IFD_ERROR_NOT_CONNECTED -103 /* Specific error codes for proxy protocol */ #define IFD_ERROR_ALREADY_CLAIMED -200 #define IFD_ERROR_DEVICE_BUSY -201 #define IFD_ERROR_UNKNOWN_DEVICE -202 extern const char * ct_strerror(int); #ifdef __cplusplus } #endif #endif /* OPENCT_ERROR_H */ openct-0.6.20/src/include/openct/tlv.h0000644000175000017500000000307710422076714014502 00000000000000/* * Handle TLV encoded data * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_TLV_H #define OPENCT_TLV_H #ifdef __cplusplus extern "C" { #endif #include #include typedef unsigned char ifd_tag_t; typedef struct ct_tlv_parser { unsigned char use_large_tags; unsigned char * val[256]; unsigned int len[256]; } ct_tlv_parser_t; typedef struct ct_tlv_builder { int error; unsigned char use_large_tags; ct_buf_t * buf; unsigned int len; unsigned char * lenp; } ct_tlv_builder_t; extern int ct_tlv_parse(ct_tlv_parser_t *, ct_buf_t *); /* ct_tlv_get return 0 == not there, 1 == there */ extern int ct_tlv_get_int(ct_tlv_parser_t *, ifd_tag_t, unsigned int *); extern int ct_tlv_get_string(ct_tlv_parser_t *, ifd_tag_t, char *, size_t); extern int ct_tlv_get_opaque(ct_tlv_parser_t *, ifd_tag_t, unsigned char **, size_t *); /* or number of bytes */ extern int ct_tlv_get_bytes(ct_tlv_parser_t *, ifd_tag_t, void *, size_t); extern void ct_tlv_builder_init(ct_tlv_builder_t *, ct_buf_t *, int); extern void ct_tlv_put_int(ct_tlv_builder_t *, ifd_tag_t, unsigned int); extern void ct_tlv_put_string(ct_tlv_builder_t *, ifd_tag_t, const char *); extern void ct_tlv_put_opaque(ct_tlv_builder_t *, ifd_tag_t, const unsigned char *, size_t); extern void ct_tlv_put_tag(ct_tlv_builder_t *, ifd_tag_t); extern void ct_tlv_add_byte(ct_tlv_builder_t *, unsigned char); extern void ct_tlv_add_bytes(ct_tlv_builder_t *, const unsigned char *, size_t); #ifdef __cplusplus } #endif #endif /* OPENCT_TLV_H */ openct-0.6.20/src/include/openct/path.h0000644000175000017500000000050410423236124014613 00000000000000/* * Path handling routines * * Copyright (C) 2006, Andreas Jellinghaus */ #ifndef OPENCT_PATH_H #define OPENCT_PATH_H #ifdef __cplusplus extern "C" { #endif extern int ct_format_path(char *path, const size_t pathlen, const char *file); #ifdef __cplusplus } #endif #endif /* OPENCT_PATH_H */ openct-0.6.20/src/include/openct/Makefile.am0000644000175000017500000000041511043042742015543 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in DISTCLEANFILES = types.h openctinclude_HEADERS = \ apdu.h buffer.h conf.h device.h driver.h error.h ifd.h \ logging.h openct.h path.h protocol.h server.h socket.h tlv.h nodist_openctinclude_HEADERS = $(builddir)/types.h openct-0.6.20/src/include/openct/server.h0000644000175000017500000000057311141256300015167 00000000000000/* * Server side functionality * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_SERVER_H #define OPENCT_SERVER_H #ifdef __cplusplus extern "C" { #endif #include extern void ct_mainloop_add_socket(ct_socket_t *); extern void ct_mainloop(void); extern void ct_mainloop_leave(void); #ifdef __cplusplus } #endif #endif /* OPENCT_SERVER_H */ openct-0.6.20/src/include/openct/conf.h0000644000175000017500000000267710422076714014627 00000000000000/* * Configuration stuff for IFD library * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_CONF_H #define OPENCT_CONF_H #ifdef __cplusplus extern "C" { #endif extern struct ct_config { int debug; int autoload; int hotplug; int suppress_errors; const char * ifdhandler; const char * modules_dir; const char * driver_modules_dir; const char * protocol_modules_dir; const char * socket_dir; } ct_config; typedef struct ifd_conf_node { struct ifd_conf_node *next; struct ifd_conf_node *children; char * name; char * value; } ifd_conf_node_t; extern int ifd_config_parse(const char *); extern int ifd_conf_get_string(const char *, char **); extern int ifd_conf_get_integer(const char *, unsigned int *); extern int ifd_conf_get_bool(const char *, unsigned int *); extern int ifd_conf_get_string_list(const char *, char **, size_t); extern int ifd_conf_get_nodes(const char *, ifd_conf_node_t **, size_t); extern int ifd_conf_node_get_string(ifd_conf_node_t *, const char *, char **); extern int ifd_conf_node_get_integer(ifd_conf_node_t *, const char *, unsigned int *); extern int ifd_conf_node_get_bool(ifd_conf_node_t *, const char *, unsigned int *); extern int ifd_conf_node_get_string_list(ifd_conf_node_t *, const char *, char **, size_t); extern int ifd_conf_node_get_nodes(ifd_conf_node_t *, const char *, ifd_conf_node_t **, size_t); #ifdef __cplusplus } #endif #endif /* OPENCT_CONF_H */ openct-0.6.20/src/include/openct/Makefile.in0000644000175000017500000003727511336457520015603 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/openct DIST_COMMON = $(openctinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) 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)$(openctincludedir)" \ "$(DESTDIR)$(openctincludedir)" HEADERS = $(nodist_openctinclude_HEADERS) $(openctinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in DISTCLEANFILES = types.h openctinclude_HEADERS = \ apdu.h buffer.h conf.h device.h driver.h error.h ifd.h \ logging.h openct.h path.h protocol.h server.h socket.h tlv.h nodist_openctinclude_HEADERS = $(builddir)/types.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/openct/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/openct/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_openctincludeHEADERS: $(nodist_openctinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(openctincludedir)" || $(MKDIR_P) "$(DESTDIR)$(openctincludedir)" @list='$(nodist_openctinclude_HEADERS)'; test -n "$(openctincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(openctincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(openctincludedir)" || exit $$?; \ done uninstall-nodist_openctincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_openctinclude_HEADERS)'; test -n "$(openctincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(openctincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(openctincludedir)" && rm -f $$files install-openctincludeHEADERS: $(openctinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(openctincludedir)" || $(MKDIR_P) "$(DESTDIR)$(openctincludedir)" @list='$(openctinclude_HEADERS)'; test -n "$(openctincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(openctincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(openctincludedir)" || exit $$?; \ done uninstall-openctincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(openctinclude_HEADERS)'; test -n "$(openctincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(openctincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(openctincludedir)" && 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)$(openctincludedir)" "$(DESTDIR)$(openctincludedir)"; 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_openctincludeHEADERS \ install-openctincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nodist_openctincludeHEADERS \ uninstall-openctincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man \ install-nodist_openctincludeHEADERS \ install-openctincludeHEADERS install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-nodist_openctincludeHEADERS \ uninstall-openctincludeHEADERS # 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: openct-0.6.20/src/include/openct/apdu.h0000644000175000017500000000155210422076714014622 00000000000000/* * APDU type definitions * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_APDU_H #define OPENCT_APDU_H #ifdef __cplusplus extern "C" { #endif typedef struct ifd_iso_apdu { unsigned char cse, cla, ins, p1, p2; unsigned int lc, le; unsigned int sw; void * data; size_t len; /* xxx go away */ unsigned char * rcv_buf; unsigned int rcv_len; } ifd_iso_apdu_t; enum { IFD_APDU_CASE_1 = 0x00, IFD_APDU_CASE_2S = 0x01, IFD_APDU_CASE_3S = 0x02, IFD_APDU_CASE_4S = 0x03, IFD_APDU_CASE_2E = 0x10, IFD_APDU_CASE_3E = 0x20, IFD_APDU_CASE_4E = 0x30, IFD_APDU_BAD = -1 }; #define IFD_APDU_CASE_LC(c) ((c) & 0x02) #define IFD_APDU_CASE_LE(c) ((c) & 0x01) extern int ifd_iso_apdu_parse(const void *, size_t, ifd_iso_apdu_t *); extern int ifd_apdu_case(const void *, size_t); #ifdef __cplusplus } #endif #endif /* OPENCT_APDU_H */ openct-0.6.20/src/include/openct/socket.h0000644000175000017500000000435411141256300015152 00000000000000/* * Socket type definitions * * Copyright (C) 2003, Olaf Kirch */ #ifndef OPENCT_SOCKET_H #define OPENCT_SOCKET_H #ifdef __cplusplus extern "C" { #endif #include #include #include /* forward decl */ struct pollfd; typedef struct header { uint32_t xid; uint32_t dest; int16_t error; uint16_t count; } header_t; typedef struct ct_socket { struct ct_socket *next, *prev; int fd; int eof; ct_buf_t rbuf, sbuf; unsigned int use_large_tags : 1, use_network_byte_order : 1, listener : 1; /* events to poll for */ int events; void * user_data; int (*poll)(struct ct_socket *, struct pollfd *); int (*error)(struct ct_socket *); int (*recv)(struct ct_socket *); int (*send)(struct ct_socket *); int (*process)(struct ct_socket *, header_t *, ct_buf_t *, ct_buf_t *); void (*close)(struct ct_socket *); pid_t client_id; uid_t client_uid; } ct_socket_t; #define CT_SOCKET_BUFSIZ 4096 extern ct_socket_t * ct_socket_new(unsigned int); extern void ct_socket_free(ct_socket_t *); extern void ct_socket_reuseaddr(int); extern int ct_socket_connect(ct_socket_t *, const char *); extern int ct_socket_listen(ct_socket_t *, const char *, int); extern ct_socket_t * ct_socket_accept(ct_socket_t *); extern void ct_socket_close(ct_socket_t *); extern int ct_socket_call(ct_socket_t *, ct_buf_t *, ct_buf_t *); extern int ct_socket_flsbuf(ct_socket_t *, int); extern int ct_socket_filbuf(ct_socket_t *, long); extern int ct_socket_put_packet(ct_socket_t *, header_t *, ct_buf_t *); extern int ct_socket_puts(ct_socket_t *, const char *); extern int ct_socket_get_packet(ct_socket_t *, header_t *, ct_buf_t *); extern int ct_socket_gets(ct_socket_t *, char *, size_t); extern int ct_socket_send(ct_socket_t *, header_t *, ct_buf_t *); extern int ct_socket_recv(ct_socket_t *, header_t *, ct_buf_t *); extern int ct_socket_write(ct_socket_t *, void *, size_t); extern int ct_socket_read(ct_socket_t *, void *, size_t); extern void ct_socket_link(ct_socket_t *, ct_socket_t *); extern void ct_socket_unlink(ct_socket_t *); extern int ct_socket_getpeername(ct_socket_t *, char *, size_t); #ifdef __cplusplus } #endif #endif /* OPENCT_SOCKET_H */ openct-0.6.20/src/include/Makefile.am0000644000175000017500000000007711043042742014257 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = openct openct-0.6.20/src/include/Makefile.in0000644000175000017500000004266411336457520014311 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = openct all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openct-0.6.20/src/tools/0000777000175000017500000000000011336457577012045 500000000000000openct-0.6.20/src/tools/openct-tool.1.in0000644000175000017500000000133110422076712014670 00000000000000.TH openct-tool "1" "May 2005" "OpenCT @VERSION@" "OpenCT" .SH NAME openct-tool \- OpenCT smart card utility .SH SYNOPSIS openct\-tool [options] command ... .SH OPTIONS .TP \fB\-d\fR enable debugging; repeat to increase verbosity .TP \fB\-f\fR \fIconfigfile\fR specify config file (default @openct_conf_path@) .TP \fB\-r\fR \fIreader\fR specify index of reader to use .TP \fB\-h\fR display this message .TP \fB\-v\fR display version and exit .SH COMMANDS .TP \fBlist\fR list all readers found .TP \fBatr\fR print ATR of card in selected reader .TP \fBwait\fR wait for card to be inserted .TP \fBrwait\fR wait for reader to be attached .TP \fBmf\fR try to select main folder of card .TP \fBread\fR dump memory of synchronous card openct-0.6.20/src/tools/openct-control.c0000644000175000017500000001462211055603235015056 00000000000000/* * OpenCT ifdhandler control * * Copyright (C) 2003 Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #ifdef HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include static int mgr_init(int argc, char **argv); static int mgr_shutdown(int argc, char **argv); static int mgr_attach(int argc, char **argv); static int mgr_status(int argc, char **argv); static void usage(int exval); static void version(void); static const char *opt_config = NULL; static int opt_debug = 0; static int opt_coldplug = 1; static void configure_reader(ifd_conf_node_t *); int main(int argc, char **argv) { int c; /* Make sure the mask is good */ umask(033); while ((c = getopt(argc, argv, "df:hvs")) != -1) { switch (c) { case 'd': opt_debug++; break; case 'n': opt_coldplug = 0; break; case 'f': opt_config = optarg; break; case 'v': version(); case 'h': usage(0); default: usage(1); } } ct_config.debug = opt_debug; /* Parse IFD config file */ if (ifd_config_parse(opt_config) < 0) exit(1); if (optind == argc) usage(1); argv += optind; argc -= optind; if (!strcmp(argv[0], "init")) { return mgr_init(argc, argv); } else if (!strcmp(argv[0], "shutdown")) { return mgr_shutdown(argc, argv); } else if (!strcmp(argv[0], "attach")) { return mgr_attach(argc, argv); } else if (!strcmp(argv[0], "status")) { return mgr_status(argc, argv); } fprintf(stderr, "Unknown command: %s\n", argv[0]); return 1; } static int mgr_init(int argc, char **argv) { char *ifdhandler_user = NULL; char *sval; int n; if (argc != 1) usage(1); /* Get the ifdhandler user so we can set ownership */ if (ifd_conf_get_string("ifdhandler.user", &sval) >= 0) ifdhandler_user = sval; /* Zap the status file */ ct_status_clear(OPENCT_MAX_READERS, ifdhandler_user); /* Initialize IFD library */ ifd_init(); /* Create an ifdhandler process for every reader defined * in the config file */ n = ifd_conf_get_nodes("reader", NULL, 0); if (n >= 0) { ifd_conf_node_t **nodes; int i; nodes = (ifd_conf_node_t **) calloc(n, sizeof(*nodes)); if (!nodes) { ct_error("out of memory"); return 1; } n = ifd_conf_get_nodes("reader", nodes, n); for (i = 0; i < n; i++) configure_reader(nodes[i]); free(nodes); } /* Create an ifdhandler process for every hotplug reader found */ if (opt_coldplug) ifd_scan_usb(); return 0; } /* * shut down the whole thing */ static int mgr_shutdown(int argc, char **argv) { const ct_info_t *status; int num, killed = 0; if (argc != 1) usage(1); if ((num = ct_status(&status)) < 0) { fprintf(stderr, "cannot access status file; no readers killed\n"); return 0; } while (num--) { if (status[num].ct_pid && kill(status[num].ct_pid, SIGTERM) >= 0) killed++; } ct_status_destroy(); printf("%d process%s killed.\n", killed, (killed == 1) ? "" : "es"); return 0; } /* * Attach a new reader */ static int mgr_attach(int argc, char **argv) { const char *driver, *type, *device; char *typedev; ifd_devid_t id; pid_t pid; if (argc != 4) usage(1); driver = argv[1]; type = argv[2]; device = argv[3]; /* Initialize IFD library */ ifd_init(); typedev = malloc(strlen(type) + strlen(device) + 2); if (!typedev) { fprintf(stderr, "out of memory\n"); return 1; } sprintf(typedev, "%s:%s", type, device); if (strncmp(type, driver, strlen(type)) == 0) { /* detect what kind of device we have */ if (ifd_device_id_parse(driver, &id) < 0) { fprintf(stderr, "Cannot parse device ID %s\n", driver); return 1; } if (!(driver = ifd_driver_for_id(&id))) { /* fall back to ccid driver */ driver = "ccid"; } } pid = ifd_spawn_handler(driver, typedev, -1); return (pid > 0) ? 0 : 1; } /* * Show status of all readers */ static int mgr_status(int argc, char **argv) { const ct_info_t *readers, *r; unsigned int j; int i, num, count = 0; char *sepa; if (argc != 1) usage(1); if ((num = ct_status(&readers)) < 0) { fprintf(stderr, "Unable to get reader status\n"); return 1; } for (i = 0, r = readers; i < num; i++, r++) { if (r->ct_pid == 0 || (kill(r->ct_pid, 0) < 0 && errno == ESRCH)) continue; if (count == 0) printf("No. Name Info\n" "===================================================\n"); printf(" %2d %-29.29s", i, r->ct_name); sepa = ""; if (r->ct_slots > 1) { printf("%s%d slots", sepa, r->ct_slots); sepa = ", "; } if (r->ct_display) { printf("%sdisplay", sepa); sepa = ", "; } if (r->ct_keypad) { printf("%skeypad", sepa); sepa = ", "; } for (j = 0; j < r->ct_slots; j++) { printf("%sslot%u: ", sepa, j); if (r->ct_card[j]) printf("card present"); else printf("empty"); sepa = ", "; } printf("\n"); } return 0; } /* * Configure a reader using info from the config file */ static void configure_reader(ifd_conf_node_t * cf) { static unsigned int nreaders = 0; char *device, *driver; if (ifd_conf_node_get_string(cf, "device", &device) < 0) { ct_error("no device specified in reader configuration"); return; } if (ifd_conf_node_get_string(cf, "driver", &driver) < 0) { ct_error ("no driver specified in reader configuration for device %s", device); return; } if (device == NULL && driver == NULL) { ct_error("neither device nor driver specified " "in reader configuration"); return; } ifd_spawn_handler(driver, device, nreaders++); } /* * Display version */ static void version(void) { fprintf(stdout, "OpenCT " VERSION "\n"); exit(0); } /* * Usage message */ static void usage(int exval) { fprintf(exval ? stderr : stdout, "usage: openct-control [-d] [-f configfile] command\n" " -d enable debugging; repeat to increase verbosity\n" " -n disable coldplugging\n" " -f specify config file (default %s)\n" " -h display this message\n" " -v display version and exit\n" "\nWhere command is one of:\n" "init - initialize OpenCT\n" "attach driver type device - attach a hotplug device\n" "status - display status of all readers present\n" "shutdown - shutdown OpenCT\n", OPENCT_CONF_PATH); exit(exval); } openct-0.6.20/src/tools/openct-tool.c0000644000175000017500000001633210625650421014354 00000000000000/* * openct-tool * * Copyright (C) 2003 Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include static void usage(int exval); static void version(void); static int do_reset(ct_handle *, unsigned char *, size_t); static void do_select_mf(ct_handle * reader); static void do_read_memory(ct_handle *, unsigned int, unsigned int); static void print_reader(ct_handle * h); static void print_reader_info(ct_info_t * info); static void print_atr(ct_handle *, unsigned char *, size_t); static void dump(unsigned char *data, size_t len); static unsigned int opt_reader = 0; static unsigned int opt_slot = 0; static const char *opt_config = NULL; static int opt_debug = 0; static int opt_command = -1; enum { CMD_LIST = 0, CMD_WAIT, CMD_RWAIT, CMD_ATR, CMD_MF, CMD_READ, CMD_VERSION }; int main(int argc, char **argv) { unsigned char atr[64]; const char *cmd; ct_handle *h; ct_lock_handle lock; int c, rc; while ((c = getopt(argc, argv, "df:r:s:hv")) != -1) { switch (c) { case 'd': opt_debug++; break; case 'f': opt_config = optarg; break; case 'v': version(); case 'h': usage(0); case 'r': opt_reader = atoi(optarg); break; case 's': opt_slot = atoi(optarg); break; default: usage(1); } } if (optind == argc) usage(1); cmd = argv[optind++]; if (!strcmp(cmd, "list")) opt_command = CMD_LIST; else if (!strcmp(cmd, "atr")) opt_command = CMD_ATR; else if (!strcmp(cmd, "rwait")) opt_command = CMD_RWAIT; else if (!strcmp(cmd, "wait")) opt_command = CMD_WAIT; else if (!strcmp(cmd, "mf")) opt_command = CMD_MF; else if (!strcmp(cmd, "read")) opt_command = CMD_READ; else { fprintf(stderr, "Unknown command \"%s\"\n", cmd); usage(1); } if (opt_command == CMD_LIST) { int i; for (i = 0; i < OPENCT_MAX_READERS; i++) { ct_info_t info; if (ct_reader_info(i, &info) < 0) continue; printf(" %2d ", i); print_reader_info(&info); } exit(0); } if (opt_command == CMD_RWAIT) { while (1) { h = ct_reader_connect(opt_reader); if (h) { free(h); break; } sleep(1); } exit(0); } if (!(h = ct_reader_connect(opt_reader))) { fprintf(stderr, "Unknown reader #%u\n", opt_reader); return 1; } if (opt_command == CMD_WAIT) { int status; while (1) { if ((rc = ct_card_status(h, opt_slot, &status)) < 0) { fprintf(stderr, "failed to get card status: %s\n", ct_strerror(rc)); return 1; } if (status) break; sleep(1); } printf("Card detected\n"); return 0; } printf("Detected "); print_reader(h); if ((rc = ct_card_lock(h, opt_slot, IFD_LOCK_SHARED, &lock)) < 0) { fprintf(stderr, "ct_card_lock: err=%d\n", rc); exit(1); } rc = do_reset(h, atr, sizeof(atr)); switch (opt_command) { case CMD_ATR: print_atr(h, atr, rc); break; case CMD_MF: do_select_mf(h); break; case CMD_READ:{ unsigned int address = 0, count = 1024; if (optind < argc) address = strtoul(argv[optind++], NULL, 0); if (optind < argc) count = strtoul(argv[optind++], NULL, 0); do_read_memory(h, address, count); } break; } ct_card_unlock(h, 0, lock); sleep(1); return 0; } static void version(void) { fprintf(stdout, "OpenCT " VERSION "\n"); exit(0); } static void usage(int exval) { fprintf(exval ? stderr : stdout, "usage: openct-tool [-d] [-f configfile] [-r reader] command ...\n" " -d enable debugging; repeat to increase verbosity\n" " -f specify config file (default %s)\n" " -r specify index of reader to use\n" " -s specify slot of reader to use\n" " -h display this message\n" " -v display version and exit\n" "\n" "command: can be one of the following\n" " list list all readers found\n" " atr print ATR of card in selected reader\n" " wait wait for card to be inserted\n" " rwait wait for reader to be attached\n" " mf try to select main folder of card\n" " read dump memory of synchronous card\n", OPENCT_CONF_PATH); exit(exval); } static int do_reset(ct_handle * h, unsigned char *atr, size_t atr_len) { int rc, n, status; if ((rc = ct_card_status(h, opt_slot, &status)) < 0) { fprintf(stderr, "ct_card_status: err=%d\n", rc); exit(1); } printf("Card %spresent%s\n", (status & IFD_CARD_PRESENT) ? "" : "not ", (status & IFD_CARD_STATUS_CHANGED) ? ", status changed" : ""); if (status & IFD_CARD_PRESENT) { n = ct_card_reset(h, opt_slot, atr, atr_len); } else { n = ct_card_request(h, opt_slot, 5, "Please insert card", atr, atr_len); } if (n < 0) { fprintf(stderr, "failed to reset card\n"); exit(1); } return n; } static void do_select_mf(ct_handle * h) { unsigned char cmd[] = { 0x00, 0xA4, 0x00, 0x00, 0x02, 0x3f, 0x00, 0x00 }; unsigned char res[256]; ct_lock_handle lock; int rc; if ((rc = ct_card_lock(h, opt_slot, IFD_LOCK_EXCLUSIVE, &lock)) < 0) { fprintf(stderr, "ct_card_lock: err=%d\n", rc); exit(1); } again: rc = ct_card_transact(h, opt_slot, cmd, sizeof(cmd), res, sizeof(res)); if (rc < 0) { fprintf(stderr, "card communication failure, err=%d\n", rc); return; } if (rc == 2 && res[0] == 0x6A && res[1] == 0x86) { /* FIXME - Cryptoflex needs class byte 0xC0 :-( */ if (cmd[0] == 0x00) { cmd[0] = 0xC0; goto again; } } printf("Selected MF, response:\n"); dump(res, rc); } static void do_read_memory(ct_handle * h, unsigned int address, unsigned int count) { unsigned char buffer[8192]; int rc; if (count > sizeof(buffer)) count = sizeof(buffer); rc = ct_card_read_memory(h, opt_slot, address, buffer, count); if (rc < 0) { fprintf(stderr, "failed to read memory card: %s\n", ct_strerror(rc)); exit(1); } printf("Read %u bytes at address 0x%04x\n", rc, address); dump(buffer, rc); } static void print_reader(ct_handle * h) { ct_info_t info; int rc; if ((rc = ct_reader_status(h, &info)) < 0) { printf("ct_reader_status: err=%d\n", rc); } else { print_reader_info(&info); } } static void print_reader_info(ct_info_t * info) { const char *sepa; printf("%s", info->ct_name); sepa = " ("; if (info->ct_slots != 1) { printf("%s%d slots", sepa, info->ct_slots); sepa = ", "; } if (info->ct_display) { printf("%sdisplay", sepa); sepa = ", "; } if (info->ct_keypad) { printf("%skeypad", sepa); sepa = ", "; } if (sepa[0] != ' ') printf(")"); printf("\n"); } static void print_atr(ct_handle * h, unsigned char *atr, size_t len) { unsigned int m; printf("ATR:"); if (len == 0) { printf(""); } else { for (m = 0; m < len; m++) printf(" %02x", atr[m]); } printf("\n"); } static void dump(unsigned char *data, size_t len) { unsigned int offset = 0; do { unsigned int i; printf("%04x:", offset); for (i = 0; i < 16; i++) { if (offset + i < len) printf(" %02x", data[offset + i]); else printf(" "); } printf(" "); for (i = 0; i < 16 && offset + i < len; i++) { int c = data[offset + i]; if (!isprint(c) || (isspace(c) && c != ' ')) c = '.'; printf("%c", c); } offset += 16; printf("\n"); } while (offset < len); } openct-0.6.20/src/tools/Makefile.am0000644000175000017500000000105611043042742013772 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in bin_PROGRAMS = openct-tool sbin_PROGRAMS = openct-control man1_MANS = openct-tool.1 openct_tool_SOURCES = openct-tool.c openct_tool_LDADD = $(top_builddir)/src/ct/libopenct.la openct_tool_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include openct_control_SOURCES = openct-control.c openct_control_LDADD = $(top_builddir)/src/ifd/libifd.la $(top_builddir)/src/ct/libopenct.la openct_control_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include openct-0.6.20/src/tools/Makefile.in0000644000175000017500000006631211336457520014022 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = openct-tool$(EXEEXT) sbin_PROGRAMS = openct-control$(EXEEXT) subdir = src/tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/openct-tool.1.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = openct-tool.1 CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am_openct_control_OBJECTS = openct_control-openct-control.$(OBJEXT) openct_control_OBJECTS = $(am_openct_control_OBJECTS) openct_control_DEPENDENCIES = $(top_builddir)/src/ifd/libifd.la \ $(top_builddir)/src/ct/libopenct.la openct_control_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(openct_control_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_openct_tool_OBJECTS = openct_tool-openct-tool.$(OBJEXT) openct_tool_OBJECTS = $(am_openct_tool_OBJECTS) openct_tool_DEPENDENCIES = $(top_builddir)/src/ct/libopenct.la openct_tool_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(openct_tool_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(openct_control_SOURCES) $(openct_tool_SOURCES) DIST_SOURCES = $(openct_control_SOURCES) $(openct_tool_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' man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man1_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in man1_MANS = openct-tool.1 openct_tool_SOURCES = openct-tool.c openct_tool_LDADD = $(top_builddir)/src/ct/libopenct.la openct_tool_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include openct_control_SOURCES = openct-control.c openct_control_LDADD = $(top_builddir)/src/ifd/libifd.la $(top_builddir)/src/ct/libopenct.la openct_control_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/tools/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): openct-tool.1: $(top_builddir)/config.status $(srcdir)/openct-tool.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list openct-control$(EXEEXT): $(openct_control_OBJECTS) $(openct_control_DEPENDENCIES) @rm -f openct-control$(EXEEXT) $(openct_control_LINK) $(openct_control_OBJECTS) $(openct_control_LDADD) $(LIBS) openct-tool$(EXEEXT): $(openct_tool_OBJECTS) $(openct_tool_DEPENDENCIES) @rm -f openct-tool$(EXEEXT) $(openct_tool_LINK) $(openct_tool_OBJECTS) $(openct_tool_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openct_control-openct-control.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openct_tool-openct-tool.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< openct_control-openct-control.o: openct-control.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_control_CFLAGS) $(CFLAGS) -MT openct_control-openct-control.o -MD -MP -MF $(DEPDIR)/openct_control-openct-control.Tpo -c -o openct_control-openct-control.o `test -f 'openct-control.c' || echo '$(srcdir)/'`openct-control.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/openct_control-openct-control.Tpo $(DEPDIR)/openct_control-openct-control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='openct-control.c' object='openct_control-openct-control.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_control_CFLAGS) $(CFLAGS) -c -o openct_control-openct-control.o `test -f 'openct-control.c' || echo '$(srcdir)/'`openct-control.c openct_control-openct-control.obj: openct-control.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_control_CFLAGS) $(CFLAGS) -MT openct_control-openct-control.obj -MD -MP -MF $(DEPDIR)/openct_control-openct-control.Tpo -c -o openct_control-openct-control.obj `if test -f 'openct-control.c'; then $(CYGPATH_W) 'openct-control.c'; else $(CYGPATH_W) '$(srcdir)/openct-control.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/openct_control-openct-control.Tpo $(DEPDIR)/openct_control-openct-control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='openct-control.c' object='openct_control-openct-control.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_control_CFLAGS) $(CFLAGS) -c -o openct_control-openct-control.obj `if test -f 'openct-control.c'; then $(CYGPATH_W) 'openct-control.c'; else $(CYGPATH_W) '$(srcdir)/openct-control.c'; fi` openct_tool-openct-tool.o: openct-tool.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_tool_CFLAGS) $(CFLAGS) -MT openct_tool-openct-tool.o -MD -MP -MF $(DEPDIR)/openct_tool-openct-tool.Tpo -c -o openct_tool-openct-tool.o `test -f 'openct-tool.c' || echo '$(srcdir)/'`openct-tool.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/openct_tool-openct-tool.Tpo $(DEPDIR)/openct_tool-openct-tool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='openct-tool.c' object='openct_tool-openct-tool.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_tool_CFLAGS) $(CFLAGS) -c -o openct_tool-openct-tool.o `test -f 'openct-tool.c' || echo '$(srcdir)/'`openct-tool.c openct_tool-openct-tool.obj: openct-tool.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_tool_CFLAGS) $(CFLAGS) -MT openct_tool-openct-tool.obj -MD -MP -MF $(DEPDIR)/openct_tool-openct-tool.Tpo -c -o openct_tool-openct-tool.obj `if test -f 'openct-tool.c'; then $(CYGPATH_W) 'openct-tool.c'; else $(CYGPATH_W) '$(srcdir)/openct-tool.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/openct_tool-openct-tool.Tpo $(DEPDIR)/openct_tool-openct-tool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='openct-tool.c' object='openct_tool-openct-tool.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_tool_CFLAGS) $(CFLAGS) -c -o openct_tool-openct-tool.obj `if test -f 'openct-tool.c'; then $(CYGPATH_W) 'openct-tool.c'; else $(CYGPATH_W) '$(srcdir)/openct-tool.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man1_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && 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) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)"; 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ uninstall-sbinPROGRAMS uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 \ uninstall-sbinPROGRAMS # 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: openct-0.6.20/src/ct/0000777000175000017500000000000011336457577011313 500000000000000openct-0.6.20/src/ct/path.c0000644000175000017500000000211510625640312012303 00000000000000/* * Path handling routines * * Copyright (C) 2006, Andreas Jellinghaus */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* * Format path */ int ct_format_path(char *path, const size_t pathlen, const char *file) { int rc; if (!file) return 0; #if defined (sunray) || defined (sunrayclient) { if (getenv("UTDEVROOT")) rc = snprintf(path, pathlen, "%s/openct/%s", getenv("UTDEVROOT"), file); else if (getenv("OPENCT_SOCKETDIR")) rc = snprintf(path, pathlen, "%s/%s", getenv("OPENCT_SOCKETDIR"), file); else rc = snprintf(path, pathlen, "%s/%s", OPENCT_SOCKET_PATH, file); } #else if (getenv("OPENCT_SOCKETDIR")) { rc = snprintf(path, pathlen, "%s/%s", getenv("OPENCT_SOCKETDIR"), file); } else { rc = snprintf(path, pathlen, "%s/%s", OPENCT_SOCKET_PATH, file); } #endif if (rc < 0) { /* hmm. error handling? */ return 0; } if (rc >= pathlen) { /* truncated */ return 0; } return 1; } openct-0.6.20/src/ct/buffer.c0000644000175000017500000000534110422076714012630 00000000000000/* * Buffer handling functions * * Copyright (C) 2003, Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include void ct_buf_init(ct_buf_t * bp, void *mem, size_t len) { memset(bp, 0, sizeof(*bp)); bp->base = (unsigned char *)mem; bp->size = len; } void ct_buf_set(ct_buf_t * bp, void *mem, size_t len) { ct_buf_init(bp, mem, len); bp->tail = len; } void ct_buf_clear(ct_buf_t * bp) { bp->head = bp->tail = 0; } int ct_buf_get(ct_buf_t * bp, void *mem, size_t len) { if (len > bp->tail - bp->head) return -1; if (mem) memcpy(mem, bp->base + bp->head, len); bp->head += len; return len; } int ct_buf_gets(ct_buf_t * bp, char *buffer, size_t size) { unsigned int n, avail; unsigned char *s; size -= 1; /* room for NUL byte */ /* Limit string to what we have */ avail = bp->tail - bp->head; if (size > avail) size = avail; /* Look for newline */ s = bp->base + bp->head; for (n = 0; n < size && s[n] != '\n'; n++) ; /* Copy string (excluding newline) */ memcpy(buffer, s, n); buffer[n] = '\0'; /* And eat any characters that weren't copied * (including the newline) */ while (n < avail && s[n++] != '\n') ; bp->head += n; return 0; } int ct_buf_put(ct_buf_t * bp, const void *mem, size_t len) { if (len > bp->size - bp->tail) ct_buf_compact(bp); if (len > bp->size - bp->tail) { bp->overrun = 1; return -1; } if (mem) memcpy(bp->base + bp->tail, mem, len); bp->tail += len; return len; } int ct_buf_push(ct_buf_t * bp, const void *mem, size_t len) { if (bp->head < len) return -1; bp->head -= len; if (mem) memcpy(bp->base + bp->head, mem, len); return len; } int ct_buf_putc(ct_buf_t * bp, int byte) { unsigned char c = byte; return ct_buf_put(bp, &c, 1); } int ct_buf_puts(ct_buf_t * bp, const char *string) { return ct_buf_put(bp, string, strlen(string)); } unsigned int ct_buf_avail(ct_buf_t * bp) { return bp->tail - bp->head; } unsigned int ct_buf_tailroom(ct_buf_t * bp) { return bp->size - bp->tail; } unsigned int ct_buf_size(ct_buf_t * bp) { return bp->size; } void *ct_buf_head(ct_buf_t * bp) { return bp->base + bp->head; } void *ct_buf_tail(ct_buf_t * bp) { return bp->base + bp->tail; } int ct_buf_read(ct_buf_t * bp, int fd) { unsigned int count; int n; ct_buf_compact(bp); count = bp->size - bp->tail; if ((n = read(fd, bp->base + bp->tail, count)) < 0) return -1; bp->tail += n; return 0; } void ct_buf_compact(ct_buf_t * bp) { unsigned int count; if (bp->head == 0) return; count = bp->tail - bp->head; memmove(bp->base, bp->base + bp->head, count); bp->tail -= bp->head; bp->head = 0; } int ct_buf_overrun(ct_buf_t * bp) { return bp->overrun; } openct-0.6.20/src/ct/status.c0000644000175000017500000001117011175777371012714 00000000000000/* * Shared status file for OpenCT readers * * Copyright (C) 2003 Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int ct_status_lock(void); static void ct_status_unlock(void); static void *ct_map_status(int flags, size_t * size) { struct stat stb; int fd, prot; void *addr = NULL; char status_path[PATH_MAX]; if (!ct_format_path(status_path, PATH_MAX, "status")) { return NULL; } if ((fd = open(status_path, flags)) < 0) { ct_error("can't open %s: %s", status_path, strerror(errno)); return NULL; } if (fstat(fd, &stb) < 0) { ct_error("unable to stat %s: %m", status_path); goto done; } *size = stb.st_size; prot = PROT_READ; if ((flags & O_ACCMODE) == O_RDWR) prot |= PROT_WRITE; addr = mmap(NULL, *size, prot, MAP_SHARED, fd, 0); if (addr == MAP_FAILED) { addr = NULL; } done:close(fd); return addr; } int ct_status_destroy(void) { char status_path[PATH_MAX]; if (!ct_format_path(status_path, PATH_MAX, "status")) { return -1; } return unlink(status_path); } int ct_status_clear(unsigned int count, const char *owner) { int fd = -1; char status_path[PATH_MAX]; if (!ct_format_path(status_path, PATH_MAX, "status")) { return -1; } unlink(status_path); if ((fd = open(status_path, O_RDWR | O_CREAT, 0644)) < 0 || ftruncate(fd, count * sizeof(ct_info_t)) < 0 || fchmod(fd, 0644) < 0) { ct_error("cannot create %s: %m", status_path); goto error; } if (owner != NULL) { struct passwd *p = getpwnam(owner); if (p == NULL) { ct_error("cannot parse user %s", owner); goto error; } if (fchown(fd, p->pw_uid, -1) == -1) { ct_error("cannot chown %s to %s: %m", status_path, owner); goto error; } } return 0; error: unlink(status_path); if (fd >= 0) close(fd); return -1; } int ct_status(const ct_info_t ** result) { static const ct_info_t *reader_status; static unsigned int num_status; if (reader_status == NULL) { size_t size; reader_status = (ct_info_t *) ct_map_status(O_RDONLY, &size); if (reader_status == NULL) return -1; num_status = size / sizeof(ct_info_t); } *result = reader_status; return num_status; } ct_info_t *ct_status_alloc_slot(int *num) { ct_info_t *info; size_t size; unsigned int n, max; info = (ct_info_t *) ct_map_status(O_RDWR, &size); if (info == NULL) return NULL; max = size / sizeof(ct_info_t); if (*num == -1) { sigset_t sigset; /* Block all signals while holding the lock */ sigfillset(&sigset); sigprocmask(SIG_SETMASK, &sigset, &sigset); /* Lock the status file against concurrent access */ ct_status_lock(); /* find a free slot */ for (n = 0; n < max; n++, info) { if (info[n].ct_pid == 0 || (kill(info[n].ct_pid, 0) < 0 && errno == ESRCH)) { *num = n; break; } } /* Done, unlock the file again */ ct_status_unlock(); /* unblock signals */ sigprocmask(SIG_SETMASK, &sigset, NULL); } else if (*num >= max) { munmap((void *)info, size); return NULL; } memset(&info[*num], 0, sizeof(ct_info_t)); info[*num].ct_pid = getpid(); msync((void *)info, size, MS_SYNC); return info + *num; } #define ALIGN(x, size) (((caddr_t) (x)) - ((unsigned long) (x) % (size))) int ct_status_update(ct_info_t * status) { size_t size; caddr_t page; /* get the page this piece of data is sitting on */ size = getpagesize(); page = ALIGN(status, size); /* flush two pages if data spans two pages */ if (page != ALIGN(status + 1, size)) size <<= 1; if (msync(page, size, MS_SYNC) < 0) { ct_error("msync: %m"); return -1; } return 0; } /* * Lock file handling */ static int ct_status_lock(void) { int fd, retries = 10; int ret = -1; char status_lock_path[PATH_MAX]; char status_temp_path[PATH_MAX]; if (!ct_format_path(status_lock_path, PATH_MAX, "status.lock")) { return -1; } snprintf(status_temp_path, PATH_MAX, "%s.%u", status_lock_path, (unsigned int)getpid()); if ((fd = open(status_temp_path, O_CREAT | O_RDWR, 0600)) < 0) return -1; while (retries--) { if (link(status_temp_path, status_lock_path) >= 0) { ret = 0; break; } } close(fd); unlink(status_temp_path); return ret; } static void ct_status_unlock(void) { char status_lock_path[PATH_MAX]; if (!ct_format_path(status_lock_path, PATH_MAX, "status.lock")) { return; } unlink(status_lock_path); } openct-0.6.20/src/ct/mainloop.c0000644000175000017500000000501111141256300013155 00000000000000/* * Resource manager daemon - main loop * * Copyright (C) 2003 Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #define IFD_MAX_SOCKETS 256 static ct_socket_t sock_head; static int leave_mainloop; void ct_mainloop_add_socket(ct_socket_t * sock) { if (sock) ct_socket_link(&sock_head, sock); } /* * Main loop */ void ct_mainloop(void) { leave_mainloop = 0; while (!leave_mainloop) { struct pollfd pfd[IFD_MAX_SOCKETS + 1]; ct_socket_t *poll_socket[IFD_MAX_SOCKETS]; ct_socket_t *sock, *next; unsigned int nsockets = 0, npoll = 0; unsigned int n = 0, listening; int have_driver_with_poll = 0; int rc; /* Zap poll structure */ memset(pfd, 0, sizeof(pfd)); /* Count active sockets, and decide whether to * accept additional connections or not. */ for (sock = sock_head.next; sock; sock = next) { next = sock->next; /* Kill any dead or excess sockets */ if (sock->fd < 0 || nsockets == IFD_MAX_SOCKETS) { ct_socket_free(sock); } else { nsockets++; } } listening = (nsockets < IFD_MAX_SOCKETS) ? POLLIN : 0; /* Now loop over all sockets and set up the poll structs */ for (sock = sock_head.next; sock; sock = sock->next) { poll_socket[npoll] = sock; if (sock->poll) { have_driver_with_poll = 1; if (sock->poll(sock, &pfd[npoll]) == 1) npoll++; } else { if (sock->listener) sock->events = listening; pfd[npoll].fd = sock->fd; pfd[npoll].events = sock->events; npoll++; } } if (npoll == 0) break; rc = poll(pfd, npoll, have_driver_with_poll ? 1000 : -1); if (rc < 0) { if (errno == EINTR) continue; ct_error("poll: %m"); break; } for (n = 0; n < npoll; n++) { sock = poll_socket[n]; if (sock->poll) { if (sock->poll(sock, &pfd[n]) < 0) { ct_socket_free(sock); continue; } continue; } if (pfd[n].revents & POLLERR) { if (sock->error(sock) < 0) { ct_socket_free(sock); continue; } } if (pfd[n].revents & POLLOUT) { if (sock->send(sock) < 0) { ct_socket_free(sock); continue; } } if (pfd[n].revents & POLLIN) { if ((rc = sock->recv(sock)) < 0) { ct_socket_free(sock); continue; } } } } } void ct_mainloop_leave(void) { leave_mainloop = 1; } openct-0.6.20/src/ct/client.c0000644000175000017500000002364410625650421012641 00000000000000/* * Communication with ifd handler * * Copyright (C) 2003 Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include struct ct_handle { ct_socket_t *sock; unsigned int index; /* reader index */ unsigned int card[OPENCT_MAX_SLOTS]; /* card seq */ const ct_info_t *info; }; static void ct_args_int(ct_buf_t *, ifd_tag_t, unsigned int); static void ct_args_string(ct_buf_t *, ifd_tag_t, const char *); static void ct_args_opaque(ct_buf_t *, ifd_tag_t, const unsigned char *, size_t); /* * Get reader info */ int ct_reader_info(unsigned int reader, ct_info_t * result) { const ct_info_t *info; int rc; if ((rc = ct_status(&info)) < 0 || reader > (unsigned int)rc) return -1; /* Make sure the server process is alive */ if (info[reader].ct_pid == 0 || (kill(info[reader].ct_pid, 0) < 0 && errno == ESRCH)) return -1; *result = info[reader]; return 0; } /* * Connect to a reader manager */ ct_handle *ct_reader_connect(unsigned int reader) { const ct_info_t *info; char path[PATH_MAX]; char file[PATH_MAX]; ct_handle *h; int rc, len; len = PATH_MAX; snprintf(file, PATH_MAX, "%d", reader); if (!ct_format_path(path, PATH_MAX, file)) { return NULL; } if ((rc = ct_status(&info)) < 0 || reader > (unsigned int)rc) return NULL; if (!(h = (ct_handle *) calloc(1, sizeof(*h)))) return NULL; if (!(h->sock = ct_socket_new(CT_SOCKET_BUFSIZ))) { free(h); return NULL; } if (ct_socket_connect(h->sock, path) < 0) { ct_reader_disconnect(h); return NULL; } h->info = info + reader; return h; } /* * Disconnect from reader manager */ void ct_reader_disconnect(ct_handle * h) { if (h->sock) ct_socket_free(h->sock); memset(h, 0, sizeof(*h)); free(h); } /* * Retrieve reader status */ int ct_reader_status(ct_handle * h, ct_info_t * info) { *info = *h->info; return 0; } #if 0 /* * Print something to the reader's display */ int ct_reader_output(ct_handle * h, const char *message) { unsigned char buffer[256]; ct_buf_t args, resp; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_OUTPUT); ct_buf_putc(&args, CT_UNIT_READER); /* Add arguments if given */ if (message) ct_args_string(&args, CT_TAG_MESSAGE, message); return ct_socket_call(h->sock, &args, &resp); } #endif /* * Get card status */ int ct_card_status(ct_handle * h, unsigned int slot, int *status) { const ct_info_t *info; unsigned int seq; info = h->info; if (slot > info->ct_slots) return IFD_ERROR_INVALID_ARG; seq = info->ct_card[slot]; *status = 0; if (seq != 0) { *status = IFD_CARD_PRESENT; if (seq != h->card[slot]) *status |= IFD_CARD_STATUS_CHANGED; } h->card[slot] = seq; return 0; } /* * Reset the card - this is the same as "request icc" without parameters */ int ct_card_reset(ct_handle * h, unsigned int slot, void *atr, size_t atr_len) { return ct_card_request(h, slot, 0, NULL, atr, atr_len); } int ct_card_request(ct_handle * h, unsigned int slot, unsigned int timeout, const char *message, void *atr, size_t atr_len) { ct_tlv_parser_t tlv; unsigned char buffer[256]; ct_buf_t args, resp; int rc; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_RESET); ct_buf_putc(&args, slot); /* Add arguments if given */ if (timeout) ct_args_int(&args, CT_TAG_TIMEOUT, timeout); if (message) ct_args_string(&args, CT_TAG_MESSAGE, message); rc = ct_socket_call(h->sock, &args, &resp); if (rc < 0) return rc; if ((rc = ct_tlv_parse(&tlv, &resp)) < 0) return rc; /* Get the ATR. There may be no ATR if the card is synchronous */ rc = ct_tlv_get_bytes(&tlv, CT_TAG_ATR, atr, atr_len); if (rc < 0) rc = 0; return rc; } #if 0 int ct_card_eject(ct_handle * h, unsigned int slot, unsigned int timeout, const char *message) { unsigned char buffer[256]; ct_buf_t args, resp; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_EJECT_ICC); ct_buf_putc(&args, slot); /* Add arguments if given */ if (timeout) ct_args_int(&args, CT_TAG_TIMEOUT, timeout); if (message) ct_args_string(&args, CT_TAG_MESSAGE, message); return ct_socket_call(h->sock, &args, &resp); } #endif int ct_card_set_protocol(ct_handle * h, unsigned int slot, unsigned int protocol) { unsigned char buffer[256]; ct_buf_t args, resp; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_SET_PROTOCOL); ct_buf_putc(&args, slot); ct_args_int(&args, CT_TAG_PROTOCOL, protocol); return ct_socket_call(h->sock, &args, &resp); } /* * Transceive an APDU */ int ct_card_transact(ct_handle * h, unsigned int slot, const void *send_data, size_t send_len, void *recv_buf, size_t recv_size) { ct_tlv_parser_t tlv; unsigned char buffer[CT_SOCKET_BUFSIZ]; ct_buf_t args, resp; int rc; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_TRANSACT); ct_buf_putc(&args, slot); ct_args_opaque(&args, CT_TAG_CARD_REQUEST, (const unsigned char *)send_data, send_len); rc = ct_socket_call(h->sock, &args, &resp); if (rc < 0) return rc; if ((rc = ct_tlv_parse(&tlv, &resp)) < 0) return rc; /* Get the ATR */ return ct_tlv_get_bytes(&tlv, CT_TAG_CARD_RESPONSE, recv_buf, recv_size); } /* * Read from a synchronous card */ int ct_card_read_memory(ct_handle * h, unsigned int slot, unsigned short address, void *recv_buf, size_t recv_len) { ct_tlv_parser_t tlv; unsigned char buffer[CT_SOCKET_BUFSIZ]; ct_buf_t args, resp; int rc; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_MEMORY_READ); ct_buf_putc(&args, slot); ct_args_int(&args, CT_TAG_ADDRESS, address); ct_args_int(&args, CT_TAG_COUNT, recv_len); rc = ct_socket_call(h->sock, &args, &resp); if (rc < 0) return rc; if ((rc = ct_tlv_parse(&tlv, &resp)) < 0) return rc; return ct_tlv_get_bytes(&tlv, CT_TAG_DATA, recv_buf, recv_len); } int ct_card_write_memory(ct_handle * h, unsigned int slot, unsigned short address, const void *send_buf, size_t send_len) { unsigned char buffer[CT_SOCKET_BUFSIZ]; ct_buf_t args, resp; int rc; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_MEMORY_WRITE); ct_buf_putc(&args, slot); ct_args_int(&args, CT_TAG_ADDRESS, address); ct_args_opaque(&args, CT_TAG_DATA, (const unsigned char *)send_buf, send_len); rc = ct_socket_call(h->sock, &args, &resp); if (rc < 0) return rc; return 0; } /* * Verify PIN */ int ct_card_verify(ct_handle * h, unsigned int slot, unsigned int timeout, const char *prompt, unsigned int pin_encoding, unsigned int pin_length, unsigned int pin_offset, const void *send_buf, size_t send_len, void *recv_buf, size_t recv_len) { unsigned char buffer[256]; ct_buf_t args, resp; ct_tlv_builder_t builder; ct_tlv_parser_t parser; unsigned char control = 0x00; int rc; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, recv_buf, recv_len); ct_buf_putc(&args, CT_CMD_PERFORM_VERIFY); ct_buf_putc(&args, slot); if (timeout) ct_args_int(&args, CT_TAG_TIMEOUT, timeout); if (prompt) ct_args_string(&args, CT_TAG_MESSAGE, prompt); ct_tlv_builder_init(&builder, &args, 1); ct_tlv_put_tag(&builder, CT_TAG_PIN_DATA); /* Build the control byte */ if (pin_encoding == IFD_PIN_ENCODING_ASCII) control |= 0x01; else if (pin_encoding != IFD_PIN_ENCODING_BCD) return IFD_ERROR_INVALID_ARG; if (pin_length) control |= pin_length << 4; ct_tlv_add_byte(&builder, control); /* Offset is 1 based */ ct_tlv_add_byte(&builder, pin_offset + 1); ct_tlv_add_bytes(&builder, (const unsigned char *)send_buf, send_len); rc = ct_socket_call(h->sock, &args, &resp); if (rc < 0) return rc; if ((rc = ct_tlv_parse(&parser, &resp)) < 0) return rc; /* Get the ATR */ return ct_tlv_get_bytes(&parser, CT_TAG_CARD_RESPONSE, recv_buf, recv_len); } /* * Lock/unlock a card */ int ct_card_lock(ct_handle * h, unsigned int slot, int type, ct_lock_handle * res) { ct_tlv_parser_t tlv; unsigned char buffer[256]; ct_buf_t args, resp; int rc; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_LOCK); ct_buf_putc(&args, slot); ct_args_int(&args, CT_TAG_LOCKTYPE, type); rc = ct_socket_call(h->sock, &args, &resp); if (rc < 0) return rc; if ((rc = ct_tlv_parse(&tlv, &resp)) < 0) return rc; if (ct_tlv_get_int(&tlv, CT_TAG_LOCK, res) == 0) return IFD_ERROR_GENERIC; return 0; } int ct_card_unlock(ct_handle * h, unsigned int slot, ct_lock_handle lock) { unsigned char buffer[256]; ct_buf_t args, resp; ct_buf_init(&args, buffer, sizeof(buffer)); ct_buf_init(&resp, buffer, sizeof(buffer)); ct_buf_putc(&args, CT_CMD_UNLOCK); ct_buf_putc(&args, slot); ct_args_int(&args, CT_TAG_LOCK, lock); return ct_socket_call(h->sock, &args, &resp); } /* * Add arguments when calling a resource manager function */ static void ct_args_int(ct_buf_t * bp, ifd_tag_t tag, unsigned int value) { ct_tlv_builder_t builder; ct_tlv_builder_init(&builder, bp, 1); ct_tlv_put_int(&builder, tag, value); } static void ct_args_string(ct_buf_t * bp, ifd_tag_t tag, const char *value) { ct_tlv_builder_t builder; ct_tlv_builder_init(&builder, bp, 1); ct_tlv_put_string(&builder, tag, value); } static void ct_args_opaque(ct_buf_t * bp, ifd_tag_t tag, const unsigned char *value, size_t len) { ct_tlv_builder_t builder; ct_tlv_builder_init(&builder, bp, 1); ct_tlv_put_opaque(&builder, tag, value, len); } openct-0.6.20/src/ct/socket.c0000644000175000017500000004022610625650421012646 00000000000000/* * Socket handling routines * * Copyright (C) 2003, Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static unsigned int ifd_xid = 1; static int ifd_reuse_addr = 0; static inline unsigned int min(unsigned int a, unsigned int b) { return (a < b) ? a : b; } static int ct_socket_default_recv_cb(ct_socket_t *); static int ct_socket_default_send_cb(ct_socket_t *); static int ct_socket_getcreds(ct_socket_t *); /* * Create a socket object */ ct_socket_t *ct_socket_new(unsigned int bufsize) { ct_socket_t *sock; unsigned char *p; sock = (ct_socket_t *) calloc(1, sizeof(*sock) + 2 * bufsize); if (sock == NULL) return NULL; /* Initialize socket buffer */ p = (unsigned char *)(sock + 1); ct_buf_init(&sock->rbuf, p, bufsize); ct_buf_init(&sock->sbuf, p + bufsize, bufsize); sock->recv = ct_socket_default_recv_cb; sock->send = ct_socket_default_send_cb; sock->fd = -1; return sock; } /* * Free a socket object */ void ct_socket_free(ct_socket_t * sock) { ct_socket_unlink(sock); if (sock->close) sock->close(sock); ct_socket_close(sock); free(sock); } void ct_socket_reuseaddr(int n) { ifd_reuse_addr = n; } /* * Make the socket. * This code tries to deal with IPv4/IPv6 and AF_UNIX sockets */ enum { CT_MAKESOCK_BIND, CT_MAKESOCK_CONNECT }; static int __ct_socket_make(ct_socket_t * sock, int op, const struct sockaddr *sa, socklen_t salen) { int fd, oerrno; if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) < 0) return -1; /* For non-local sockets, use network byte order */ if (sa->sa_family != AF_UNIX) sock->use_network_byte_order = 1; /* set close on exec */ if (fcntl(fd, F_SETFD, 1) < 0) goto failed; switch (op) { case CT_MAKESOCK_BIND: #ifdef IPV6_V6ONLY # ifndef SOL_IPV6 # define SOL_IPV6 IPPROTO_IPV6 # endif if (sa->sa_family == AF_INET6) { int val = 1; setsockopt(fd, SOL_IPV6, IPV6_V6ONLY, &val, sizeof(val)); } #endif if (ifd_reuse_addr) { int val = 1; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); } if (bind(fd, sa, salen) >= 0) { sock->fd = fd; return fd; } ct_debug("bind() failed: %m"); break; case CT_MAKESOCK_CONNECT: if (connect(fd, sa, salen) >= 0) { sock->fd = fd; return fd; } /* no error message - reader does not exist. */ break; default: errno = EINVAL; } failed: oerrno = errno; close(fd); /* XXX translate error */ return -1; } static int ct_socket_make(ct_socket_t * sock, int op, const char *addr) { union { struct sockaddr a; struct sockaddr_in in; struct sockaddr_in6 ix; struct sockaddr_un un; } s; struct addrinfo *res, *ai; char addrbuf[1024], *port; unsigned int portnum = 6666; int fd; memset(&s, 0, sizeof(s)); /* Simple stuff first - unix domain sockets */ if (addr[0] == '/') { s.un.sun_family = AF_UNIX; strncpy(s.un.sun_path, addr, sizeof(s.un.sun_path)); if (op == CT_MAKESOCK_BIND) { if (unlink(addr) < 0 && errno != ENOENT) return -1; } return __ct_socket_make(sock, op, &s.a, sizeof(s.un)); } memset(addrbuf, 0, sizeof(addrbuf)); strncpy(addrbuf, addr, sizeof(addrbuf) - 1); addr = addrbuf; if ((port = strchr(addrbuf, ';')) != NULL) { *port++ = '\0'; } else if ((port = strchr(addrbuf, ':')) != NULL && (strchr(port + 1, ':')) == NULL) { *port++ = '\0'; } if (*addr == '\0') addr = "0.0.0.0"; if (port) { portnum = strtoul(port, &port, 10); if (*port) return -1; portnum = htons(portnum); } if (inet_pton(AF_INET, addr, &s.in.sin_addr) > 0) { s.in.sin_family = AF_INET; s.in.sin_port = portnum; return __ct_socket_make(sock, op, &s.a, sizeof(s.in)); } if (inet_pton(AF_INET6, addr, &s.ix.sin6_addr) > 0) { s.ix.sin6_family = AF_INET6; s.ix.sin6_port = portnum; return __ct_socket_make(sock, op, &s.a, sizeof(s.ix)); } if (getaddrinfo(addr, NULL, NULL, &res) < 0) return -1; fd = -1; for (ai = res; ai; ai = ai->ai_next) { if (ai->ai_family == AF_INET) ((struct sockaddr_in *)ai->ai_addr)->sin_port = portnum; else if (ai->ai_family == AF_INET6) ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port = portnum; fd = __ct_socket_make(sock, op, ai->ai_addr, ai->ai_addrlen); if (fd >= 0) break; } freeaddrinfo(res); return fd; } /* * Create a client socket */ int ct_socket_connect(ct_socket_t * sock, const char *addr) { ct_socket_close(sock); if (ct_socket_make(sock, CT_MAKESOCK_CONNECT, addr) < 0) return -1; return 0; } /* * Listen on a socket */ int ct_socket_listen(ct_socket_t * sock, const char *path, int mode) { ct_socket_close(sock); if (ct_socket_make(sock, CT_MAKESOCK_BIND, path) < 0) return -1; if (listen(sock->fd, 5) < 0) { ct_socket_close(sock); return -1; } if (path[0] == '/') chmod(path, mode); sock->listener = 1; sock->events = POLLIN; return 0; } /* * Accept incoming connection */ ct_socket_t *ct_socket_accept(ct_socket_t * sock) { ct_socket_t *svc; int fd; if (!(svc = ct_socket_new(CT_SOCKET_BUFSIZ))) return NULL; if ((fd = accept(sock->fd, NULL, NULL)) < 0) { ct_socket_free(svc); return NULL;; } svc->use_network_byte_order = sock->use_network_byte_order; svc->events = POLLIN; svc->fd = fd; /* obtain client credentials */ svc->client_uid = -2; ct_socket_getcreds(svc); /* Add socket to list */ ct_socket_link(sock, svc); return svc; } /* * Get client credentials * Should move this to a platform specific file */ static int ct_socket_getcreds(ct_socket_t * sock) { #ifdef SO_PEERCRED struct ucred creds; socklen_t len; len = sizeof(creds); if (getsockopt(sock->fd, SOL_SOCKET, SO_PEERCRED, &creds, &len) < 0) return -1; sock->client_uid = creds.uid; #endif return 0; } /* * Get the peer name */ int ct_socket_getpeername(ct_socket_t * sock, char *buf, size_t len) { struct sockaddr_storage ss; socklen_t slen = sizeof(struct sockaddr_storage); getpeername(sock->fd, (struct sockaddr *)&ss, &slen); switch (ss.ss_family) { case AF_INET: inet_ntop(AF_INET, &((struct sockaddr_in *)&ss)->sin_addr, buf, len); break; case AF_INET6: inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&ss)->sin6_addr, buf, len); break; case AF_UNIX: snprintf(buf, len, ""); break; default: ct_error("Unsupported address family\n"); return -1; } return 0; } /* * Close socket */ void ct_socket_close(ct_socket_t * sock) { ct_buf_clear(&sock->rbuf); ct_buf_clear(&sock->sbuf); if (sock->fd >= 0) close(sock->fd); sock->fd = -1; } /* * Transmit a call and receive the response */ int ct_socket_call(ct_socket_t * sock, ct_buf_t * args, ct_buf_t * resp) { ct_buf_t data; unsigned int xid, avail; header_t header; int rc; /* Compact send buffer */ ct_buf_compact(&sock->sbuf); if ((xid = ifd_xid++) == 0) xid = ifd_xid++; /* Build header - note there's no need to convert * integers to network byte order: everything happens * on the same host, so there's no byte order issue */ header.xid = xid; header.count = ct_buf_avail(args); header.dest = 0; header.error = 0; /* Put everything into send buffer and transmit */ if ((rc = ct_socket_put_packet(sock, &header, args)) < 0 || (rc = ct_socket_flsbuf(sock, 1)) < 0) return rc; /* Return right now if we don't expect a response */ if (resp == NULL) return 0; /* Loop until we receive a complete packet with the * right xid in it */ rc = 0; do { if ((rc == 0) && (rc = ct_socket_filbuf(sock, -1)) < 0) return -1; ct_buf_clear(resp); if ((rc = ct_socket_get_packet(sock, &header, &data)) < 0) return rc; } while (rc == 0 || header.xid != xid); if (header.error) return header.error; avail = ct_buf_avail(&data); if (avail > ct_buf_tailroom(resp)) { ct_error("received truncated reply (%u out of %u bytes)", rc, header.count); return IFD_ERROR_BUFFER_TOO_SMALL; } ct_buf_put(resp, ct_buf_head(&data), avail); return header.count; } /* * Put packet into send buffer */ int ct_socket_put_packet(ct_socket_t * sock, header_t * hdr, ct_buf_t * data) { header_t hcopy; ct_buf_t *bp = &sock->sbuf; size_t count; int rc; count = sizeof(*hdr) + (data ? ct_buf_avail(data) : 0); if (ct_buf_tailroom(bp) < count) { if ((rc = ct_socket_flsbuf(sock, 1)) < 0) return rc; ct_buf_compact(bp); if (ct_buf_tailroom(bp) < count) { ct_error("packet too large for buffer"); return IFD_ERROR_BUFFER_TOO_SMALL; } } hdr->count = data ? ct_buf_avail(data) : 0; hcopy = *hdr; if (sock->use_network_byte_order) { hcopy.error = ntohs(hcopy.error); hcopy.count = ntohs(hcopy.count); } ct_buf_put(bp, &hcopy, sizeof(hcopy)); if (hdr->count) ct_buf_put(bp, ct_buf_head(data), hdr->count); sock->events = POLLOUT; return 0; } int ct_socket_puts(ct_socket_t * sock, const char *string) { ct_buf_t *bp = &sock->sbuf; ct_buf_clear(bp); if (ct_buf_puts(bp, string) < 0) { ct_error("string too large for buffer"); return -1; } sock->events = POLLOUT; return 0; } /* * Get packet from buffer */ int ct_socket_get_packet(ct_socket_t * sock, header_t * hdr, ct_buf_t * data) { ct_buf_t *bp = &sock->rbuf; unsigned int avail; header_t th; avail = ct_buf_avail(bp); if (avail < sizeof(header_t)) return 0; memcpy(&th, ct_buf_head(bp), sizeof(th)); if (sock->use_network_byte_order) { th.count = ntohs(th.count); th.error = ntohs(th.error); } if (avail >= sizeof(header_t) + th.count) { /* There's enough data in the buffer * Extract header... */ ct_buf_get(bp, NULL, sizeof(*hdr)); *hdr = th; /* ... set data buffer (don't copy, just set pointers) ... */ ct_buf_set(data, ct_buf_head(bp), hdr->count); /* ... and advance head pointer */ ct_buf_get(bp, NULL, hdr->count); return 1; } /* Check if this packet will ever fit into this buffer */ if (ct_buf_size(bp) < sizeof(header_t) + th.count) { ct_error("packet too large for buffer"); return -1; } return 0; } int ct_socket_gets(ct_socket_t * sock, char *buffer, size_t size) { return ct_buf_gets(&sock->rbuf, buffer, size); } /* * Read some data from socket and put it into buffer */ int ct_socket_filbuf(ct_socket_t * sock, long timeout) { ct_buf_t *bp = &sock->rbuf; unsigned int count; int n; if (!(count = ct_buf_tailroom(bp))) { ct_buf_compact(bp); if (!(count = ct_buf_tailroom(bp))) { ct_error("packet too large"); return -1; } } if (timeout >= 0) { struct pollfd pfd; pfd.fd = sock->fd; pfd.events = POLLIN; do { n = poll(&pfd, 1, timeout); } while (n < 0 && errno == EINTR); if (n == 0) return IFD_ERROR_TIMEOUT; } retry: n = read(sock->fd, ct_buf_tail(bp), count); if (n < 0 && errno == EINTR) goto retry; if (n < 0) { ct_error("socket recv error: %m"); return -1; } /* When EOF occurs, the server's recv() routine * should deal with it instantly. If we come here * a second time we may be looping on a closed * socket, so error out */ if (n == 0) { if (sock->eof) { ct_error("Peer closed connection"); return -1; } sock->eof = 1; return 0; } /* Advance buffer tail pointer */ ct_buf_put(bp, NULL, n); return n; } /* * Flush data from buffer to socket */ int ct_socket_flsbuf(ct_socket_t * sock, int all) { struct sigaction act; ct_buf_t *bp = &sock->sbuf; int n, rc = 0; /* Ignore SIGPIPE while writing to socket */ memset(&act, 0, sizeof(act)); act.sa_handler = SIG_IGN; sigaction(SIGPIPE, &act, &act); do { if (!(n = ct_buf_avail(bp))) { sock->events = POLLIN; break; } n = write(sock->fd, ct_buf_head(bp), n); if (n < 0) { if (errno != EPIPE) ct_error("socket send error: %m"); rc = IFD_ERROR_NOT_CONNECTED; break; } /* Advance head pointer */ ct_buf_get(bp, NULL, n); } while (all); /* Restore old signal handler */ sigaction(SIGPIPE, &act, &act); if (rc >= 0 && all == 2) { /* Shutdown socket for write */ if (shutdown(sock->fd, 1) < 0) { ct_error("socket shutdown error: %m"); return -1; } } return rc; } /* * Default send/receive handlers */ static int ct_socket_default_recv_cb(ct_socket_t * sock) { char buffer[CT_SOCKET_BUFSIZ + 64]; header_t header; ct_buf_t args, resp; int rc; /* Error or client closed connection? */ if ((rc = ct_socket_filbuf(sock, -1)) <= 0) return -1; while (ct_buf_avail(&sock->rbuf)) { /* If request is incomplete, go back * and wait for more * XXX add timeout? */ rc = ct_socket_get_packet(sock, &header, &args); if (rc <= 0) return 0; ct_buf_init(&resp, buffer, sizeof(buffer)); if (sock->process == 0) continue; /* Process the request */ rc = sock->process(sock, &header, &args, &resp); /* Do not reply if the request was dropped */ if (header.xid == 0) continue; if (rc >= 0) { header.error = 0; } else { /* Do not return an error to a reply */ if (header.dest) continue; ct_buf_clear(&resp); } /* Now mark as reply */ header.dest = 1; /* Put packet into transmit buffer */ if ((rc = ct_socket_put_packet(sock, &header, &resp)) < 0) return rc; } return 0; } static int ct_socket_default_send_cb(ct_socket_t * sock) { return ct_socket_flsbuf(sock, 0); } /* * Send/receive request */ int ct_socket_send(ct_socket_t * sock, header_t * hdr, ct_buf_t * data) { header_t hcopy = *hdr; if (sock->use_network_byte_order) { hcopy.error = htons(hcopy.error); hcopy.count = htons(hcopy.count); } if (ct_socket_write(sock, &hcopy, sizeof(hcopy)) < 0 || ct_socket_write(sock, ct_buf_head(data), hdr->count) < 0) return -1; return 0; } int ct_socket_recv(ct_socket_t * sock, header_t * hdr, ct_buf_t * resp) { header_t hcopy = *hdr; unsigned int left, count, n; unsigned char c; int rc; if (sock->use_network_byte_order) { hcopy.error = htons(hcopy.error); hcopy.count = htons(hcopy.count); } if (ct_socket_write(sock, &hcopy, sizeof(hcopy)) < 0) return -1; if (hdr->count > 1024) { ct_error("oversize packet, discarding"); ct_socket_close(sock); return -1; } /* Read the data following the packet header. If * there's more data than the receive buffer can hold, * truncate the packet. * We return the number of bytes stored - the true packet * length is available from the header */ left = hdr->count; count = 0; while (left) { n = min(left, ct_buf_tailroom(resp)); if (n == 0) { rc = ct_socket_read(sock, &c, 1); } else { rc = ct_socket_read(sock, ct_buf_tail(resp), n); } if (rc < 0) return -1; count += n; left -= rc; } return count; } /* * Socket read/write routines */ int ct_socket_write(ct_socket_t * sock, void *ptr, size_t len) { struct sigaction act; unsigned int count = 0; int rc; caddr_t p = (caddr_t) ptr; if (sock->fd < 0) return -1; /* Ignore SIGPIPE while writing to socket */ memset(&act, 0, sizeof(act)); act.sa_handler = SIG_IGN; sigaction(SIGPIPE, &act, &act); while (count < len) { rc = write(sock->fd, (const void *)p, len); if (rc < 0) { ct_error("send error: %m"); goto done; } p += rc; count += rc; } rc = count; done: /* Restore old signal handler */ sigaction(SIGPIPE, &act, &act); return rc; } int ct_socket_read(ct_socket_t * sock, void *ptr, size_t size) { unsigned int count = 0; int rc; caddr_t p = (caddr_t) ptr; if (sock->fd < 0) return -1; while (count < size) { rc = read(sock->fd, (void *)p, size - count); if (rc < 0) { ct_error("recv error: %m"); goto done; } if (rc == 0) { ct_error("peer closed connection"); rc = -1; goto done; } p += rc; count += rc; } rc = count; done:return rc; } /* * Link/unlink socket */ void ct_socket_link(ct_socket_t * prev, ct_socket_t * sock) { ct_socket_t *next; if (!prev) return; next = prev->next; if (next) next->prev = sock; prev->next = sock; sock->prev = prev; sock->next = next; } void ct_socket_unlink(ct_socket_t * sock) { ct_socket_t *next = sock->next, *prev = sock->prev; if (next) next->prev = prev; if (prev) prev->next = next; sock->prev = sock->next = NULL; } openct-0.6.20/src/ct/libopenct.pc.in0000644000175000017500000000030111043042743014105 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libopenct Description: libopenct Version: @VERSION@ Libs: -L${libdir} -lopenct Cflags: -I${includedir} openct-0.6.20/src/ct/tlv.c0000644000175000017500000001044710422076714012167 00000000000000/* * TLV handling routines * * Copyright (C) 2003 Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GETOPT_H #include #endif #include #include #include #include #include #include /* * Parse TLV data */ int ct_tlv_parse(ct_tlv_parser_t * parser, ct_buf_t * bp) { unsigned int avail, len; unsigned char *p, tag; /* Code below relies on it */ assert(((ifd_tag_t) - 1) == 255); while ((avail = ct_buf_avail(bp)) != 0) { unsigned int header = 2; if (avail < 2) return -1; p = (unsigned char *)ct_buf_head(bp); tag = p[0]; len = p[1]; if (tag & __CT_TAG_LARGE) { parser->use_large_tags = 1; tag &= ~__CT_TAG_LARGE; if (avail < 3) return -1; len = (len << 8) | p[header++]; } if (len == 0 || header + len > avail) return -1; parser->val[tag] = p + header; parser->len[tag] = len; ct_buf_get(bp, NULL, header + len); } return 0; } /* * Extract TLV encoded items as strings, integers, etc. */ int ct_tlv_get_string(ct_tlv_parser_t * parser, ifd_tag_t tag, char *buf, size_t size) { unsigned char *p; unsigned int len; if (!(p = parser->val[tag])) return 0; len = parser->len[tag]; if (len > size - 1) len = size - 1; strncpy(buf, (const char *)p, len); buf[len] = '\0'; return 1; } int ct_tlv_get_int(ct_tlv_parser_t * parser, ifd_tag_t tag, unsigned int *value) { unsigned char *p; unsigned int len; *value = 0; if (!(p = parser->val[tag])) return 0; len = parser->len[tag]; while (len--) { *value <<= 8; *value |= *p++; } return 1; } int ct_tlv_get_opaque(ct_tlv_parser_t * parser, ifd_tag_t tag, unsigned char **data, size_t * lenp) { unsigned char *p; *data = NULL; *lenp = 0; if (!(p = parser->val[tag])) return 0; *lenp = parser->len[tag]; *data = p; return 1; } int ct_tlv_get_bytes(ct_tlv_parser_t * parser, ifd_tag_t tag, void *buf, size_t size) { unsigned char *p; unsigned int len; if (!(p = parser->val[tag])) return 0; len = parser->len[tag]; if (len > size) len = size; memcpy(buf, p, len); return len; } /* * Initialize a TLV data builder */ void ct_tlv_builder_init(ct_tlv_builder_t * builder, ct_buf_t * bp, int large_tags) { memset(builder, 0, sizeof(*builder)); builder->use_large_tags = large_tags; builder->buf = bp; } /* * TLV encode objects */ void ct_tlv_put_int(ct_tlv_builder_t * builder, ifd_tag_t tag, unsigned int value) { int n; if (builder->error) return; ct_tlv_put_tag(builder, tag); for (n = 0; (value >> (n + 8)) != 0; n += 8) ; do { ct_tlv_add_byte(builder, value >> n); n -= 8; } while (n >= 0); builder->lenp = NULL; } void ct_tlv_put_string(ct_tlv_builder_t * builder, ifd_tag_t tag, const char *string) { if (builder->error) return; ct_tlv_put_tag(builder, tag); ct_tlv_add_bytes(builder, (const unsigned char *)string, strlen(string)); builder->lenp = NULL; } void ct_tlv_put_opaque(ct_tlv_builder_t * builder, ifd_tag_t tag, const unsigned char *data, size_t len) { if (builder->error) return; ct_tlv_put_tag(builder, tag); ct_tlv_add_bytes(builder, data, len); builder->lenp = NULL; } void ct_tlv_put_tag(ct_tlv_builder_t * builder, ifd_tag_t tag) { ct_buf_t *bp = builder->buf; if (builder->error < 0) return; if (builder->use_large_tags) tag |= __CT_TAG_LARGE; if (ct_buf_putc(bp, tag) < 0) goto err; builder->len = 0; builder->lenp = (unsigned char *)ct_buf_tail(bp); if (ct_buf_putc(bp, 0) < 0 || (builder->use_large_tags && ct_buf_putc(bp, 0) < 0)) goto err; return; err:builder->error = -1; } void ct_tlv_add_byte(ct_tlv_builder_t * builder, unsigned char byte) { ct_tlv_add_bytes(builder, &byte, 1); } void ct_tlv_add_bytes(ct_tlv_builder_t * builder, const unsigned char *data, size_t num) { ct_buf_t *bp = builder->buf; if (builder->error < 0) return; if (!builder->lenp) goto error; builder->len += num; if (ct_buf_put(bp, data, num) < 0) goto error; if (builder->use_large_tags) { if (builder->len > 65535) goto error; builder->lenp[0] = builder->len >> 8; builder->lenp[1] = builder->len; } else { if (builder->len > 266) goto error; builder->lenp[0] = builder->len; } return; error: builder->error = -1; return; } openct-0.6.20/src/ct/error.c0000644000175000017500000000630510422076714012511 00000000000000/* * Error handling * * Copyright (C) 2003, Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include enum { DST_STDERR, DST_SYSLOG }; static int log_open = 0; static int log_dest = DST_STDERR; static void ct_log_init(void) { if (!log_open) { openlog("ifdhandler", LOG_PID, LOG_DAEMON); log_open = 1; } } void ct_log_destination(const char *dest) { ct_log_init(); if (!strcmp(dest, "@stderr")) { log_dest = DST_STDERR; } else if (!strcmp(dest, "@syslog")) { log_dest = DST_SYSLOG; } else { log_dest = DST_STDERR; ct_error("log destination %s not implemented yet", dest); } } void ct_error(const char *fmt, ...) { va_list ap; int n; va_start(ap, fmt); if (log_dest == DST_STDERR) { fprintf(stderr, "Error: "); vfprintf(stderr, fmt, ap); if (!(n = strlen(fmt)) || fmt[n - 1] != '\n') fprintf(stderr, "\n"); } else { vsyslog(LOG_WARNING, fmt, ap); } va_end(ap); } void ct_debug(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (log_dest == DST_STDERR) { fprintf(stderr, "Debug: "); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); } else { vsyslog(LOG_DEBUG, fmt, ap); } va_end(ap); } const char *ct_hexdump(const void *data, size_t len) { static char string[1024]; unsigned char *d = (unsigned char *)data; unsigned int i, left; string[0] = '\0'; left = sizeof(string); for (i = 0; len--; i += 3) { if (i >= sizeof(string) - 4) break; snprintf(string + i, 4, " %02x", *d++); } return string; } #define DIM(v) (sizeof(v)/(sizeof((v)[0]))) const char *ct_strerror(int rc) { const char *proto_errors[] = { "Invalid message", "Invalid command", "Missing argument", "Not connected to IFD handler", }; const int proto_base = -IFD_ERROR_INVALID_MSG; const char *gen_errors[] = { "Success", "Generic error", "Command timed out", "Invalid slot", "Operation not supported", "Communication error", "No card present", "Reader already locked", "Reader not locked", "Invalid argument", "Out of memory", "Buffer too small", "Timeout on user input", "Operation aborted by user", "PIN mismatch", "Unable to reset card", "Device cannot perform requested operation", "Device was disconnected", "Card returned invalid ATR", }; const int gen_base = -IFD_SUCCESS; const char *proxy_errors[] = { "Device already claimed", "Device busy", "Device not known", }; const int proxy_base = -IFD_ERROR_ALREADY_CLAIMED; const char **errors = NULL, *msg = NULL; int count = 0, err_base = 0, error = rc; static char message[64]; if (error < 0) error = -error; if (error >= proto_base) { errors = proto_errors; count = DIM(proto_errors); err_base = proto_base; } else if (error >= gen_base) { errors = gen_errors; count = DIM(gen_errors); err_base = gen_base; } else if (error >= proxy_base) { errors = proxy_errors; count = DIM(proxy_errors); err_base = proxy_base; } error -= err_base; if (error >= count || count == 0) { msg = message; snprintf(message, sizeof(message), "Unknown OpenCT error %d", -rc); } else { msg = errors[error]; } return msg; } openct-0.6.20/src/ct/Makefile.am0000644000175000017500000000064211043042743013241 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in lib_LTLIBRARIES = libopenct.la pkgconfig_DATA = libopenct.pc libopenct_la_SOURCES = \ buffer.c client.c error.c mainloop.c path.c \ socket.c status.c tlv.c libopenct_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include libopenct_la_LDFLAGS = \ -version-info @OPENCT_LT_CURRENT@:@OPENCT_LT_REVISION@:@OPENCT_LT_AGE@ \ -no-undefined openct-0.6.20/src/ct/Makefile.in0000644000175000017500000006546011336457517013301 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/ct DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/libopenct.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = libopenct.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libopenct_la_LIBADD = am_libopenct_la_OBJECTS = libopenct_la-buffer.lo \ libopenct_la-client.lo libopenct_la-error.lo \ libopenct_la-mainloop.lo libopenct_la-path.lo \ libopenct_la-socket.lo libopenct_la-status.lo \ libopenct_la-tlv.lo libopenct_la_OBJECTS = $(am_libopenct_la_OBJECTS) libopenct_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libopenct_la_CFLAGS) \ $(CFLAGS) $(libopenct_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libopenct_la_SOURCES) DIST_SOURCES = $(libopenct_la_SOURCES) DATA = $(pkgconfig_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in lib_LTLIBRARIES = libopenct.la pkgconfig_DATA = libopenct.pc libopenct_la_SOURCES = \ buffer.c client.c error.c mainloop.c path.c \ socket.c status.c tlv.c libopenct_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include libopenct_la_LDFLAGS = \ -version-info @OPENCT_LT_CURRENT@:@OPENCT_LT_REVISION@:@OPENCT_LT_AGE@ \ -no-undefined all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ct/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/ct/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): libopenct.pc: $(top_builddir)/config.status $(srcdir)/libopenct.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libopenct.la: $(libopenct_la_OBJECTS) $(libopenct_la_DEPENDENCIES) $(libopenct_la_LINK) -rpath $(libdir) $(libopenct_la_OBJECTS) $(libopenct_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-mainloop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-status.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenct_la-tlv.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libopenct_la-buffer.lo: buffer.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-buffer.lo -MD -MP -MF $(DEPDIR)/libopenct_la-buffer.Tpo -c -o libopenct_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-buffer.Tpo $(DEPDIR)/libopenct_la-buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buffer.c' object='libopenct_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c libopenct_la-client.lo: client.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-client.lo -MD -MP -MF $(DEPDIR)/libopenct_la-client.Tpo -c -o libopenct_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-client.Tpo $(DEPDIR)/libopenct_la-client.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='client.c' object='libopenct_la-client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-client.lo `test -f 'client.c' || echo '$(srcdir)/'`client.c libopenct_la-error.lo: error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-error.lo -MD -MP -MF $(DEPDIR)/libopenct_la-error.Tpo -c -o libopenct_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-error.Tpo $(DEPDIR)/libopenct_la-error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='libopenct_la-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c libopenct_la-mainloop.lo: mainloop.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-mainloop.lo -MD -MP -MF $(DEPDIR)/libopenct_la-mainloop.Tpo -c -o libopenct_la-mainloop.lo `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-mainloop.Tpo $(DEPDIR)/libopenct_la-mainloop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mainloop.c' object='libopenct_la-mainloop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-mainloop.lo `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c libopenct_la-path.lo: path.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-path.lo -MD -MP -MF $(DEPDIR)/libopenct_la-path.Tpo -c -o libopenct_la-path.lo `test -f 'path.c' || echo '$(srcdir)/'`path.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-path.Tpo $(DEPDIR)/libopenct_la-path.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='path.c' object='libopenct_la-path.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-path.lo `test -f 'path.c' || echo '$(srcdir)/'`path.c libopenct_la-socket.lo: socket.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-socket.lo -MD -MP -MF $(DEPDIR)/libopenct_la-socket.Tpo -c -o libopenct_la-socket.lo `test -f 'socket.c' || echo '$(srcdir)/'`socket.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-socket.Tpo $(DEPDIR)/libopenct_la-socket.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='socket.c' object='libopenct_la-socket.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-socket.lo `test -f 'socket.c' || echo '$(srcdir)/'`socket.c libopenct_la-status.lo: status.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-status.lo -MD -MP -MF $(DEPDIR)/libopenct_la-status.Tpo -c -o libopenct_la-status.lo `test -f 'status.c' || echo '$(srcdir)/'`status.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-status.Tpo $(DEPDIR)/libopenct_la-status.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='status.c' object='libopenct_la-status.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-status.lo `test -f 'status.c' || echo '$(srcdir)/'`status.c libopenct_la-tlv.lo: tlv.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -MT libopenct_la-tlv.lo -MD -MP -MF $(DEPDIR)/libopenct_la-tlv.Tpo -c -o libopenct_la-tlv.lo `test -f 'tlv.c' || echo '$(srcdir)/'`tlv.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenct_la-tlv.Tpo $(DEPDIR)/libopenct_la-tlv.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tlv.c' object='libopenct_la-tlv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenct_la_CFLAGS) $(CFLAGS) -c -o libopenct_la-tlv.lo `test -f 'tlv.c' || echo '$(srcdir)/'`tlv.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkgconfigdir)" && 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 $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)"; 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgconfigDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA # 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: openct-0.6.20/src/pcsc/0000777000175000017500000000000011336457577011635 500000000000000openct-0.6.20/src/pcsc/pcsc.c0000644000175000017500000002767710625650421012647 00000000000000/* * PC/SC Lite IFD front-end for libopenctapi * * Mapping of CT-API / CT-BCS interface to the IFD Handler 2.0. * Getting/Setting IFD/Protocol/ICC parameters other than the ATR is not * supported. IFDH_MAX_READERS simultaneous readers are supported. * * This file was taken and modified from the Unix driver for * Towitoko smart card readers. Used and re-licensed as BSD with * a permission from the author. * * Copyright (C) 1998-2001, Carlos Prados * Copyright (C) 2003, Antti Tapaninen */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #ifdef HAVE_PTHREAD #include #endif #ifdef DEBUG_IFDH #include #endif #ifdef __APPLE__ #include #include #else #include #include #endif #include #include "ctapi.h" /* XXX: ? */ #define IFDHANDLERv2 #include "ifdhandler.h" /* Maximum number of readers handled */ #define IFDH_MAX_READERS OPENCT_MAX_READERS /* Maximum number of slots per reader handled */ #define IFDH_MAX_SLOTS 1 /* XXX: OPENCT_MAX_SLOTS? */ typedef struct { DEVICE_CAPABILITIES device_capabilities; ICC_STATE icc_state; DWORD ATR_Length; PROTOCOL_OPTIONS protocol_options; } IFDH_Context; /* Matrix that stores conext information of all slots and readers */ static IFDH_Context *ifdh_context[IFDH_MAX_READERS][IFDH_MAX_SLOTS] = { {NULL}, {NULL}, {NULL}, {NULL}, }; /* Mutexes for all readers */ #ifdef HAVE_PTHREAD static pthread_mutex_t ifdh_context_mutex[IFDH_MAX_READERS] = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER }; #endif /* PC/SC Lite hotplugging base channel */ #define HOTPLUG_BASE_PORT 0x200000 RESPONSECODE IFDHCreateChannel(DWORD Lun, DWORD Channel) { char ret; unsigned short ctn, pn, slot; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; #ifdef HAVE_PTHREAD pthread_mutex_lock(&ifdh_context_mutex[ctn]); #endif if (ifdh_context[ctn][slot] == NULL) { if (Channel >= HOTPLUG_BASE_PORT) { Channel -= HOTPLUG_BASE_PORT; } /* We don't care that much about IFDH CHANNELID handling */ if (Channel > IFDH_MAX_READERS) { pn = 0; } else { pn = ((Channel == 0) ? 0 : Channel - 1); } ret = CT_init(ctn, pn); if (ret == OK) { /* Initialize context of the all slots in this reader */ for (slot = 0; slot < IFDH_MAX_SLOTS; slot++) { ifdh_context[ctn][slot] = (IFDH_Context *) malloc(sizeof(IFDH_Context)); if (ifdh_context[ctn][slot] != NULL) memset(ifdh_context[ctn][slot], 0, sizeof(IFDH_Context)); } rv = IFD_SUCCESS; } else { rv = IFD_COMMUNICATION_ERROR; } } else { /* Assume that IFDHCreateChannel is being called for another already initialized slot in this same reader, and return Success */ rv = IFD_SUCCESS; } #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHCreateChannel(Lun=0x%X, Channel=0x%X)=%d", Lun, Channel, rv); #endif return rv; } RESPONSECODE IFDHCloseChannel(DWORD Lun) { char ret; unsigned short ctn, slot; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; ret = CT_close(ctn); if (ret == OK) { #ifdef HAVE_PTHREAD pthread_mutex_lock(&ifdh_context_mutex[ctn]); #endif /* Free context of the all slots in this reader */ for (slot = 0; slot < IFDH_MAX_SLOTS; slot++) { if (ifdh_context[ctn][slot] != NULL) { free(ifdh_context[ctn][slot]); ifdh_context[ctn][slot] = NULL; } } #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif rv = IFD_SUCCESS; } else { rv = IFD_COMMUNICATION_ERROR; } #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHCloseChannel(Lun=0x%X)=%d", Lun, rv); #endif return rv; } RESPONSECODE IFDHGetCapabilities(DWORD Lun, DWORD Tag, PDWORD Length, PUCHAR Value) { unsigned short ctn, slot; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; #ifdef HAVE_PTHREAD pthread_mutex_lock(&ifdh_context_mutex[ctn]); #endif switch (Tag) { case TAG_IFD_ATR: (*Length) = ifdh_context[ctn][slot]->ATR_Length; memcpy(Value, ifdh_context[ctn][slot]->icc_state.ATR, (*Length)); rv = IFD_SUCCESS; break; case TAG_IFD_SLOTS_NUMBER: (*Length) = 1; (*Value) = IFDH_MAX_SLOTS; rv = IFD_SUCCESS; break; case TAG_IFD_SIMULTANEOUS_ACCESS: (*Length) = 1; (*Value) = IFDH_MAX_READERS; rv = IFD_SUCCESS; break; default: (*Length) = 0; rv = IFD_ERROR_TAG; } #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHGetCapabilities (Lun=0x%X, Tag=0x%X)=%d", Lun, Tag, rv); #endif return rv; } RESPONSECODE IFDHSetCapabilities(DWORD Lun, DWORD Tag, DWORD Length, PUCHAR Value) { #ifdef DEBUG_IFDH #if 0 syslog(LOG_INFO, "IFDH: IFDHSetCapabilities (Lun=%X, Tag=%X)=%d", Lun, Tag, IFD_NOT_SUPPORTED); #endif #endif return IFD_NOT_SUPPORTED; } RESPONSECODE IFDHSetProtocolParameters(DWORD Lun, DWORD Protocol, UCHAR Flags, UCHAR PTS1, UCHAR PTS2, UCHAR PTS3) { char ret; unsigned short ctn, slot, lc, lr; UCHAR cmd[10], rsp[256], sad, dad; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; #ifdef HAVE_PTHREAD pthread_mutex_lock(&ifdh_context_mutex[ctn]); #endif if (ifdh_context[ctn][slot] != NULL) { cmd[0] = CTBCS_CLA_2; cmd[1] = CTBCS_INS_SET_INTERFACE_PARAM; cmd[2] = (UCHAR) (slot + 1); cmd[3] = 0x00; cmd[4] = 0x03; cmd[5] = CTBCS_TAG_TPP; cmd[6] = 0x01; cmd[7] = Protocol & 0xFF; lc = 8; dad = 0x01; sad = 0x02; lr = 256; ret = CT_data(ctn, &dad, &sad, lc, cmd, &lr, rsp); if (ret == OK) { rv = IFD_SUCCESS; } else { rv = IFD_ERROR_PTS_FAILURE; } } else { rv = IFD_ICC_NOT_PRESENT; } #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHSetProtocolParameters (Lun=0x%X, Protocol=%d, Flags=0x%02X, PTS1=0x%02X, PTS2=0x%02X, PTS3=0x%02X)=%d", Lun, Protocol, Flags, PTS1, PTS2, PTS3, rv); #endif return rv; } RESPONSECODE IFDHPowerICC(DWORD Lun, DWORD Action, PUCHAR Atr, PDWORD AtrLength) { char ret; unsigned short ctn, slot, lc, lr; UCHAR cmd[5], rsp[256], sad, dad; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; #ifdef HAVE_PTHREAD pthread_mutex_lock(&ifdh_context_mutex[ctn]); #endif if (ifdh_context[ctn][slot] != NULL) { if (Action == IFD_POWER_UP) { cmd[0] = CTBCS_CLA; cmd[1] = CTBCS_INS_REQUEST_ICC; cmd[2] = (UCHAR) (slot + 1); cmd[3] = CTBCS_P2_REQUEST_GET_ATR; cmd[4] = 0x00; dad = 0x01; sad = 0x02; lr = 256; lc = 5; ret = CT_data(ctn, &dad, &sad, 5, cmd, &lr, rsp); if ((ret == OK) && (lr >= 2)) { ifdh_context[ctn][slot]->ATR_Length = (DWORD) lr - 2; memcpy(ifdh_context[ctn][slot]->icc_state.ATR, rsp, lr - 2); (*AtrLength) = (DWORD) lr - 2; memcpy(Atr, rsp, lr - 2); rv = IFD_SUCCESS; } else { rv = IFD_COMMUNICATION_ERROR; } } else if (Action == IFD_POWER_DOWN) { cmd[0] = CTBCS_CLA; cmd[1] = CTBCS_INS_EJECT_ICC; cmd[2] = (UCHAR) (slot + 1); cmd[3] = 0x00; cmd[4] = 0x00; dad = 0x01; sad = 0x02; lr = 256; lc = 5; ret = CT_data(ctn, &dad, &sad, 5, cmd, &lr, rsp); if (ret == OK) { ifdh_context[ctn][slot]->ATR_Length = 0; memset(ifdh_context[ctn][slot]->icc_state.ATR, 0, MAX_ATR_SIZE); (*AtrLength) = 0; rv = IFD_SUCCESS; } else { rv = IFD_COMMUNICATION_ERROR; } } else if (Action == IFD_RESET) { cmd[0] = CTBCS_CLA; cmd[1] = CTBCS_INS_RESET; cmd[2] = (UCHAR) (slot + 1); cmd[3] = CTBCS_P2_RESET_GET_ATR; cmd[4] = 0x00; dad = 0x01; sad = 0x02; lr = 256; lc = 5; ret = CT_data(ctn, &dad, &sad, 5, cmd, &lr, rsp); if ((ret == OK) && (lr >= 2)) { ifdh_context[ctn][slot]->ATR_Length = (DWORD) lr - 2; memcpy(ifdh_context[ctn][slot]->icc_state.ATR, rsp, lr - 2); (*AtrLength) = (DWORD) lr - 2; memcpy(Atr, rsp, lr - 2); rv = IFD_SUCCESS; } else { rv = IFD_ERROR_POWER_ACTION; } } else { rv = IFD_NOT_SUPPORTED; } } else { rv = IFD_ICC_NOT_PRESENT; } #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHPowerICC (Lun=0x%X, Action=0x%X)=%d", Lun, Action, rv); #endif return rv; } RESPONSECODE IFDHTransmitToICC(DWORD Lun, SCARD_IO_HEADER SendPci, PUCHAR TxBuffer, DWORD TxLength, PUCHAR RxBuffer, PDWORD RxLength, PSCARD_IO_HEADER RecvPci) { char ret; unsigned short ctn, slot, lc, lr; UCHAR sad, dad; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; #ifdef HAVE_PTHREAD pthread_mutex_lock(&ifdh_context_mutex[ctn]); #endif if (ifdh_context[ctn][slot] != NULL) { #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif dad = (UCHAR) ((slot == 0) ? 0x00 : slot + 1); sad = 0x02; lr = (unsigned short)(*RxLength); lc = (unsigned short)TxLength; ret = CT_data(ctn, &dad, &sad, lc, TxBuffer, &lr, RxBuffer); if (ret == OK) { (*RxLength) = lr; rv = IFD_SUCCESS; } else { (*RxLength) = 0; rv = IFD_COMMUNICATION_ERROR; } } else { #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif rv = IFD_ICC_NOT_PRESENT; } #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHTransmitToICC (Lun=0x%X, Tx=%u, Rx=%u)=%d", Lun, TxLength, (*RxLength), rv); #endif return rv; } #ifdef IFDHANDLERv2 RESPONSECODE IFDHControl(DWORD Lun, PUCHAR TxBuffer, DWORD TxLength, PUCHAR RxBuffer, PDWORD RxLength) { char ret; unsigned short ctn, slot, lc, lr; UCHAR sad, dad; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; #ifdef HAVE_PTHREAD pthread_mutex_lock(&ifdh_context_mutex[ctn]); #endif if (ifdh_context[ctn][slot] != NULL) { #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif dad = 0x01; sad = 0x02; lr = (unsigned short)(*RxLength); lc = (unsigned short)TxLength; ret = CT_data(ctn, &dad, &sad, lc, TxBuffer, &lr, RxBuffer); if (ret == OK) { (*RxLength) = lr; rv = IFD_SUCCESS; } else { (*RxLength) = 0; rv = IFD_COMMUNICATION_ERROR; } } else { #ifdef HAVE_PTHREAD pthread_mutex_unlock(&ifdh_context_mutex[ctn]); #endif rv = IFD_ICC_NOT_PRESENT; } #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHControl (Lun=0x%X, Tx=%u, Rx=%u)=%d", Lun, TxLength, (*RxLength), rv); #endif return rv; } #else RESPONSECODE IFDHControl(DWORD Lun, DWORD dwControlCode, PUCHAR TxBuffer, DWORD TxLength, PUCHAR RxBuffer, DWORD RxLength, PDWORD pdwBytesReturned) { /* FIXME */ } #endif RESPONSECODE IFDHICCPresence(DWORD Lun) { char ret; unsigned short ctn, slot, lc, lr; UCHAR cmd[5], rsp[256], sad, dad; RESPONSECODE rv; ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; cmd[0] = CTBCS_CLA; cmd[1] = CTBCS_INS_STATUS; cmd[2] = CTBCS_UNIT_CT; cmd[3] = CTBCS_P2_STATUS_ICC; cmd[4] = 0x00; dad = 0x01; sad = 0x02; lc = 5; lr = 256; ret = CT_data(ctn, &dad, &sad, lc, cmd, &lr, rsp); if (ret == OK) { if (slot < lr - 2) { if (rsp[slot] == CTBCS_DATA_STATUS_NOCARD) { rv = IFD_ICC_NOT_PRESENT; } else { rv = IFD_ICC_PRESENT; } } else { rv = IFD_ICC_NOT_PRESENT; } } else { rv = IFD_COMMUNICATION_ERROR; } #ifdef DEBUG_IFDH syslog(LOG_INFO, "IFDH: IFDHICCPresence (Lun=0x%X)=%d", Lun, rv); #endif return rv; } openct-0.6.20/src/pcsc/Makefile.am0000644000175000017500000000165011043042743013563 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in if ENABLE_PCSC lib_LTLIBRARIES = openct-ifd.la endif openct_ifd_la_SOURCES = pcsc.c openct_ifd_la_LDFLAGS = -module -avoid-version -no-undefined openct_ifd_la_LIBADD = $(PCSC_LIBS) $(top_builddir)/src/ctapi/libopenctapi.la openct_ifd_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/ctapi \ $(PCSC_CFLAGS) # Don't use ENABLE_BUNDLES for this case, pcsc-lite loads # USB drivers from MacOS X like bundles for all platforms install-exec-local: install-libLTLIBRARIES if ENABLE_PCSC if ENABLE_BUNDLES $(MKDIR_P) "$(DESTDIR)$(bundledir)" "$(top_srcdir)/macos/libtool-bundle" -e "$(top_srcdir)/etc/Info.plist" \ "$(DESTDIR)$(libdir)/openct-ifd.so" "$(DESTDIR)$(bundledir)" endif endif uninstall-local: uninstall-libLTLIBRARIES if ENABLE_PCSC if ENABLE_BUNDLES rm -rf "$(DESTDIR)$(bundledir)/openct-ifd.bundle/" endif endif openct-0.6.20/src/pcsc/Makefile.in0000644000175000017500000004624411336457520013614 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/pcsc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = openct_ifd_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/src/ctapi/libopenctapi.la am_openct_ifd_la_OBJECTS = openct_ifd_la-pcsc.lo openct_ifd_la_OBJECTS = $(am_openct_ifd_la_OBJECTS) openct_ifd_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(openct_ifd_la_CFLAGS) \ $(CFLAGS) $(openct_ifd_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_PCSC_TRUE@am_openct_ifd_la_rpath = -rpath $(libdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(openct_ifd_la_SOURCES) DIST_SOURCES = $(openct_ifd_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in @ENABLE_PCSC_TRUE@lib_LTLIBRARIES = openct-ifd.la openct_ifd_la_SOURCES = pcsc.c openct_ifd_la_LDFLAGS = -module -avoid-version -no-undefined openct_ifd_la_LIBADD = $(PCSC_LIBS) $(top_builddir)/src/ctapi/libopenctapi.la openct_ifd_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/ctapi \ $(PCSC_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/pcsc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/pcsc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done openct-ifd.la: $(openct_ifd_la_OBJECTS) $(openct_ifd_la_DEPENDENCIES) $(openct_ifd_la_LINK) $(am_openct_ifd_la_rpath) $(openct_ifd_la_OBJECTS) $(openct_ifd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openct_ifd_la-pcsc.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< openct_ifd_la-pcsc.lo: pcsc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_ifd_la_CFLAGS) $(CFLAGS) -MT openct_ifd_la-pcsc.lo -MD -MP -MF $(DEPDIR)/openct_ifd_la-pcsc.Tpo -c -o openct_ifd_la-pcsc.lo `test -f 'pcsc.c' || echo '$(srcdir)/'`pcsc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/openct_ifd_la-pcsc.Tpo $(DEPDIR)/openct_ifd_la-pcsc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pcsc.c' object='openct_ifd_la-pcsc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(openct_ifd_la_CFLAGS) $(CFLAGS) -c -o openct_ifd_la-pcsc.lo `test -f 'pcsc.c' || echo '$(srcdir)/'`pcsc.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-local .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-local \ install-html install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-local # Don't use ENABLE_BUNDLES for this case, pcsc-lite loads # USB drivers from MacOS X like bundles for all platforms install-exec-local: install-libLTLIBRARIES @ENABLE_BUNDLES_TRUE@@ENABLE_PCSC_TRUE@ $(MKDIR_P) "$(DESTDIR)$(bundledir)" @ENABLE_BUNDLES_TRUE@@ENABLE_PCSC_TRUE@ "$(top_srcdir)/macos/libtool-bundle" -e "$(top_srcdir)/etc/Info.plist" \ @ENABLE_BUNDLES_TRUE@@ENABLE_PCSC_TRUE@ "$(DESTDIR)$(libdir)/openct-ifd.so" "$(DESTDIR)$(bundledir)" uninstall-local: uninstall-libLTLIBRARIES @ENABLE_BUNDLES_TRUE@@ENABLE_PCSC_TRUE@ rm -rf "$(DESTDIR)$(bundledir)/openct-ifd.bundle/" # 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: openct-0.6.20/src/Makefile.am0000644000175000017500000000015511043042743012632 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in # Order IS important SUBDIRS = include ct ifd tools ctapi pcsc openct-0.6.20/src/ctapi/0000777000175000017500000000000011336457577012005 500000000000000openct-0.6.20/src/ctapi/ctapi.h0000644000175000017500000000712210422076712013153 00000000000000/* * Defines CT-API functions and returns * * Copyright (C) 1998, David Corcoran */ #ifndef OPENCT_CTAPI_H #define OPENCT_CTAPI_H #ifdef __cplusplus extern "C" { #endif #define MAX_APDULEN 1040 char CT_init(unsigned short Ctn, /* Terminal Number */ unsigned short pn /* Port Number */ ); char CT_close(unsigned short Ctn /* Terminal Number */ ); char CT_data(unsigned short ctn, /* Terminal Number */ unsigned char *dad, /* Destination */ unsigned char *sad, /* Source */ unsigned short lc, /* Length of command */ unsigned char *cmd, /* Command/Data Buffer */ unsigned short *lr, /* Length of Response */ unsigned char *rsp /* Response */ ); #define OK 0 /* Success */ #define ERR_INVALID -1 /* Invalid Data */ #define ERR_CT -8 /* CT Error */ #define ERR_TRANS -10 /* Transmission Error */ #define ERR_MEMORY -11 /* Memory Allocate Error */ #define ERR_HOST -127 /* Abort by Host/OS */ #define ERR_HTSI -128 /* HTSI Error */ enum { CTAPI_DAD_ICC1 = 0, CTAPI_DAD_CT = 1, CTAPI_DAD_HOST = 2, CTAPI_DAD_ICC2 = 3 }; /* * CT-BCS commands */ #define CTBCS_CLA 0x20 #define CTBCS_CLA_2 0x80 #define CTBCS_INS_RESET 0x11 #define CTBCS_INS_REQUEST_ICC 0x12 #define CTBCS_INS_STATUS 0x13 #define CTBCS_INS_EJECT_ICC 0x15 #define CTBCS_INS_INPUT 0x16 #define CTBCS_INS_OUTPUT 0x17 #define CTBCS_INS_PERFORM_VERIFICATION 0x18 #define CTBCS_INS_MODIFY_VERIFICATION 0x19 #define CTBCS_INS_SET_INTERFACE_PARAM 0x60 /* * CT-BCS functional units (P1 byte) */ #define CTBCS_UNIT_CT 0x00 #define CTBCS_UNIT_INTERFACE1 0x01 #define CTBCS_UNIT_INTERFACE2 0x02 #define CTBCS_UNIT_DISPLAY 0x40 #define CTBCS_UNIT_KEYPAD 0x50 /* * P2 parameter for Reset CT: data to be returned */ #define CTBCS_P2_RESET_NO_RESP 0x00 /* Return no data */ #define CTBCS_P2_RESET_GET_ATR 0x01 /* Return complete ATR */ #define CTBCS_P2_RESET_GET_HIST 0x02 /* Return historical bytes */ /* * P2 parameter for Request ICC: data to be returned */ #define CTBCS_P2_REQUEST_NO_RESP 0x00 /* Return no data */ #define CTBCS_P2_REQUEST_GET_ATR 0x01 /* Return complete ATR */ #define CTBCS_P2_REQUEST_GET_HIST 0x02 /* Return historical bytes */ /* * P2 parameter for Get status: TAG of data object to return */ #define CTBCS_P2_STATUS_MANUFACTURER 0x46 /* Return manufacturer DO */ #define CTBCS_P2_STATUS_ICC 0x80 /* Return ICC DO */ /* * P2 parameter for Input */ #define CTBCS_P2_INPUT_ECHO 0x01 /* Echo input on display */ #define CTBCS_P2_INPUT_ASTERISKS 0x02 /* Echo input as asterisks */ /* * Tags for paramaters to input, output et al. */ #define CTBCS_TAG_PROMPT 0x50 #define CTBCS_TAG_VERIFY_CMD 0x52 #define CTBCS_TAG_TIMEOUT 0x80 #define CTBCS_TAG_TPP 0x22 #define CTBCS_TAG_TPC 0x45 /* * PIN command control flags */ #define CTBCS_PIN_CONTROL_LEN_SHIFT 4 #define CTBCS_PIN_CONTROL_LEN_MASK 0x0F #define CTBCS_PIN_CONTROL_ENCODE_ASCII 0x01 /* * Status words returned by CTBCS */ #define CTBCS_SW_BAD_LENGTH 0x6700 #define CTBCS_SW_BAD_COMMAND 0x6900 #define CTBCS_SW_NOT_EXECUTABLE 0x6985 #define CTBCS_SW_BAD_PARAMS 0x6a00 #define CTBCS_SW_NOT_SUPPORTED 0x6a80 #define CTBCS_SW_INVALID_TLV 0x6a85 #define CTBCS_SW_BAD_LE 0x6c00 #define CTBCS_SW_BAD_INS 0x6d00 #define CTBCS_SW_BAD_CLASS 0x6e00 #define CTBCS_SW_BAD_ICC 0x6f00 #define CTBCS_SW_SUCCESS 0x9000 /* * Data returned by Get Status command */ #define CTBCS_DATA_STATUS_NOCARD 0x00 /* No card present */ #define CTBCS_DATA_STATUS_CARD 0x01 /* Card present */ #define CTBCS_DATA_STATUS_CARD_CONNECT 0x05 /* Card present */ #ifdef __cplusplus } #endif #endif /* OPENCT_CTAPI_H */ openct-0.6.20/src/ctapi/ctapi.c0000644000175000017500000003556510423515556013167 00000000000000/* * CTAPI front-end for libopenct * * Copyright (C) 2003 Olaf Kirch */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "ctapi.h" /* * Functions for setting the SW */ static int ctapi_put_sw(ct_buf_t * bp, unsigned int sw) { unsigned char temp[2]; temp[0] = sw >> 8; temp[1] = sw & 0xff; if (ct_buf_put(bp, temp, 2) < 0) return ERR_INVALID; return 2; } static int ctapi_error(ct_buf_t * bp, unsigned int sw) { ct_buf_clear(bp); return ctapi_put_sw(bp, sw); } struct CardTerminal; struct CardTerminalFile { unsigned int id; int (*gen) (struct CardTerminal * ct, ct_buf_t * buf, off_t start, size_t length, size_t * size); struct CardTerminalFile *dir[20]; }; static struct CardTerminal { unsigned short ctn; ct_handle *h; unsigned int slots; ct_lock_handle lock; unsigned char sync; struct CardTerminalFile mf; struct CardTerminalFile ctcf; struct CardTerminalFile ctdir; struct CardTerminalFile iccdir[16]; struct CardTerminalFile hostcf; struct CardTerminalFile hoststatus; struct CardTerminalFile *cwd; struct CardTerminal *next; } *cardTerminals; static int put(ct_buf_t * buf, off_t * start, size_t * length, size_t * size, const unsigned char *data, size_t data_len) { *size += data_len; while (data_len--) { if (*start == 0) { if (*length > 0) { if (buf != (ct_buf_t *) 0 && ct_buf_put(buf, data, 1) < 0) return -1; ++data; --(*length); } } else --(*start); } return 0; } static int dir(struct CardTerminal *ct, ct_buf_t * buf, off_t start, size_t length, size_t * size) { struct CardTerminalFile **entry; if (!size) return -1; *size = 0; for (entry = &ct->cwd->dir[0]; *entry; ++entry) { unsigned char r[5]; int rc; r[0] = ((*entry)->id >> 8) & 0xff; r[1] = ((*entry)->id) & 0xff; r[2] = 0x01; r[3] = 0x00; r[4] = 0x00; if ((rc = put(buf, &start, &length, size, r, 5)) < 0) return rc; } return 0; } static int ctcf(struct CardTerminal *ct, ct_buf_t * buf, off_t start, size_t length, size_t * size) { return 0; } static int hostcf(struct CardTerminal *ct, ct_buf_t * buf, off_t start, size_t length, size_t * size) { unsigned char data[2]; const char *version = "OpenCT"; int rc; if (!size) return -1; *size = 0; data[0] = 0x01; data[1] = strlen(version); if ((rc = put(buf, &start, &length, size, data, 2)) < 0) return rc; if ((rc = put(buf, &start, &length, size, (const unsigned char *)version, strlen(version))) < 0) return rc; return 0; } static int hoststatus(struct CardTerminal *ct, ct_buf_t * buf, off_t start, size_t length, size_t * size) { return 0; } static int CardTerminalFile_read(struct CardTerminal *ct, ct_buf_t * buf, off_t offset, size_t len) { int rc; size_t size; if ((rc = ct->cwd->gen(ct, buf, offset, len, &size)) < 0) return rc; if (offset > size) { return ctapi_error(buf, 0x6b00); } else if (offset + len >= size) { if (ctapi_put_sw(buf, 0x9000) < 0) return ctapi_error(buf, CTBCS_SW_BAD_LENGTH); return 0; } else { if (ctapi_put_sw(buf, 0x6282) < 0) return ctapi_error(buf, CTBCS_SW_BAD_LENGTH); else return 0; } } static int CardTerminalFile_select(struct CardTerminal *ct, int id, ct_buf_t * buf) { struct CardTerminalFile *cur = (struct CardTerminalFile *)0; unsigned char r[12] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x00 }; size_t size = 0; if (id == 0x3f00) cur = &ct->mf; else if (id == 0xff10) cur = &ct->hostcf; else if (id == 0xff11) cur = &ct->hoststatus; else { struct CardTerminalFile **entry; for (entry = &ct->cwd->dir[0]; *entry && (*entry)->id != id; ++entry) ; cur = *entry; } if (cur == (struct CardTerminalFile *)0) return ctapi_error(buf, 0x6a82); ct->cwd = cur; ct->cwd->gen(ct, (ct_buf_t *) 0, 0, 1024, &size); r[2] = r[0] = size >> 8; r[3] = r[1] = size & 0xff; r[4] = ct->cwd->dir[0] != (struct CardTerminalFile *)0 ? 0x88 : 0x08; return ct_buf_put(buf, r, 12); } static int ctapi_reset(struct CardTerminal *ct, char p1, char p2, ct_buf_t * rbuf, time_t timeout, const char *message) { unsigned int atrlen = 0; unsigned char atr[64]; int rc; switch (p1) { case CTBCS_UNIT_INTERFACE1: case CTBCS_UNIT_INTERFACE2: rc = ct_card_reset(ct->h, p1 - CTBCS_UNIT_INTERFACE1, atr, sizeof(atr)); break; case CTBCS_UNIT_CT: /* Reset is already performed during CT_init() */ rc = 0; break; default: /* Unknown unit */ return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); } if (rc < 0) return ERR_TRANS; if (rc == 4) ct->sync |= 1 << (p1 - CTBCS_UNIT_INTERFACE1); else ct->sync &= ~(1 << (p1 - CTBCS_UNIT_INTERFACE1)); switch (p2 & 0xF) { case CTBCS_P2_RESET_NO_RESP: atrlen = 0; break; case CTBCS_P2_RESET_GET_ATR: atrlen = rc; break; case CTBCS_P2_RESET_GET_HIST: ct_error("CTAPI RESET: P2=GET_HIST not supported yet"); return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); } if (ct_buf_put(rbuf, atr, atrlen) < 0 || ctapi_put_sw(rbuf, 0x9000) < 0) return ctapi_error(rbuf, CTBCS_SW_BAD_LENGTH); return 0; } /* * Request ICC */ static int ctapi_request_icc(struct CardTerminal *ct, char p1, char p2, ct_buf_t * sbuf, ct_buf_t * rbuf) { time_t timeout = 0; char msgbuf[256], *message; switch (p2 >> 4) { case 0x00: /* use default label, or label specified * in data. An empty message string indicates * the default message */ message = msgbuf; msgbuf[0] = '\0'; break; case 0x0f: /* No message */ message = NULL; default: return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); } while (ct_buf_avail(sbuf)) { unsigned char type, len, val; if (ct_buf_get(sbuf, &type, 1) < 0 || ct_buf_get(sbuf, &len, 1) < 0 || ct_buf_avail(sbuf) < len) goto bad_length; if (type == 0x50) { ct_buf_get(sbuf, msgbuf, len); msgbuf[len] = '\0'; } else if (type == 0x80) { if (len != 1) goto bad_length; ct_buf_get(sbuf, &val, 1); timeout = val; } else { /* Ignore unknown tag */ ct_buf_get(sbuf, NULL, len); } } /* ctapi_reset does all the rest of the work */ return ctapi_reset(ct, p1, p2, rbuf, timeout, message); bad_length: return ctapi_error(rbuf, CTBCS_SW_BAD_LENGTH); } static int ctapi_set_interface_parameter(struct CardTerminal *ct, char p1, char p2, ct_buf_t * sbuf, ct_buf_t * rbuf) { unsigned char proto = 0xff; unsigned int slot; if ((p1 == 0x00) || (p1 > 2)) return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); slot = p1 - 1; if (p2 != 0x00) return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); while (ct_buf_avail(sbuf)) { unsigned char type, len, val; if (ct_buf_get(sbuf, &type, 1) < 0 || ct_buf_get(sbuf, &len, 1) < 0 || ct_buf_avail(sbuf) < len) goto bad_length; if (type == CTBCS_TAG_TPP) { /* Transmission Protocol Preference */ if (len != 1) goto bad_length; ct_buf_get(sbuf, &proto, len); switch (proto) { case 0x01: proto = IFD_PROTOCOL_T0; /* T=0 */ break; case 0x02: proto = IFD_PROTOCOL_T1; /* T=1 */ break; case 0x80: case 0x81: case 0x82: case 0x83: return ctapi_error(rbuf, CTBCS_SW_NOT_SUPPORTED); default: return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); } } else if (type == CTBCS_TAG_TPC) { /* Transmission Protocol Conventions */ if (len != 1) goto bad_length; ct_buf_get(sbuf, &val, len); switch (val) { case 0x00: case 0x01: ctapi_error(rbuf, CTBCS_SW_NOT_SUPPORTED); default: return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); } } else { /* Ignore unknown tag */ ct_buf_get(sbuf, NULL, len); return ctapi_error(rbuf, CTBCS_SW_INVALID_TLV); } } if (proto == 0xff) return ctapi_error(rbuf, CTBCS_SW_BAD_PARAMS); if (!ct_card_set_protocol(ct->h, slot, proto)) return ctapi_error(rbuf, CTBCS_SW_SUCCESS); else return ctapi_error(rbuf, CTBCS_SW_NOT_EXECUTABLE); bad_length: return ctapi_error(rbuf, CTBCS_SW_BAD_LENGTH); } static int ctapi_status(ct_handle * h, ct_buf_t * rbuf) { unsigned int n; for (n = 0; n < 2; n++) { unsigned char c; int status; if (ct_card_status(h, n, &status) < 0) break; c = (status & IFD_CARD_PRESENT) ? CTBCS_DATA_STATUS_CARD_CONNECT : CTBCS_DATA_STATUS_NOCARD; if (ct_buf_put(rbuf, &c, 1) < 0) goto bad_length; } if (ctapi_put_sw(rbuf, 0x9000) < 0) goto bad_length; return 0; bad_length: return ctapi_error(rbuf, CTBCS_SW_BAD_LENGTH); } /* * Handle CTBCS messages */ static int ctapi_control(struct CardTerminal *ct, const unsigned char *cmd, size_t cmd_len, void *rsp, size_t rsp_len) { ct_buf_t sbuf, rbuf; int rc; int le = 0; unsigned char id[2]; if (rsp_len < 2) return ERR_INVALID; if (cmd_len < 4) return ctapi_error(&rbuf, CTBCS_SW_BAD_LENGTH); ct_buf_set(&sbuf, (void *)cmd, cmd_len); ct_buf_init(&rbuf, rsp, rsp_len); if (cmd_len == 4) { le = 0; ct_buf_get(&sbuf, NULL, 4); } else if (cmd_len == 5 + cmd[4]) { le = 0; ct_buf_get(&sbuf, NULL, 5); } else { le = cmd[4]; ct_buf_get(&sbuf, NULL, 5); } if (le == 0) le = 256; switch ((cmd[0] << 8) | cmd[1]) { case (CTBCS_CLA << 8) | 0x10: /* B1 compatibility reset command */ if (cmd_len != 5) return ctapi_error(&rbuf, CTBCS_SW_BAD_LENGTH); if ((cmd_len == 5) && (cmd[4] != 0x00)) return ctapi_error(&rbuf, CTBCS_SW_BAD_LE); rc = ctapi_reset(ct, cmd[2], cmd[3], &rbuf, 0, NULL); break; case (CTBCS_CLA << 8) | CTBCS_INS_RESET: /* RESET_CT command */ if (cmd_len > 5) return ctapi_error(&rbuf, CTBCS_SW_BAD_LENGTH); if ((cmd_len == 5) && (cmd[4] != 0x00)) return ctapi_error(&rbuf, CTBCS_SW_BAD_LE); rc = ctapi_reset(ct, cmd[2], cmd[3], &rbuf, 0, NULL); break; case (CTBCS_CLA << 8) | CTBCS_INS_REQUEST_ICC: rc = ctapi_request_icc(ct, cmd[2], cmd[3], &sbuf, &rbuf); break; case (CTBCS_CLA << 8) | CTBCS_INS_STATUS: rc = ctapi_status(ct->h, &rbuf); break; case (0x00 << 8) | 0xb0: rc = CardTerminalFile_read(ct, &rbuf, (cmd[2] << 8) | cmd[3], le); break; case (0x00 << 8) | 0xa4: if (cmd[4] != 2 || ct_buf_get(&sbuf, id, 2) == -1) { ct_error("Bad SELECT FILE ID"); rc = ctapi_error(&rbuf, CTBCS_SW_BAD_CLASS); } else rc = CardTerminalFile_select(ct, (id[0] << 8) | id[1], &rbuf); break; case (CTBCS_CLA_2 << 8) | CTBCS_INS_SET_INTERFACE_PARAM: rc = ctapi_set_interface_parameter(ct, cmd[2], cmd[3], &sbuf, &rbuf); break; default: if (cmd[0] != CTBCS_CLA && cmd[0] != 0x00) { ct_error("Bad CTBCS APDU, cla=0x%02x", cmd[0]); rc = ctapi_error(&rbuf, CTBCS_SW_BAD_CLASS); } else { ct_error("Bad CTBCS APDU, ins=0x%02x", cmd[1]); rc = ctapi_error(&rbuf, CTBCS_SW_BAD_INS); } } if (rc < 0) return rc; if (ct_buf_avail(&rbuf) > le + 2) return ctapi_error(&rbuf, CTBCS_SW_BAD_LENGTH); return ct_buf_avail(&rbuf); } /* * Handle card transactions */ static int ctapi_transact(struct CardTerminal *ct, int nslot, const unsigned char *cmd, size_t cmd_len, void *rsp, size_t rsp_len) { static const unsigned char select_kvk[11] = { 0x00, 0xa4, 0x04, 0x00, 0x06, 0xd2, 0x80, 0x00, 0x00, 0x01, 0x01 }; static const unsigned char read_binary[2] = { 0x00, 0xb0 }; ct_buf_t sbuf, rbuf; int rc; int le = 0; ct_buf_set(&sbuf, (void *)cmd, cmd_len); ct_buf_init(&rbuf, rsp, rsp_len); if (cmd_len == 4) { le = 0; ct_buf_get(&sbuf, NULL, 4); } else if (cmd_len == 5 + (unsigned char)cmd[4]) { le = 0; ct_buf_get(&sbuf, NULL, 5); } else { le = (unsigned char)cmd[4]; ct_buf_get(&sbuf, NULL, 5); } if (le == 0) le = 256; if (cmd_len == 11 && memcmp(cmd, select_kvk, 11) == 0) { if (ctapi_put_sw(&rbuf, 0x9000) < 0) return ctapi_error(&rbuf, CTBCS_SW_BAD_LENGTH); return ct_buf_avail(&rbuf); } else if ((ct->sync & (1 << nslot)) && cmd_len >= 5 && memcmp(cmd, read_binary, 2) == 0) { unsigned char buf[256]; if ((rc = ct_card_read_memory(ct->h, nslot, (((unsigned char)cmd[2]) << 8) | ((unsigned char)cmd[3]), buf, le)) < 0) { #if 0 printf("rc is %d\n", rc); #endif return rc; } if (ct_buf_put(&rbuf, buf, rc) < 0 || ctapi_put_sw(&rbuf, 0x9000) < 0) return ctapi_error(&rbuf, CTBCS_SW_BAD_LENGTH); return ct_buf_avail(&rbuf); } else return ct_card_transact(ct->h, 0, cmd, cmd_len, rsp, rsp_len); } /* * Initialize card terminal #N. */ char CT_init(unsigned short ctn, unsigned short pn) { struct CardTerminal *ct; ct_handle *h; ct_info_t info; int i; ct = (struct CardTerminal *)malloc(sizeof(struct CardTerminal)); if (ct == NULL) return ERR_MEMORY; if (!(h = ct_reader_connect(pn))) { free(ct); return ERR_INVALID; } memset(ct, 0, sizeof(struct CardTerminal)); ct->ctn = ctn; ct->h = h; ct->next = cardTerminals; cardTerminals = ct; ct->cwd = &ct->mf; ct_reader_info(pn, &info); ct->mf.id = 0x3f00; ct->mf.gen = dir; ct->mf.dir[0] = &ct->mf; ct->mf.dir[1] = &ct->ctcf; ct->mf.dir[2] = &ct->ctdir; for (i = 0; i < info.ct_slots; ++i) { ct->mf.dir[3 + i] = &ct->iccdir[i]; } ct->ctcf.id = 0x0020; ct->ctcf.gen = ctcf; ct->ctcf.dir[0] = &ct->mf; ct->ctdir.id = 0x7f60; ct->ctdir.gen = dir; ct->ctdir.dir[0] = &ct->mf; for (i = 0; i < info.ct_slots; ++i) { ct->iccdir[i].id = 0x7f70 + i; ct->iccdir[i].gen = dir; ct->iccdir[i].dir[0] = &ct->iccdir[i]; } ct->hostcf.id = 0xff10; ct->hostcf.gen = hostcf; ct->hostcf.dir[0] = &ct->hostcf; ct->hoststatus.id = 0xff11; ct->hoststatus.gen = hoststatus; ct->hoststatus.dir[0] = &ct->hoststatus; if (ct_card_lock(h, 0, IFD_LOCK_EXCLUSIVE, &ct->lock) < 0) { CT_close(ctn); return ERR_HTSI; } return OK; } char CT_close(unsigned short ctn) { struct CardTerminal **ct, *this; for (ct = &cardTerminals; *ct && (*ct)->ctn != ctn; ct = &(*ct)->next) ; this = *ct; if (!this) return ERR_INVALID; ct_reader_disconnect(this->h); ct = &(this->next); this->next = NULL; free(this); return OK; } char CT_data(unsigned short ctn, unsigned char *dad, unsigned char *sad, unsigned short lc, unsigned char *cmd, unsigned short *lr, unsigned char *rsp) { struct CardTerminal **ct; int rc; for (ct = &cardTerminals; *ct && (*ct)->ctn != ctn; ct = &(*ct)->next) ; if ((*ct) == (struct CardTerminal *)0 || !sad || !dad) return ERR_INVALID; #if 0 ct_debug("CT_data(dad=%d lc=%u lr=%u cmd=%s", *dad, lc, *lr, ct_hexdump(cmd, lc)); #endif switch (*dad) { case CTAPI_DAD_ICC1: rc = ctapi_transact(*ct, 0, cmd, lc, rsp, *lr); break; case CTAPI_DAD_ICC2: rc = ctapi_transact(*ct, 1, cmd, lc, rsp, *lr); break; case CTAPI_DAD_CT: rc = ctapi_control(*ct, cmd, lc, rsp, *lr); break; case CTAPI_DAD_HOST: ct_error("CT-API: host talking to itself - " "needs professional help?"); return ERR_INVALID; default: ct_error("CT-API: unknown DAD %u", *dad); return ERR_INVALID; } /* Somewhat simplistic error translation */ if (rc < 0) return ERR_INVALID; *lr = rc; return OK; } openct-0.6.20/src/ctapi/Makefile.am0000644000175000017500000000057611043042742013740 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in openctinclude_HEADERS = ctapi.h lib_LTLIBRARIES = libopenctapi.la libopenctapi_la_SOURCES = ctapi.c ctapi.h libopenctapi_la_LIBADD = $(top_builddir)/src/ct/libopenct.la libopenctapi_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include libopenctapi_la_LDFLAGS = -avoid-version -no-undefined --module openct-0.6.20/src/ctapi/Makefile.in0000644000175000017500000004711011336457517013763 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/ctapi DIST_COMMON = $(openctinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(openctincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libopenctapi_la_DEPENDENCIES = $(top_builddir)/src/ct/libopenct.la am_libopenctapi_la_OBJECTS = libopenctapi_la-ctapi.lo libopenctapi_la_OBJECTS = $(am_libopenctapi_la_OBJECTS) libopenctapi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libopenctapi_la_CFLAGS) \ $(CFLAGS) $(libopenctapi_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libopenctapi_la_SOURCES) DIST_SOURCES = $(libopenctapi_la_SOURCES) HEADERS = $(openctinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in openctinclude_HEADERS = ctapi.h lib_LTLIBRARIES = libopenctapi.la libopenctapi_la_SOURCES = ctapi.c ctapi.h libopenctapi_la_LIBADD = $(top_builddir)/src/ct/libopenct.la libopenctapi_la_CFLAGS = $(AM_CFLAGS) \ -I$(top_srcdir)/src/include \ -I$(top_builddir)/src/include libopenctapi_la_LDFLAGS = -avoid-version -no-undefined --module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ctapi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/ctapi/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libopenctapi.la: $(libopenctapi_la_OBJECTS) $(libopenctapi_la_DEPENDENCIES) $(libopenctapi_la_LINK) -rpath $(libdir) $(libopenctapi_la_OBJECTS) $(libopenctapi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopenctapi_la-ctapi.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libopenctapi_la-ctapi.lo: ctapi.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenctapi_la_CFLAGS) $(CFLAGS) -MT libopenctapi_la-ctapi.lo -MD -MP -MF $(DEPDIR)/libopenctapi_la-ctapi.Tpo -c -o libopenctapi_la-ctapi.lo `test -f 'ctapi.c' || echo '$(srcdir)/'`ctapi.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libopenctapi_la-ctapi.Tpo $(DEPDIR)/libopenctapi_la-ctapi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ctapi.c' object='libopenctapi_la-ctapi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopenctapi_la_CFLAGS) $(CFLAGS) -c -o libopenctapi_la-ctapi.lo `test -f 'ctapi.c' || echo '$(srcdir)/'`ctapi.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-openctincludeHEADERS: $(openctinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(openctincludedir)" || $(MKDIR_P) "$(DESTDIR)$(openctincludedir)" @list='$(openctinclude_HEADERS)'; test -n "$(openctincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(openctincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(openctincludedir)" || exit $$?; \ done uninstall-openctincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(openctinclude_HEADERS)'; test -n "$(openctincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(openctincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(openctincludedir)" && 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 $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(openctincludedir)"; 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-openctincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-openctincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man \ install-openctincludeHEADERS install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-openctincludeHEADERS # 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: openct-0.6.20/src/Makefile.in0000644000175000017500000004271311336457517012667 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in # Order IS important SUBDIRS = include ct ifd tools ctapi pcsc all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openct-0.6.20/etc/0000777000175000017500000000000011336457577010671 500000000000000openct-0.6.20/etc/openct.udev.compat0000644000175000017500000000053111043042743014217 00000000000000 # some distributions might not have a proper rule to set the name. # this is needed without USB_DEVICEFS the kernel doesn't tell us about # DEVICE. so we need to know the name of the device created by udev in # /dev/bus/usb. SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \ NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" openct-0.6.20/etc/openct.hald.in0000644000175000017500000000156611175777371013342 00000000000000#!/bin/bash PRODUCT="`printf %x/%x/%x $HAL_PROP_USB_VENDOR_ID $HAL_PROP_USB_PRODUCT_ID \ $HAL_PROP_USB_DEVICE_REVISION_BCD`" # this script is run by root, so you can use it to modify # owner, group and permissions of the device file. # # NOTE: Minor race condidion. udev creates nodes with o+r. # # commented out for now, every administrator/distribution # should apply the security policy it prefers. # # usualy openct is run as root.root, thus no changes are # necessary (well, a chmod o-r would be good). but if # you choose to run openct as a different user or group. # you need to setup permissions here. # #chmod o-r $HAL_PROP_SMART_CARD_READER_DEVICE_FILE #chown @USER@:@GROUP@ $HAL_PROP_SMART_CARD_READER_DEVICE_FILE if test -e "$HAL_PROP_SMART_CARD_READER_DEVICE_FILE" then exec @sbindir@/openct-control attach usb:$PRODUCT usb $HAL_PROP_SMART_CARD_READER_DEVICE_FILE fi openct-0.6.20/etc/openct-disable.fdi0000644000175000017500000000042311175777371014157 00000000000000 hald-addon-openct openct-0.6.20/etc/openct.fdi0000644000175000017500000001106011303255320012527 00000000000000 true true true true true true true true true true true true true true true true true true true true true true smart_card_reader @info.parent:linux.device_file smart_card_reader openct-0.6.20/etc/openct_usb.in0000644000175000017500000000265411305172167013266 00000000000000#!/bin/sh # maybe udev passes the device name to us. if [ -n "$1" ]; then DEVNAME="$1" fi [ -n "$DEVPATH" ] || exit 0 [ "$ACTION" = "add" ] || exit 0 [ -e "@OPENCT_SOCKET_PATH@/status" ] || exit 0 # try to get the device node from the parent device if [ -z "$DEVNAME" ]; then # # Guess udev info interface. # Newer udev uses udevadm # if which udevinfo > /dev/null 2>&1; then UDEVINFO="udevinfo" else UDEVINFO="udevadm info" fi DEVNAME=/dev/$($UDEVINFO --query=name --path=$(dirname $DEVPATH)) fi # if udev supplied a device node directly from the usb-device, we use it, # because it is guaranteed to exist at the time we run if [ -n "$DEVNAME" -a -e "$DEVNAME" ]; then DEVICE="$DEVNAME" fi [ -n "$DEVICE" ] || exit 0 if [ -z "$PRODUCT" -a -n "$MODALIAS" ]; then PRODUCT=$(echo $MODALIAS | sed -e 's/usb:v\(....\)p\(....\)d\(....\).*/\1\/\2\/\3/g' |tr A-F a-f) fi if [ -z "$PRODUCT" ]; then V=$(cat /sys$(dirname $DEVPATH)/idVendor | sed -e 's/^0*//') P=$(cat /sys$(dirname $DEVPATH)/idProduct | sed -e 's/^0*//') D=$(cat /sys$(dirname $DEVPATH)/bcdDevice | sed -e 's/^0*//') PRODUCT="$V/$P/$D" fi [ -n "$PRODUCT" ] || exit 0 # we may neeed to wait for the device node, when usbfs is used for A in "0 1 2 3 4 5 6 7 8 9"; do if [ -e "$DEVICE" ]; then @sbindir@/openct-control attach usb:$PRODUCT usb $DEVICE exit 0 fi sleep 0.1 done echo "$0 waited for $DEVICE but it did not appear." | logger -p daemon.error exit 0 openct-0.6.20/etc/openct-policy.fdi0000644000175000017500000000042311175777371014053 00000000000000 hald-addon-openct openct-0.6.20/etc/openct.udev.modalias.in0000644000175000017500000000532611242466001015137 00000000000000# udev rules file for openct # # COMPATIBILITY NOTES # new versions of udev want DRIVERS, older versions only support DRIVER # new versions of udev want SUBSYSTEMS, older versions only support BUS # # new combinations of udev and linux kernel do not create proper events # (or udev processes them "too fast" / race conditions) or similar. # as a result there is no way to get openct-control run when a usb smart # card reader is plugged in. restarting the init script will help as a # crude workaround. # SUBSYSTEM!="usb", GOTO="openct_usb_rules_end" ACTION!="add", GOTO="openct_usb_rules_end" # egate ENV{MODALIAS}=="usb:v0973p0001*", RUN+="@udevdir@/openct_usb" # eToken ENV{MODALIAS}=="usb:v0529p050C*", RUN+="@udevdir@/openct_usb" ENV{MODALIAS}=="usb:v0529p0514*", RUN+="@udevdir@/openct_usb" # eToken 64 ENV{MODALIAS}=="usb:v0529p0600*", RUN+="@udevdir@/openct_usb" ENV{MODALIAS}=="usb:v0529p0700*", RUN+="@udevdir@/openct_usb" # eutron ENV{MODALIAS}=="usb:v073Dp0005*", RUN+="@udevdir@/openct_usb" # ikey2k ENV{MODALIAS}=="usb:v04B9p1200*", RUN+="@udevdir@/openct_usb" # ikey3k ENV{MODALIAS}=="usb:v04B9p1300*", RUN+="@udevdir@/openct_usb" # starkey ENV{MODALIAS}=="usb:v096Ep0005*", RUN+="@udevdir@/openct_usb" # cardman #ENV{MODALIAS}=="usb:v076Bp0596*", RUN+="@udevdir@/openct_usb" #ENV{MODALIAS}=="usb:v076Bp1784*", RUN+="@udevdir@/openct_usb" #ENV{MODALIAS}=="usb:v08D4p0009*", RUN+="@udevdir@/openct_usb" # ccid ENV{MODALIAS}=="usb:*ic0Bisc00*", RUN+="@udevdir@/openct_usb" # spr 532 - ccid, but with wrong interface class (vendor) :( ENV{MODALIAS}=="usb:v04E6p0003*", RUN+="@udevdir@/openct_usb" ENV{MODALIAS}=="usb:v04E6pE003*", RUN+="@udevdir@/openct_usb" # pertosmart1030 ENV{MODALIAS}=="usb:v072Fp0001*", RUN+="@udevdir@/openct_usb" ENV{MODALIAS}=="usb:v072Fp8009*", RUN+="@udevdir@/openct_usb" # pertosmart1038 ENV{MODALIAS}=="usb:v072Fp9000*", RUN+="@udevdir@/openct_usb" ENV{MODALIAS}=="usb:v072Fp9006*", RUN+="@udevdir@/openct_usb" ENV{MODALIAS}=="usb:v072Fp9007*", RUN+="@udevdir@/openct_usb" ENV{MODALIAS}=="usb:v072Fp90D0*", RUN+="@udevdir@/openct_usb" # wbeiuu - driver not working yet #ENV{MODALIAS}=="usb:v104Fp0004*", RUN+="@udevdir@/openct_usb" # Rutoken S ENV{MODALIAS}=="usb:v0a89p0020*", RUN+="@udevdir@/openct_usb" # ePass3000 ENV{MODALIAS}=="usb:v096ep0401*", RUN+="@udevdir@/openct_usb" LABEL="openct_usb_rules_end" # udev pcmcia rules file for openct # SUBSYSTEMS!="pcmcia", GOTO="openct_pcmcia_rules_end" ACTION!="add", GOTO="openct_pcmcia_rules_end" # omnikey cardman 4040 SUBSYSTEM=="cardman_4040", RUN+="@udevdir@/openct_pcmcia" # Gemplus PCMCIA Card DRIVERS=="serial_cs", SYSFS{prod_id1}=="Gemplus", SYSFS{prod_id2}=="SerialPort", SYSFS{prod_id3}=="GemPC Card", RUN+="@udevdir@/openct_serial" LABEL="openct_pcmcia_rules_end" openct-0.6.20/etc/openct_pcmcia.in0000644000175000017500000000033411043042743013715 00000000000000#!/bin/sh test "$ACTION" = "add" || exit 0 test -n "$DEVNAME" || exit 0 test -e "@OPENCT_SOCKET_PATH@/status" || exit 0 if [ -n "$DEVNAME" ] then @sbindir@/openct-control attach ccid pcmcia_block $DEVNAME exit 0 fi openct-0.6.20/etc/openct.usermap0000644000175000017500000001251711303255320013451 00000000000000# note: this file is for the old linux hotplug mechanism without udev. # it is no longer properly maintained and not very much supported - I don't # have a machine left where I use it. All I can do is answer emails :( # module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info # egate: openct 0x0003 0x0973 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # # eToken openct 0x0003 0x0529 0x050c 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 openct 0x0003 0x0529 0x0514 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # eToken 64 / NG OTP openct 0x0003 0x0529 0x0600 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 openct 0x0003 0x0529 0x0700 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # eutron openct 0x0003 0x073d 0x0005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # ikey2k openct 0x0003 0x04b9 0x1200 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # ikey3k openct 0x0003 0x04b9 0x1300 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # starkey openct 0x0003 0x096e 0x0005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # cardman #openct 0x0003 0x076b 0x0596 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 #openct 0x0003 0x076b 0x1784 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 #openct 0x0003 0x08d4 0x0009 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # ccid openct 0x0380 0x0000 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 # spr 532 - ccid, but with wrong interface class (vendor) :( openct 0x0003 0x04e6 0x0003 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 openct 0x0003 0x04e6 0xe003 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 # pertosmart1030 openct 0x0003 0x072f 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 openct 0x0003 0x072f 0x8009 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 # pertosmart1038 openct 0x0003 0x072f 0x9000 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 openct 0x0003 0x072f 0x9006 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 openct 0x0003 0x072f 0x9007 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 openct 0x0003 0x072f 0x90d0 0x0000 0x0000 0x00 0x00 0x00 0x0b 0x00 0x00 0x00000000 # wbeiuu - driver not working yet #openct 0x0003 0x104f 0x0004 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # cyberjack openct 0x003 0x0c4b 0x0100 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # rutoken openct 0x0003 0x0a89 0x0020 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 openct 0x0003 0x0a89 0x0012 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # ePass3000 openct 0x0003 0x096e 0x0401 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 openct-0.6.20/etc/openct_usb.mdev.in0000644000175000017500000000110511125447432014206 00000000000000#!/bin/sh # # Copy to /lib/mdev/openct_usb # Put the following in /etc/mdev.conf: # .* 0:0 0660 @/lib/mdev/openct_usb # For some strange reason "usb.*" does not catch the event. # [ -n "${DEVPATH}" ] || exit 0 [ "${ACTION}" = "add" ] || exit 0 [ "${DEVTYPE}" = "usb_device" ] || exit 0 DEVICE="/dev/bus/usb/${BUSNUM}/${DEVNUM}" if ! [ -e "${DEVICE}" ]; then mkdir -p "$(dirname "${DEVICE}")" mknod "${DEVICE}" c ${MAJOR} ${MINOR} fi [ -e "@OPENCT_SOCKET_PATH@/status" ] || exit 0 # Don't know why... sleep 1 @sbindir@/openct-control attach "usb:${PRODUCT}" usb "${DEVICE}" openct-0.6.20/etc/openct.udev.in0000644000175000017500000001000511321327446013344 00000000000000# udev rules file for openct # Update 2009-11-25 # Thanks to Scott James Remnant and Martin Pitt for helping on irc # to figure out the new syntax / rules for udev. # COMPATIBILITY NOTES # new versions of udev want DRIVERS, older versions only support DRIVER # new versions of udev want SUBSYSTEMS, older versions only support BUS # # new combinations of udev and linux kernel do not create proper events # (or udev processes them "too fast" / race conditions) or similar. # as a result there is no way to get openct-control run when a usb smart # card reader is plugged in. restarting the init script will help as a # crude workaround. # SUBSYSTEM!="usb", GOTO="openct_usb_rules_end" ACTION!="add", GOTO="openct_usb_rules_end" # last file created by the kernel, if this is present everything should be # KERNEL=="[0-9]*:*", WAIT_FOR_ATTR="bInterfaceProtocol" # 2010-01-06 removed, as latest udev doesn't know WAIT_FOR_ATTR any more. # sleep for 100ms - the wait_for_sysfs might not be enough PROGRAM="/bin/sleep 0.1" # ccid ATTR{bInterfaceClass}=="0b", ATTR{bInterfaceSubClass}=="00", ATTR{bInterfaceProtocol}=="00", ATTRS{idVendor}=="?*" RUN+="@udevdir@/openct_usb /dev/$parent" # egate ATTR{idVendor}=="0973", ATTR{idProduct}=="0001", RUN+="@udevdir@/openct_usb /dev/$name" # eToken ATTR{idVendor}=="0529", ATTR{idProduct}=="050c", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="0529", ATTR{idProduct}=="0514", RUN+="@udevdir@/openct_usb /dev/$name" # eToken 64 ATTR{idVendor}=="0529", ATTR{idProduct}=="0600", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="0529", ATTR{idProduct}=="0700", RUN+="@udevdir@/openct_usb /dev/$name" # eutron ATTR{idVendor}=="073d", ATTR{idProduct}=="0005", RUN+="@udevdir@/openct_usb /dev/$name" # ikey2k ATTR{idVendor}=="04b9", ATTR{idProduct}=="1200", RUN+="@udevdir@/openct_usb /dev/$name" # ikey3k ATTR{idVendor}=="04b9", ATTR{idProduct}=="1300", RUN+="@udevdir@/openct_usb /dev/$name" # starkey ATTR{idVendor}=="096e", ATTR{idProduct}=="0005", RUN+="@udevdir@/openct_usb /dev/$name" # cardman #ATTR{idVendor}=="076b", ATTR{idProduct}=="0596", RUN+="@udevdir@/openct_usb /dev/$name" #ATTR{idVendor}=="076b", ATTR{idProduct}=="1784", RUN+="@udevdir@/openct_usb /dev/$name" #ATTR{idVendor}=="08d4", ATTR{idProduct}=="0009", RUN+="@udevdir@/openct_usb /dev/$name" # spr 532 - ccid, but with wrong interface class (vendor) :( ATTR{idVendor}=="04e6", ATTR{idProduct}=="0003", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="04e6", ATTR{idProduct}=="E003", RUN+="@udevdir@/openct_usb /dev/$name" # pertosmart1030 ATTR{idVendor}=="072f", ATTR{idProduct}=="0001", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="072f", ATTR{idProduct}=="8009", RUN+="@udevdir@/openct_usb /dev/$name" # pertosmart1038 ATTR{idVendor}=="072f", ATTR{idProduct}=="9000", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="072f", ATTR{idProduct}=="9006", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="072f", ATTR{idProduct}=="9007", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="072f", ATTR{idProduct}=="90d0", RUN+="@udevdir@/openct_usb /dev/$name" # wbeiuu - driver not working yet. #ATTR{idVendor}=="104f", ATTR{idProduct}=="0004", RUN+="@udevdir@/openct_usb /dev/$name" # cyberjack ATTR{idVendor}=="0c4b", ATTR{idProduct}=="0100", RUN+="@udevdir@/openct_usb /dev/$name" # rutoken ATTR{idVendor}=="0a89", ATTR{idProduct}=="0020", RUN+="@udevdir@/openct_usb /dev/$name" ATTR{idVendor}=="0a89", ATTR{idProduct}=="0012", RUN+="@udevdir@/openct_usb /dev/$name" # ePass3000 ATTR{idVendor}=="096e", ATTR{idProduct}=="0401", RUN+="@udevdir@/openct_usb /dev/$name" LABEL="openct_usb_rules_end" # udev pcmcia rules file for openct # SUBSYSTEMS!="pcmcia", GOTO="openct_pcmcia_rules_end" ACTION!="add", GOTO="openct_pcmcia_rules_end" # omnikey cardman 4040 SUBSYSTEM=="cardman_4040", RUN+="@udevdir@/openct_pcmcia /dev/$name" # Gemplus PCMCIA Card DRIVERS=="serial_cs", ATTR{prod_id1}=="Gemplus", ATTR{prod_id2}=="SerialPort", ATTR{prod_id3}=="GemPC Card", RUN+="@udevdir@/openct_serial /dev/$name" LABEL="openct_pcmcia_rules_end" openct-0.6.20/etc/openct.conf.in0000644000175000017500000000607611303255320013332 00000000000000# Set debug level debug = 0; # # Enable hot plugging hotplug = yes; # # Path to ifdhandler ifdhandler { program = @sbindir@/ifdhandler; # # Safe to disable force_poll: # >=linux-2.6.27.14 # >=linux-2.6.28.3 # force_poll = 1; @ENABLE_NON_PRIVILEGED@ user = @daemon_user@; @ENABLE_NON_PRIVILEGED@ groups = { @ENABLE_NON_PRIVILEGED@ @daemon_groups@, @ENABLE_NON_PRIVILEGED@ }; }; # # Configuration for ifdproxy (if you use it) ifdproxy { # server-port = @OPENCT_SOCKET_PATH@/.ifdproxy, # device-port = :6666; }; # Configure static, non-hotplug aware readers here # # For a list of drivers try command 'ifdhandler -i', please # notice that not all drivers have serial device capability. #reader towitoko { # driver = towitoko; # device = serial:/dev/ttyS0; #}; #reader gempc { # driver = gempc; # device = serial:/dev/ttyS0; #}; #reader cm4000 { # driver = cm4000; # device = pcmcia:/dev/cmm0; #}; #reader cm4040 { # driver = ccid; # device = pcmcia_block:/dev/cmx0; #}; #reader pertosmart1030 { # driver = pertosmart1030; # device = serial:/dev/ttyS0; #}; # # Hotplug IDs driver egate { ids = { usb:0973/0001, }; }; driver ePass3000 { ids = { usb:096e/0401, }; }; driver etoken { ids = { usb:0529/050c, usb:0529/0514, }; }; driver etoken64 { ids = { usb:0529/0600, usb:0529/0700, }; }; driver eutron { ids = { usb:073d/0005, }; }; driver ikey2k { ids = { usb:04b9/1202, }; }; driver ikey3k { ids = { usb:04b9/1300, }; }; driver starkey { ids = { usb:096e/0005, }; }; driver cardman { ids = { # usb:076b/0596, # OMNIKEY CardMan 2020 # usb:076b/1784, # OMNIKEY CardMan 6020 # usb:08d4/0009, # Fujitsu Siemens SCR USB Reader }; }; driver ccid { ids = { usb:03f0/1024, # HP Keyboard with CCID reader usb:046a/0010, # Cherry smartboard G83-6744 usb:04e6/5115, usb:04e6/5116, usb:04e6/5117, # SCM Micro token size reader usb:04e6/511d, # SCM Micro SCR3311 usb:04e6/E001, usb:04e6/E003, usb:073d/0c00, # Eutron SimPocket (doesn't work yet) usb:076b/1021, # OmniKey CardMan 1021 usb:076b/3021, usb:076b/5121, usb:076b/5321, # OmniKey CardMan 5321 usb:076b/6622, # OmniKey CardMan 6121 usb:0783/0003, usb:08e6/3437, # Gemplus usb:08e6/3438, # Gemplus GemPC Key SmartCard Reader usb:08e6/4433, # Gemplus usb:0b97/7762, # O2 Micro, Inc. Oz776 SmartCard Reader usb:0b97/7772, # O2 Micro, Inc. Oz776 SmartCard Reader usb:0bf8/1006, # fujitsu siemens 3.5" drive size reader usb:0dc3/1004, # Athena Smartcard Solutions, Inc. ASEKey usb:0a89/0030, # Aktiv Rutoken ECP }; }; driver pertosmart1030 { ids = { usb:072f/0001, usb:072f/8009, }; }; driver pertosmart1038 { ids = { usb:072f/9000, usb:072f/9006, # ACS CryptoMate Token usb:072f/9007, # ACS ACR 100 SIMFlash usb:072f/90d0, }; }; #driver wbeiuu { # driver not working yet # ids = { # usb:104f/0004, # }; #}; # Tested with USBID 0c4b:0100. These are red readers: one with LCD, # another one without. driver cyberjack { ids = { usb:0c4b/0100, }; }; driver rutoken { ids = { usb:0a89/0020, # Aktiv Rutoken S usb:0a89/0012, # Aktiv uaToken S }; }; openct-0.6.20/etc/Info.plist0000644000175000017500000001040711303255320012527 00000000000000 ifdManufacturerString OpenCT Project (www.opensc-project.org/openct/) ifdProductString PC/SC Lite IFD wrapper for OpenCT ifdCapabilities 0x00000000 ifdProtocolSupport 0x00000001 ifdVersionNumber 0x00000001 ifdVendorID 0x0973 0x0529 0x0529 0x0529 0x0529 0x073d 0x04b9 0x04b9 0x096e 0x03f0 0x046a 0x04e6 0x04e6 0x04e6 0x04e6 0x04e6 0x04e6 0x073d 0x076b 0x076b 0x076b 0x076b 0x076b 0x0783 0x08e6 0x08e6 0x08e6 0x0b97 0x0b97 0x0bf8 0x0dc3 0x0a89 0x072f 0x072f 0x072f 0x072f 0x072f 0x072f 0x104f 0x0c4b 0x0a89 0x0a89 ifdProductID 0x0001 0x050c 0x0514 0x0600 0x0700 0x0005 0x1202 0x1300 0x0005 0x1024 0x0010 0x5115 0x5116 0x5117 0x511d 0xE001 0xE003 0x0c00 0x1021 0x3021 0x5121 0x5321 0x6622 0x0003 0x3437 0x3438 0x4433 0x7762 0x7772 0x1006 0x1004 0x0030 0x0001 0x8009 0x9000 0x9006 0x9007 0x90d0 0x0004 0x0100 0x0020 0x0012 ifdFriendlyName Axalto/Schlumberger/Gemalo egate token Aladdin eToken PRO Aladdin eToken PRO Aladdin eToken PRO 64 Aladdin eToken PRO NG OTP Eutron CryptoIdendity Rainbow iKey 2000 Rainbow iKey 3000 G&D Starkey 100 Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Generic CCID Reader Pertosmart Card Reader Pertosmart Card Reader Pertosmart Card Reader Pertosmart Card Reader Pertosmart Card Reader Pertosmart Card Reader WB Electronics Inifinty USB Ulimited Cyberjack Reader Aktiv Rutoken S Aktiv uaToken S openct-0.6.20/etc/reader.conf.in0000644000175000017500000000031411043042743013275 00000000000000# OpenCT configuration file for pcsc-lite # http://www.opensc.org/openct/ FRIENDLYNAME "OpenCT" DEVICENAME /dev/null LIBPATH @libdir@/openct-ifd.so CHANNELID 0 # End of file openct-0.6.20/etc/init-script.in0000644000175000017500000000423111176003652013361 00000000000000#! /bin/sh ### BEGIN INIT INFO # Provides: openct # Required-Start: $syslog # Required-Stop: $syslog # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: smart card terminal framework # Description: Initialize the OpenCT smart card terminal # framework. ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=@sbindir@/openct-control STATUS_DIR="@OPENCT_SOCKET_PATH@" STATUS_FILE="$STATUS_DIR/status" NAME=OpenCT DESC="smart card terminal framework" test -x $DAEMON || exit 0 # create the directory for our status and socket files, # if it does not exist. if ! test -e "$STATUS_DIR" then mkdir "$STATUS_DIR" # maybe you also want to set owner ship and permissions here. # this example would assign the directory to a group "scard" # and set permissions so only users in that group can access # smart card readers via openct. #chown root:scard "$STATUS_DIR" #chmod 0750 "$STATUS_DIR" fi set -e case "$1" in start) echo -n "Starting $DESC: $NAME" $DAEMON init echo "." ;; stop) echo -n "Stopping $DESC: $NAME " if [ -f $STATUS_FILE ]; then $DAEMON shutdown rm -f $STATUS_FILE fi echo "." ;; #reload) # # If the daemon can reload its config files on the fly # for example by sending it SIGHUP, do it here. # # If the daemon responds to changes in its config file # directly anyway, make this a do-nothing entry. # # echo -n "Reloading $DESC configuration..." # start-stop-daemon --stop --signal 1 --quiet --pidfile \ # @localstatedir@/run/$NAME.pid --exec $DAEMON # echo "done." #;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting $DESC: $NAME" if [ -f $STATUS_FILE ]; then $DAEMON shutdown rm -f $STATUS_FILE fi sleep 0.1 $DAEMON init echo "." ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 openct-0.6.20/etc/Makefile.am0000644000175000017500000000334611175777371012645 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUFFIXES = .in sources = openct.udev.in openct.udev.modalias.in openct.udev.compat openct_usb.mdev.in \ openct.conf.in openct.hald.in reader.conf.in \ init-script.in openct.hald.in openct_usb.mdev.in \ openct_usb.in openct_pcmcia.in openct_serial.in generated_data = openct.udev openct.udev.modalias openct_usb.mdev \ openct.conf openct.hald reader.conf noinst_generated_scripts = init-script openct.hald openct_usb.mdev udev_generated_scripts = openct_usb openct_pcmcia openct_serial CLEANFILES = $(generated_data) $(noinst_generated_scripts) $(udev_generated_scripts) nodist_noinst_SCRIPTS = $(noinst_generated_scripts) dist_noinst_DATA = Info.plist openct.fdi openct-policy.fdi openct-disable.fdi $(sources) nodist_noinst_DATA = $(generated_data) if ENABLE_UDEV nodist_udev_SCRIPTS = $(udev_generated_scripts) else nodist_noinst_SCRIPTS += $(udev_generated_scripts) endif if ENABLE_HOTPLUG hotplug_DATA = openct.usermap else dist_noinst_DATA += openct.usermap endif sysconf_DATA=#required in order to create dir install-exec-hook: install-sysconfDATA openct.conf if [ -f "$(DESTDIR)$(sysconfdir)/openct.conf" ]; then \ $(INSTALL_DATA) openct.conf "$(DESTDIR)$(sysconfdir)/openct.conf.new"; \ else \ $(INSTALL_DATA) openct.conf "$(DESTDIR)$(sysconfdir)/openct.conf"; \ fi .in: sed \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@udevdir[@]|$(udevdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@OPENCT_SOCKET_PATH[@]|@OPENCT_SOCKET_PATH@|g' \ -e 's|@ENABLE_NON_PRIVILEGED[@]|@ENABLE_NON_PRIVILEGED@|g' \ -e 's|@daemon_user[@]|@daemon_user@|g' \ -e 's|@daemon_groups[@]|@daemon_groups@|g' \ < "$<" > "$@" openct-0.6.20/etc/Makefile.in0000644000175000017500000004217511336457517012655 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_UDEV_FALSE@am__append_1 = $(udev_generated_scripts) @ENABLE_HOTPLUG_FALSE@am__append_2 = openct.usermap subdir = etc DIST_COMMON = $(am__dist_noinst_DATA_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(udevdir)" "$(DESTDIR)$(hotplugdir)" \ "$(DESTDIR)$(sysconfdir)" SCRIPTS = $(nodist_noinst_SCRIPTS) $(nodist_udev_SCRIPTS) SOURCES = DIST_SOURCES = am__dist_noinst_DATA_DIST = Info.plist openct.fdi openct-policy.fdi \ openct-disable.fdi openct.udev.in openct.udev.modalias.in \ openct.udev.compat openct_usb.mdev.in openct.conf.in \ openct.hald.in reader.conf.in init-script.in openct_usb.in \ openct_pcmcia.in openct_serial.in openct.usermap DATA = $(dist_noinst_DATA) $(hotplug_DATA) $(nodist_noinst_DATA) \ $(sysconf_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUFFIXES = .in sources = openct.udev.in openct.udev.modalias.in openct.udev.compat openct_usb.mdev.in \ openct.conf.in openct.hald.in reader.conf.in \ init-script.in openct.hald.in openct_usb.mdev.in \ openct_usb.in openct_pcmcia.in openct_serial.in generated_data = openct.udev openct.udev.modalias openct_usb.mdev \ openct.conf openct.hald reader.conf noinst_generated_scripts = init-script openct.hald openct_usb.mdev udev_generated_scripts = openct_usb openct_pcmcia openct_serial CLEANFILES = $(generated_data) $(noinst_generated_scripts) $(udev_generated_scripts) nodist_noinst_SCRIPTS = $(noinst_generated_scripts) $(am__append_1) dist_noinst_DATA = Info.plist openct.fdi openct-policy.fdi \ openct-disable.fdi $(sources) $(am__append_2) nodist_noinst_DATA = $(generated_data) @ENABLE_UDEV_TRUE@nodist_udev_SCRIPTS = $(udev_generated_scripts) @ENABLE_HOTPLUG_TRUE@hotplug_DATA = openct.usermap sysconf_DATA = #required in order to create dir all: all-am .SUFFIXES: .SUFFIXES: .in $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-nodist_udevSCRIPTS: $(nodist_udev_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(udevdir)" || $(MKDIR_P) "$(DESTDIR)$(udevdir)" @list='$(nodist_udev_SCRIPTS)'; test -n "$(udevdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(udevdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(udevdir)$$dir" || exit $$?; \ } \ ; done uninstall-nodist_udevSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nodist_udev_SCRIPTS)'; test -n "$(udevdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(udevdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(udevdir)" && rm -f $$files mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-hotplugDATA: $(hotplug_DATA) @$(NORMAL_INSTALL) test -z "$(hotplugdir)" || $(MKDIR_P) "$(DESTDIR)$(hotplugdir)" @list='$(hotplug_DATA)'; test -n "$(hotplugdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(hotplugdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(hotplugdir)" || exit $$?; \ done uninstall-hotplugDATA: @$(NORMAL_UNINSTALL) @list='$(hotplug_DATA)'; test -n "$(hotplugdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(hotplugdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(hotplugdir)" && rm -f $$files install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(sysconfdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sysconfdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(udevdir)" "$(DESTDIR)$(hotplugdir)" "$(DESTDIR)$(sysconfdir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-hotplugDATA install-nodist_udevSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sysconfDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-hotplugDATA uninstall-nodist_udevSCRIPTS \ uninstall-sysconfDATA .MAKE: install-am install-exec-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook \ install-hotplugDATA install-html install-html-am install-info \ install-info-am install-man install-nodist_udevSCRIPTS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-sysconfDATA installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-hotplugDATA \ uninstall-nodist_udevSCRIPTS uninstall-sysconfDATA install-exec-hook: install-sysconfDATA openct.conf if [ -f "$(DESTDIR)$(sysconfdir)/openct.conf" ]; then \ $(INSTALL_DATA) openct.conf "$(DESTDIR)$(sysconfdir)/openct.conf.new"; \ else \ $(INSTALL_DATA) openct.conf "$(DESTDIR)$(sysconfdir)/openct.conf"; \ fi .in: sed \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@udevdir[@]|$(udevdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@OPENCT_SOCKET_PATH[@]|@OPENCT_SOCKET_PATH@|g' \ -e 's|@ENABLE_NON_PRIVILEGED[@]|@ENABLE_NON_PRIVILEGED@|g' \ -e 's|@daemon_user[@]|@daemon_user@|g' \ -e 's|@daemon_groups[@]|@daemon_groups@|g' \ < "$<" > "$@" # 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: openct-0.6.20/etc/openct_serial.in0000644000175000017500000000032611043042743013741 00000000000000#!/bin/sh test "$ACTION" = "add" || exit 0 test -n "$DEVNAME" || exit 0 test -e "@OPENCT_SOCKET_PATH@/status" || exit 0 if [ -n "$DEVNAME" ] then @sbindir@/openct-control attach ccid serial $DEVNAME exit 0 fi openct-0.6.20/missing0000755000175000017500000002623311336457517011431 00000000000000#! /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: openct-0.6.20/configure0000755000175000017500000170147011336457516011744 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.64 for openct 0.6.20. # # 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'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-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. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # 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 if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi 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='openct' PACKAGE_TARNAME='openct' PACKAGE_VERSION='0.6.20' PACKAGE_STRING='openct 0.6.20' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/ifd/ifdhandler.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS ENABLE_PCSC_FALSE ENABLE_PCSC_TRUE ENABLE_HOTPLUG_FALSE ENABLE_HOTPLUG_TRUE ENABLE_UDEV_FALSE ENABLE_UDEV_TRUE ENABLE_BUNDLES_FALSE ENABLE_BUNDLES_TRUE ENABLE_API_DOC_FALSE ENABLE_API_DOC_TRUE ENABLE_DOC_FALSE ENABLE_DOC_TRUE SVN_CHECKOUT_FALSE SVN_CHECKOUT_TRUE ENABLE_NON_PRIVILEGED OPENCT_SOCKET_PATH OPTIONAL_LIBUSB_LIBS OPTIONAL_LIBUSB_CFLAGS OPENCT_LT_OLDEST OPENCT_LT_AGE OPENCT_LT_REVISION OPENCT_LT_CURRENT OPENCT_VERSION_FIX OPENCT_VERSION_MINOR OPENCT_VERSION_MAJOR daemon_groups daemon_user hotplugdir udevdir ifddir bundledir apidocdir openctincludedir pkgconfigdir PCSC_LIBS PCSC_CFLAGS LIBUSB_LIBS LIBUSB_CFLAGS LTLIB_LIBS LTLIB_CFLAGS LIBOBJS DOXYGEN TR WGET_OPTS WGET SVN XSLTPROC OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP LIBTOOL SED LN_S PKG_CONFIG EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build 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 enable_strict enable_pedantic enable_doc enable_api_doc enable_pcsc enable_usb enable_debug enable_sunray enable_sunrayclient enable_non_privileged with_bundle with_udev with_hotplug with_ifddir with_apidocdir with_daemon_user with_daemon_groups enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG XSLTPROC SVN WGET WGET_OPTS TR DOXYGEN LTLIB_CFLAGS LTLIB_LIBS LIBUSB_CFLAGS LIBUSB_LIBS PCSC_CFLAGS PCSC_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=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 openct 0.6.20 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/openct] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of openct 0.6.20:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-strict enable strict compile mode [disabled] --enable-pedantic enable pedantic compile mode [disabled] --enable-doc enable installation of documents [disabled] --enable-api-doc enable generation and installation of api documents [disabled] --enable-pcsc enable pcsc support [disabled] --enable-usb enable usb support [disabled] --enable-debug enable debug messages [disabled] --enable-sunray enable sunray support [disabled] --enable-sunrayclient enable sunray client support [disabled] --enable-non-privileged enable non privileged mode [disabled] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-bundle=PATH install bundle file for pcsc-lite to PATH [not installed] --with-udev=PATH install udev files into PATH [not installed] --with-hotplug=PATH install hotplug files into PATH [not installed] --with-ifddir ifd directory [/usr/lib/ifd] --with-apidocdir put API documents at this directory [HTMLDIR/api] --with-daemon-user=USER use this user for daemon [openctd] --with-daemon-groups=GROUPS use these comma separated group list for daemon [usb] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [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 C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility XSLTPROC xsltproc utility SVN subversion utility WGET wget utility WGET_OPTS wget options TR tr utility DOXYGEN tr utility LTLIB_CFLAGS C compiler flags for libltdl LTLIB_LIBS linker flags for libltdl LIBUSB_CFLAGS C compiler flags for LIBUSB, overriding pkg-config LIBUSB_LIBS linker flags for LIBUSB, overriding pkg-config PCSC_CFLAGS C compiler flags for PCSC, overriding pkg-config PCSC_LIBS linker flags for PCSC, overriding pkg-config 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 openct configure 0.6.20 generated by GNU Autoconf 2.64 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;} return $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} return $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { 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_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { 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_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} return $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { 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_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} return $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { 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_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 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 openct $as_me 0.6.20, which was generated by GNU Autoconf 2.64. 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 -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. if 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 . "$srcdir"/.; 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 . \"$srcdir\"/." "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h" 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 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. test -d ./--version && rmdir ./--version 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=${PACKAGE_NAME} VERSION=${PACKAGE_VERSION} 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 -' OPENCT_VERSION_MAJOR="0" OPENCT_VERSION_MINOR="6" OPENCT_VERSION_FIX="20" # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) # (Oldest interface removed: OLDEST++) # (Interfaces added: CURRENT++, REVISION=0) OPENCT_LT_CURRENT="1" OPENCT_LT_OLDEST="1" OPENCT_LT_REVISION="0" OPENCT_LT_AGE="$((${OPENCT_LT_CURRENT}-${OPENCT_LT_OLDEST}))" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # ct_socket_getcreds::SO_PEERCRED DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if 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 rm -f conftest.er1 conftest.err fi $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. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; 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 conftest.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 for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then : $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; }; } fi ac_exeext=$ac_cv_exeext # 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 the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { { 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: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out ac_clean_files=$ac_clean_files_save # 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; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $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$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 { $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 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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$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 \"$CPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " 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 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = x""yes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h 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 rm -f conftest.er1 conftest.err fi $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_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 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 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; 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_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) 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_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; 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_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) 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_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; 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; } PKG_CONFIG="" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking svn checkout" >&5 $as_echo_n "checking svn checkout... " >&6; } if test -e "${srcdir}/packaged"; then svn_checkout="no" else svn_checkout="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${svn_checkout}" >&5 $as_echo "${svn_checkout}" >&6; } case "${host}" in *-*-hpux*) CPPFLAGS="${CPPFLAGS} -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED" ;; *-*-solaris*) CPPFLAGS="${CPPFLAGS} -I/usr/local/include" LDFLAGS="${LDFLAGS} -L/usr/local/lib -R/usr/local/lib" need_dash_r="1" ;; *-*-sunos4*) CPPFLAGS="${CPPFLAGS} -DSUNOS4" ;; *-*-aix*) CPPFLAGS="${CPPFLAGS} -I/usr/local/include" LDFLAGS="${LDFLAGS} -L/usr/local/lib" if test "${LD}" != "gcc" -a -z "${blibpath}"; then blibpath="/usr/lib:/lib:/usr/local/lib" fi ;; *-*-osf*) CPPFLAGS="${CPPFLAGS} -D_POSIX_PII_SOCKET" ;; *-*-darwin*) LIBS="${LIBS} -Wl,-framework,CoreFoundation" if test "${GCC}" = "yes"; then CFLAGS="${CFLAGS} -no-cpp-precomp" fi ;; esac # Check whether --enable-strict was given. if test "${enable_strict+set}" = set; then : enableval=$enable_strict; else enable_strict="no" fi # Check whether --enable-pedantic was given. if test "${enable_pedantic+set}" = set; then : enableval=$enable_pedantic; else enable_pedantic="no" fi # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then : enableval=$enable_doc; else enable_doc="no" fi # Check whether --enable-api-doc was given. if test "${enable_api_doc+set}" = set; then : enableval=$enable_api_doc; else enable_api_doc="no" fi # Check whether --enable-pcsc was given. if test "${enable_pcsc+set}" = set; then : enableval=$enable_pcsc; else enable_pcsc="no" fi # Check whether --enable-usb was given. if test "${enable_usb+set}" = set; then : enableval=$enable_usb; else enable_usb="no" fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; test "${enableval}" = "yes" && $as_echo "#define DEBUG 1" >>confdefs.h fi # Check whether --enable-sunray was given. if test "${enable_sunray+set}" = set; then : enableval=$enable_sunray; test "${enableval}" = "yes" && $as_echo "#define sunray 1" >>confdefs.h fi # Check whether --enable-sunrayclient was given. if test "${enable_sunrayclient+set}" = set; then : enableval=$enable_sunrayclient; test "${enableval}" = "yes" && $as_echo "#define sunrayclient 1" >>confdefs.h fi # Check whether --enable-non-privileged was given. if test "${enable_non_privileged+set}" = set; then : enableval=$enable_non_privileged; test "${enableval}" = "no" && ENABLE_NON_PRIVILEGED="#" else ENABLE_NON_PRIVILEGED="#" fi # Check whether --with-bundle was given. if test "${with_bundle+set}" = set; then : withval=$with_bundle; if test "${withval}" = "yes"; then bundledir="\$(libdir)" else bundledir="${withval}" fi else bundledir="" fi # Check whether --with-udev was given. if test "${with_udev+set}" = set; then : withval=$with_udev; if test "${withval}" = "yes"; then udevdir="\$(libdir)/udev" else udevdir="${withval}" fi else udevdir="" fi # Check whether --with-hotplug was given. if test "${with_hotplug+set}" = set; then : withval=$with_hotplug; if test "${withval}" = "yes"; then hotplugdir="\$(sysconfdir)/hotplug/usb" else hotplugdir="${withval}" fi else hotplugdir="" fi # Check whether --with-ifddir was given. if test "${with_ifddir+set}" = set; then : withval=$with_ifddir; ifddir="${withval}" else ifddir="\${libdir}/ifd" fi # Check whether --with-apidocdir was given. if test "${with_apidocdir+set}" = set; then : withval=$with_apidocdir; apidocdir="${with_apidocdir}" else apidocdir="\$(htmldir)/api" fi # Check whether --with-daemon-user was given. if test "${with_daemon_user+set}" = set; then : withval=$with_daemon_user; daemon_user="${withval}" else daemon_user="openctd" fi # Check whether --with-daemon-groups was given. if test "${with_daemon_groups+set}" = set; then : withval=$with_daemon_groups; daemon_groups="${withval}" else daemon_groups="usb" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$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 \"$CPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { $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 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 case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.6' macro_revision='1.3012' ltmain="$ac_aux_dir/ltmain.sh" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" 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_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" 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_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:6731: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:6734: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:6737: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; 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_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; 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_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru 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 test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if 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 test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 7931 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9193: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:9197: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9532: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:9536: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9637: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:9641: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:9692: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:9696: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu) link_all_deplibs=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 12075 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 12171 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: for ac_prog in xsltproc 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_XSLTPROC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then ac_cv_prog_XSLTPROC="$XSLTPROC" # 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_XSLTPROC="$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 XSLTPROC=$ac_cv_prog_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XSLTPROC" && break done for ac_prog in svn 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_SVN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$SVN"; then ac_cv_prog_SVN="$SVN" # 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_SVN="$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 SVN=$ac_cv_prog_SVN if test -n "$SVN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SVN" >&5 $as_echo "$SVN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SVN" && break done for ac_prog in wget 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_WGET+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$WGET"; then ac_cv_prog_WGET="$WGET" # 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_WGET="$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 WGET=$ac_cv_prog_WGET if test -n "$WGET"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 $as_echo "$WGET" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$WGET" && break done for ac_prog in tr 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_TR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$TR"; then ac_cv_prog_TR="$TR" # 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_TR="$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 TR=$ac_cv_prog_TR if test -n "$TR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR" >&5 $as_echo "$TR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$TR" && break done for ac_prog in doxygen 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_DOXYGEN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # 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_DOXYGEN="$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 DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DOXYGEN" && break done test -z "${WGET_OPTS}" && WGET_OPTS="-nv" if test "${svn_checkout}" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking XSLTPROC requirement" >&5 $as_echo_n "checking XSLTPROC requirement... " >&6; } if test -n "${XSLTPROC}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else if test "${enable_doc}" = "yes"; then as_fn_error "Missing XSLTPROC svn build with doc" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"make dist\" will not work" >&5 $as_echo "$as_me: WARNING: \"make dist\" will not work" >&2;} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking DOXYGEN requirement" >&5 $as_echo_n "checking DOXYGEN requirement... " >&6; } if test -n "${DOXYGEN}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else if test "${enable_api_doc}" = "yes"; then as_fn_error "Missing DOXYGEN svn build with api doc" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"make dist\" will not work" >&5 $as_echo "$as_me: WARNING: \"make dist\" will not work" >&2;} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking svn doc build dependencies" >&5 $as_echo_n "checking svn doc build dependencies... " >&6; } if test -n "${SVN}" -a -n "${TR}" -a -n "${WGET}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else if test "${enable_doc}" = "yes"; then as_fn_error "Missing SVN, TR or WGET for svn doc build" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"make dist\" will not work" >&5 $as_echo "$as_me: WARNING: \"make dist\" will not work" >&2;} fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if 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_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in \ errno.h fcntl.h malloc.h stdlib.h string.h \ strings.h sys/time.h unistd.h getopt.h \ dlfcn.h sys/poll.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 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 { $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_c_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 uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if test "${ac_cv_type_uid_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if test "${ac_cv_lib_error_at_line+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_error_at_line=yes else ac_cv_lib_error_at_line=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 $as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_stat_empty_string_bug=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_stat_empty_string_bug=no else ac_cv_func_stat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = x""yes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in gettimeofday daemon do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $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_c_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 for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = x""yes; then : LIBS="${LIBS} -lsocket" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_query in -lresolv" >&5 $as_echo_n "checking for res_query in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_res_query+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $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 res_query (); int main () { return res_query (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_res_query=yes else ac_cv_lib_resolv_res_query=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_resolv_res_query" >&5 $as_echo "$ac_cv_lib_resolv_res_query" >&6; } if test "x$ac_cv_lib_resolv_res_query" = x""yes; then : LIBS="${LIBS} -lresolv" fi fi if test -z "${LTLIB_LIBS}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlopen in -lltdl" >&5 $as_echo_n "checking for lt_dlopen in -lltdl... " >&6; } if test "${ac_cv_lib_ltdl_lt_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lt_dlopen (); int main () { return lt_dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dlopen=yes else ac_cv_lib_ltdl_lt_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dlopen" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dlopen" >&6; } if test "x$ac_cv_lib_ltdl_lt_dlopen" = x""yes; then : LTLIB_LIBS="-lltdl" else as_fn_error "ltdl not found, please install libltdl and/or libtool" "$LINENO" 5 fi fi saved_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${LTLIB_CFLAGS}" ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default" if test "x$ac_cv_header_ltdl_h" = x""yes; then : else as_fn_error "ltdl.h not found, please install libltdl and/or libtool" "$LINENO" 5 fi CFLAGS="${saved_CFLAGS}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr_storage::ss_family" >&5 $as_echo_n "checking struct sockaddr_storage::ss_family... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sockaddr_storage s; s.ss_family = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct sockaddr_storage s; s.__ss_family = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: hack" >&5 $as_echo "hack" >&6; } cat >>confdefs.h <<_ACEOF #define ss_family __ss_family _ACEOF else as_fn_error "Invalid struct sockaddr_storage" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poll in -lpoll" >&5 $as_echo_n "checking for poll in -lpoll... " >&6; } if test "${ac_cv_lib_poll_poll+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpoll $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 poll (); int main () { return poll (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_poll_poll=yes else ac_cv_lib_poll_poll=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_poll_poll" >&5 $as_echo "$ac_cv_lib_poll_poll" >&6; } if test "x$ac_cv_lib_poll_poll" = x""yes; then : LIBS="$LIBS -lpoll" fi if test "${enable_usb}" = "yes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUSB" >&5 $as_echo_n "checking for LIBUSB... " >&6; } if test -n "$PKG_CONFIG"; then if test -n "$LIBUSB_CFLAGS"; then pkg_cv_LIBUSB_CFLAGS="$LIBUSB_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb\""; } >&5 ($PKG_CONFIG --exists --print-errors "libusb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUSB_CFLAGS=`$PKG_CONFIG --cflags "libusb" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$LIBUSB_LIBS"; then pkg_cv_LIBUSB_LIBS="$LIBUSB_LIBS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb\""; } >&5 ($PKG_CONFIG --exists --print-errors "libusb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUSB_LIBS=`$PKG_CONFIG --libs "libusb" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBUSB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libusb"` else LIBUSB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libusb"` fi # Put the nasty error message in config.log where it belongs echo "$LIBUSB_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error "Cannot detect libusb" "$LINENO" 5 elif test $pkg_failed = untried; then as_fn_error "Cannot detect libusb" "$LINENO" 5 else LIBUSB_CFLAGS=$pkg_cv_LIBUSB_CFLAGS LIBUSB_LIBS=$pkg_cv_LIBUSB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ENABLE_LIBUSB 1" >>confdefs.h fi fi if test "${enable_pcsc}" = "yes"; then case "$host" in *-*-darwin*) if test -z "$PCSC_LIBS" -a -z "$PCSC_LIBS"; then PCSC_MSG=yes PCSC_CFLAGS="" PCSC_LIBS="-Wl,-framework,PCSC" fi ;; *) pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCSC" >&5 $as_echo_n "checking for PCSC... " >&6; } if test -n "$PKG_CONFIG"; then if test -n "$PCSC_CFLAGS"; then pkg_cv_PCSC_CFLAGS="$PCSC_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcsclite\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpcsclite") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCSC_CFLAGS=`$PKG_CONFIG --cflags "libpcsclite" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$PCSC_LIBS"; then pkg_cv_PCSC_LIBS="$PCSC_LIBS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcsclite\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpcsclite") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCSC_LIBS=`$PKG_CONFIG --libs "libpcsclite" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PCSC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpcsclite"` else PCSC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpcsclite"` fi # Put the nasty error message in config.log where it belongs echo "$PCSC_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error "Cannot locate pcsc-lite" "$LINENO" 5 elif test $pkg_failed = untried; then as_fn_error "Cannot locate pcsc-lite" "$LINENO" 5 else PCSC_CFLAGS=$pkg_cv_PCSC_CFLAGS PCSC_LIBS=$pkg_cv_PCSC_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : fi ;; esac fi if test "${enable_usb}" = "yes"; then OPTIONAL_LIBUSB_CFLAGS="${LIBUSB_CFLAGS}" OPTIONAL_LIBUSB_LIBS="${LIBUSB_LIBS}" fi OPENCT_SOCKET_PATH='${localstatedir}/run/openct' CPPFLAGS_OPENCT_SOCKET_PATH='-DOPENCT_SOCKET_PATH="\"$(OPENCT_SOCKET_PATH)\""' CPPFLAGS_OPENCT_CONF_PATH='-DOPENCT_CONF_PATH="\"$(sysconfdir)/openct.conf\""' CPPFLAGS_OPENCT_MODULES_PATH='-DOPENCT_MODULES_PATH="\"$(ifddir)\""' CPPFLAGS_OPENCT_IFDHANDLER_PATH='-DOPENCT_IFDHANDLER_PATH="\"$(sbindir)/ifdhandler\""' CPPFLAGS="${CPPFLAGS} \ ${CPPFLAGS_OPENCT_CONF_PATH} \ ${CPPFLAGS_OPENCT_SOCKET_PATH} \ ${CPPFLAGS_OPENCT_MODULES_PATH} \ ${CPPFLAGS_OPENCT_IFDHANDLER_PATH}" # ------ AC CREATE STDINT H ------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint-types...." >&5 $as_echo_n "checking for stdint-types....... " >&6; } ac_stdint_h=`echo src/include/openct/types.h` if test "$ac_stdint_h" = "stdint.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"(are you sure you want them in ./stdint.h?)\"" >&5 $as_echo "\"(are you sure you want them in ./stdint.h?)\"" >&6; } elif test "$ac_stdint_h" = "inttypes.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"(are you sure you want them in ./inttypes.h?)\"" >&5 $as_echo "\"(are you sure you want them in ./inttypes.h?)\"" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"(putting them into $ac_stdint_h)\"" >&5 $as_echo "\"(putting them into $ac_stdint_h)\"" >&6; } fi inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h \ | sed -e 's/,/ /g'` ac_cv_header_stdint_x="no-file" ac_cv_header_stdint_o="no-file" ac_cv_header_stdint_u="no-file" for i in stdint.h $inttype_headers ; do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <$i> " if test "x$ac_cv_type_uintptr_t" = x""yes; then : ac_cv_header_stdint_x=$i else continue fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = x""yes; then : and64="(uint64_t too)" else and64="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen our uintptr_t in $i $and64" >&5 $as_echo "... seen our uintptr_t in $i $and64" >&6; } break; done if test "$ac_cv_header_stdint_x" = "no-file" ; then for i in stdint.h $inttype_headers ; do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <$i> " if test "x$ac_cv_type_uint32_t" = x""yes; then : ac_cv_header_stdint_o=$i else continue fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = x""yes; then : and64="(uint64_t too)" else and64="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen our uint32_t in $i $and64" >&5 $as_echo "... seen our uint32_t in $i $and64" >&6; } break; done if test "$ac_cv_header_stdint_o" = "no-file" ; then for i in sys/types.h $inttype_headers ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <$i> " if test "x$ac_cv_type_u_int32_t" = x""yes; then : ac_cv_header_stdint_u=$i else continue fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = x""yes; then : and64="(u_int64_t too)" else and64="" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen our u_int32_t in $i $and64" >&5 $as_echo "... seen our u_int32_t in $i $and64" >&6; } break; done fi fi # ----------------- DONE inttypes.h checks MAYBE C basic types -------- if test "$ac_cv_header_stdint_x" = "no-file" ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 $as_echo_n "checking size of char... " >&6; } if test "${ac_cv_sizeof_char+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : else if test "$ac_cv_type_char" = yes; then { { $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 "cannot compute sizeof (char) See \`config.log' for more details." "$LINENO" 5; }; } else ac_cv_sizeof_char=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 $as_echo "$ac_cv_sizeof_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $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 "cannot compute sizeof (short) See \`config.log' for more details." "$LINENO" 5; }; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $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 "cannot compute sizeof (int) See \`config.log' for more details." "$LINENO" 5; }; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $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 "cannot compute sizeof (long) See \`config.log' for more details." "$LINENO" 5; }; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 $as_echo_n "checking size of void*... " >&6; } if test "${ac_cv_sizeof_voidp+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : else if test "$ac_cv_type_voidp" = yes; then { { $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 "cannot compute sizeof (void*) See \`config.log' for more details." "$LINENO" 5; }; } else ac_cv_sizeof_voidp=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 $as_echo "$ac_cv_sizeof_voidp" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOIDP $ac_cv_sizeof_voidp _ACEOF ac_cv_header_stdint_test="yes" else ac_cv_header_stdint_test="no" fi # ----------------- DONE inttypes.h checks START header ------------- _ac_stdint_h=`$as_echo "_$ac_stdint_h" | $as_tr_cpp` { $as_echo "$as_me:${as_lineno-$LINENO}: result: creating $ac_stdint_h : $_ac_stdint_h" >&5 $as_echo "creating $ac_stdint_h : $_ac_stdint_h" >&6; } ${MKDIR_P} $(echo "${ac_stdint_h}" | ${SED} 's/[^/]*$//') 2> /dev/null echo "#ifndef" $_ac_stdint_h >$ac_stdint_h echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h if test "$GCC" = "yes" ; then echo "/* generated using a gnu compiler version" `$CC --version` "*/" \ >>$ac_stdint_h else echo "/* generated using $CC */" >>$ac_stdint_h fi echo "" >>$ac_stdint_h if test "$ac_cv_header_stdint_x" != "no-file" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "$ac_cv_header_stdint_o" != "no-file" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "$ac_cv_header_stdint_u" != "no-file" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi # ----------------- See if int_least and int_fast types are present unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <$ac_cv_header_stdint> " if test "x$ac_cv_type_int_least32_t" = x""yes; then : fi ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include<$ac_cv_header_stdint> " if test "x$ac_cv_type_int_fast32_t" = x""yes; then : fi if test "$ac_cv_header_stdint" != "stddef.h" ; then if test "$ac_cv_header_stdint" != "stdint.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding include stddef.h" >&5 $as_echo "..adding include stddef.h" >&6; } echo "#include " >>$ac_stdint_h fi ; fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding include $ac_cv_header_stdint" >&5 $as_echo "..adding include $ac_cv_header_stdint" >&6; } echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h echo "" >>$ac_stdint_h # ----------------- DONE header START basic int types ------------- if test "$ac_cv_header_stdint_x" = "no-file" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... need to look at C basic types" >&5 $as_echo "... need to look at C basic types" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen good stdint.h inttypes" >&5 $as_echo "... seen good stdint.h inttypes" >&6; } fi if test "$ac_cv_header_stdint_u" != "no-file" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen bsd/sysv typedefs" >&5 $as_echo "... seen bsd/sysv typedefs" >&6; } cat >>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <&5 $as_echo "..adding $t normal 16-bit system" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding $t 32-bit system derived from a 16-bit" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding $t normal 32-bit system" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding $t 32-bit system prepared for 64-bit" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding $t normal 64-bit system" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding $t 64-bit system derived from a 32-bit" >&6; } cat >>$ac_stdint_h <&5 $as_echo "... seen good uint64_t" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding typedef u_int64_t uint64_t" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding generic uint64_t runtime checks" >&6; } cat >>$ac_stdint_h < 199901L #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #endif #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ #if !defined _NO_LONGLONG #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef long int64_t; typedef unsigned long uint64_t; #endif #endif /* compiler/cpu type ... or just ISO C99 */ #endif #endif EOF # plus a default 64-bit for systems that are likely to be 64-bit ready case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in 1:2:8:8) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding uint64_t default" >&5 $as_echo "..adding uint64_t default" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding uint64_t default" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding uint64_t default" >&6; } cat >>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <&5 $as_echo "..adding typedef $a intptr_t" >&6; } fi # ------------- DONE intptr types START int_least types ------------ if test "$ac_cv_type_int_least32_t" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding generic int_least-types" >&5 $as_echo "..adding generic int_least-types" >&6; } cat >>$ac_stdint_h <&5 $as_echo "..adding generic int_fast-types" >&6; } cat >>$ac_stdint_h <>$ac_stdint_h <&5 $as_echo "... DONE $ac_stdint_h" >&6; } cat >>$ac_stdint_h <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__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 "${SVN_CHECKOUT_TRUE}" && test -z "${SVN_CHECKOUT_FALSE}"; then as_fn_error "conditional \"SVN_CHECKOUT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DOC_TRUE}" && test -z "${ENABLE_DOC_FALSE}"; then as_fn_error "conditional \"ENABLE_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_API_DOC_TRUE}" && test -z "${ENABLE_API_DOC_FALSE}"; then as_fn_error "conditional \"ENABLE_API_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BUNDLES_TRUE}" && test -z "${ENABLE_BUNDLES_FALSE}"; then as_fn_error "conditional \"ENABLE_BUNDLES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_UDEV_TRUE}" && test -z "${ENABLE_UDEV_FALSE}"; then as_fn_error "conditional \"ENABLE_UDEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_HOTPLUG_TRUE}" && test -z "${ENABLE_HOTPLUG_FALSE}"; then as_fn_error "conditional \"ENABLE_HOTPLUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PCSC_TRUE}" && test -z "${ENABLE_PCSC_FALSE}"; then as_fn_error "conditional \"ENABLE_PCSC\" 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 openct $as_me 0.6.20, which was generated by GNU Autoconf 2.64. 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 -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_version="\\ openct config.status 0.6.20 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" 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 ;; --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" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/doxygen.conf") CONFIG_FILES="$CONFIG_FILES doc/doxygen.conf" ;; "doc/nonpersistent/Makefile") CONFIG_FILES="$CONFIG_FILES doc/nonpersistent/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "macos/Makefile") CONFIG_FILES="$CONFIG_FILES macos/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/ct/Makefile") CONFIG_FILES="$CONFIG_FILES src/ct/Makefile" ;; "src/ct/libopenct.pc") CONFIG_FILES="$CONFIG_FILES src/ct/libopenct.pc" ;; "src/ctapi/Makefile") CONFIG_FILES="$CONFIG_FILES src/ctapi/Makefile" ;; "src/ifd/Makefile") CONFIG_FILES="$CONFIG_FILES src/ifd/Makefile" ;; "src/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; "src/include/openct/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/openct/Makefile" ;; "src/pcsc/Makefile") CONFIG_FILES="$CONFIG_FILES src/pcsc/Makefile" ;; "src/tools/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;; "src/tools/openct-tool.1") CONFIG_FILES="$CONFIG_FILES src/tools/openct-tool.1" ;; *) 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 } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # 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 file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit $? 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 cat <" section requires the dnl existence of an include file that defines a set of dnl typedefs, especially uint8_t,int32_t,uintptr_t. dnl Many older installations will not provide this file, but some will dnl have the very same definitions in . In other enviroments dnl we can use the inet-types in which would define the dnl typedefs int8_t and u_int8_t respectivly. dnl dnl This macros will create a local "_stdint.h" or the headerfile given as dnl an argument. In many cases that file will just have a singular dnl "#include " or "#include " statement, while dnl in other environments it will provide the set of basic 'stdint's defined: dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t dnl int_least32_t.. int_fast32_t.. intmax_t dnl which may or may not rely on the definitions of other files, dnl or using the AC_CHECK_SIZEOF macro to determine the actual dnl sizeof each type. dnl dnl if your header files require the stdint-types you will want to create an dnl installable file mylib-int.h that all your other installable header dnl may include. So if you have a library package named "mylib", just use dnl dnl AC_CREATE_STDINT_H(mylib-int.h) dnl dnl in configure.in and go to install that very header file in Makefile.am dnl along with the other headers (mylib.h) - and the mylib-specific headers dnl can simply use "#include " to obtain the stdint-types. dnl dnl Remember, if the system already had a valid , the generated dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... dnl dnl (note also the newer variant AX_CREATE_STDINT_H of this macro) dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/) dnl @version $Id: ac_create_stdint_h.m4 1028 2008-04-04 22:28:07Z alonbl $ dnl @author Guido Draheim AC_DEFUN([AC_CREATE_STDINT_H], [# ------ AC CREATE STDINT H ------------------------------------- AC_PROG_MKDIR_P AC_PROG_SED AC_MSG_CHECKING([for stdint-types....]) ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` if test "$ac_stdint_h" = "stdint.h" ; then AC_MSG_RESULT("(are you sure you want them in ./stdint.h?)") elif test "$ac_stdint_h" = "inttypes.h" ; then AC_MSG_RESULT("(are you sure you want them in ./inttypes.h?)") else AC_MSG_RESULT("(putting them into $ac_stdint_h)") fi inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h $2 \ | sed -e 's/,/ /g'` ac_cv_header_stdint_x="no-file" ac_cv_header_stdint_o="no-file" ac_cv_header_stdint_u="no-file" for i in stdint.h $inttype_headers ; do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>]) AC_MSG_RESULT(... seen our uintptr_t in $i $and64) break; done if test "$ac_cv_header_stdint_x" = "no-file" ; then for i in stdint.h $inttype_headers ; do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>]) AC_MSG_RESULT(... seen our uint32_t in $i $and64) break; done if test "$ac_cv_header_stdint_o" = "no-file" ; then for i in sys/types.h $inttype_headers ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="(u_int64_t too)"],[and64=""],[#include<$i>]) AC_MSG_RESULT(... seen our u_int32_t in $i $and64) break; done fi fi # ----------------- DONE inttypes.h checks MAYBE C basic types -------- if test "$ac_cv_header_stdint_x" = "no-file" ; then AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(void*) ac_cv_header_stdint_test="yes" else ac_cv_header_stdint_test="no" fi # ----------------- DONE inttypes.h checks START header ------------- _ac_stdint_h=AS_TR_CPP(_$ac_stdint_h) AC_MSG_RESULT(creating $ac_stdint_h : $_ac_stdint_h) ${MKDIR_P} $(echo "${ac_stdint_h}" | ${SED} 's/[[^/]]*$//') 2> /dev/null echo "#ifndef" $_ac_stdint_h >$ac_stdint_h echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h if test "$GCC" = "yes" ; then echo "/* generated using a gnu compiler version" `$CC --version` "*/" \ >>$ac_stdint_h else echo "/* generated using $CC */" >>$ac_stdint_h fi echo "" >>$ac_stdint_h if test "$ac_cv_header_stdint_x" != "no-file" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "$ac_cv_header_stdint_o" != "no-file" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "$ac_cv_header_stdint_u" != "no-file" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi # ----------------- See if int_least and int_fast types are present unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) if test "$ac_cv_header_stdint" != "stddef.h" ; then if test "$ac_cv_header_stdint" != "stdint.h" ; then AC_MSG_RESULT(..adding include stddef.h) echo "#include " >>$ac_stdint_h fi ; fi AC_MSG_RESULT(..adding include $ac_cv_header_stdint) echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h echo "" >>$ac_stdint_h # ----------------- DONE header START basic int types ------------- if test "$ac_cv_header_stdint_x" = "no-file" ; then AC_MSG_RESULT(... need to look at C basic types) dnl ac_cv_header_stdint_test="yes" # moved up before creating the file else AC_MSG_RESULT(... seen good stdint.h inttypes) dnl ac_cv_header_stdint_test="no" # moved up before creating the file fi if test "$ac_cv_header_stdint_u" != "no-file" ; then AC_MSG_RESULT(... seen bsd/sysv typedefs) cat >>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h < 199901L #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #endif #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ dnl /* note: all ELF-systems seem to have loff-support which needs 64-bit */ #if !defined _NO_LONGLONG #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef long int64_t; typedef unsigned long uint64_t; #endif #endif /* compiler/cpu type ... or just ISO C99 */ #endif #endif EOF # plus a default 64-bit for systems that are likely to be 64-bit ready case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in 1:2:8:8) AC_MSG_RESULT(..adding uint64_t default, normal 64-bit system) cat >>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-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. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # 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 if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # 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 () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # 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 file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) openct-0.6.20/m4/ltversion.m40000644000175000017500000000127511336457510012631 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # Generated from ltversion.in. # serial 3012 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6]) m4_define([LT_PACKAGE_REVISION], [1.3012]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6' macro_revision='1.3012' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) openct-0.6.20/m4/ltsugar.m40000644000175000017500000001042411336457510012261 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) openct-0.6.20/m4/ltoptions.m40000644000175000017500000002724211336457510012641 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) openct-0.6.20/m4/lt~obsolete.m40000644000175000017500000001311311336457510013150 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) openct-0.6.20/solaris/0000777000175000017500000000000011336457576011571 500000000000000openct-0.6.20/solaris/pkginfo.in0000644000175000017500000000032410422076714013453 00000000000000PKG="OSCopenct" NAME="openct" VERSION="@VERSION@" ARCH="@ARCH@" CLASSES="none" CATEGORY="drivers" VENDOR="OSC" PSTAMP="26thFeb2005" EMAIL="william@wanders.org" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" BASEDIR="/" openct-0.6.20/solaris/devices-openct-fabric.xml-dist0000644000175000017500000000312610422076714017310 00000000000000 openct-0.6.20/solaris/postinstall0000755000175000017500000000013210422076714013765 00000000000000#!/bin/sh svccfg import /var/svc/manifest/system/device/devices-openct-fabric.xml exit 0 openct-0.6.20/solaris/Makefile.client0000644000175000017500000000372110422076714014407 00000000000000PACKAGE=OSCopenct PACKAGE_NAME=openct CLASSES=none CATEGORY=drivers VENDOR=OSC EMAIL=william@wanders.org DATE=date PSTAMP=$(DATE:sh) VERSION=SVN PWD=pwd CONFIGURE_PREFIX=$(PWD:sh)/.. CONFIGURE=${CONFIGURE_PREFIX}/configure CONFIGURE_ARGS=--prefix=/usr --sysconfdir=/etc/openct --enable-sunrayclient CONFIG_GUESS=${CONFIGURE_PREFIX}/config.guess UNAME_ARCH=/sbin/uname -p PLATFORM = $(CONFIG_GUESS:sh) ARCH = $(UNAME_ARCH:sh) build: @echo "Setup platform specific build directory ${PLATFORM}" mkdir -p build-${PLATFORM} ( cd build-${PLATFORM}; CC=cc ${CONFIGURE} ${CONFIGURE_ARGS}; make ) dist: @echo "Setup platform specific dist directory dist-${PLATFORM}" mkdir -p dist-${PLATFORM} @echo "Performing Installing in dist directory" ( cd build-${PLATFORM}; make DESTDIR=`pwd`/../dist-${PLATFORM} install ) package: @echo "Setup package meta files" -rm proto checkinstall pkginfo -sed "s|@ARCH@|${ARCH}|" checkinstall -( echo "PKG=\"${PACKAGE}\""; \ echo "NAME=\"${PACKAGE_NAME}\""; \ echo "VERSION=\"${VERSION}\""; \ echo "ARCH=\"${ARCH}\""; \ echo "CLASSES=\"${CLASSES}\""; \ echo "CATEGORY=\"${CATEGORY}\""; \ echo "VENDOR=\"${VENDOR}\""; \ echo "PSTAMP=\"${PSTAMP}\""; \ echo "EMAIL=\"${EMAIL}\""; \ echo "ISTATES=\"S s 1 2 3\""; \ echo "RSTATES=\"S s 1 2 3\""; \ echo "BASEDIR=\"/\"" ) >pkginfo @echo "Setup package distribution" mkdir -p dist-${PLATFORM}/etc/openct -cp openct.conf-dist dist-${PLATFORM}/etc/openct/openct.conf -( pkgproto dist-${PLATFORM}= | sed -e "s|$(LOGNAME) other$$|root bin|" | egrep -v "(s|d) none (/|/etc|/var|/usr|/usr/local) "; \ echo "i checkinstall=checkinstall"; \ echo "i pkginfo=pkginfo" ) >proto @echo "Creating package" -pkgmk -o -r . -d . -f proto -pkgtrans -s . ${PACKAGE_NAME}-${VERSION}-${PLATFORM}.pkg ${PACKAGE} clean: rm -rf build-${PLATFORM} rm -rf dist-${PLATFORM} rm -rf ${PACKAGE} rm -f proto checkinstall pkginfo veryclean: clean rm -f ${PACKAGE_NAME}-${VERSION}-${PLATFORM}.pkg openct-0.6.20/solaris/openct-hotplug-dist0000755000175000017500000000312610422076714015330 00000000000000#!/bin/sh # # USB Hotplug script for OpenCT on Solaris # # This script should be run by sysevent daemon (sysevent[conf]d). # # This can be configured by issuing the followin comand as "root". # # syseventadm add -v SUNW -p ddi -c EC_devfs -s ESC_devfs_devi_add \ # /usr/sbin/openct-hotplug '${di.path}' # # The script will search for the applicable /dev link file for # the given device. If such link is found it means that the # device is bound in the system through the ugen device driver # and should be accessable by OpenCT. An openct-control command # is then issued to attach the device. # OPENCT_CONTROL=/usr/sbin/openct-control DEVICE=$1 for CNTRL0 in `ls /devices$DEVICE:[0-9a-f]*.[0-9a-f]*.cntrl0 2>/dev/null` do #echo "CNTRL0=$CNTRL0" VENDOR_PRODUCT=`echo $CNTRL0 | sed "s|/devices$DEVICE:\([0-9a-f]*\.[0-9a-f]*\).cntrl0|\1|"` #echo "VENDOR_PRODUCT=$VENDOR_PRODUCT" for CNTRL0_INSTANCE in `ls /dev/usb/$VENDOR_PRODUCT/*/cntrl0 2>/dev/null` do #echo "CNTRL0_INSTANCE=$CNTRL0_INSTANCE" if `ls -l "$CNTRL0_INSTANCE" | grep "$DEVICE" >/dev/null` then #echo "$CNTRL0_INSTANCE points to /pci@1f,0/pci@5/usb@0,1/device@2" VENDOR=`echo $VENDOR_PRODUCT | sed "s|\([0-9a-f]*\)\.\([0-9a-f]*\)|\1|"` PRODUCT=`echo $VENDOR_PRODUCT | sed "s|\([0-9a-f]*\)\.\([0-9a-f]*\)|\2|"` #echo "VENDOR=$VENDOR" #echo "PRODUCT=$PRODUCT" ID_INSTANCE=`printf "usb:%04x/%04x" 0x$VENDOR 0x$PRODUCT` logger -i -p local0.notice -t openct-hotplug "$OPENCT_CONTROL attach $CNTRL0_INSTANCE $ID_INSTANCE" $OPENCT_CONTROL attach $CNTRL0_INSTANCE $ID_INSTANCE fi done done exit 0 openct-0.6.20/solaris/openct-fabric-dist0000755000175000017500000000265210422076714015077 00000000000000#!/sbin/sh # # Copyright 2005 William Wanders. All rights reserved. # Use is subject to license terms. # # ident "@(#)openct-fabric 1.1 04/08/31 SMI" # # This script is used initialize and shutdown the OpenCT fabric # case "$1" in 'start') # Create directory for OpenCT fabric if [ ! -d /var/run/openct ] then mkdir -p /var/run/openct fi # Startup the OpenCT fabric if [ ! -f /var/run/openct/status ] then /usr/sbin/openct-control init fi # Add sysevent handler for hotplug support if syseventadm list \ -v SUNW -p ddi -c EC_devfs -s ESC_devfs_devi_add \ /usr/sbin/openct-hotplug '${di.path}' >/dev/null then echo "system eventhandler already added" else syseventadm add \ -v SUNW -p ddi -c EC_devfs -s ESC_devfs_devi_add \ /usr/sbin/openct-hotplug '${di.path}' fi ;; 'stop') # Remove sysevent handler for hotplug support if syseventadm list \ -v SUNW -p ddi -c EC_devfs -s ESC_devfs_devi_add \ /usr/sbin/openct-hotplug '${di.path}' >/dev/null then syseventadm remove \ -v SUNW -p ddi -c EC_devfs -s ESC_devfs_devi_add \ /usr/sbin/openct-hotplug '${di.path}' fi # Shutdown the OpenCT fabric if [ -f /var/run/openct/status ] then /usr/sbin/openct-control shutdown fi # Cleanup the OpenCT fabric directory if [ -d /var/run/openct ] then rm -rf /var/run/openct fi ;; 'status') /usr/sbin/openct-control status ;; *) echo "Usage: $0 { start | stop | status}" exit 1 ;; esac exit $? openct-0.6.20/solaris/Makefile.server0000644000175000017500000000376710422076714014451 00000000000000PACKAGE=OSCutopenct PACKAGE_NAME=utopenct CLASSES=none CATEGORY=drivers VENDOR=OSC EMAIL=william@wanders.org DATE=date PSTAMP=$(DATE:sh) VERSION=SVN PWD=pwd CONFIGURE_PREFIX=$(PWD:sh)/.. CONFIGURE=${CONFIGURE_PREFIX}/configure CONFIGURE_ARGS=--prefix=/opt/SUNWut --sysconfdir=/etc/opt/SUNWut/openct --enable-sunray CONFIG_GUESS=${CONFIGURE_PREFIX}/config.guess UNAME_ARCH=/sbin/uname -p PLATFORM = $(CONFIG_GUESS:sh) ARCH = $(UNAME_ARCH:sh) build: @echo "Setup platform specific build directory ${PLATFORM}" mkdir -p build-${PLATFORM} ( cd build-${PLATFORM}; CC=cc ${CONFIGURE} ${CONFIGURE_ARGS}; make ) dist: @echo "Setup platform specific dist directory dist-${PLATFORM}" mkdir -p dist-${PLATFORM} @echo "Performing Installing in dist directory" ( cd build-${PLATFORM}; make DESTDIR=`pwd`/../dist-${PLATFORM} install ) package: @echo "Setup package meta files" -rm proto checkinstall pkginfo -sed "s|@ARCH@|${ARCH}|" checkinstall -( echo "PKG=\"${PACKAGE}\""; \ echo "NAME=\"${PACKAGE_NAME}\""; \ echo "VERSION=\"${VERSION}\""; \ echo "ARCH=\"${ARCH}\""; \ echo "CLASSES=\"${CLASSES}\""; \ echo "CATEGORY=\"${CATEGORY}\""; \ echo "VENDOR=\"${VENDOR}\""; \ echo "PSTAMP=\"${PSTAMP}\""; \ echo "EMAIL=\"${EMAIL}\""; \ echo "ISTATES=\"S s 1 2 3\""; \ echo "RSTATES=\"S s 1 2 3\""; \ echo "BASEDIR=\"/\"" ) >pkginfo @echo "Setup package distribution" mkdir -p dist-${PLATFORM}/etc/opt/SUNWut/openct -cp openct.conf-dist dist-${PLATFORM}/etc/opt/SUNWut/openct/openct.conf -( pkgproto dist-${PLATFORM}= | sed -e "s|$(LOGNAME) other$$|root bin|" | egrep -v "(s|d) none (/|/etc|/var|/usr|/usr/local) "; \ echo "i checkinstall=checkinstall"; \ echo "i pkginfo=pkginfo" ) >proto @echo "Creating package" -pkgmk -o -r . -d . -f proto -pkgtrans -s . ${PACKAGE_NAME}-${VERSION}-${PLATFORM}.pkg ${PACKAGE} clean: rm -rf build-${PLATFORM} rm -rf dist-${PLATFORM} rm -rf ${PACKAGE} rm -f proto checkinstall pkginfo veryclean: clean rm -f ${PACKAGE_NAME}-${VERSION}-${PLATFORM}.pkg openct-0.6.20/solaris/preremove0000755000175000017500000000011310422076714013414 00000000000000#!/bin/sh svcadm disable openct-fabric svccfg delete openct-fabric exit 0 openct-0.6.20/solaris/proto0000644000175000017500000000550310422076714012560 00000000000000d none usr 0755 root sys d none usr/include 0755 root bin d none usr/include/openct 0755 root bin f none usr/include/openct/apdu.h 0644 root bin f none usr/include/openct/buffer.h 0644 root bin f none usr/include/openct/conf.h 0644 root bin f none usr/include/openct/device.h 0644 root bin f none usr/include/openct/driver.h 0644 root bin f none usr/include/openct/error.h 0644 root bin f none usr/include/openct/ifd.h 0644 root bin f none usr/include/openct/logging.h 0644 root bin f none usr/include/openct/openct.h 0644 root bin f none usr/include/openct/protocol.h 0644 root bin f none usr/include/openct/server.h 0644 root bin f none usr/include/openct/socket.h 0644 root bin f none usr/include/openct/tlv.h 0644 root bin f none usr/include/openct/types.h 0644 root bin f none usr/include/openct/ctapi.h 0644 root bin d none usr/lib 0755 root bin s none usr/lib/libopenct.so.0=libopenct.so.0.0.2 f none usr/lib/libopenct.so.0.0.2 0755 root bin s none usr/lib/libopenct.so=libopenct.so.0.0.2 d none usr/lib/pkgconfig 0755 root other f none usr/lib/pkgconfig/libopenct.pc 0644 root other f none usr/lib/libopenct.la 0755 root bin f none usr/lib/libopenct.a 0644 root bin s none usr/lib/libifd.so.0=libifd.so.0.0.2 f none usr/lib/libifd.so.0.0.2 0755 root bin s none usr/lib/libifd.so=libifd.so.0.0.2 f none usr/lib/libifd.la 0755 root bin f none usr/lib/libifd.a 0644 root bin f none usr/lib/libopenctapi.so 0755 root bin f none usr/lib/libopenctapi.la 0755 root bin f none usr/lib/libopenctapi.a 0644 root bin f none usr/lib/openct-ifd.so 0755 root bin f none usr/lib/openct-ifd.la 0755 root bin f none usr/lib/openct-ifd.a 0644 root bin d none usr/lib/openct-ifd.bundle 0755 root bin d none usr/lib/openct-ifd.bundle/Contents 0755 root bin d none usr/lib/openct-ifd.bundle/Contents/SunOS 0755 root bin f none usr/lib/openct-ifd.bundle/Contents/SunOS/openct-ifd 0755 root bin f none usr/lib/openct-ifd.bundle/Contents/PkgInfo 0644 root bin f none usr/lib/openct-ifd.bundle/Contents/Info.plist 0644 root bin d none usr/sbin 0755 root bin f none usr/sbin/ifdhandler 0755 root bin f none usr/sbin/ifdproxy 0755 root bin f none usr/sbin/openct-control 0755 root bin f none usr/sbin/openct-hotplug 0755 root bin d none usr/bin 0755 root bin f none usr/bin/openct-tool 0755 root bin d none etc 0755 root sys d none etc/openct 0755 root sys f none etc/openct/openct.conf 0644 root sys d none lib 0755 root bin d none lib/svc 0755 root bin d none lib/svc/method 0755 root bin f none lib/svc/method/openct-fabric 0755 root bin d none var 0755 root sys d none var/svc 0755 root sys d none var/svc/manifest 0755 root sys d none var/svc/manifest/system 0755 root sys d none var/svc/manifest/system/device 0755 root sys f none var/svc/manifest/system/device/devices-openct-fabric.xml 0644 root sys i checkinstall=checkinstall i postinstall=postinstall i preremove=preremove i pkginfo=pkginfo openct-0.6.20/solaris/openct.conf-dist0000644000175000017500000000214710422076714014573 00000000000000# Set debug level debug = 0; # # Enable hot plugging hotplug = yes; # # Path to ifdhandler ifdhandler = /opt/SUNWut/sbin/ifdhandler; # # Configuration for ifdproxy (if you use it) ifdproxy { # server-port = /var/run/openct/.ifdproxy, # device-port = :6666; }; # Configure static, non-hotplug aware readers here # # For a list of drivers try command 'ifdhandler -i', please # notice that not all drivers have serial device capability. #reader towitoko { # driver = towitoko; # device = serial:/dev/ttyS0; #}; # # Hotplug IDs driver egate { ids = { usb:0973/0001, }; }; driver etoken { ids = { usb:0529/050c, usb:0529/0514, }; }; driver eutron { ids = { usb:073d/0005, }; }; driver ikey2k { ids = { usb:04b9/1202, }; }; driver ikey3k { ids = { usb:04b9/1300, }; }; driver cardman { ids = { usb:076b/0596, # OMNIKEY CardMan 2020 usb:076b/1784, # OMNIKEY CardMan 6020 usb:08d4/0009, # Fujitsu Siemens SCR USB Reader }; }; driver ccid { ids = { usb:08e6/3437, usb:08e6/3438, usb:08e6/4433, usb:04e6/5115, usb:04e6/E001, usb:04e6/E003, usb:076b/3021, usb:0783/0003, }; }; openct-0.6.20/solaris/checkinstall.in0000755000175000017500000000027410422076714014471 00000000000000#!/bin/sh expected_platform="@ARCH@" platform=`uname -p` if [ ${platform} != ${expected_platform} ]; then echo "This package must be installed on ${expected_platform}" exit 1 fi exit 0 openct-0.6.20/solaris/README0000644000175000017500000000112610422076714012347 00000000000000Creating an installable package for Solaris Sunray (SRSS 3.1) ============================================================= The files in this directory are an attempt to ease the building of openct packages for Solaris running as Sunray Server. The basic steps to create Solaris packages are: # make -f Makefile.server build # make -f Makefile.server dist # make -f Makefile.server package # make -f Makefile.client build # make -f Makefile.client dist # make -f Makefile.client package NOTE: If using the GNU compiler adjust the Makefile TODO: Start/stop utopenct service for active Sunrays. openct-0.6.20/NEWS0000644000175000017500000002251111336457132010515 00000000000000NEWS for OpenCT -- History of user visible changes New in 0.6.20; 2010-02-16; Andreas Jellinghaus * Modify Rutoken S binary interfaces by Aktiv Co. * Makefiles fixed in doc/ directory New in 0.6.19; 2010-01-07; Andreas Jellinghaus * update on udev rules. Please now use udev instead of hal, as distributions are deprecating hal in favor for udev. * Thanks to Daniel Kahn Gillmor for testing on debian. New in 0.6.18; 2009-09-25; Andreas Jellinghaus * USB code for BSD fixed by Emmanuel Dreyfus * Add support for Rutoken S by Aktiv Co. / Aleksey Samsonov New in 0.6.17; 2009-07-29; Andreas Jellinghaus * add support for Rutoken ECP (ccid driver) * small bugfixes New in 0.6.16; 2009-05-04; Andreas Jellinghaus * For ccid, etoken* drivers remove polling loop, review the force_poll configuration option, this reduces power consumption and CPU load. * Fix some issues caused by newer udev version. * Handle T1 abort better. * Some build system fixes. * Some minor fixes. * Re-add api documentation (pre-generated), like we used to. New in 0.6.15; 2008-07-31; Andreas Jellinghaus * Build system rewritten (NOTICE: configure options was modified). * Build system rewritten (NOTICE: configure options was modified). * None privileged configuration added, as a result /etc/openct.conf ifdhandler was modified, please review sample at etc/openct.conf before upgrade. * The usb device add (/dev/bus/usb/$env{BUSNUM}/$env{DEVNUM}) udev rule is now available in separate file, as it should be available at most distributions, and may conflict. Install this only if you are using old udev that miss this statement. * Basic coldplug support on Linux is available without libusb dependency. * CCID-1.10 is now supported. New in 0.6.14; 2007-08-30; Andreas Jellinghaus * further fixes to udev script by Kay Sievers New in 0.6.13; 2007-08-23; Andreas Jellinghaus * get hal setup to work * more fixes to udev setup. works now without usbfs. * fix openct.udev.modalias rule file for openct. tested, now working fine. * this version works with linux kernel 2.6.22+ if patched, see http://lkml.org/lkml/2007/8/17/193 for a patch. will be fixed in 2.6.22.6 I hope. * improve etc/openct_usb.in script for working without PRODUCT environment * comment out wbeiuu driver - use kernel driver plus phoenix driver instead New in 0.6.12; 2007-07-11; Andreas Jellinghaus * add alternative udev rules based on MODALIAS. * update wiki export (fix links, add images). * remove TEST_MINUS_S_SH tests from configure (not needed). * make lots of functions static (warnings from sparse). * rename variables clashing with function names such as index. * fix DragonFly BSD build. * add small delays to smph driver, suggested by Alexej Wassiljew. * fix pcsclite compile issue (Ludovic Rousseau). * add ccid as fallback driver if no other is found (linux only, FIXME others). * add more drivers to etc/ files, get them in sync. * fix lots of warnings/issues found by sparse. * add patch by harald welte for contactless reader support (librfid). * add set_params to pcmcia and pcmcia-block code to get cm4000/cm4040 drivers to work again. New in 0.6.11; 2006-11-22; Andreas Jellinghaus * add usb reset for non-linux too (dummy code only). * fix three small bugs/warnings New in 0.6.10; 2006-11-11; Andreas Jellinghaus * fix etc/Makefile installation (Ville Skytta) * bsd compile fixed (Markus Schatzl) * include string.h in utils.c (Dann Frazier) * fix 'BUS="pcmcia"' match in udev rules file. * improve egate reset logic (Chaskiel Grundman, bugs by AJ) * implement usb reset (Andrey Jivsov) New in 0.6.9; 2006-09-20; Andreas Jellinghaus * more work on wbeiuu driver. * better handling of usb devices for openbsd. * small delays in egate initialisation for new sealed egate token. * small bugfix in socket code. * fix openct.conf for wbeeui driver. * move scripts used by udev to /lib/udev/ by default. * udev scripts for usb, pcmcia_block and serial readers. * add several usb ids to ccid driver config. * small fix in ccid driver with configuration 0. * don't claim interface in device_open, instead make sure all drivers call ifd_device_set_parameters which will (in the case of usb) claim the interface. * cleanup the parameters to ifdhandler and openct-control attach. include type of the device in these parameters. do not drop the type if already known. this change requires the updated hotplug files. New in 0.6.8; 2006-06-19; Andreas Jellinghaus Fix bug in socket code: retry if read() returns -1/EINTR. New in 0.6.7; 2006-05-01; Andreas Jellinghaus * configure.ac uses now pkg-config. * sys-linux.c does not need kernel headers (all data etc. included) * now generating a Changelog file in the documentation * all urls now based on http://www.opensc-project.org/ * wiki documentation included as html snapshot * new driver for WB Electronics' Infinity USB Unlimited by Juan Carlos Borras * bug in sleep code fixed. * new pertosmart ac1038 driver by Carlos Henrique Bauer * new smartkey driver: not finished yet * support for both /proc/bus/usb and /dev/bus/usb devices with linux * improved T=1 implementation by Ludovic Rousseau * improved eutron driver by Chaskiel Grundman * OPENCT_SOCKETDIR environment can point to any dir for the sockets so users can use it without being root. * sample config files for both hald and udev. we suggest udev as hotplug replacement. hald is not tested. * sample reader.conf included for pcsc-lite. remember to use opensc->openct or opensc->pcsc->openct but not both. * add phoenix/smartmouse driver by Antoine Nguyen based on sctk by Alexandre Becoulet * License is now officialy LGPL. So far it was BSD/LGPL dual licensed, and most parts still are, but we already had some usb code under LGPL and now got another driver under LGPL, so the project as whole is considered LGPL. Libopenct is still 100% BSD, in case you want to use it. so this only affects the ifdhandler process and other tools. * Siemens B1 driver improved by Lorenz Knauer. New in 0.6.6; 2005-09-11 Andreas Jellinghaus * updated html documentation. now generated with "make dist". * indent'ed with linux kernel Lindet script. * use libltdl instead of scdl. * new ident schema: Lident (from linux kernel) * new etoken64 driver (completely untested. not supported by opensc.) * new pertosmart driver by Carlos Henrique Bauer * new acr30u driver by Laurent Pinchart * initial driver documentation by Laurent Pinchart * ccid driver now supports pcmcia block based devices such as the OMNIKEY CardMan 4040 (Harald Welte) New in 0.6.5; 2005-05-16; Andreas Jellinghaus * add pcmcia subsystem (Harald Welte) * add cm4000 driver (Harald Welte) * improve ccid driver (Harald Welte) * sunray support (William Wanders) * updated solaris support (William Wanders) * silience some aclocal warning (Ville Skytta) * man page for openct-tool (Ville Skytta) * print usage to stdout if there is no error (Ville Skytta) * document ifdhandler "-i" option (Ville Skytta) * gempc configuration example (Ville Skytta) * first claim usb interface, then configure it. * replace xml/html documentation with a wiki snapshot. New in 0.6.4; 2005-04-25; Andreas Jellinghaus: * solaris/ directory with files for building openct on solaris * improved usb code for bsd * improved usb code for solaris * require automake 1.5 * on darwin link with -Wl,-framework,CoreFoundation * configure code cleanup (use AC_HELP_STRING etc.) * implement protocol selection, improved command checking * ccid update with some cleanups. * improved t=1 protocoll code. * improved and fixed remote socket code. * increased library version to 1.0.0 (incompatible with 0.*.* versions) * fix libtool issue on mac os X (thanks to ville skytta) New in 0.6.3; 2005-01-11; Andreas Jellinghaus * silence "unable to open" and "Debug: connect() failed:" error messages, as they can happen in normal operation (e.g. opensc compiled with openct support (but openct not used), or probing for readers to see if there is one). * add version option to all command line tools. New in 0.6.2; 2004-10-31; Andreas Jellinghaus * Small fix in hotplug script. * Increased transfer buffer to 258 bytes for e-gate. * Improved error handling in e-gate driver. * Updated Info.plist files. * Small fix in atr.c that returned an error for legal atrs. * Improvements to the kaan driver. New in 0.6.1; 2004-07-18; Andreas Jellinghaus * This is a test version of alpha code quality There are several known problems with it, please use the older 0.5.0 release in production environments * new driver for generic usb smart card readers (ccid) * new proxy mechanism for remote access * small fix in ct_buf_put function, new ct_buf_push function * improved ct-api interface code * support for solaris * improved t=1 protocol New in 0.5.0; 2003-11-24; Antti Tapaninen: * Initial support for synchronous ICCs * Improved support for egate, kaan and towitoko drivers * Initial support for Siemens B1 (DTAG/T-TeleSec), iKey 2032, Cherry Smartboard and GemPC readers * A new CT-API implementation by Michael Haardt * A new PC/SC IFD module implementation based on work by Carlos Prados * USB/serial layer cleanups. USB support for other than Linux is under development, volunteers welcome * Lots of generic build and portability fixes. Now works with native compilers for several OS's including Linux, *BSD, MacOS X, Solaris, Tru64 and AIX * Some OpenCT client API resource leaks fixed * Documentation improvements New in 0.1.0; 2003-08-15; Olaf Kirch: * Initial release openct-0.6.20/macos/0000777000175000017500000000000011336457577011220 500000000000000openct-0.6.20/macos/Makefile.am0000644000175000017500000000012311043042742013137 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in dist_noinst_SCRIPTS = libtool-bundle openct-0.6.20/macos/Makefile.in0000644000175000017500000002467311336457517013207 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = macos DIST_COMMON = $(dist_noinst_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(dist_noinst_SCRIPTS) SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in dist_noinst_SCRIPTS = libtool-bundle all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu macos/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu macos/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: openct-0.6.20/macos/libtool-bundle0000755000175000017500000000454210422076712013761 00000000000000#!/bin/sh # A shell script to create MacOS X bundles # from files created by GNU libtool. # Incomplete, but works. # # $Id: libtool-bundle 616 2005-04-17 20:03:55Z aj $ # # set -e verbose=0 verbose_msg () { if [ $verbose -ne 0 ]; then echo "libtool-bundle: $@" fi } error_msg () { echo 1>&2 "libtool-bundle: $@" } usage () { error_msg "Usage: $0 [-e extra XML data] [Mach-O bundle file] [destination directory] " exit 1 } case $1 in -e) shift; if [ "$1" ]; then extradata=$1; shift; else usage; fi; ;; esac [ $# -le 1 -o $# -ge 4 ] && usage sofile=$1 [ ! -f $sofile ] && error_msg "Not a file or file not found: $sofile" && exit 1 case "$sofile" in *.so*) # Assume it's ok ;; *) error_msg "Invalid bundle: $sofile" exit 1 ;; esac destdir=$2 [ ! -d $destdir -o ! -w $destdir ] && error_msg "Not a directory or no write access: $destdir" && exit 1 name="$sofile" [ $# -eq 3 ] && name=$3 name=`echo $name | sed -e "s@.*/@@" -e "s@\.so.*@@"` root="$destdir/${name}.bundle" verbose_msg "sofile: $sofile" verbose_msg "destdir: $destdir" verbose_msg "name: $name" verbose_msg "root: $root" arch=`uname` [ x$arch = xDarwin ] && arch=MacOS type="BNDL" creator="????" # Overwrite existing bundle [ -d "$root" ] && rm -rf "$root" mkdir -p "$root"/Contents/$arch cp "$sofile" "$root"/Contents/$arch/ echo "$type$creator" > "$root"/Contents/PkgInfo create_info_plist () { echo "" echo "" echo "" echo "" echo " CFBundleDevelopmentRegion" echo " English" echo " CFBundleExecutable" echo " `basename \"$sofile\"`" echo " CFBundleInfoDictionaryVersion" echo " 6.0" echo " CFBundleName" echo " $name" echo " CFBundlePackageType" echo " $type" echo " CFBundleSignature" echo " $creator" echo " CFBundleVersion" echo " 0.0.1d1" if [ "$extradata" ]; then echo "" [ -f "$extradata" ]; cat $extradata fi echo "" echo "" } create_info_plist > "$root"/Contents/Info.plist echo "Installed $sofile as $root" openct-0.6.20/svnignore0000644000175000017500000000106711043042743011747 00000000000000Makefile Makefile.in core archive acinclude.m4 aclocal.m4 autom4te.cache compile confdefs.h config.* configure conftest conftest.c depcomp install-sh libtool libtool.m4 ltmain.sh missing mkinstalldirs so_locations stamp-h* .deps .libs .#*# .*.bak .*.orig .*.rej .*~ #*# *.bak *.d *.def *.dll *.exe *.la *.lib *.lo *.orig *.pdb *.rej *.u *.rc *.pc *~ *.gz *.bz2 *.[0-9] *.html *.gif *.css *.out *.loT ChangeLog doxygen.conf reader.conf openct_serial openct.hald openct_usb openct_pcmcia init-script openct.conf types.h ifdhandler ifdproxy openct-tool openct-control openct-0.6.20/config.sub0000755000175000017500000010224011336457517012006 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2009-04-17' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: openct-0.6.20/TODO0000644000175000017500000000103510422076714010502 00000000000000- sometimes the communication freezes, some packet does not reach the destination. can be proproduced with egate driver, cryptoflex card and opensc regression test init0004,6, but is not specific to these drivers and cards - improve pc/sc detection - error handling: use error codes everywhere - pin verification via keypad - ifdhandler should clear status file slot on exit - openct-control init: debug messages to syslog - rewrite USB layer, add native support for *BSD and MacOS X. Remove optional libusb dependency - CCID driver openct-0.6.20/configure.ac0000644000175000017500000003003311336457132012302 00000000000000dnl -*- mode: m4; -*- AC_PREREQ(2.60) define([PACKAGE_VERSION_MAJOR], [0]) define([PACKAGE_VERSION_MINOR], [6]) define([PACKAGE_VERSION_FIX], [20]) define([PACKAGE_SUFFIX], []) AC_INIT([openct],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}]) OPENCT_VERSION_MAJOR="PACKAGE_VERSION_MAJOR" OPENCT_VERSION_MINOR="PACKAGE_VERSION_MINOR" OPENCT_VERSION_FIX="PACKAGE_VERSION_FIX" # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) # (Oldest interface removed: OLDEST++) # (Interfaces added: CURRENT++, REVISION=0) OPENCT_LT_CURRENT="1" OPENCT_LT_OLDEST="1" OPENCT_LT_REVISION="0" OPENCT_LT_AGE="$((${OPENCT_LT_CURRENT}-${OPENCT_LT_OLDEST}))" AC_CONFIG_SRCDIR(src/ifd/ifdhandler.c) AC_CANONICAL_HOST # ct_socket_getcreds::SO_PEERCRED AC_GNU_SOURCE AC_PROG_CC PKG_PROG_PKG_CONFIG AC_C_BIGENDIAN AC_MSG_CHECKING([svn checkout]) if test -e "${srcdir}/packaged"; then svn_checkout="no" else svn_checkout="yes" fi AC_MSG_RESULT([${svn_checkout}]) dnl Check for some target-specific stuff case "${host}" in *-*-hpux*) CPPFLAGS="${CPPFLAGS} -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED" ;; *-*-solaris*) CPPFLAGS="${CPPFLAGS} -I/usr/local/include" LDFLAGS="${LDFLAGS} -L/usr/local/lib -R/usr/local/lib" need_dash_r="1" ;; *-*-sunos4*) CPPFLAGS="${CPPFLAGS} -DSUNOS4" ;; *-*-aix*) CPPFLAGS="${CPPFLAGS} -I/usr/local/include" LDFLAGS="${LDFLAGS} -L/usr/local/lib" if test "${LD}" != "gcc" -a -z "${blibpath}"; then blibpath="/usr/lib:/lib:/usr/local/lib" fi ;; *-*-osf*) CPPFLAGS="${CPPFLAGS} -D_POSIX_PII_SOCKET" ;; *-*-darwin*) LIBS="${LIBS} -Wl,-framework,CoreFoundation" if test "${GCC}" = "yes"; then CFLAGS="${CFLAGS} -no-cpp-precomp" fi ;; esac AC_ARG_ENABLE( [strict], [AS_HELP_STRING([--enable-strict],[enable strict compile mode @<:@disabled@:>@])], , [enable_strict="no"] ) AC_ARG_ENABLE( [pedantic], [AS_HELP_STRING([--enable-pedantic],[enable pedantic compile mode @<:@disabled@:>@])], , [enable_pedantic="no"] ) AC_ARG_ENABLE( [doc], [AS_HELP_STRING([--enable-doc],[enable installation of documents @<:@disabled@:>@])], , [enable_doc="no"] ) AC_ARG_ENABLE( [api-doc], [AS_HELP_STRING([--enable-api-doc],[enable generation and installation of api documents @<:@disabled@:>@])], , [enable_api_doc="no"] ) AC_ARG_ENABLE( [pcsc], [AS_HELP_STRING([--enable-pcsc],[enable pcsc support @<:@disabled@:>@])], , [enable_pcsc="no"] ) AC_ARG_ENABLE( [usb], [AS_HELP_STRING([--enable-usb],[enable usb support @<:@disabled@:>@])], , [enable_usb="no"] ) AC_ARG_ENABLE( [debug], [AS_HELP_STRING([--enable-debug],[enable debug messages @<:@disabled@:>@])], [test "${enableval}" = "yes" && AC_DEFINE([DEBUG], [1], [Enable debug messages.])] ) AC_ARG_ENABLE( [sunray], [AS_HELP_STRING([--enable-sunray],[enable sunray support @<:@disabled@:>@])], [test "${enableval}" = "yes" && AC_DEFINE([sunray], [1], [Enable sunray support.])] ) AC_ARG_ENABLE( [sunrayclient], [AS_HELP_STRING([--enable-sunrayclient],[enable sunray client support @<:@disabled@:>@])], [test "${enableval}" = "yes" && AC_DEFINE(sunrayclient, 1, [Enable sunray client support.])] ) AC_ARG_ENABLE( [non-privileged], [AS_HELP_STRING([--enable-non-privileged],[enable non privileged mode @<:@disabled@:>@])], [test "${enableval}" = "no" && ENABLE_NON_PRIVILEGED="#"], [ENABLE_NON_PRIVILEGED="#"] ) AC_ARG_WITH( [bundle], [AS_HELP_STRING([--with-bundle=PATH],[install bundle file for pcsc-lite to PATH @<:@not installed@:>@])], [ if test "${withval}" = "yes"; then bundledir="\$(libdir)" else bundledir="${withval}" fi ], [bundledir=""] ) AC_ARG_WITH( [udev], [AS_HELP_STRING([--with-udev=PATH],[install udev files into PATH @<:@not installed@:>@])], [ if test "${withval}" = "yes"; then udevdir="\$(libdir)/udev" else udevdir="${withval}" fi ], [udevdir=""] ) AC_ARG_WITH( [hotplug], [AS_HELP_STRING([--with-hotplug=PATH],[install hotplug files into PATH @<:@not installed@:>@])], [ if test "${withval}" = "yes"; then hotplugdir="\$(sysconfdir)/hotplug/usb" else hotplugdir="${withval}" fi ], [hotplugdir=""] ) AC_ARG_WITH( [ifddir], [AS_HELP_STRING([--with-ifddir],[ifd directory @<:@/usr/lib/ifd@:>@])], [ifddir="${withval}"], [ifddir="\${libdir}/ifd"] ) AC_ARG_WITH( [apidocdir], [AS_HELP_STRING([--with-apidocdir],[put API documents at this directory @<:@HTMLDIR/api@:>@])], [apidocdir="${with_apidocdir}"], [apidocdir="\$(htmldir)/api"] ) AC_ARG_WITH( [daemon-user], [AS_HELP_STRING([--with-daemon-user=USER],[use this user for daemon @<:@openctd@:>@])], [daemon_user="${withval}"], [daemon_user="openctd"] ) AC_ARG_WITH( [daemon-groups], [AS_HELP_STRING([--with-daemon-groups=GROUPS],[use these comma separated group list for daemon @<:@usb@:>@])], [daemon_groups="${withval}"], [daemon_groups="usb"] ) dnl Checks for programs. AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_SED AC_PROG_MAKE_SET AM_PROG_CC_C_O dnl Add libtool support. ifdef( [LT_INIT], [ LT_INIT ], [ AC_PROG_LIBTOOL ] ) dnl These required for svn checkout AC_ARG_VAR([XSLTPROC], [xsltproc utility]) AC_ARG_VAR([SVN], [subversion utility]) AC_ARG_VAR([WGET], [wget utility]) AC_ARG_VAR([WGET_OPTS], [wget options]) AC_ARG_VAR([TR], [tr utility]) AC_ARG_VAR([DOXYGEN], [tr utility]) AC_CHECK_PROGS([XSLTPROC],[xsltproc]) AC_CHECK_PROGS([SVN],[svn]) AC_CHECK_PROGS([WGET],[wget]) AC_CHECK_PROGS([TR],[tr]) AC_CHECK_PROGS([DOXYGEN],[doxygen]) test -z "${WGET_OPTS}" && WGET_OPTS="-nv" dnl svn checkout dependencies if test "${svn_checkout}" = "yes"; then AC_MSG_CHECKING([XSLTPROC requirement]) if test -n "${XSLTPROC}"; then AC_MSG_RESULT([ok]) else if test "${enable_doc}" = "yes"; then AC_MSG_ERROR([Missing XSLTPROC svn build with doc]) else AC_MSG_WARN(["make dist" will not work]) fi fi AC_MSG_CHECKING([DOXYGEN requirement]) if test -n "${DOXYGEN}"; then AC_MSG_RESULT([ok]) else if test "${enable_api_doc}" = "yes"; then AC_MSG_ERROR([Missing DOXYGEN svn build with api doc]) else AC_MSG_WARN(["make dist" will not work]) fi fi AC_MSG_CHECKING([svn doc build dependencies]) if test -n "${SVN}" -a -n "${TR}" -a -n "${WGET}"; then AC_MSG_RESULT([ok]) else if test "${enable_doc}" = "yes"; then AC_MSG_ERROR([Missing SVN, TR or WGET for svn doc build]) else AC_MSG_WARN(["make dist" will not work]) fi fi fi dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([ \ errno.h fcntl.h malloc.h stdlib.h string.h \ strings.h sys/time.h unistd.h getopt.h \ dlfcn.h sys/poll.h ]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T AC_TYPE_SIZE_T AC_HEADER_TIME dnl Checks for library functions. AC_FUNC_ERROR_AT_LINE AC_FUNC_STAT AC_FUNC_VPRINTF AC_CHECK_FUNCS([gettimeofday daemon]) dnl C Compiler features AC_C_INLINE dnl See if socket() is found from libsocket AC_CHECK_LIB( [socket], [socket], [ LIBS="${LIBS} -lsocket" AC_CHECK_LIB( [resolv], [res_query], [LIBS="${LIBS} -lresolv"] ) ] ) AC_ARG_VAR([LTLIB_CFLAGS], [C compiler flags for libltdl]) AC_ARG_VAR([LTLIB_LIBS], [linker flags for libltdl]) if test -z "${LTLIB_LIBS}"; then AC_CHECK_LIB( [ltdl], [lt_dlopen], [LTLIB_LIBS="-lltdl"], [AC_MSG_ERROR([ltdl not found, please install libltdl and/or libtool])] ) fi saved_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${LTLIB_CFLAGS}" AC_CHECK_HEADER( [ltdl.h], , [AC_MSG_ERROR([ltdl.h not found, please install libltdl and/or libtool])] ) CFLAGS="${saved_CFLAGS}" AC_MSG_CHECKING([struct sockaddr_storage::ss_family]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]] )], [AC_MSG_RESULT([ok])], [AC_TRY_COMPILE( [ #include #include ], [ struct sockaddr_storage s; s.__ss_family = 1; ], [ AC_MSG_RESULT([hack]) AC_DEFINE_UNQUOTED([ss_family], [__ss_family], [sockaddr_storage.ss_family wrapper]) ], [AC_MSG_ERROR([Invalid struct sockaddr_storage])] )] ) dnl see if poll() is found from libpoll AC_CHECK_LIB([poll], [poll], [LIBS="$LIBS -lpoll"]) if test "${enable_usb}" = "yes"; then PKG_CHECK_MODULES( [LIBUSB], [libusb], [AC_DEFINE([ENABLE_LIBUSB], [1], [Have libusb libraries and header files])], [AC_MSG_ERROR([Cannot detect libusb])] ) fi if test "${enable_pcsc}" = "yes"; then case "$host" in *-*-darwin*) if test -z "$PCSC_LIBS" -a -z "$PCSC_LIBS"; then PCSC_MSG=yes PCSC_CFLAGS="" PCSC_LIBS="-Wl,-framework,PCSC" fi ;; *) PKG_CHECK_MODULES( [PCSC], [libpcsclite], , [AC_MSG_ERROR([Cannot locate pcsc-lite])] ) ;; esac fi if test "${enable_usb}" = "yes"; then OPTIONAL_LIBUSB_CFLAGS="${LIBUSB_CFLAGS}" OPTIONAL_LIBUSB_LIBS="${LIBUSB_LIBS}" fi OPENCT_SOCKET_PATH='${localstatedir}/run/openct' CPPFLAGS_OPENCT_SOCKET_PATH='-DOPENCT_SOCKET_PATH="\"$(OPENCT_SOCKET_PATH)\""' CPPFLAGS_OPENCT_CONF_PATH='-DOPENCT_CONF_PATH="\"$(sysconfdir)/openct.conf\""' CPPFLAGS_OPENCT_MODULES_PATH='-DOPENCT_MODULES_PATH="\"$(ifddir)\""' CPPFLAGS_OPENCT_IFDHANDLER_PATH='-DOPENCT_IFDHANDLER_PATH="\"$(sbindir)/ifdhandler\""' CPPFLAGS="${CPPFLAGS} \ ${CPPFLAGS_OPENCT_CONF_PATH} \ ${CPPFLAGS_OPENCT_SOCKET_PATH} \ ${CPPFLAGS_OPENCT_MODULES_PATH} \ ${CPPFLAGS_OPENCT_IFDHANDLER_PATH}" AC_CREATE_STDINT_H([src/include/openct/types.h]) if test "${enable_pedantic}" = "yes"; then enable_strict="yes"; CFLAGS="${CFLAGS} -pedantic" fi if test "${enable_strict}" = "yes"; then CFLAGS="${CFLAGS} -Wall -Wextra" fi pkgconfigdir="\$(libdir)/pkgconfig" openctincludedir="\$(includedir)/openct" AC_SUBST([pkgconfigdir]) AC_SUBST([openctincludedir]) AC_SUBST([apidocdir]) AC_SUBST([bundledir]) AC_SUBST([ifddir]) AC_SUBST([udevdir]) AC_SUBST([hotplugdir]) AC_SUBST([daemon_user]) AC_SUBST([daemon_groups]) AC_SUBST([OPENCT_VERSION_MAJOR]) AC_SUBST([OPENCT_VERSION_MINOR]) AC_SUBST([OPENCT_VERSION_FIX]) AC_SUBST([OPENCT_LT_CURRENT]) AC_SUBST([OPENCT_LT_REVISION]) AC_SUBST([OPENCT_LT_AGE]) AC_SUBST([OPENCT_LT_OLDEST]) AC_SUBST([OPTIONAL_LIBUSB_CFLAGS]) AC_SUBST([OPTIONAL_LIBUSB_LIBS]) AC_SUBST([OPENCT_SOCKET_PATH]) AC_SUBST([ENABLE_NON_PRIVILEGED]) AM_CONDITIONAL([SVN_CHECKOUT], [test "${svn_checkout}" = "yes"]) AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"]) AM_CONDITIONAL([ENABLE_API_DOC], [test "${enable_api_doc}" = "yes"]) AM_CONDITIONAL([ENABLE_BUNDLES], [test -n "${bundledir}"]) AM_CONDITIONAL([ENABLE_UDEV], [test -n "${udevdir}"]) AM_CONDITIONAL([ENABLE_HOTPLUG], [test -n "${hotplugdir}"]) AM_CONDITIONAL([ENABLE_PCSC], [test "${enable_pcsc}" = "yes"]) AC_CONFIG_FILES([ Makefile doc/Makefile doc/doxygen.conf doc/nonpersistent/Makefile etc/Makefile macos/Makefile src/Makefile src/ct/Makefile src/ct/libopenct.pc src/ctapi/Makefile src/ifd/Makefile src/include/Makefile src/include/openct/Makefile src/pcsc/Makefile src/tools/Makefile src/tools/openct-tool.1 ]) AC_OUTPUT cat <&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: openct-0.6.20/packaged0000644000175000017500000000000111336457577011503 00000000000000 openct-0.6.20/config.h.in0000644000175000017500000001222611336457516012051 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Enable debug messages. */ #undef DEBUG /* Have libusb libraries and header files */ #undef ENABLE_LIBUSB /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_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_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* 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 /* The size of `char', as computed by sizeof. */ #undef SIZEOF_CHAR /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* The size of `void*', as computed by sizeof. */ #undef SIZEOF_VOIDP /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned int' if does not define. */ #undef size_t /* sockaddr_storage.ss_family wrapper */ #undef ss_family /* Enable sunray support. */ #undef sunray /* Enable sunray client support. */ #undef sunrayclient /* Define to `int' if doesn't define. */ #undef uid_t openct-0.6.20/ltmain.sh0000755000175000017500000073337411336457510011661 00000000000000# 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 openct-0.6.20/Makefile.am0000644000175000017500000000202011336456552012050 00000000000000AUTOMAKE_OPTIONS = foreign 1.10 ACLOCAL_AMFLAGS = -I m4 MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub \ $(srcdir)/m4/ltsugar.m4 $(srcdir)/m4/libtool.m4 \ $(srcdir)/m4/ltversion.m4 $(srcdir)/m4/lt~obsolete.m4 \ $(srcdir)/m4/ltoptions.m4 \ $(srcdir)/packaged EXTRA_DIST = svnignore SUBDIRS = etc macos src doc dist_noinst_SCRIPTS = bootstrap dist_noinst_DATA = LGPL-2.1 TODO \ solaris/Makefile.client solaris/Makefile.server solaris/README \ solaris/checkinstall.in solaris/devices-openct-fabric.xml-dist \ solaris/openct-fabric-dist solaris/openct-hotplug-dist \ solaris/openct.conf-dist solaris/pkginfo.in solaris/postinstall \ solaris/preremove solaris/proto dist_doc_DATA = NEWS # Allow detection of packaged tarball dist-hook: echo > "$(distdir)/packaged" openct-0.6.20/aclocal.m40000644000175000017500000012046211336457515011667 00000000000000# generated automatically by aclocal 1.11 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, [m4_warning([this file was generated for autoconf 2.64. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # 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 dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ac_create_stdint_h.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) openct-0.6.20/compile0000755000175000017500000000717311336457517011412 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2009-04-28.21; # 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 mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then 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: openct-0.6.20/Makefile.in0000644000175000017500000006407511336457520012077 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = $(am__configure_deps) $(dist_doc_DATA) \ $(dist_noinst_DATA) $(dist_noinst_SCRIPTS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(top_srcdir)/configure NEWS TODO \ compile config.guess config.sub depcomp install-sh ltmain.sh \ missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(dist_noinst_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive 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)$(docdir)" DATA = $(dist_doc_DATA) $(dist_noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ AUTOMAKE_OPTIONS = foreign 1.10 ACLOCAL_AMFLAGS = -I m4 MAINTAINERCLEANFILES = \ config.log config.status \ $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 $(srcdir)/compile \ $(srcdir)/config.guess $(srcdir)/config.sub \ $(srcdir)/m4/ltsugar.m4 $(srcdir)/m4/libtool.m4 \ $(srcdir)/m4/ltversion.m4 $(srcdir)/m4/lt~obsolete.m4 \ $(srcdir)/m4/ltoptions.m4 \ $(srcdir)/packaged EXTRA_DIST = svnignore SUBDIRS = etc macos src doc dist_noinst_SCRIPTS = bootstrap dist_noinst_DATA = LGPL-2.1 TODO \ solaris/Makefile.client solaris/Makefile.server solaris/README \ solaris/checkinstall.in solaris/devices-openct-fabric.xml-dist \ solaris/openct-fabric-dist solaris/openct-hotplug-dist \ solaris/openct.conf-dist solaris/pkginfo.in solaris/postinstall \ solaris/preremove solaris/proto dist_doc_DATA = NEWS all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_docDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_docDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-dist_docDATA # Allow detection of packaged tarball dist-hook: echo > "$(distdir)/packaged" # 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: openct-0.6.20/doc/0000777000175000017500000000000011336457577010663 500000000000000openct-0.6.20/doc/doxygen-footer.html0000644000175000017500000000036511043042742014415 00000000000000
libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
openct-0.6.20/doc/opensc-logo.gif0000644000175000017500000001106711043042742013473 00000000000000GIF89a2XKJL (+4cba $j̱5 14fr!ȩQȴQ˔{z{3賀uZ'4ɴ#zx$f$ӵ77btF cֵ naHR1Dpm+a  CsJ ZoDON"ǭ<@( Љ@!?, j AqŖ ,1\"d8mlE):Pc ]@GCpC] i!1`@8K\r@xhVB!ad8+㎳yCP05L矟nyӄY$yhD6`s r|:B T(|F{9K:5DW>Bw+qol5 ,t?(a^ } Q}Vmf \8:D¼!B0>@ڃ,H؂1$vb=? S@I& r\ے^iC>ew9h1K SC$'j@m@e7 |P{\uJ,  3)9x@kpi4! T 9!SwTxM~6hP&,{lZ, 2T5i ]@ψ08L&Z(9*Jf}bkkR > tc YS-^{JT@{:B#@w@-F!:(lʤ{@*hRpo1 ,:2YyF <[ C._k -0؆/;o@@@хbUmr%@ZFXh0,[L)Y1$jPq|M 䍁`ي+m #1+vSk7>r("+g=|yW tpAh='>*IG - 8dA(Bun.If@)7f1 >ax#|*L Ĉid"y P@tQ15ӅfTꕿ՚! $Z14=eu:@&>Jxķ.;3OYO O4D^A8yv$\ uŤ)M0+6Fp Dqh5@A}f VЬG &n P?p^j9C>5@ȼ1V_6rusj r & OHz0Xb0huMV+ /xk0J}NyA X#YKd^B  @s?rѤPa >9c}u]{W|~|]p8r Mx xחsGFYogofY4T YG.k~Uwk ) />ZAA[Q$l 2$2+  s6|G^#3w|۰ PBDp BPdSi}'jއDjUyL%Ё2~5iӳKat:O Ar`:575ME*4(>h0  ~Cw1cŗ(-R)" @V[4dtJ%R3)H@@ U5h2A 2 jC6 Wt0 Bb{} ۠0dQ Z  _@0 ezY0U PrZ YpTpꇋD4?`#˰4>76l !b:#nP0g0m0 p f0o a/< wp~4yySJH2vH%*)0 ԀJAIzv+W@ 2ʁY9pŦ w:Peh+ B?)P1x4S|| F1ay7U`UAV0jZG0  R3@%`*v Fn/ )ޢrp P#&L$-HaЂGG$J'^#| pyfZ@_ki_Dp( PYR$8~f(uy'( Jya۷\7^񁁥hCA| IPpm 빟뷰qL"Ycƺ;&# ̀]{⸽,KP 8W ©[u8 k(;openct-0.6.20/doc/nonpersistent/0000777000175000017500000000000011336457577013576 500000000000000openct-0.6.20/doc/nonpersistent/export-wiki.sh0000755000175000017500000000363011044332001016277 00000000000000#!/bin/sh set -e test -z "$XSLTPROC" && XSLTPROC="xsltproc" test -z "$WGET" && WGET="wget" test -z "$WGET_OPTS" && WGET_OPTS="$WGET_OPTS" test -z "$SED" && SED="sed" test -z "$TR" && TR="tr" test -z "$SERVER" && SERVER="http://www.opensc-project.org" test -z "$PROJECT" && PROJECT="opensc" SRCDIR=. OUTDIR=. test -n "$1" && SRCDIR="$1" test -n "$2" && OUTDIR="$2" WIKI="$PROJECT/wiki" XSL="$SRCDIR/export-wiki.xsl" test -f "$SRCDIR"/`basename $0` test -e "$OUTDIR" && rm -fr "$OUTDIR" mkdir "$OUTDIR" || exit 1 $WGET $WGET_OPTS $SERVER/$WIKI/TitleIndex -O "$OUTDIR"/TitleIndex.tmp $SED -e "s##\n#g" < "$OUTDIR"/TitleIndex.tmp \ | grep "\"/$WIKI/[^\"]*\"" \ |$SED -e "s#.*\"/$WIKI/\([^\"]*\)\".*#\1#g" \ > "$OUTDIR"/WikiWords.tmp $SED -e /^Trac/d -e /^Wiki/d -e /^TitleIndex/d -e /^RecentChanges/d \ -e /^CamelCase/d -e /^SandBox/d -e /^InterMapTxt/d -e /^InterWiki/d \ -e /^InterTrac/d -i "$OUTDIR"/WikiWords.tmp for A in WikiStart `cat "$OUTDIR"/WikiWords.tmp` do F=`echo $A|$SED -e 's/\//_/g'` $WGET $WGET_OPTS $SERVER/$WIKI/$A -O "$OUTDIR"/$F.tmp $XSLTPROC --nonet --output "$OUTDIR"/$F.html "$XSL" "$OUTDIR"/$F.tmp $SED -e "s# api.out. Try to fix this. 2010-01-21 10:38 s * trunk/NEWS: update on NEWS 2010-01-21 10:28 s * trunk/src/ifd/ifd-rutoken.c: fix: Le (APDU_CASE_2S) for get_do_info in accordance with Windows driver 2010-01-07 09:53 aj * trunk/configure.ac: trunk is now pre-0.6.20 2010-01-07 09:52 aj * trunk/NEWS, trunk/configure.ac, trunk/etc/openct.udev.in: create new release. 2009-11-25 16:36 aj * trunk/NEWS, trunk/etc/openct.udev.in, trunk/etc/openct_usb.in: latest udev rules, thanks to the ubuntu developers. 2009-11-24 15:49 s * trunk/src/ifd/ifd-rutoken.c: Modify Rutoken S binary interfaces by Aktiv Co. (accordance with http://www.opensc-project.org/opensc/changeset/3865) (Rutoken S+OpenCT+PCSC-Lite+rdesktop works now) 2009-11-09 11:58 s * trunk/etc/Info.plist, trunk/etc/openct.conf.in, trunk/etc/openct.fdi, trunk/etc/openct.udev.in, trunk/etc/openct.usermap: add uaToken S 2009-11-04 15:45 aj * trunk/src/ifd/atr.c: Enable cards without TDx entries to work - e.g. RSA SecureID 800. Patch by Andrey Jivsov 2009-09-25 07:50 aj * trunk/NEWS, trunk/configure.ac: trunk is now pre 0.6.19 2009-09-25 07:49 aj * trunk/NEWS, trunk/configure.ac: new release 0.6.18 2009-09-24 14:53 s * trunk/etc/Info.plist: corrected Info.plist according to openct.conf 2009-09-24 13:40 s * trunk/etc/Info.plist: add the ID for Rutoken S and Rutoken ECP to Info.plist 2009-08-27 09:51 aj * trunk/src/ifd/sys-bsd.c: abort if retries reach 0 or something other than EIO was returned. 2009-08-18 08:38 aj * trunk/NEWS, trunk/etc/openct.fdi, trunk/etc/openct.udev.modalias.in: Add support for Rutoken S by Aktiv Co. / Aleksey Samsonov 2009-08-18 08:21 aj * trunk/NEWS, trunk/src/ifd/sys-bsd.c: Apply fix by Emmanuel Dreyfus (Enhanced to limit the loop to 5 tries) 2009-07-29 06:59 aj * trunk/configure.ac: trunk is now post-release. 2009-07-29 06:58 aj * trunk/NEWS, trunk/configure.ac: Prepare new release. 2009-07-22 12:21 aj * trunk/src/ifd/sys-linux.c: Aktiv Co./Aleksey Samsonov: corrected comment in src/ifd/sys-linux.c 2009-07-16 13:32 ludovic.rousseau * trunk/etc/openct.conf.in: add support for Aktiv Rutoken ECP using the CCID driver Thanks to Aleksey Samsonov for the patch http://www.opensc-project.org/pipermail/opensc-devel/2009-July/012315.html 2009-07-16 11:55 ludovic.rousseau * trunk/src/ifd/ifd-ccid.c: ccid_open_usb(): do not complain if card initialization features are missing for an ICCD device Thanks to Aleksey Samsonov for the patch http://www.opensc-project.org/pipermail/opensc-devel/2009-July/012313.html 2009-05-29 12:29 alonbl * trunk/configure.ac, trunk/doc/Makefile.am: Make build work again after last api-doc change. 2009-05-16 18:24 alonbl * trunk/src/ifd/internal.h: Fix implicit declarations in OpenCT by Arfrever Frehtes Taifersar Arahesis. I'm attaching the patch which fixes the following compiler warnings in OpenCT: ifdhandler.c: In function ‘ifdhandler_error’: ifdhandler.c:299: warning: implicit declaration of function ‘ifd_error’ ifdhandler.c: In function ‘ifdhandler_event’: ifdhandler.c:313: warning: implicit declaration of function ‘ifd_event’ 2009-05-04 11:23 aj * trunk/NEWS, trunk/configure.ac: prepare new release. * trunk/src/ifd/ifd-rutoken.c: Change debug level in rutoken to 6. 2009-04-29 09:31 aj * trunk/doc/Makefile.am: fix api doc generation / including it in the tar.gz distribution in generated form (copied from wiki code). 2009-04-29 07:54 aj * trunk/etc/init-script.in: merge changes from debian. 2009-04-14 15:47 aj * trunk/etc/openct.hald.in: comment out owner, group and permission changes for now. 2009-04-14 15:44 aj * trunk/etc/openct.hald.in: Stanislav Brabec: - Uses HAL_PROP_SMART_CARD_READER_DEVICE_FILE defined in FDI patches above instead of guessing the device node name. - Restricts access to the group. Requires a change in Makefiles to replace @USER@ and @GROUP@ - Removes deprecated access to /proc/bus/usb. 2009-04-14 15:42 aj * trunk/etc/openct.fdi: enhance fdi (got something wrong while manualy applying changed) 2009-04-14 15:38 aj * trunk/etc/Makefile.am, trunk/etc/openct-disable.fdi: add example file that can be used to disable openct. 2009-04-14 15:37 aj * trunk/etc/Makefile.am, trunk/etc/openct-policy.fdi, trunk/openct-policy.fdi: oops,wrong directory. add to makefile. 2009-04-14 15:34 aj * trunk/openct-policy.fdi: Stanislav Brabec: split selector and policy, this new file contains the new policy rule. 2009-04-14 15:33 aj * trunk/etc/openct.fdi: Stanislav Brabec:Defines a common rule. 2009-04-14 15:31 aj * trunk/etc/openct.fdi: Stanislav Brabec: Simplification of rules: Define one key, then define everything else only once. 2009-04-14 15:28 aj * trunk/etc/openct.fdi: Stanislav Brabec: Defines a rule matching all CCID readers. 2009-04-14 15:26 aj * trunk/etc/openct.fdi: Stanislav Brabec: Fixes syntax for the new HAL. 2009-04-02 16:45 alonbl * trunk/src/ct/status.c: Fix openst status lock By Stanislav Brabec. 2009-03-30 17:39 alonbl * trunk/configure.ac, trunk/src/ifd/sys-bsd.c: FreeBSD patches with libusb support By Andrew Thompson. http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011997.html --- Hi, Here is a patch to add libusb support to ifd/sys-bsd.c, this will be needed for FreeBSD 8.0 onwards. I have verified with unifdef that the source is unchanged when ENABLE_LIBUSB isnt defined. http://people.freebsd.org/~thompsa/patch-src_ifd_sys-bsd.c cheers, Andrew 2009-02-11 21:03 alonbl * trunk/src/ifd/device.c, trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-etoken64.c, trunk/src/ifd/ifd-rutoken.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/internal.h, trunk/src/ifd/reader.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-osx.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/ifd/usb.c, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h: Allow driver to specify events to poll 2009-02-06 13:32 ludovic.rousseau * trunk/src/ifd/ifd-ccid.c: give priority to pcsc-lite for CCID devices 2009-02-04 19:38 alonbl * trunk/src/ifd/usb-descriptors.c: Revert r942, reopen bug #15 http://www.opensc-project.org/pipermail/opensc-devel/2009-February/011781.html 2009-02-03 06:54 alonbl * trunk/src/ifd/ifd-ccid.c: Cleanup suggested by Andrey Jivsov 2009-02-02 18:49 alonbl * trunk/etc/openct.conf.in: USB fix went into stable 2009-02-02 18:48 alonbl * trunk/etc/openct.conf.in, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/pcmcia.c: Revert 1131 2009-02-02 18:31 alonbl * trunk/etc/openct.conf.in, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/pcmcia.c: USB fix went into stable 2009-02-02 09:48 alonbl * trunk/configure.ac: Fix type, thanks to Aktiv Co. Aleksey Samsonov 2009-01-29 22:51 alonbl * trunk/src/ifd/ifd-ccid.c: Fix for O2 Micro CCID SC Reader Buggy O2 Micro CCID SC Reader has zero extra len at interface level but not endpoint descriptor. Patch the interface level field and proceed. ProdID 7762 reader is in Dell Latitude D620 and 7772 is in D630. By Andrey Jivsov http://www.opensc-project.org/pipermail/opensc-devel/2009-January/011745.html 2009-01-29 15:10 alonbl * trunk/src/ifd/ifd-rutoken.c: Rutoken now support event interface, by Aktiv Co. Aleksey Samsonov 2009-01-26 13:54 ludovic.rousseau * trunk/src/ifd/proto-t1.c: use #defined named NAD, PCB, LEN and DATA instead of hard coded numbers 2009-01-26 10:51 ludovic.rousseau * trunk/src/ifd/internal.h: ifd_driver_register() and ifd_driver_get() are already declared in include/openct/driver.h internal.h:148: warning: redundant redeclaration of 'ifd_driver_register' ../../src/include/openct/driver.h:378: warning: previous declaration of 'ifd_driver_register' was here internal.h:149: warning: redundant redeclaration of 'ifd_driver_get' ../../src/include/openct/driver.h:379: warning: previous declaration of 'ifd_driver_get' was here 2009-01-26 10:45 ludovic.rousseau * trunk/src/include/openct/server.h: define ct_mainloop_leave() arguments 2009-01-23 08:39 alonbl * trunk/configure.ac: Use ( instead of { to be make friendly 2009-01-22 14:22 alonbl * trunk/configure.ac: Finally remove eval stuff from autoconf 2009-01-21 17:29 alonbl * trunk/configure.ac: Fix default ifdhandler path 2009-01-21 06:03 alonbl * trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-etoken64.c: Remove warnings, thanks to Ludovic 2009-01-19 13:41 alonbl * trunk/configure.ac: Add PACKAGE_SUFFIX 2009-01-03 11:54 alonbl * trunk/NEWS: Update news 2009-01-03 11:36 alonbl * trunk/src/ifd/ifd-etoken64.c: Modify etoken64 driver to use the event interface 2009-01-03 11:35 alonbl * trunk/src/ifd/ifd-etoken.c: Modify etoken driver to use the event interface * trunk/src/ifd/ifd-ccid.c: Modify ccid driver to use the event interface * trunk/etc/openct.conf.in, trunk/src/ct/mainloop.c, trunk/src/ifd/device.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/internal.h, trunk/src/ifd/process.c, trunk/src/ifd/reader.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-osx.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/socket.h: Support event mode for drivers Current implementation forces poll loop every one second or so, this consume CPU and power. This changeset adds the ability for a driver to provide file descriptor for event handling, removing the need to poll. Only Linux USB interface was modified to use this new interface. All other environments will fall-back into the poll mode. New driver methods: before_command Executed before command, makes it easy to remove event capture. after_command Execute after command, makes it easy to add event capture. get_eventfd Get an event fd out of the driver, if unsupported -1 should be returned, this fall-back into the poll mode. event Event method to call with th evntfd is signaled. before_command Execute whatever needed before executing a command. Useful if driver need to turn off event capture. after_command Execute whatever needed before blocking. Useful if driver need to turn on event capture. New device methods: get_eventfd Gets eventfd if available. New USB methods: ifd_usb_get_eventfd Get event fd to poll for events. ifd_usb_capture_event None blocking capture. New CT socket methods: error Called with POLLERR is received. New configuration file options: force_poll Force polling, default is true (as correct behavior), until Linux kernel will resolve its issues. New command-line options: ifdhandler -p Force polling. Linux specific notes: This enable safe detection of device removal and allow USB drivers to stop polling device, even if they do not have interrupt interface. As OpenCT uses /dev/bus/usb namespace if exists, and this feature worked only on usbfs prior to linux-2.6.28, it will not work with older kernels. linux-2.6.28 has a bug that cause the signal not to be sent if kernel is configured without CONFIG_USB_DEVICEFS, see [1]. linux-2.6.29 is expected to solve this issue. Even if ccid driver works correctly, as it uses interrupt endpoint, by default polling will be forced. [1] http://marc.info/?t=123075926900001&r=1&w=2 M src/ifd/ifdhandler.c M src/ifd/utils.c M src/ifd/process.c M src/ifd/sys-osx.c M src/ifd/sys-null.c M src/ifd/device.c M src/ifd/internal.h M src/ifd/usb.c M src/ifd/reader.c M src/ifd/sys-linux.c M src/ifd/sys-bsd.c M src/ifd/sys-solaris.c M src/ifd/sys-sunray.c M src/include/openct/driver.h M src/include/openct/device.h M src/include/openct/ifd.h M src/include/openct/socket.h M src/ct/mainloop.c M etc/openct.conf.in 2009-01-03 11:11 alonbl * trunk/src/ifd/ifd-ccid.c: Handle no card error from get slot status * trunk/src/ifd/ifd-ccid.c: Avoid changing the altsetting if there is only one In this state it somewhat safe to skip. If altsetting is changed the ifdhandler cannot communicate with the reader next time it executes unless usb reset is issued. By Chaskiel Grundman. 2009-01-03 11:08 alonbl * trunk/src/ifd/ifd-ccid.c: Some more debug info * trunk/src/ifd/sys-linux.c: Reduce warnings 2009-01-02 14:00 alonbl * trunk/etc/openct.udev.in: Do not execute ifdhandler more than one time (udev) udev adds usb device and usb interfaces, for devices that are detected by vendor and product, run the openct_usb only for the device. 2009-01-01 21:11 alonbl * trunk/doc/Makefile.am: Remove space 2009-01-01 21:06 alonbl * trunk/doc/Makefile.am, trunk/doc/nonpersistent/Makefile.am: Fix doc build issues 1. VPATH issue. 2. Parallel build issue, suggested by Ludovic Rousseau. 2008-12-31 20:37 alonbl * trunk/src/ifd/ifd-rutoken.c: Remove newlines from debug at rutoken 2008-12-23 19:54 alonbl * trunk/etc/openct_usb.in: Support newest udev 2008-12-19 20:45 alonbl * trunk/src/ifd/ifd-cyberjack.c: Fix memory leak in OpenCT/src/ifd/ifd-cyberjack.c By Ludovic Rousseau with some modifications. http://www.opensc-project.org/pipermail/opensc-devel/2008-December/011502.html 2008-12-18 19:36 alonbl * trunk/src/ifd/proto-t1.c: Fix T1 abort handling Copy fix from rousseau's ccid driver. http://svn.debian.org/viewsvn/pcsclite/trunk/Drivers/ccid/src/openct/proto-t1.c?rev=2916&r1=2152&r2=2916 2008-11-21 11:29 martin * trunk/src/ifd/ifd-epass3k.c: Comment format change 2008-11-21 11:26 martin * trunk/etc/openct.conf.in, trunk/etc/openct.fdi, trunk/etc/openct.udev.in, trunk/etc/openct.udev.modalias.in, trunk/etc/openct.usermap, trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-epass3k.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: ePass3000 driver by EnterSafe 2008-09-30 22:38 alonbl * trunk/etc/openct_usb.mdev.in: Properly handle kernel without usb filesystem at all 2008-09-20 15:41 alonbl * trunk/configure.ac: Handle svn checkout detection correctly when srcdir is different 2008-09-20 15:38 alonbl * trunk/Makefile.am, trunk/configure.ac: Revert last changes 2008-09-20 14:38 aj * trunk/Makefile.am, trunk/configure.ac: fix packaged detection logic. 2008-09-20 14:16 aj * trunk/Makefile.am: hmm, maybe this works better? 2008-09-20 14:12 aj * trunk/Makefile.am: trying to include pakcaged file in EXTRA_DIST - maybe this fixes the logic? 2008-09-19 06:52 alonbl * trunk/doc/nonpersistent/Makefile.am: Don't remove external files on distclean 2008-08-11 12:46 ludovic.rousseau * trunk/src/tools/openct-control.c: mgr_shutdown(): do not return an error code if shutdown fails because of a non existant status file (because openct was not running for example) Closes Debian bug #494385 "prerm doesn't work if openct isn't running" 2008-08-09 17:19 aj * trunk/etc/openct.fdi, trunk/etc/openct.udev.in, trunk/etc/openct.udev.modalias.in, trunk/etc/openct.usermap: is it 04e6:0003 or 04e6:e003? to be on the safe side: list both. bug 256055 in launchpad. 2008-07-31 12:43 aj * trunk/doc/nonpersistent/export-wiki.sh: update export script. 2008-07-31 11:58 aj * trunk/configure.ac: update configure verison. 2008-07-31 11:56 aj * trunk/NEWS: Update NEWS file. 2008-07-30 14:05 alonbl * trunk/NEWS: Update NEWS 2008-07-21 14:37 aj * trunk/src/ifd/ifd-eutron.c: Chaskiel Grundman: This uncovered an issue in openct. namely, that eutron_recv doesn't wait long enough. (my device sent a wtx request after 23 loops, but we abort after 20). Also, eutron_recv returns short writes to its caller, even though t1_xcv cannot deal with that at all. This patch fixes those things, as well as changes a memcpy of overlapping memory areas to a memmove. 2008-07-14 20:12 aj * trunk/etc/Info.plist, trunk/etc/openct.conf.in, trunk/etc/openct.fdi, trunk/etc/openct.udev.in, trunk/etc/openct.udev.modalias.in, trunk/etc/openct.usermap: Add two readers reported by Johannes Deisenhofer. 2008-07-10 18:54 aj * trunk/etc/openct.udev.modalias.in: Vasiliy Nechaev found this bug: the string must end with an asterisk. 2008-06-11 10:14 alonbl * trunk/configure.ac: Detect libtool-1 or libtool-2 at runtime 2008-06-09 08:32 alonbl * trunk/Makefile.am: More aclocal->m4 2008-06-09 08:31 alonbl * trunk/Makefile.am: More aclocal->m4 2008-06-09 07:37 alonbl * trunk/configure.ac: Turn on GNU extensions for ct_socket_getcreds::SO_PEERCRED, bug #30, thanks to vapier 2008-06-05 20:33 alonbl * trunk/configure.ac: OpenCT will never run on Windows... 2008-06-05 20:17 alonbl * trunk/m4/acx_pthread.m4, trunk/m4/lib-ld.m4, trunk/m4/lib-link.m4, trunk/m4/lib-prefix.m4: Remove m4 files that are not used * trunk/Makefile.am, trunk/configure.ac, trunk/m4/Makefile.am: Prepare for libtool-2 2008-06-05 19:56 alonbl * trunk/Makefile.am, trunk/aclocal, trunk/configure.ac, trunk/m4: Rename aclocal->m4 to be more standard 2008-05-29 08:01 alonbl * trunk/etc/Makefile.am: openct.udev.compat is not generated Thanks to David Imhoff 2008-05-29 07:56 alonbl * trunk/configure.ac: Warn about missing libusb only in Linux By David Imhoff 2008-05-22 13:27 alonbl * trunk/src/ct/libopenct.pc.in: Cleanup pkg-config file 2008-05-22 13:07 alonbl * trunk/src/ifd/sys-bsd.c: Fix OpenBSD issues. fixes sys-bsd.c to use the correct device filenames on OpenBSD. An earlier patch already fixed this for the control endpoint, but this caused the other endpoints to be accessed under '/dev/ugenX.00.E'. This patch causes the correct filenames to be used for all endpoints. Also, Fix BSD support of USB devices. By David Imhoff and Hasso Tepper. 2008-05-17 19:51 alonbl * trunk/etc/Makefile.am: Cleanup etc/Makefile.am 2008-05-17 18:45 alonbl * trunk/NEWS, trunk/etc/Makefile.am, trunk/etc/openct.udev.compat, trunk/etc/openct.udev.in, trunk/etc/openct.udev.modalias.in: Move out compatibility udev rule into its own rule, update NEWS to alert packagers 2008-05-17 07:51 alonbl * trunk/src/ifd/sys-linux.c: Support linux mini-coldplug by CCID interface class 2008-05-17 06:46 alonbl * trunk/etc/init-script.in, trunk/src/ct/status.c, trunk/src/include/openct/openct.h, trunk/src/tools/openct-control.c: Delete status on shutdown 2008-05-14 18:09 alonbl * trunk/configure.ac: Fixup configure help strings 2008-05-14 18:04 alonbl * trunk/configure.ac: Relax libusb warning 2008-05-14 18:02 alonbl * trunk/configure.ac, trunk/etc/Makefile.am, trunk/etc/openct.conf.in: Add --enable-non-privileged, --with-daemon-user, --with-daemon-groups to ease packagers. 2008-05-14 16:47 alonbl * trunk/configure.ac, trunk/etc/Makefile.am, trunk/etc/init-script.in, trunk/etc/openct.conf.in, trunk/etc/openct.hald.in, trunk/etc/openct.udev, trunk/etc/openct.udev.in, trunk/etc/openct.udev.modalias, trunk/etc/openct.udev.modalias.in, trunk/etc/openct_pcmcia.in, trunk/etc/openct_serial.in, trunk/etc/openct_usb.in, trunk/etc/openct_usb.mdev.in, trunk/etc/reader.conf.in: Fixup etc substitutions 2008-05-14 15:22 alonbl * trunk/etc/openct.conf.in, trunk/src/ct/status.c, trunk/src/ifd/init.c, trunk/src/ifd/utils.c, trunk/src/include/openct/openct.h, trunk/src/tools/openct-control.c: Non privileged operation As OpenCT is a security component, it best to use least privileged mode, and udev allows this now. The attached patch allows users to run the ifdhandler as none root user. The configuration file was modified, not the ifdhandler is a node in the following format: # # Path to ifdhandler ifdhandler { program = SBINDIR/ifdhandler; # user = openctd; # groups = { # usb, # }; }; I believe this place is correct, but if people want to keep backward compatibility I guess this can be splitted, and keep current ifdhandler key. The openct-control running from init.d script or udev rule script will fork the ifdhandler using the specified user and set the context to the specified groups. There may be more than one group as there are more than one device type. It also set the /var/run/openct/status owner to the specified user. M src/tools/openct-control.c M src/ifd/utils.c M src/ifd/init.c M src/include/openct/openct.h M src/ct/status.c M etc/openct.conf.in 2008-05-11 10:48 alonbl * trunk/etc/Makefile.am: Install openct configuration, don't distribute generated files 2008-05-08 07:14 alonbl * trunk/src/ifd/ifd-ccid.c: Opps, BCD->hex 2008-05-07 22:01 alonbl * trunk/etc/openct_usb.mdev.in, trunk/src/ifd/sys-linux.c: Linux - Allow minimal usb coldplug using sysfs Drop libusb requirement for most of cases. Scan one level of /sys/bus/usb/devices, search for valid and known usb devices. 2008-05-07 19:46 alonbl * trunk/etc/openct.conf.in: Add ASEKey CCID support 2008-05-07 19:45 alonbl * trunk/src/ifd/ifd-ccid.c: Support CCID 1.10 and fix pts and parameter setting in the proper order By: Chaskiel Grundman I have apparently been sitting on a patch that does pts and parameter setting in the proper order for most of a year. (the problem you have seems to be that the existing code changes the baud rate before doing pts, so the card responds at the old baud rate) I do not know why I did not submit this patch earlier. I do know that I have not really tested it recently 2008-05-07 19:10 alonbl * trunk/etc/Makefile.am: Trivial clean 2008-05-07 19:09 alonbl * trunk/etc/Makefile.am, trunk/etc/openct_usb.mdev.in: Add mdev support script 2008-04-25 13:05 alonbl * trunk/configure.ac: Remove duplicate doc 2008-04-25 12:22 alonbl * trunk/src/ct/status.c: Fixup SEGV, by Aktiv Co. Aleksey Samsonov 2008-04-20 12:54 ludovic.rousseau * trunk/src/tools/openct-control.c: typo in comment: devide -> device 2008-04-18 20:39 alonbl * trunk/bootstrap: Add --force to autoreconf 2008-04-17 10:58 alonbl * trunk/src/ifd/ifd-ccid.c: Print better message for unknown ccid, including missing version element 2008-04-04 22:28 alonbl * trunk, trunk/Makefile.am, trunk/aclocal, trunk/aclocal/Makefile.am, trunk/aclocal/ac_compile_check_sizeof.m4, trunk/aclocal/ac_create_stdint_h.m4, trunk/aclocal/pkg.m4, trunk/configure.ac, trunk/doc, trunk/doc/Makefile.am, trunk/doc/changelog.sh, trunk/doc/doxygen-footer.html, trunk/doc/doxygen.conf.in, trunk/doc/export-wiki.sh, trunk/doc/export-wiki.xsl, trunk/doc/generate-api.sh, trunk/doc/nonpersistent, trunk/doc/nonpersistent/Makefile.am, trunk/doc/nonpersistent/export-wiki.sh, trunk/doc/nonpersistent/export-wiki.xsl, trunk/doc/nonpersistent/svn2cl.xsl, trunk/doc/opensc-logo.gif, trunk/doc/svn2cl.xsl, trunk/etc, trunk/etc/Makefile.am, trunk/macos, trunk/macos/Makefile.am, trunk/solaris, trunk/src, trunk/src/Makefile.am, trunk/src/ct, trunk/src/ct/Makefile.am, trunk/src/ctapi, trunk/src/ctapi/Makefile.am, trunk/src/ifd, trunk/src/ifd/Makefile.am, trunk/src/ifd/atr.c, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-pertosmart1030.c, trunk/src/ifd/ifd-pertosmart1038.c, trunk/src/ifd/ifd-rutoken.c, trunk/src/ifd/sys-linux.c, trunk/src/include, trunk/src/include/Makefile.am, trunk/src/include/openct, trunk/src/include/openct/Makefile.am, trunk/src/pcsc, trunk/src/pcsc/Makefile.am, trunk/src/tools, trunk/src/tools/Makefile.am, trunk/svnignore: New build system Sync with other projects. merge -r 1014:1027 https://www.opensc-project.org/svn/openct/branches/alonbl/build _M . _M macos M macos/Makefile.am M configure.ac _M doc D doc/changelog.sh M doc/doxygen.conf.in D doc/export-wiki.xsl M doc/Makefile.am A doc/opensc-logo.gif D doc/generate-api.sh D doc/export-wiki.sh AM doc/nonpersistent A doc/nonpersistent/export-wiki.xsl A doc/nonpersistent/Makefile.am A doc/nonpersistent/export-wiki.sh A doc/nonpersistent/svn2cl.xsl D doc/svn2cl.xsl A doc/doxygen-footer.html _M src _M src/ctapi M src/ctapi/Makefile.am _M src/tools M src/tools/Makefile.am _M src/ifd M src/ifd/ifd-cm4000.c M src/ifd/atr.c M src/ifd/ifd-pertosmart1030.c M src/ifd/ifd-pertosmart1038.c M src/ifd/ifd-rutoken.c M src/ifd/sys-linux.c M src/ifd/Makefile.am _M src/include _M src/include/openct M src/include/openct/Makefile.am M src/include/Makefile.am _M src/ct M src/ct/Makefile.am _M src/pcsc M src/pcsc/Makefile.am M src/Makefile.am M Makefile.am A svnignore _M etc M etc/Makefile.am _M solaris _M aclocal D aclocal/pkg.m4 M aclocal/ac_create_stdint_h.m4 D aclocal/ac_compile_check_sizeof.m4 M aclocal/Makefile.am 2008-03-15 20:18 ludovic.rousseau * trunk/src/ifd/sys-osx.c: change prototype of ifd_sysdep_usb_reset() to reflect its definition from src/ifd/internal.h 2008-01-10 08:35 ludovic.rousseau * trunk/src/ifd/ifd-rutoken.c: new patch for ruToken support from Andrew V. Stepanov http://www.opensc-project.org/pipermail/opensc-devel/2008-January/010648.html 2008-01-03 09:21 ludovic.rousseau * trunk/configure.ac, trunk/src/ifd/Makefile.am: do not use AC_LIB_LINKFLAGS() since this macro is provided by gettext and we do not use gettext. Use AC_CHECK_LIB() instead 2007-12-17 13:29 ludovic.rousseau * trunk/src/ifd/ifd-rutoken.c: the entire file was duplicated 2007-12-17 13:14 ludovic.rousseau * trunk/etc/openct.conf.in, trunk/etc/openct.udev, trunk/etc/openct.usermap, trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-rutoken.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: add support of ruToken Thanks to Andrew V. Stepanov http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html 2007-12-07 09:58 ludovic.rousseau * trunk/etc/openct.conf.in, trunk/etc/openct.udev, trunk/etc/openct.usermap, trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-cyberjack.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: add cyberJack driver with pinpad support thanks to Andrey Jivsov for the patch http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010610.html 2007-09-27 15:00 aj * trunk/etc/openct.conf.in: Add cardman 5321 reader - patch by grer zen. 2007-08-30 18:18 aj * trunk/configure.ac: trunk is now post 0.6.14. 2007-08-30 18:17 aj * trunk/NEWS, trunk/configure.ac: create new version openct 0.6.14. 2007-08-27 08:38 aj * trunk/etc/openct_usb.in: fixed typo ("-u" instead of "-z") and other improvements by Kay Sievers. 2007-08-23 20:13 aj * trunk/configure.ac: trunk is now post 0.6.13. 2007-08-23 20:12 aj * trunk/NEWS: Document many provements we did in 0.6.13. 2007-08-23 07:09 aj * trunk/etc/openct.fdi, trunk/etc/openct.hald.in: update hal configuration and addon script. 2007-08-22 08:20 aj * trunk/etc/openct.udev, trunk/etc/openct.udev.modalias, trunk/etc/openct_usb.in: commit changes so this code works without CONFIG_USB_DEVICEFS. 2007-08-22 07:17 aj * trunk/etc/Makefile.am, trunk/etc/openct.fdi: add fdi file for hal. 2007-08-21 09:26 aj * trunk/NEWS: document latest changes. 2007-08-21 09:22 aj * trunk/etc/openct_usb.in: fix typo. 2007-08-21 09:04 aj * trunk/etc/openct_usb.in: simply PRODUCT regeneration. 2007-08-21 08:53 aj * trunk/etc/openct_usb.in: fix missing quotes. 2007-08-21 07:06 aj * trunk/etc/openct_usb.in: reconstruct PRODUCT from MODALIAS setting. 2007-08-21 07:01 aj * trunk/NEWS, trunk/etc/openct.conf.in, trunk/etc/openct.udev, trunk/etc/openct.udev.modalias, trunk/etc/openct.usermap, trunk/src/ifd/Makefile.am, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: disable wbeiuu driver - not working yet, but kernel alternative works with phoenix driver. 2007-08-21 06:55 aj * trunk/etc/openct.udev.modalias: fix modalias rules. 2007-07-11 14:45 aj * trunk/configure.ac: trunk is now after 0.6.12. 2007-07-11 14:44 aj * trunk/NEWS: needed one more day. 2007-07-10 15:33 aj * trunk/etc/openct_usb.in: fix udev script. 2007-07-10 14:45 aj * trunk/etc/openct_usb.in: - add flexible loop to wait for device. - the loop must run in the background, otherwise udev will not create the device till the loop timed out. 2007-07-10 13:02 aj * trunk/NEWS: document latest changes. 2007-07-10 13:01 aj * trunk/doc/export-wiki.sh: update wiki export script 2007-07-10 08:27 aj * trunk/etc/Makefile.am, trunk/etc/openct.udev.modalias: add new udev rules file based on MODALIAS match for usb devices. 2007-07-09 09:31 aj * trunk/etc/openct.udev: document the sad compatiblity situation. 2007-07-04 06:42 aj * trunk/NEWS: target saturday for release. 2007-07-03 14:31 aj * trunk/configure.ac: prepare for next version. 2007-07-02 09:18 aj * trunk/NEWS: document recent changes to openct. 2007-06-29 12:28 aj * trunk/src/ifd/process.c: ct_tlv_get_int needs an unsigned int pointer as argument. closes gentoo bug https://bugs.gentoo.org/show_bug.cgi?id=162427 and out bug 24. 2007-06-29 11:12 aj * trunk/configure.ac: test for bash/ksh/sh not needed according to ticket 27. thanks to kheinz. 2007-06-28 06:07 aj * trunk/etc/openct.udev: use DRIVERS== not DRIVER== to match the whole device chain. 2007-06-26 07:08 aj * trunk/src/ifd/sys-bsd.c: fix drageonflybsd build and include needed header file, both fixes by kheinz. (closes #28). 2007-06-26 07:07 aj * trunk/src/ifd/sys-null.c: fix dragonflybsd build by kheinz (ticket #28). 2007-06-21 10:31 aj * trunk/src/ifd/ifd-ccid.c: silence a warning. 2007-06-21 09:49 aj * trunk/src/ifd/ifd-ccid.c, trunk/src/include/openct/driver.h: source buffer is unchanged, mark const to fit rest of api. 2007-06-21 09:41 aj * trunk/src/ifd/ifd-ccid.c: Chaskiel M Grundman: add ccid char support. * trunk/etc/Info.plist, trunk/etc/openct.conf.in: correct usb id. Chaskiel M Grundman: Lastly, it appears that the usb id was specified incorrectly in etc/Info.plist and etc/openct.conf. b97/7761 is a usb hub. The actual smartcard devices are b97/7762 (according to ccid/readers/Oz776S.txt from pcsc) and b97/7772 (my new machine) 2007-06-21 07:20 aj * trunk/src/ifd/ifd-smph.c: use sleep/usleep instead of udelay (kernel only). 2007-06-06 11:00 aj * trunk/NEWS: document a change. 2007-06-06 10:55 aj * trunk/src/ifd/ifd-smph.c: add delays suggested by Alexej Wassiljew. 2007-05-25 21:11 aj * trunk/src/ifd/atr.c, trunk/src/ifd/conf.c, trunk/src/ifd/ctbcs.c, trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-etoken64.c, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/ifd-ikey2k.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-smartboard.c, trunk/src/ifd/ifd-starkey.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/ifd-wbeiuu.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/pcmcia-block.c, trunk/src/ifd/pcmcia.c, trunk/src/ifd/process.c, trunk/src/ifd/proto-escape.c, trunk/src/ifd/proto-gbp.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/reader.c, trunk/src/ifd/ria-device.c, trunk/src/ifd/ria-server.c, trunk/src/ifd/ria.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/ifd/usb-descriptors.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c: indent changes only. 2007-05-25 21:05 aj * trunk/src/ct/client.c, trunk/src/ct/socket.c, trunk/src/ct/status.c, trunk/src/pcsc/pcsc.c, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: indent changes only. 2007-05-25 21:00 aj * trunk/NEWS: document latest changes. 2007-05-25 20:45 aj * trunk/etc/init-script.in, trunk/etc/openct.udev, trunk/etc/openct_usb.in: try if 100ms delay is enough to avoid race conditions. * trunk/src/ifd/proto-escape.c: add missing file / contactless patch by Harald Welte. 2007-05-25 19:53 aj * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h: add patch by Harald Welte for contactless reader support. 2007-05-25 19:49 aj * trunk/etc/Info.plist, trunk/etc/openct.conf.in: add the ID for SCR3311 to openct.conf and Info.plist by Ville Skytt / https://bugzilla.redhat.com/238962 2007-05-25 12:18 aj * trunk/src/ifd/ria-server.c: add static in both places. 2007-05-25 12:15 aj * trunk/src/ifd/ifd-wbeiuu.c: s/#ifdef 0/#if 0/ 2007-05-25 12:13 aj * trunk/src/ifd/ifdhandler.c: fix typo. * trunk/src/ifd/ifd-wbeiuu.c: #if 0 dead code 2007-05-25 12:12 aj * trunk/src/ifd/ifd-ccid.c: fix 0/NULL situation. 2007-05-25 12:04 aj * trunk/src/ifd/ifd-wbeiuu.c: oops, not dead code. 2007-05-25 12:02 aj * trunk/src/ifd/ifd-acr30u.c, trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/ifd-wbeiuu.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/ria-device.c, trunk/src/ifd/ria-server.c, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: and more static definitions. 2007-05-25 11:52 aj * trunk/src/ifd/ifd-acr30u.c, trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/ifd-etoken64.c, trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-pertosmart1030.c, trunk/src/ifd/ifd-smartboard.c, trunk/src/ifd/ifd-smph.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/ifd-wbeiuu.c, trunk/src/ifd/proto-gbp.c, trunk/src/ifd/proto-sync.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/reader.c, trunk/src/ifd/ria.c, trunk/src/ifd/serial.c, trunk/src/ifd/usb-descriptors.c: work on lots of warnings, mostly things once declared with static and later without. 2007-05-25 11:36 aj * trunk/src/ifd/reader.c: include header file with declaration of this function. 2007-05-25 11:35 aj * trunk/src/ifd/init.c, trunk/src/ifd/manager.c, trunk/src/ifd/process.c: make more functions static. pass void instead of empty parameter list. 2007-05-25 11:33 aj * trunk/src/ifd/ctbcs.c: make function static, not needed outside this scope. 2007-05-25 10:51 aj * trunk/src/ifd/conf.c: fix more warnings / missing static declarations and replace 0/NULL for pointer. 2007-05-25 10:45 aj * trunk/src/ct/path.c, trunk/src/ct/socket.c, trunk/src/ct/status.c: fix more compiler warnings. 2007-05-25 10:42 aj * trunk/src/ct/client.c: kill dead code and fix missing static declaration. 2007-05-25 10:33 aj * trunk/src/ifd/sys-linux.c: first implementation of ccid detection. 2007-05-25 08:40 aj * trunk/src/ifd/usb-descriptors.c: try patch to detect cyberjack readers by Kurt Jaeger (bug #15). 2007-05-25 08:38 aj * trunk/src/ifd/init.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/tools/openct-control.c: add fall back to ccid driver. 2007-05-25 08:25 aj * trunk/etc/Info.plist, trunk/etc/openct.usermap: update other files to latest config. 2007-05-25 08:16 aj * trunk/etc/openct.conf.in, trunk/etc/openct.udev: add aladdin etoken NG, new version. 2007-05-25 08:15 aj * trunk/src/ifd/process.c: that function need a pointer to an unsigned int, not a size_t which might be bigger on amd64. also Bug 24 and gentoo bug 162427. 2007-05-25 08:11 aj * trunk/src/pcsc/Makefile.am, trunk/src/pcsc/ifdhandler.h, trunk/src/pcsc/pcsc.c: Bug: #25 remove our own version of ifdhandler.h and use the pcsc provided one. needs to be tested if this works on all plattforms. Add patch by Ludovic. 2007-03-16 20:50 aj * trunk/etc/openct.udev: improve openct udev rules - fix match, work around fast scheduler (e.g. rsdl). 2007-02-22 08:48 aj * trunk/etc/openct.conf.in: Add omnikey 1021, thanks to Antti Andreimann. 2006-12-19 21:55 aj * trunk/src/ifd/ifd-wbeiuu.c: rename to uint*, which seems to be the normal name in use everywhere else in the code (and does not cause problems on solaris 10). 2006-12-19 21:49 aj * trunk/src/ifd/ifd-cm4000.c: disable driver except on linux. 2006-12-19 21:03 aj * trunk/aclocal/pkg.m4, trunk/src/ifd/ifd-wbeiuu.c: use ascii/utf-8. 2006-12-07 10:51 aj * trunk/src/ifd/ifd-wbeiuu.c: don't compile in an unused funciton (kill warning). 2006-12-07 10:50 aj * trunk/src/ifd/ifd-ikey2k.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/sys-linux.c: index is a function in glibc . use a different name to avoid confusion / shadowing. * trunk/src/ifd/ifd-kaan.c: remove duplicate variable definition. 2006-12-07 10:47 aj * trunk/src/ifd/ifd-ccid.c: defined twice, one is enough. * trunk/src/ifd/ifd-acr30u.c, trunk/src/ifd/ifd-cardman.c: index is a funciton in glibc . lets use a different name to avoid confusion / shadowing. 2006-12-07 10:42 aj * trunk/src/ifd/usb.c: index is a function defined in glibc . lets use a different name to avoid confusion / shadowing. 2006-12-07 10:41 aj * trunk/src/ifd/manager.c: index is a function in glibc . use a different name to avoid confusion / shadowing. 2006-11-23 07:57 aj * trunk/NEWS: fix typo. 2006-11-23 07:28 aj * trunk/NEWS: update news (oops, date was wrong). 2006-11-23 07:27 aj * trunk/src/ifd/pcmcia-block.c, trunk/src/ifd/pcmcia.c: add set_params to pcmia and pcmcia-block to get cm4000/cm4040 to work again. 2006-11-22 21:10 aj * trunk/etc/openct.conf.in: sort usb id's and add 02 micro reader (used in dell notebooks). 2006-11-22 08:17 aj * trunk/NEWS, trunk/configure.ac: create new version. 2006-11-14 09:39 aj * trunk/NEWS: document latest changes. 2006-11-14 09:13 aj * trunk/src/tools/openct-control.c: typedev isn't const of course. 2006-11-14 09:12 aj * trunk/src/ifd/usb.c: remove unused variable. 2006-11-14 09:11 aj * trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-osx.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c: ad mising usb_reset implementtions. unfortunatly solaris and bsd don't know how to do that, I'm told. 2006-11-14 09:10 aj * trunk/src/ifd/sys-linux.c: fix small bug. 2006-11-11 17:02 aj * trunk/NEWS, trunk/configure.ac: update version and NEWS. 2006-11-05 22:47 aj * trunk/NEWS, trunk/src/ifd/internal.h, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c: add usb reset patch by andrey jivsov. 2006-11-05 22:45 aj * trunk/etc/openct.udev: revert SUBSYSTEMS to BUS as most people have a udev that doesn't know about the new name. 2006-11-02 07:56 aj * trunk/src/ifd/ifd-wbeiuu.c: fix from freebsd cvs. 2006-11-02 07:48 aj * trunk/NEWS: document latest changes. 2006-11-02 07:47 aj * trunk/src/ifd/ifd-egate.c: improved reset logic for egate - improvements by Chaskiel, Bugs by Andreas :) 2006-11-02 07:46 aj * trunk/src/ifd/utils.c: include string.h in utils.c (Dann Frazier) * trunk/etc/openct.udev: fix BUS="pcmcia" bug. rename BUS to SUBSYSTEMS (as does udev). 2006-09-24 13:59 aj * trunk/NEWS: and update NEWS. * trunk/src/ifd/sys-bsd.c: fix bsd support, thanks to Markus Schatzl. 2006-09-22 20:53 aj * trunk/NEWS, trunk/etc/Makefile.am: ouch, stupid bug in the Makefile. Thanks to Ville for finding and fixing. 2006-09-20 19:18 aj * trunk/configure.ac: trunk now after 0.6.9 release. 2006-09-20 19:17 aj * trunk/NEWS: document latest news. * trunk/etc/openct.hald.in: convert hald file to new style too. * trunk/etc/openct.conf.in: add comment what this device is. 2006-09-13 07:06 aj * trunk/src/ifd/device.c, trunk/src/ifd/internal.h, trunk/src/ifd/serial.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-osx.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c: remove device guessing and identify code (no longer used / needed / was not ever used anyway). 2006-09-12 23:21 aj * trunk/NEWS, trunk/etc/openct_pcmcia.in, trunk/etc/openct_serial.in, trunk/etc/openct_usb.in, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/reader.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/ifd/utils.c, trunk/src/tools/openct-control.c: cleanup the parameters to ifdhandler and openct-control attach. include type of the device in these parameters. do not drop the type if already known. this change requires the updated hotplug files. 2006-09-12 21:45 aj * trunk/NEWS, trunk/src/ifd/ifd-acr30u.c, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-etoken64.c, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/ifd-ikey2k.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-starkey.c, trunk/src/ifd/ifd-wbeiuu.c, trunk/src/ifd/usb.c: replace global claim_interface with per driver set_parameter call. 2006-09-12 21:44 aj * trunk/etc/Makefile.am: fix typo in makefile. 2006-09-12 16:23 aj * trunk/etc/hotplug.openct.in, trunk/etc/openct_pcmcia.in, trunk/etc/openct_serial.in, trunk/etc/openct_usb.in: new scripts for udev or hotplug. 2006-09-12 16:21 aj * trunk/NEWS, trunk/etc/Makefile.am, trunk/etc/openct.conf.in, trunk/etc/openct.udev, trunk/src/ifd/ifd-ccid.c: ifd-ccid fix by Chaskiel, add more ids for ccid, move towards udev. 2006-08-30 12:08 aj * trunk/src/ifd/ifd-egate.c: add some delays for the new egate tokens. 2006-07-28 19:53 nils * trunk/src/ct/socket.c: properly initialize header_t structure 2006-06-16 17:36 aj * trunk/configure.ac: trunk is post 0.6.8. 2006-06-16 17:34 aj * trunk/src/ct/socket.c: not handling EINTR caused many real world problems. fix it. 2006-06-13 07:10 aj * trunk/src/ifd/sys-bsd.c: add workaround to get openbsd working. Thanks to Markus Schatzl for the patch. 2006-05-23 06:52 aj * trunk/src/ifd/ifd-wbeiuu.c: Updated driver by Juan Carlos Borras. Still not 100% working, but a lot closer. 2006-05-15 21:40 aj * trunk/etc/openct.conf.in: fix typo. 2006-05-01 09:59 aj * trunk/src/ct/path.c: fix OPENCT_SOCKETDIR for solaris 2006-04-26 13:19 aj * trunk/etc/openct.udev: fix udev rule for CCID smart card readers. 2006-04-25 21:54 aj * trunk/src/ifd/ifd-pertosmart1038.c: fix a potential segfault. * trunk/src/ifd/ifdproxy.c: memeory leak in error handling. 2006-04-25 21:53 aj * trunk/src/ifd/ifd-eutron.c: close memory leak. 2006-04-25 21:52 aj * trunk/src/ifd/ifdhandler.c: use signed value. 2006-04-25 21:51 aj * trunk/src/ctapi/ctapi.c: remove unused value. 2006-04-25 21:50 aj * trunk/src/ct/status.c: use unsigned parameter. * trunk/src/include/openct/openct.h: parameter needs to be unsigned (so we can specify -1 for "any"). 2006-04-25 08:54 aj * trunk/configure.ac: this tree is for development past 0.6.7 2006-04-25 08:53 aj * trunk/configure.ac, trunk/etc/Info.plist: improved bundle handling. 2006-04-25 08:10 aj * trunk/src/ifd/ifdhandler.c: ct_format_path needs opt_reader as argument, and the resulting path needs to be used in ct_socket_listen. 2006-04-24 20:57 aj * trunk/src/ct/socket.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/ria.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/include/openct/socket.h: use limits.h where necessary. convert reader(int) to path in ifdhandler, not ct_socket_listen. use ct_format_path also in ifdproxy code. fix solaris compile (thanks to William Wanders). 2006-04-24 20:54 aj * trunk/src/ct/path.c, trunk/src/include/openct/path.h: last argument of ct_format_path is never changed. 2006-04-24 19:49 aj * trunk/src/ifd/ria.c: fix invalid use of ct_socket_connect, reported by ludovic rousseau. 2006-04-24 09:59 ludovic.rousseau * trunk/src/ifd/ifd-starkey.c: starkey_card_reset(): remove two unused variables 2006-04-24 09:58 ludovic.rousseau * trunk/src/ifd/ifd-pertosmart1038.c: ps_card_status(): initialize stat structure before using is to avoid a "may be used uninitialized in this function" compiler warning 2006-04-24 09:54 ludovic.rousseau * trunk/src/ifd/ifd-ccid.c: ccid_open_usb(): initialize ccid structure to avoid "may be used uninitialized in this function" compiler warnings 2006-04-24 09:50 ludovic.rousseau * trunk/src/ct/status.c: ct_status_unlock(): the function is of type void so we can't return NULL, use return instead 2006-04-24 09:47 ludovic.rousseau * trunk/src/ct/path.c: add #include so that getenv() is correctly defined (avoid 3 compiler warnings) 2006-04-21 06:33 aj * trunk/NEWS: updated news file. 2006-04-20 07:31 aj * trunk/etc/openct.conf.in, trunk/etc/openct.udev, trunk/etc/openct.usermap, trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-wbeiuu.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: Add driver for WB Electronics' Infinity USB Unlimited card readers by Juan Carlos Borrs 2006-04-19 15:42 aj * trunk/src/ifd/internal.h, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-osx.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/ifd/usb.c: new locking strategy: claim the control interface so only one process will be able to use any usb device at any give time. 2006-04-18 16:04 aj * trunk/etc/reader.conf.in: add reader.conf.in file as template for a pcsc-lite reader.conf file. 2006-04-18 15:12 aj * trunk/etc/Makefile.am: add example reader.conf file for pcsc-lite. * trunk/etc/openct.conf.in: add id for cherry smartboard ccid readers. 2006-04-18 15:11 aj * trunk/src/ct/status.c: reverse change: enable error messages when looking for status file - no error messages confused a lot of users. 2006-04-18 14:38 aj * trunk/src/ifd/atr.c, trunk/src/ifd/atr.h, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-t1.c: improvements by Chaskiel Grundman to add support for more eutron versions. 2006-04-18 11:11 aj * trunk/etc/openct.udev: ouch, most lines did not end in \". 2006-04-17 18:38 aj * trunk/src/ct/client.c, trunk/src/ct/path.c, trunk/src/ct/socket.c: fix segfault (oops). improve error checking. 2006-04-17 17:13 aj * trunk/etc/hotplug.openct.in, trunk/etc/init-script.in: add more comments for better useability. 2006-04-17 17:11 aj * trunk/src/ifd/ifd-pertosmart1038.c: Carlos Henrique Bauer: adds debug messages filtering to the PertoSmart/ACR AC-1038 driver and fixes a bug for ps_get_status() not returning correctly the flag IFD_CARD_STATUS_CHANGED. 2006-04-17 17:10 aj * trunk/src/ifd/ifd-pertosmart1030.c: Carlos Henrique Bauer: add debug messages filtering to the PertoSmart/ACR AC-1030 driver. 2006-04-17 16:17 aj * trunk/src/ct/Makefile.am, trunk/src/ct/client.c, trunk/src/ct/path.c, trunk/src/ct/socket.c, trunk/src/ct/status.c, trunk/src/ifd/ifdhandler.c, trunk/src/include/openct/Makefile.am, trunk/src/include/openct/path.h, trunk/src/include/openct/socket.h: put path handling into one central place. allow setting OPENCT_SOCKETDIR environment to choose a different place. 2006-04-12 08:00 aj * trunk/src/ifd/utils.c: Andrey Jivsov found this bug: "%" is bogus, the function should return time elapsed in miliseconds... 2006-03-19 22:35 aj * trunk/src/ifd/atr.c, trunk/src/ifd/atr.h, trunk/src/ifd/ifd-ccid.c: Chaskiel Grundman: This patch fixes some broken PTS behavior that resulted from two misconceptions that I had about PTS: 1) that the PTS response from the card must be an exact reflection of the request in order to be considered successful. 7816-3 says that the card may refuse the PTS1 byte by sending a response that doesn't include PTS1. 2) that the PTS2 byte was an N (guard time) value. PTS2 is in fact a coded-value, of which only the low 2 bits are defined. The patch adds a new function, ifd_verify_pts, that validates a pts response according to the pts request that would have been sent for a given atr_info. it clears the TA1 field from the atr_info if PTS1 was refused by the card. 2006-03-19 21:44 aj * trunk/etc/openct.udev: fix typo, this needs to be one long line, not two. * trunk/etc/hotplug.openct.in, trunk/etc/init-script.in, trunk/etc/openct.hald.in: init script: mkdir /var/run/openct, as some distributions use a tmpfs for /var/run and the directory can vanish over reboots. hald: we s/SBINDIR/.../, not @SBINDIR@ ... hotplug: make it work with udev and /dev/bus/usb device files. 2006-03-16 21:56 aj * trunk/src/ifd/init.c: proper sorting. (only for readability) 2006-03-16 21:53 aj * trunk/configure.ac, trunk/src/ifd/sys-linux.c: openct does not compile on some plattforms with header file issues. fix this - as suggested by usb kernel good greg KH - by including all necessary definitions in the source code. 2006-03-16 21:36 aj * trunk/configure.ac: simply the revision, drop the m4 code. it didn't turn out the way I wanted it (does not contain the _repository_/_branch_ revision). 2006-03-14 21:43 aj * trunk/NEWS, trunk/src/ifd/ifd-kaan.c: improved Siemens B1 driver by Lorenz Knauer 2006-02-27 22:03 aj * trunk/src/ifd/ifd-pertosmart1030.c: a) driver not claiming a USB interface before using it. b) driver not being able to receive data from the reader. by Carlos Henrique Bauer 2006-02-27 21:57 aj * trunk/src/ifd/ifd-pertosmart1038.c: This patch fixes a problem with the pertosmart1038 driver not being able to receive data from reader. By Carlos Henrique Bauer. 2006-02-27 21:55 aj * trunk/src/ifd/sys-linux.c: fix ifd_sysdep_device_type() always failing for USB devices in Linux. Thanks to Carlos Henrique Bauer and Nicola Franchi. 2006-02-15 08:46 aj * trunk/src/ifd/ifd-ccid.c: List of problems fixed: * Fixed interface search algorithm (was buggy for interface > 0) * Fixed a double free when no suitable device descriptors are found * Enabled status polling (instead of interrupt) for USB devices that don't have an interrupt endpoint (such as this keyboard) * Do not set device configuration if the device has only one configuration available (fixes kernel warnings and EBUSY on some HCI-s on Linux). by Antti Andreimann 2006-02-15 08:45 aj * trunk/etc/openct.conf.in: add new ids reported by Antti Andreimann 2006-02-09 19:45 aj * trunk/LGPL-2.1, trunk/Makefile.am: add LGPL-2.1 to distribution tar file. 2006-02-09 19:37 aj * trunk/NEWS: clarify license change. 2006-02-09 19:34 aj * trunk/NEWS: update news for new driver. 2006-02-09 19:33 aj * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-smph.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: Add Phoenix/SmartMouse drier by Antoine Nguyen Based on Alexandre Becoulet SCTK project (http://freshmeat.net/projects/sctk/). 2006-01-22 21:13 aj * trunk/etc/Info.plist: fix url to opensc-project for now and mention OpenCT, not OpenSC. 2006-01-22 21:05 aj * trunk/doc/README, trunk/doc/export-wiki.sh: moved to opensc-project till dns for opensc.org is back. 2006-01-14 17:38 aj * trunk/etc/Makefile.am, trunk/etc/openct.conf.in, trunk/etc/openct.hald.in, trunk/etc/openct.udev: add a script for hald and a config file for udev. add starkey token. 2006-01-14 17:36 aj * trunk/etc/openct.usermap: add starkey driver. * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-starkey.c, trunk/src/ifd/init.c: add starkey driver. doesn't work yet (but you can get an atr!). 2006-01-14 17:35 aj * trunk/src/ifd/sys-linux.c: try /dev/bus/usb/* first, fallback to /proc/bus/usb as usual. * trunk/src/ifd/sys-bsd.c: at least on some bsd the file is called /dev/ugen0.00 for control transfers. strange, control transfer is no endpoint AFAIK. 2005-12-26 22:57 aj * trunk/configure.ac: add "-svn-rXXXX" with svn revision as version number. thanks to werner koch. 2005-12-15 14:19 aj * trunk/etc/openct.usermap: add line for spr 532 readers - they have at least with some firmware the wrong interface class and were thus not properly detected. 2005-12-02 21:19 aj * trunk/src/ifd/usb-descriptors.c: add some paranoia: after free change values to NULL. 2005-12-02 21:18 aj * trunk/src/ifd/ifd-pertosmart1038.c: more cleanups and better error handling. 2005-12-02 21:17 aj * trunk/src/ifd/ifd-pertosmart1030.c: fix signedness issue, improve error handling. 2005-12-02 21:15 aj * trunk/src/ifd/ifd-ccid.c: remove double free. 2005-12-01 21:34 aj * trunk/src/ifd/ifd-pertosmart1038.c: remove "const" of course. 2005-12-01 21:19 aj * trunk/src/ifd/ifd-pertosmart1038.c: declarations first, then code. 2005-12-01 21:17 aj * trunk/src/ifd/ifd-pertosmart1030.c, trunk/src/ifd/ifd-pertosmart1038.c: fix small bugs introduced in the cleanup. 2005-12-01 21:00 aj * trunk/src/ifd/ifd-pertosmart1038.c: start cleaning up this code, too. 2005-12-01 20:44 aj * trunk/src/ifd/ifd-pertosmart1030.c: more cleanups to make it more readable. 2005-12-01 20:33 aj * trunk/src/ifd/ifd-pertosmart1030.c: swap if argument, reduce empty lines, remove unneeded brace to make code easier to read and understand. 2005-12-01 20:10 aj * trunk/src/ifd/ifd-ikey2k.c: keep some dead code in case we change that define. 2005-12-01 20:09 aj * trunk/src/ifd/init.c: proper cleanup in case of an error. * trunk/src/ifd/ctbcs.c: we checked it is not null. remove dead code. 2005-12-01 20:08 aj * trunk/src/ct/socket.c: check if prev is null. don't check it later, after it was already dereferenced. 2005-12-01 20:05 aj * trunk/src/ctapi/ctapi.c: remove some dead code, and handle size!=0 with an error. 2005-12-01 19:59 aj * trunk/src/ifd/ifd-pertosmart1030.c, trunk/src/ifd/ifd-pertosmart1038.c: Lident pertosmart drivers. * trunk/src/ifd/ifd-acr30u.c: Lident acr30u. * trunk/src/ifd/ifd-ccid.c: Lindent ifd-ccid. 2005-12-01 19:58 aj * trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-etoken64.c, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/ifd-ikey2k.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/ifdproxy.c: small Lindent changes. 2005-12-01 19:56 aj * trunk/src/ifd/conf.c, trunk/src/ifd/driver.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/init.c, trunk/src/ifd/pcmcia-block.c, trunk/src/ifd/proto-gbp.c, trunk/src/ifd/proto-sync.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-osx.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/usb-descriptors.c: Lindent these files. 2005-12-01 19:51 aj * trunk/src/pcsc/pcsc.c: Lindent'ed. 2005-11-01 22:56 aj * trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-null.c: debian/freebsd has FreeBSD_kernel defined. 2005-10-13 18:49 aj * trunk/src/ifd/ifd-pertosmart1038.c: add pertosmart 1038 driver. 2005-10-13 07:04 aj * trunk/etc/openct.conf.in, trunk/etc/openct.usermap, trunk/src/ifd/Makefile.am, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: new driver by Carlos Henrique Bauer for ACS AC-1038 chipset (PertoSmart EMV and ACS ACR38U). 2005-09-23 15:44 aj * trunk/aclocal/Makefile.am: list all current macro packages. * trunk/src/ctapi/ctapi.h, trunk/src/ifd/cardman.h, trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-pertosmart1030.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/ria.h, trunk/src/tools/openct-tool.c: silence warnings about extra "," and "//" style comments. 2005-09-20 20:46 aj * trunk/src/ifd/ifd-ccid.c: - accept the "proprietary" interface class id and class descriptors tagged as proprietary for the following devices (list derived from ) { 0x04e6, 0xe003 }, /* SCM SPR 532 */ { 0x046a, 0x003e }, /* Cherry SmartTerminal ST-2XXX */ { 0x413c, 0x2100 }, /* Dell USB Smartcard Keyboard */ { 0x04e6, 0x5120 }, /* SCM SCR331-DI (NTT) */ { 0x04e6, 0x5111 }, /* SCM SCR331-DI */ { 0x08e6, 0x1359 }, /* Verisign secure storage token */ { 0x08e6, 0xACE0 }, /* Verisign secure token */ - remove the need for struct usb_ccid_descriptor to be packed - check the slot/sequence of a ccid bulk-in message before the error code. (this is not sufficient to support multi-slot readers correctly, but it's a step in the right direction) 2005-09-20 07:30 aj * trunk/aclocal/libtool.m4: including libtool.m4 was a bad idea and causes trouble. 2005-09-20 07:19 aj * trunk/src/include/openct/apdu.h, trunk/src/include/openct/device.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/openct.h: remove trailing commas. 2005-09-17 09:54 aj * trunk/src/ifd/process.c: timeout parameter is optional. 2005-09-16 17:17 aj * trunk/src/ifd/ifdhandler.c: Following patch should allow clean(er) shutdown of ifdhandler process. By Priit Randla 2005-09-16 14:15 aj * trunk/doc/changelog.sh, trunk/doc/export-wiki.sh: xsltproc without network connections. 2005-09-14 09:49 ludovic.rousseau * trunk/doc/export-wiki.sh: use -nv instead of --non-verbose since wget 1.10 now uses --no-verbose instead. Grr! 2005-09-13 10:14 aj * trunk/src/ct/client.c, trunk/src/ifd/process.c, trunk/src/include/openct/tlv.h: fix error handling, thanks to Priit for reporting the issue. 2005-09-13 10:13 aj * trunk/doc/Makefile.am: remove ChangeLog on "make maintainer-clean". 2005-09-11 19:16 aj * trunk/doc/changelog.sh: oops, too much copy&paste. 2005-09-11 18:09 aj * trunk/src/pcsc/Makefile.am: install bundle file only when activated. * trunk/src/ifd/Makefile.am: configure changes caused variable names to change. 2005-09-11 18:08 aj * trunk/NEWS, trunk/configure.ac: use pkg-config for finding pcsc-lite and libusb. same pcsc code as opensc. * trunk/doc/Makefile.am, trunk/doc/changelog.sh, trunk/doc/svn2cl.xsl: add svn2cl based changelog. 2005-09-11 17:34 aj * trunk/ANNOUNCE, trunk/Makefile.am: remove ANNOUNCE file - we don't use it anyway or always forget about it. 2005-09-11 09:59 aj * trunk/NEWS: updates done in 0.6.6 release. 2005-09-09 12:10 aj * trunk/src/ifd/sys-osx.c: null implementation, to be filled with mac os X specific code. 2005-09-09 12:01 aj * trunk/src/pcsc/ifdhandler.h: LPSTR is deprecated, use LPTSTR. * trunk/src/ifd/ifd-pertosmart1030.c: kill two signed warnings. (ugly?) 2005-09-09 12:00 aj * trunk/src/ifd/Makefile.am, trunk/src/ifd/sys-null.c: add missing function to null sys module. create a mac os X sys module (currently also null code). 2005-09-08 17:21 aj * trunk/src/ifd/Makefile.am: we use libtool for linking, so it can calucalte the dependencies using LTLIBLTDL better. Thanks to Ralf Wildenhues. 2005-09-08 17:06 aj * trunk/configure.ac: fix AC_MSG_ERROR usage. thanks to Ralf Wildenhues. 2005-09-08 17:01 aj * trunk/src/ifd/Makefile.am, trunk/src/pcsc/Makefile.am: AC_SUBSTed variables are better used with $(..). Thanks to Ralf Wildenhues. 2005-09-08 16:52 aj * trunk/Makefile.am, trunk/bootstrap: aclocal -I aclocal/ (as suggested by Ralf Wildenhues) 2005-09-05 19:12 aj * trunk/configure.ac: fail if ltdl.h is not available. 2005-09-05 19:11 aj * trunk/aclocal/lib-ld.m4, trunk/aclocal/lib-link.m4, trunk/aclocal/lib-prefix.m4, trunk/aclocal/libtool.m4, trunk/aclocal/pkg.m4: add / update all m4 macro packages we use. 2005-09-05 18:53 aj * trunk/configure.ac: improved ltdl check. 2005-09-05 18:51 aj * trunk/ANNOUNCE, trunk/NEWS, trunk/TODO: small documentation update. * trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/pcmcia-block.c: variables not used. 2005-09-05 18:50 aj * trunk/src/ifd/init.c: return 1 (error). 2005-09-05 18:49 aj * trunk/src/ifd/ifd-acr30u.c: variable not used. * trunk/src/ifd/ifd-pertosmart1030.c: too much debug info. 2005-09-05 18:37 aj * trunk/etc/openct.conf.in, trunk/etc/openct.usermap: carlos.bauer: Add new USB ID (072f:8009) to pertosmart1030 driver. 2005-09-05 06:45 ludovic.rousseau * trunk/doc/export-wiki.sh: make export-wiki.sh executable 2005-09-04 11:31 aj * trunk/etc/openct.conf.in: add cm4040 reader. 2005-09-04 11:30 aj * trunk/src/ifd/ifd-ccid.c: The changes to ifd-ccid.c are: 1) make usb config descriptor parsing conditional to USB 2) add initialization for PCMCIA variant 3) Only ask for 10 bytes when issuing CCID_CMD_GETSLOTSTAT (which is fixed size of 10 bytes according to ccid spec 1.00a anyway) adds support for omnikey 4040 devices. 2005-09-04 11:28 aj * trunk/src/ifd/Makefile.am, trunk/src/ifd/internal.h: add pcmcia block device type. 2005-09-04 11:27 aj * trunk/src/ifd/device.c, trunk/src/ifd/pcmcia-block.c: add pcmcia block device type. * trunk/src/include/openct/device.h: add pcmcia block type. 2005-09-03 22:39 aj * trunk/src/ifd/ifd-cm4000.c: Patch by Harald Welte: - cleans up some unused code from ifd-cm4000.c - adds card_status detection - fixes CM_IOCGATR ioctl on 64bit platforms (don't use numeric value) 2005-09-03 10:02 aj * trunk/src/tools/openct-tool.c: adds a new "-s" option to specify the slot number. By Harald Welte 2005-09-02 16:43 aj * trunk/Makefile.am, trunk/doc/Makefile.am: that didn't work either. new idea. 2005-09-02 09:51 aj * trunk/Makefile.am: "doc" does not work well, it is the subdirectory name. 2005-09-02 09:29 aj * trunk/Makefile.am: dist-hook: is too late, need to generate the documentation before automake "make dist" copied files around. 2005-09-01 20:15 aj * trunk/configure.ac, trunk/src/ifd/Makefile.am: use the macro (from gettext package) to link via libltdl.la. That should take care of dependencies, but maybe it does not? * trunk/doc/README: add a word on regenerating those files. 2005-09-01 15:17 aj * trunk/doc/Makefile.am, trunk/doc/trac.css: proper cleanup on documentation. 2005-09-01 14:59 aj * trunk/doc/api: remove api/ subdir, to get generate-api.sh script work better. 2005-09-01 13:58 aj * trunk/Makefile.am, trunk/api, trunk/bootstrap, trunk/configure.ac, trunk/doc/AuthorsAndCredits.html, trunk/doc/ContactInfo.html, trunk/doc/DriverApi.html, trunk/doc/FilesTools.html, trunk/doc/LicenseText.html, trunk/doc/MailingLists.html, trunk/doc/Makefile.am, trunk/doc/OperatingSystems.html, trunk/doc/OverView.html, trunk/doc/QuickStart.html, trunk/doc/RemoteAccess.html, trunk/doc/ResourcesLinks.html, trunk/doc/SecureSetup.html, trunk/doc/TroubleShooting.html, trunk/doc/api, trunk/doc/cardman.html, trunk/doc/ccid.html, trunk/doc/doxygen.conf.in, trunk/doc/egate.html, trunk/doc/etoken.html, trunk/doc/eutron.html, trunk/doc/export-wiki.sh, trunk/doc/gempc.html, trunk/doc/generate-api.sh, trunk/doc/ikey2032.html, trunk/doc/ikey3000.html, trunk/doc/index.html, trunk/doc/kaan.html, trunk/doc/pertosmart1030.html, trunk/doc/smartboard.html, trunk/doc/towitoko.html, trunk/src/ifd/Makefile.am: * big documentation update. remove generated documentation from svn. * create documentation on "make dist" * do not include libltdl, instead us and require an installed one. 2005-08-28 21:38 aj * trunk/api, trunk/api/Makefile.am, trunk/api/README, trunk/api/doxygen.conf, trunk/api/html, trunk/api/html/annotated.html, trunk/api/html/apdu_8h-source.html, trunk/api/html/buffer_8h-source.html, trunk/api/html/conf_8h-source.html, trunk/api/html/device_8h-source.html, trunk/api/html/dir_000000.html, trunk/api/html/dir_000001.html, trunk/api/html/dir_000002.html, trunk/api/html/dirs.html, trunk/api/html/doxygen.css, trunk/api/html/doxygen.png, trunk/api/html/driver_8h-source.html, trunk/api/html/driver_8h.html, trunk/api/html/error_8h-source.html, trunk/api/html/files.html, trunk/api/html/functions.html, trunk/api/html/functions_vars.html, trunk/api/html/ifd_8h-source.html, trunk/api/html/index.html, trunk/api/html/logging_8h-source.html, trunk/api/html/openct_8h-source.html, trunk/api/html/protocol_8h-source.html, trunk/api/html/server_8h-source.html, trunk/api/html/socket_8h-source.html, trunk/api/html/structifd__driver__ops.html, trunk/api/html/tlv_8h-source.html: add api documentation. 2005-08-28 21:08 aj * trunk/Makefile.am, trunk/configure.ac, trunk/src/ifd/driver.c, trunk/src/include/openct/driver.h: add initial doxygen documentation by Laurent Pinchart 2005-08-23 23:05 aj * trunk/src/ifd/ifdhandler.c: oops, fix typo. 2005-08-23 23:01 aj * trunk/NEWS: comment changes in openct since 0.6.5 so far. 2005-08-23 22:54 aj * trunk/doc/DriverApi.html, trunk/doc/Makefile.am, trunk/doc/index.html: documentation update. 2005-08-23 18:44 aj * trunk/Makefile.am, trunk/bootstrap, trunk/configure.ac, trunk/src/Makefile.am, trunk/src/ifd/Makefile.am, trunk/src/ifd/init.c, trunk/src/ifd/modules.c, trunk/src/scdl: use libltdl instead of scdl. 2005-08-23 18:41 aj * trunk/src/ifd/Makefile.am: do not install libifd - only meant to use some code in two appliactions. 2005-08-17 19:10 aj * trunk/doc/MailingLists.html, trunk/doc/Makefile.am, trunk/doc/OperatingSystems.html, trunk/doc/OverView.html, trunk/doc/RecentResults.html, trunk/doc/ResourcesLinks.html, trunk/doc/SupportedReaders.html, trunk/doc/cardman.html, trunk/doc/index.html, trunk/doc/pertosmart1030.html: documentation update. 2005-07-20 08:37 aj * trunk/src/ifd/Makefile.am: also compile in acr30u driver. 2005-07-19 20:38 aj * trunk/doc/AuthorsAndCredits.html, trunk/doc/etoken.html: small updates from current wiki. 2005-07-19 18:41 aj * trunk/src/ifd/ifd-acr30u.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: add acr30u driver by Laurent Pinchart. 2005-07-19 18:39 aj * trunk/src/ifd/device.c, trunk/src/ifd/reader.c: fix situation in case device name is NULL. patch by Laurent Pinchart. 2005-07-18 22:56 aj * trunk/doc/AuthorsAndCredits.html, trunk/doc/ContactInfo.html, trunk/doc/FilesTools.html, trunk/doc/LicenseText.html, trunk/doc/OperatingSystems.html, trunk/doc/QuickStart.html, trunk/doc/RecentResults.html, trunk/doc/RemoteAccess.html, trunk/doc/SecureSetup.html, trunk/doc/SupportedReaders.html, trunk/doc/TroubleShooting.html, trunk/doc/cardman.html, trunk/doc/ccid.html, trunk/doc/egate.html, trunk/doc/etoken.html, trunk/doc/eutron.html, trunk/doc/export-wiki.sh, trunk/doc/gempc.html, trunk/doc/ikey2032.html, trunk/doc/ikey3000.html, trunk/doc/index.html, trunk/doc/kaan.html, trunk/doc/pertosmart1030.html, trunk/doc/smartboard.html, trunk/doc/towitoko.html: replace with current wiki files. 2005-07-18 22:51 aj * trunk/etc/openct.conf.in, trunk/etc/openct.usermap: add new drivers. 2005-07-18 22:50 aj * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-etoken64.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: add etoken64 driver. 2005-07-18 22:47 aj * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-pertosmart1030.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: add pertosmart ac1030 driver. 2005-07-12 14:58 martin * trunk/doc/export-wiki.sh: Use xsltproc instead of xalan. 2005-06-16 19:38 aj * trunk/etc/openct.conf.in, trunk/solaris/openct.conf-dist, trunk/src/pcsc/pcsc.c: "smart card" not "SmartCard" or "smartcard". 2005-06-15 20:45 aj * trunk/etc/hotplug.openct.in: race found in kernel usb/hotplug interaction. sleep 1 helps a lot. 2005-06-03 20:28 aj * trunk/src/ifd/atr.c, trunk/src/ifd/atr.h: accept more parameters, e.g. estonian id card. 2005-05-29 19:39 aj * trunk/src/ctapi/ctapi.c, trunk/src/ifd/conf.c, trunk/src/ifd/driver.c, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/ifd-ikey2k.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/ifd/pcmcia.c, trunk/src/ifd/proto-gbp.c, trunk/src/ifd/proto-sync.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/include/openct/driver.h: many small compile fixes plus code/indent improvements, silenting warnings etc. 2005-05-29 17:48 aj * trunk/src/ifd/ria.c: timeout is always at least RIA_DEFAULT_TIMEOUT, so it cannot be = 0 or < 0 ... 2005-05-29 17:43 aj * trunk/src/ctapi/ctapi.c: if (size) or if (size != NULL), but for sake of readability: please don't use if (size != (size_t *) 0) ... 2005-05-29 17:35 aj * trunk/src/tools/openct-control.c: handle out of memory. 2005-05-29 17:34 aj * trunk/src/ctapi/ctapi.c: don't access structures after freeing them. 2005-05-29 17:29 aj * trunk/src/ifd/atr.c: info structure has int TA[3], i.e. 0..2 is valid as index, 3 is not. 2005-05-29 16:30 aj * trunk/src/ifd/conf.c, trunk/src/ifd/device.c, trunk/src/ifd/driver.c, trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/locks.c, trunk/src/ifd/protocol.c, trunk/src/ifd/ria-server.c, trunk/src/ifd/ria.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c, trunk/src/ifd/usb-descriptors.c: add/fix/unify out of memory handling. 2005-05-29 13:49 aj * trunk/src/ifd/reader.c: one more calloc check, one more check for NULL. 2005-05-29 13:45 aj * trunk/src/ifd/ifd-eutron.c: error on a too long atr, accept more than 4 bytes as atr complete. 2005-05-29 13:38 aj * trunk/src/ifd/ifd-towitoko.c: buffer needs to be TWT_PAGESIZE +2 (header, body, footer). 2005-05-29 13:35 aj * trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/init.c: fix a few unhandled out of memory situations. 2005-05-29 13:29 aj * trunk/src/ifd/ifdhandler.c: make device argument mandatory. 2005-05-29 13:15 aj * trunk/src/ifd/ifd-cm4000.c: len was not initialized, guess this fixes it. 2005-05-29 13:09 aj * trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: Lindent for consistent style 2005-05-29 13:08 aj * trunk/src/scdl/scdl.c: Lindent for consistent style 2005-05-29 13:06 aj * trunk/src/pcsc/pcsc.c: Lindent for consistent style 2005-05-29 13:05 aj * trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/ifd-ikey2k.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-smartboard.c, trunk/src/ifd/ifd-towitoko.c: Lindent for consistent style 2005-05-29 13:02 aj * trunk/src/ifd/serial.c: Lindent for consistent style 2005-05-29 13:00 aj * trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdhandler.h, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: Lindent for consistent style 2005-05-29 12:54 aj * trunk/src/ifd/locks.c, trunk/src/ifd/manager.c, trunk/src/ifd/modules.c: Lindent for consistent style 2005-05-29 12:53 aj * trunk/src/ifd/pcmcia.c, trunk/src/ifd/process.c, trunk/src/ifd/proto-gbp.c, trunk/src/ifd/proto-sync.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/proto-trans.c, trunk/src/ifd/protocol.c: Lindent for consistent style 2005-05-29 12:50 aj * trunk/src/ifd/reader.c, trunk/src/ifd/ria-device.c, trunk/src/ifd/ria-server.c, trunk/src/ifd/ria.c, trunk/src/ifd/ria.h: Lindent for consistent style 2005-05-29 12:48 aj * trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/sys-sunray.c: Lindent for common style, and reduce nesting in some functions to keep the code indent'able and make it easier to read. 2005-05-29 12:26 aj * trunk/src/ifd/usb-descriptors.c, trunk/src/ifd/usb-descriptors.h, trunk/src/ifd/usb.c: Lindent for consistent style 2005-05-29 12:21 aj * trunk/src/ifd/utils.c: Lindent for consistent style 2005-05-29 12:20 aj * trunk/src/ifd/ifd-cardman.c: Lindent for consistent style 2005-05-29 11:37 aj * trunk/src/ifd/device.c, trunk/src/ifd/driver.c: Lindent for consistent style 2005-05-29 11:36 aj * trunk/src/ifd/apdu.c, trunk/src/ifd/atr.c, trunk/src/ifd/atr.h, trunk/src/ifd/cardman.h, trunk/src/ifd/checksum.c, trunk/src/ifd/conf.c, trunk/src/ifd/ctbcs.c, trunk/src/ifd/ctbcs.h: Lindent for consistent style 2005-05-29 11:08 aj * trunk/src/ctapi/ctapi.c, trunk/src/ctapi/ctapi.h: Lindent for consistent style. 2005-05-29 11:05 aj * trunk/src/ct/buffer.c, trunk/src/ct/client.c, trunk/src/ct/error.c, trunk/src/ct/mainloop.c, trunk/src/ct/socket.c, trunk/src/ct/status.c, trunk/src/ct/tlv.c: Lindent for consistent style. 2005-05-16 20:40 aj * trunk/configure.ac: change back to WIP for snapshot script. 2005-05-16 20:22 aj * trunk/NEWS, trunk/configure.ac: release openct 0.6.5 without changes. 2005-05-16 20:21 aj * trunk/doc/ccid.html: minimal documentation update. 2005-05-10 20:24 aj * trunk/configure.ac: change version string back to WIP for the nightly snapshots script. 2005-05-10 20:16 aj * trunk/Makefile.am: reflect changes in solaris/. 2005-05-10 20:10 aj * trunk/src/ifd/sys-linux.c: open is defined in fcntl.h 2005-05-10 20:04 aj * trunk/AUTHORS, trunk/ChangeLog, trunk/LICENSE, trunk/Makefile.am, trunk/NEWS, trunk/QUICKSTART, trunk/README, trunk/configure.ac: remove text documentation where it duplicates html documentation. create new release. 2005-05-10 20:01 aj * trunk/doc/AuthorsAndCredits.html, trunk/doc/FilesTools.html, trunk/doc/LicenseText.html, trunk/doc/Makefile.am, trunk/doc/OperatingSystems.html, trunk/doc/QuickStart.html, trunk/doc/README, trunk/doc/RecentResults.html, trunk/doc/RemoteAccess.html, trunk/doc/SecureSetup.html, trunk/doc/SupportedReaders.html, trunk/doc/TroubleShooting.html, trunk/doc/cardman.html, trunk/doc/ccid.html, trunk/doc/egate.html, trunk/doc/etoken.html, trunk/doc/eutron.html, trunk/doc/export-wiki.sh, trunk/doc/export-wiki.xsl, trunk/doc/gempc.html, trunk/doc/ikey2032.html, trunk/doc/ikey3000.html, trunk/doc/index.html, trunk/doc/kaan.html, trunk/doc/openct.css, trunk/doc/smartboard.html, trunk/doc/towitoko.html, trunk/doc/trac.css: add new documentation based on a wiki snapshot. 2005-05-10 19:53 aj * trunk/doc/Makefile.am, trunk/doc/README, trunk/doc/export-wiki.sh, trunk/doc/export-wiki.xsl: add new documentation based on wiki export. 2005-05-10 19:51 aj * trunk/doc/openct.html, trunk/doc/openct.xml, trunk/doc/openct.xsl: remove old xml/html documentation. 2005-05-10 19:45 aj * trunk/src/ifd/usb.c: first claim interface, then configure it. 2005-05-05 22:37 aj * trunk/solaris/Makefile, trunk/solaris/Makefile.client, trunk/solaris/Makefile.server, trunk/solaris/README, trunk/solaris/openct.conf-dist: William Wanders: client/server support for solaris sunray machines. 2005-05-05 22:35 aj * trunk/src/ifd/sys-sunray.c: William Wanders: Add support for sunray machines. 2005-05-05 22:33 aj * trunk/solaris/Makefile: William Wanders: updated support files to build and create packages for Solaris 9/10 * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/internal.h, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/usb-descriptors.c, trunk/src/ifd/usb.c: William Wander: moved usb_open to the system dependant files 2005-05-05 22:31 aj * trunk/src/ct/client.c, trunk/src/ct/status.c: William Wanders: use different paths for sunray support. 2005-05-05 22:30 aj * trunk/configure.ac: William Wanders: add configure options for sunray. 2005-05-05 09:10 aj * trunk/aclocal/pkg.m4: avoids a warning from aclocal >= 1.8 when bootstrapping. (Ville Skytta) * trunk/configure.ac, trunk/src/tools/Makefile.am, trunk/src/tools/openct-tool.1.in: -man.patch contains a very rudimentary manual page for openct-tool. I intend to expand it somewhat in the future, and create manual pages for other tools in OpenCT as well. (Ville Skytta) 2005-05-05 09:08 aj * trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdproxy.c: -usage.patch prints the usage to stdout if there's no error. This was mainly inspired so that one can use help2man on the OpenCT tools, but I think it's ok to have anyway. (Ville Skytta) * trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: usage.patch prints the usage to stdout if there's no error. This was mainly inspired so that one can use help2man on the OpenCT tools, but I think it's ok to have anyway. Also carries one trivial grammar fix. (Ville Skytta) 2005-04-29 22:10 aj * trunk/src/ifd/ifdhandler.c: Ville Skytta: adds docs for "-i" to "ifdhandler -h". * trunk/etc/openct.conf.in: Ville Skytta: add a sample commented out config snippet for gempc. 2005-04-26 19:43 aj * trunk/etc/openct.conf.in: Ville Skytta: an example cm4000 configuration snippet, commented out by default due to the driver not being quite ready for real use yet. * trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/ifd-cm4000.c: Ville Skytta: cardman-strings.patch contains various cosmetic comment and string improvements to the cardman and cm4000 drivers. 2005-04-26 19:42 aj * trunk/etc/Info.plist, trunk/etc/openct.conf.in, trunk/etc/openct.usermap: Ville Skytta: comments out the orignal "cardman" driver entries in the default configs. It also adds CardMan 3121 and 5121 strings to Info.plist which enables pcsc-lite hotplug for them. 2005-04-26 09:11 aj * trunk/NEWS: 0.6.4 was released yesterday, add changes we did to 0.6.5 do far. 2005-04-25 21:01 aj * trunk/configure.ac: move back to "WIP" for the snapshot script. 2005-04-25 20:52 aj * trunk/etc/openct.conf.in, trunk/src/ifd/Makefile.am, trunk/src/ifd/cardman.h, trunk/src/ifd/ifd-cm4000.c, trunk/src/ifd/init.c: add cardman support. 2005-04-25 20:50 aj * trunk/src/ifd/device.c, trunk/src/ifd/pcmcia.c: add pcmcia support (by Harald Welte) 2005-04-25 20:49 aj * trunk/src/ifd/ifd-ccid.c, trunk/src/include/openct/device.h: make usb endpoint configureable (by Harald Welte) 2005-04-25 20:44 aj * trunk/configure.ac: create new release candidate. 2005-04-25 20:19 aj * trunk/ANNOUNCE, trunk/configure.ac: New version of openct: 0.6.4. 2005-04-17 20:15 aj * trunk/configure.ac: change back to "WIP" for the snapshot script. 2005-04-17 20:05 aj * trunk/NEWS, trunk/configure.ac: create new release candidate with the libtool fix from ville. 2005-04-17 20:03 aj * trunk/macos/libtool-bundle: Description by ville.skytta@iki.fi: Cosmetic: Installing the lib contained in the bundle as "openct-ifd" without the usual shared library suffix is slightly misleading. Will attach a patch which preserves the filename and installs it as "openct-ifd.so" (on Linux) which is what I'd expect a shared lib / loadable module to be named like. 2005-04-12 20:45 aj * trunk/configure.ac: set the version to "WIP" (work in progress) for the snapshot script. 2005-04-07 07:12 aj * trunk/Makefile.am, trunk/NEWS: Add solaris/ files to relase tar file. (via main makefile.am, because of solaris/Makefile) 2005-04-07 07:05 aj * trunk/configure.ac: create a second rc without the proto t=1 changes. 2005-04-07 07:04 aj * trunk/src/ifd/proto-t1.c: reverse proto-t1 changes for now, will be added once we have this release out of the door. 2005-03-29 07:28 aj * trunk/solaris, trunk/solaris/Makefile, trunk/solaris/README, trunk/solaris/checkinstall.in, trunk/solaris/devices-openct-fabric.xml-dist, trunk/solaris/openct-fabric-dist, trunk/solaris/openct-hotplug-dist, trunk/solaris/openct.conf-dist, trunk/solaris/pkginfo.in, trunk/solaris/postinstall, trunk/solaris/preremove, trunk/solaris/proto: Add files to make using openct on solaris easier. 2005-03-22 09:23 aj * trunk/NEWS, trunk/configure.ac: document changes in news, increase library version. 2005-03-22 08:39 aj * trunk/etc/Makefile.am: only gnu sed spits the file to stdout. *bsd sed wants < file I think. 2005-03-22 08:16 aj * trunk/src/ifd/ifd-ccid.c: From: William Wanders The first patch fixes an alignment problem I encountered with the SUN C Pro compiler and ifd-ccid.c. 2005-03-22 08:15 aj * trunk/NEWS, trunk/src/ifd/sys-solaris.c: From: William Wanders The second patch enhances the sys-solaris.c with support for bulk and interrupt endpoint transfers. Well just enough to get the CCID driver going. 2005-03-22 08:11 aj * trunk/NEWS, trunk/src/ifd/sys-bsd.c: Attached is a patch for sys-bsd.c which should add enough bulk and interrupt endpoint support for the CCID driver. Hotplugging doesn't really work that well. Polling the existence of a device through thru the ugen driver doesn't seem to have the aimed effect. 2005-03-22 08:10 aj * trunk/src/ifd/Attic: remove the Attic directory with files left from the cvs2svn conversion. 2005-03-22 08:09 aj * trunk/debian: remove old debian files, so eric can add the current version (which is complete independend, so a diff'ed merge wouldn't be of any help). 2005-03-22 08:08 aj * trunk/.cvsignore, trunk/aclocal/.cvsignore, trunk/doc/.cvsignore, trunk/etc/.cvsignore, trunk/macos/.cvsignore, trunk/src/.cvsignore, trunk/src/ct/.cvsignore, trunk/src/ctapi/.cvsignore, trunk/src/ifd/.cvsignore, trunk/src/include/.cvsignore, trunk/src/include/openct/.cvsignore, trunk/src/pcsc/.cvsignore, trunk/src/scdl/.cvsignore, trunk/src/tools/.cvsignore: remove .cvsignore files. 2005-03-22 08:07 aj * trunk/ANNOUNCE, trunk/NEWS, trunk/QUICKSTART, trunk/TODO, trunk/configure.ac: merge changes from 0.6.3 release. 2005-03-07 10:52 aet * trunk/configure.ac: - Merge with opensc 2005-02-11 20:43 aet * trunk/configure.ac: - Merge between opensc / openct 2005-01-29 10:51 aet * trunk/configure.ac: - Show package version when configure is finished 2005-01-29 10:43 aet * trunk/src/ifd/ifd-ccid.c: - ccid update by Chaskiel M Grundman with some cleanups 2005-01-29 09:12 aet * trunk/Makefile.am: - Require automake 1.5 or later 2005-01-23 10:14 aet * trunk/aclocal/Makefile.am, trunk/aclocal/pkg.m4: - Add pkg.m4 for pkg-config depencies 2005-01-16 19:21 aet * trunk/TODO: - Update 2005-01-16 19:20 aet * trunk/src/ifd/internal.h: - Add void *dev to complement ifd_device and future driver support. 2005-01-16 15:44 aet * trunk/src/ct/socket.c, trunk/src/ct/status.c: - Silence harmless error/debug messages 2004-12-15 18:18 aet * trunk/configure.ac: - Merge with opensc 2004-12-15 13:57 aet * trunk/ANNOUNCE, trunk/NEWS, trunk/QUICKSTART: - Preparations for the next release 2004-12-15 13:52 aet * trunk/src/ctapi/ctapi.c: - C++ build fix 2004-12-15 10:58 aet * trunk/src/ctapi/ctapi.c, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/process.c: - Fix compiler warnings 2004-12-05 17:47 aj * trunk/configure.ac, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdproxy.c, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: add version to tools. 2004-11-11 19:52 aj * trunk/src/ifd/device.c, trunk/src/ifd/ifd-smartboard.c, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/internal.h, trunk/src/ifd/ria-device.c, trunk/src/ifd/ria-server.c, trunk/src/ifd/ria.c, trunk/src/ifd/ria.h, trunk/src/ifd/serial.c, trunk/src/include/openct/device.h: Priit Randla writes: A couple of fixes, an additional RIA command and an API change to specify time for sending break. As ifd_serial_send_break was used in ifd-smartboard.c, I had to make a change there too. 2004-11-10 09:43 aj * trunk/src/ct/socket.c: slen needs to be set, else getpeername cannot work. 2004-11-08 23:07 aj * trunk/src/ctapi/ctapi.c: Improved command checking by Priit Randla. 2004-11-05 18:28 aj * trunk/src/ifd/reader.c: bug fix by Priit Randla. 2004-11-04 22:19 aj * trunk/src/ct/client.c, trunk/src/ctapi/ctapi.c, trunk/src/ctapi/ctapi.h, trunk/src/ifd/process.c, trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h, trunk/src/pcsc/pcsc.c: implement protocol selection. by Priit Randla 2004-10-31 15:33 aj * trunk/src/ifd/ifd-egate.c: allow 4 bytes commands as well. 2004-10-31 11:27 aj * trunk/etc/hotplug.openct.in: fix test command. 2004-10-25 06:41 aj * trunk/src/ifd/atr.c: Allow TA4, bug found by Priit Randla. 2004-10-17 21:43 aj * trunk/src/ifd/ifd-egate.c, trunk/src/ifd/process.c: increase reply buffer to 258 bytes and add proper error handling to ifd-egate. both by Chaskiel M Grundman. 2004-08-31 20:44 aj * trunk/etc/Info.plist: Here's a simple patch to make eToken (the older one) hotplug work with pcsc-lite using OpenCT's driver bundle. (Ville Skytt�) 2004-08-06 07:18 nils * trunk/src/ifd/usb-descriptors.c: add missing host endian conversion patch supplied by William Wanders 2004-08-06 07:15 nils * trunk/src/ifd/ifd-kaan.c: fix compiler warning patch supplied by William Wanders 2004-07-20 21:03 aj * trunk/Makefile.am, trunk/QUICKSTART: Add some minimal text documentation for now. 2004-07-20 20:48 aj * trunk/ANNOUNCE, trunk/LICENSE, trunk/NEWS, trunk/TODO: updated text files. 2004-07-20 00:47 aj * trunk/src/ifd/proto-t1.c, trunk/src/include/openct/ifd.h: t=1 protocol improvements by ludovic rousseau 2004-07-20 00:46 aj * trunk/configure.ac: Better placement of info text for old configure test. 2004-07-20 00:43 aj * trunk/src/ifd/ifdhandler.c: check if a full packet has been received or not (i.e. differ return code 0 / 1, not only < 0). 2004-07-20 00:19 aj * trunk/src/ct/socket.c: fix protocol bug triggered by egate. for some reason the ifdhandler sends two responses, first an ok, then an error. we ignore the second one, because the xid does not match. 2004-07-19 21:12 aj * trunk/src/ifd/internal.h: fix type difference source / header. 2004-07-19 21:05 aj * trunk/etc/Makefile.am: change init script and hotplug script to mode 755. install hotplug files only if target directory is writeable. 2004-07-19 21:02 aj * trunk/configure.ac, trunk/src/ifd/Makefile.am, trunk/src/pcsc/Makefile.am: Try pkg-config detection, fall back to conventional code. 2004-07-15 06:16 aet * trunk/src/include/openct/Makefile.am: - Fixed the previous commit 2004-07-14 21:54 aj * trunk/etc/init-script.in: remove status file in the init script on stop. 2004-07-14 21:26 aj * trunk/src/include/openct/Makefile.am: Do not include types.h in distribution tar file, as it is generated by configure. * trunk/doc/openct.html: get html documentation in sync with xml source. 2004-07-09 21:09 aj * trunk/etc/openct.usermap: Ville Skytt�: Remove duplicate CardMan 2020 entry. * trunk/doc/openct.xml: Ville Skytt�: import new openct.conf 2004-07-09 21:08 aj * trunk/src/pcsc/Makefile.am: Ville Skytt�: Create bundle dir before trying to install into it, do not mask installation failure. 2004-07-09 19:25 aj * trunk/src/ctapi/ctapi.c: This patch introduces host files to CTAPI. The implementation is not complete, but enough to compile and run code to read out German health insurance cards. It should not break existing code, but of course testing is encouraged. (fix by Michael Haardt) 2004-06-30 21:06 aj * trunk/doc/openct.html: html file update. 2004-06-30 06:54 aj * trunk/etc/hotplug.openct.in: Only start ifdhandler if already initialized / status file exists. 2004-06-28 22:45 aj * trunk/etc/openct.usermap: update usermap for usb hotplugging, too. 2004-06-28 22:44 aj * trunk/etc/openct.conf.in: additional id's found by Ville Skytt� 2004-06-28 22:43 aj * trunk/doc/openct.xml: small fixed by Ville Skytt�. 2004-03-14 18:42 aet * trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-solaris.c: - ifd_sysdep_usb_poll_presence cleanups 2004-03-14 14:39 aet * trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/sys-solaris.c, trunk/src/ifd/usb.c: - Some merging and polishing before rewriting the USB layer - Add missing functions for BSD port - Fix incorrect return values 2004-03-14 10:47 aet * trunk/src/ifd/sys-bsd.c: - Untested build fixes for FreeBSD 5.2 2004-03-04 10:08 aj * trunk/src/ifd/ifd-kaan.c: small fix by Michael Haardt 2004-02-26 10:37 aj * trunk/debian/README.Debian, trunk/debian/changelog, trunk/debian/control, trunk/debian/copyright, trunk/debian/libopenct0-dev.install, trunk/debian/libopenct0.install, trunk/debian/libopenct0.shlibs, trunk/debian/openct-dev.dirs, trunk/debian/openct-dev.files, trunk/debian/openct.README.Debian, trunk/debian/openct.dirs, trunk/debian/openct.doc-base.manual, trunk/debian/openct.docs, trunk/debian/openct.files, trunk/debian/openct.install, trunk/debian/openct.postinst, trunk/debian/rules: switch to eric dorlands debian/ files, those are used in the official debian packages. however a changelog for a current cvs snapshot was added, and maintainer set to Andreas Jellinghaus , so eric is not bothered with bugs in the cvs snapshot. 2004-02-26 10:32 aj * trunk/doc/openct.html: minimal update for changes in openct.xml. 2004-01-27 09:06 okir * trunk/src/ifd/process.c: - Patch to fix use of ifd_{read,write}_memory (Michael Haardt) 2004-01-22 08:37 okir * trunk/src/ifd/atr.c, trunk/src/ifd/ifd-ccid.c: - new CCID patches from Chaskiel 2004-01-21 10:05 okir * trunk/src/ct/error.c, trunk/src/include/openct/error.h: - added IFD_ERROR_INVALID_ATR 2004-01-21 09:43 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/atr.c, trunk/src/ifd/atr.h, trunk/src/ifd/protocol.c: - added code for ATR parsing and PTS string handling 2004-01-20 12:43 aet * trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/ria-server.c, trunk/src/ifd/usb-descriptors.c, trunk/src/ifd/usb-descriptors.h, trunk/src/ifd/utils.c: - Minor warning fixes - Portability fixes 2004-01-20 09:57 okir * trunk/doc/openct.xml: - Added author notice on CCID driver 2004-01-20 09:56 okir * trunk/etc/openct.conf.in, trunk/etc/openct.usermap, trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-ccid.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb-descriptors.c, trunk/src/ifd/usb-descriptors.h: - merged CCID driver from Chaskiel Grundmann 2004-01-20 08:51 okir * trunk/src/ifd/ifd-egate.c: - patch from Chaskiel to use symbolic names for constants * trunk/src/ifd/protocol.c: - added ifd_debug() call 2004-01-19 19:54 aet * trunk/src/ifd/sys-bsd.c: - Add USB rewrite for FreeBSD by William Wanders 2004-01-19 19:52 aet * trunk/src/ifd/Makefile.am: - Revert previous patch 2004-01-19 18:51 aj * trunk/src/ifd/Makefile.am: make libifd not standalone, i.e. all tools and libs will link it staticaly. 2004-01-19 18:50 aj * trunk/debian/changelog: new debian packages... 2004-01-14 21:41 aj * trunk/src/ct/libopenct.pc.in: library dependencies for linking where missing from the pkgconfig file. 2004-01-14 20:13 aj * trunk/debian/changelog: recompiled debian packages. 2004-01-11 12:47 aet * trunk/src/ctapi/Makefile.am: - Revert previous patch 2004-01-10 20:24 aet * trunk/src/ctapi/Makefile.am: - Add versioning 2004-01-10 19:49 aet * trunk/configure.ac: - Move the variable substitution of exec_prefix and sysincludedir to make-level (Lars T. Mikkelsen) 2004-01-08 23:25 aet * trunk/src/ifd/sys-solaris.c: - Minor cleanups and a build fix for Sun's native compiler for Solaris, yet untested. 2004-01-08 19:13 aj * trunk/debian/openct.postinst, trunk/debian/openct.postrm, trunk/debian/openct.prerm, trunk/debian/rules: remove post/pre rm/inst scripts, as debhelper will create them. dh_initinstall --init-script=../etc/init-script -name openct does not work, so the script is copied to debian/openct.init and removed in clean. 2004-01-08 12:37 aj * trunk/doc/openct.html: thanks to William Wanders for contributing Solaris support. 2004-01-08 12:36 aj * trunk/debian/files, trunk/debian/openct-dev.substvars, trunk/debian/openct.postinst.debhelper, trunk/debian/openct.postrm.debhelper, trunk/debian/openct.substvars: oops. these are temporary files created by debian and removed by debian/rules clean. they shouldn't be in the cvs. 2004-01-08 11:00 okir * trunk/doc/openct.xml: - added william wanders as author of sys-solaris.c 2004-01-08 10:53 okir * trunk/src/ifd/internal.h, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/usb.c: - created ifd_sysdep_usb_poll_presence and moved poll functionality there 2004-01-08 10:52 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/sys-solaris.c: - Solaris support from William Wanders 2004-01-08 10:43 aj * trunk/doc/openct.html: rendered with new docbook stylesheet. 2004-01-08 10:20 aj * trunk/debian, trunk/debian/README.Debian, trunk/debian/changelog, trunk/debian/compat, trunk/debian/control, trunk/debian/copyright, trunk/debian/files, trunk/debian/openct-dev.dirs, trunk/debian/openct-dev.files, trunk/debian/openct-dev.substvars, trunk/debian/openct.dirs, trunk/debian/openct.docs, trunk/debian/openct.files, trunk/debian/openct.postinst, trunk/debian/openct.postinst.debhelper, trunk/debian/openct.postrm, trunk/debian/openct.postrm.debhelper, trunk/debian/openct.prerm, trunk/debian/openct.substvars, trunk/debian/rules: files for creating debian packages. Unofficial versions. 2004-01-06 12:59 okir * trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/internal.h, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/usb.c, trunk/src/include/openct/device.h: - Merged USB enhancements from Chaskiel 2004-01-06 12:39 okir * trunk/src/ifd/ria-device.c, trunk/src/ifd/ria.c, trunk/src/ifd/ria.h: - fixed ria timeout handling 2004-01-06 12:38 okir * trunk/src/ifd/ifdproxy.c: - Fixed gcc warning 2003-12-18 18:57 okir * trunk/src/ifd/ifd-ikey2k.c: - yet another answer to card reset 2003-12-12 09:32 aet * trunk/src/pcsc/Makefile.am: - Minor bundle handling fixes 2003-12-10 14:52 aet * trunk/configure.ac, trunk/src/ifd/ifd-gempc.c: - Minor naming convention harmonisation for pc/sc and ct-api related things 2003-12-09 19:37 aet * trunk/aclocal/acx_pthread.m4: - Probe for -lpthread before -pthread, as we did in the previous version. 2003-12-09 12:38 okir * trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/proto-gbp.c: - Merged patches from Chaskiel 2003-12-09 12:13 okir * trunk/src/ifd/ifdproxy.c: - added chroot support 2003-12-09 12:12 okir * trunk/src/ct/error.c: - chroot support - open syslog as early as possible; later may be too late 2003-12-06 18:14 aet * trunk/configure.ac, trunk/src/ifd/sys-linux.c: - Build fix against latest broken glibc usb headers 2003-12-03 10:56 aet * trunk/configure.ac: - Add AM_MAINTAINER_MODE 2003-11-30 17:19 aet * trunk/ChangeLog: - Fixed an embarrassing typo from the ChangeLog URL 2003-11-27 09:51 okir * trunk/src/ifd/ifdproxy.c, trunk/src/ifd/internal.h, trunk/src/ifd/utils.c: - moved daemon() to utils.c 2003-11-27 09:45 okir * trunk/src/ct/socket.c: - updated setsockopt(IPV6_IPV6ONLY) 2003-11-26 21:22 aet * trunk/configure.ac, trunk/src/ifd/ifdproxy.c: - Check for daemon(), add wrapper code 2003-11-26 21:16 aet * trunk/src/ifd/ria-server.c: - Remove duplicate #include openct/ifd.h 2003-11-26 20:26 aet * trunk/configure.ac, trunk/src/ct/socket.c, trunk/src/ifd/ria-device.c, trunk/src/ifd/ria.c, trunk/src/ifd/ria.h, trunk/src/include/openct/socket.h: - Some portability changes to the new socket code - Warning fixes 2003-11-26 17:16 okir * trunk/src/ct/socket.c: - dont use IPV6_V6ONLY if not defined 2003-11-26 16:24 okir * trunk/etc/openct.conf.in: - added section for ifdproxy 2003-11-26 16:21 okir * trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-sync.c, trunk/src/include/openct/ifd.h: - Replace all phone card specific protocols with the eurochip protocol (patch from Michael Haardt) 2003-11-26 16:17 okir * trunk/src/ct/socket.c: - Endianness fix 2003-11-26 16:11 okir * trunk/src/pcsc/Makefile.am: - leftover patch from I don't know whom 2003-11-26 16:10 okir * trunk/src/ifd, trunk/src/ifd/.cvsignore, trunk/src/ifd/Makefile.am, trunk/src/ifd/device.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdproxy.c, trunk/src/ifd/internal.h, trunk/src/ifd/reader.c, trunk/src/ifd/ria-device.c, trunk/src/ifd/ria-server.c, trunk/src/ifd/ria.c, trunk/src/ifd/ria.h, trunk/src/ifd/serial.c: - Some changes in socket behavior - Added remote access to devices (for debugging) 2003-11-26 16:09 okir * trunk/src/ct/client.c, trunk/src/ct/mainloop.c, trunk/src/ct/socket.c, trunk/src/include/openct/server.h, trunk/src/include/openct/socket.h: - massive socket rewrite 2003-11-26 15:59 okir * trunk/src/include/openct/device.h: - added ifd_device_reset 2003-11-26 15:57 okir * trunk/src/ct/error.c, trunk/src/include/openct/error.h: - more error codes * trunk/src/ct/buffer.c: - Added ct_buf_push - ct_buf_put now compacts the buffer if needed 2003-11-26 15:56 okir * trunk/src/include/openct/buffer.h: - added ct_buf_push 2003-11-26 15:55 okir * trunk/src/ifd/ifd-towitoko.c: - fixed typo - better return codes 2003-11-25 13:38 aet * trunk/ANNOUNCE: - Fixed a typo 2003-11-24 18:05 aet * trunk/NEWS: - Set release date 2003-11-23 20:57 aet * trunk/src/ifd/Makefile.am: - Add prefix ifd- for all actual reader driver source files 2003-11-23 20:36 aet * trunk/src/ifd/ifdhandler.h: - OPENCT_ -> IFD_ 2003-11-23 15:36 aet * trunk/aclocal/Makefile.am: - Add missing m4 files to distribution tarball 2003-11-23 14:52 aet * trunk/etc/Makefile.am: - Replace the hardcoded path /etc with $(sysconfdir) 2003-11-23 13:26 aet * trunk/TODO: - Update TODO status 2003-11-23 12:53 aet * trunk/doc/openct.html, trunk/doc/openct.xml, trunk/etc/openct.conf.in: - Fixed a typo in sample configuration syntax 2003-11-23 12:45 aet * trunk/AUTHORS, trunk/doc/openct.html, trunk/doc/openct.xml, trunk/etc/openct.conf.in: - Documentation updates 2003-11-22 18:09 aet * trunk/ANNOUNCE, trunk/NEWS, trunk/README: - More documentation updates for the upcoming release 2003-11-22 17:39 aet * trunk/doc/openct.html, trunk/doc/openct.xml: - Add minor documentation updates 2003-11-22 14:12 aet * trunk/src/ifd/ifd-ikey2k.c: - Fixed a typo 2003-11-21 21:57 okir * trunk/src/ifd/ifd-gempc.c: - small update 2003-11-21 15:17 aet * trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/internal.h: - Minor warning fixes 2003-11-21 14:24 okir * trunk/src/ifd/ifd-kaan.c: - more kaan patches from mhaardt 2003-11-21 13:21 okir * trunk/etc/Makefile.am, trunk/etc/openct.usermap: - Install targets for hotplug script and usermap 2003-11-21 13:14 okir * trunk/etc/openct.conf.in: - added ID for iKey 2000 2003-11-21 13:05 okir * trunk/src/ifd/driver.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/internal.h, trunk/src/ifd/protocol.c: - implemented "ifdhandler -i" to display list of configured drivers and protocols. * trunk/src/ifd/ifd-ikey2k.c: - fixed warning 2003-11-21 12:45 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-ikey2k.c, trunk/src/ifd/init.c: - merged ikey2k driver from Andreas Jellinghaus 2003-11-21 12:44 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-gempc.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h: - added initial support for gempc readers, untested 2003-11-21 09:40 okir * trunk/src/ifd/ifd-towitoko.c: - fixed typo 2003-11-21 07:16 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-gbp.c: - first stab at Gemplus Block Protocol (GBP) 2003-11-20 21:15 aet * trunk/src/ifd/process.c: - Warning fix * trunk/src/ifd/init.c: - Disable ikey2k init for now 2003-11-20 20:37 aet * trunk/aclocal/acx_pthread.m4: - Replace the patched file with a new upstream version 2003-11-20 09:51 aet * trunk/src/ifd/Makefile.am: - snapshot build fix 2003-11-17 16:09 okir * trunk/src/ifd/ifd-kaan.c: - More Kaan patches from Michael Haardt 2003-11-17 16:03 okir * trunk/src/ifd/protocol.c: - dont crash if ops->init == NULL 2003-11-17 15:51 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-sync.c: - removed mem size probing for sync cards (ugly hack). Patch by mhaardt 2003-11-13 21:13 okir * trunk/src/tools/openct-tool.c: - fix help message (mhaardt) 2003-11-11 22:42 aet * trunk/src/scdl/Makefile.am: - Remove Makefile.mak 2003-11-11 22:30 aet * trunk/configure.ac, trunk/src/Makefile.am, trunk/src/ifd/Makefile.am, trunk/src/ifd/modules.c, trunk/src/scdl, trunk/src/scdl/.cvsignore, trunk/src/scdl/Makefile.am, trunk/src/scdl/scdl.c, trunk/src/scdl/scdl.h: - Merge scdl functions from OpenSC 2003-11-11 21:12 aet * trunk/src/pcsc/pcsc.c: - Add some handling for pcscd's different channel numbering scheme for hotplug devices 2003-11-11 20:56 aet * trunk/src/pcsc/pcsc.c: - Indent lines 2003-10-30 12:42 okir * trunk/src/ct/client.c, trunk/src/ct/socket.c, trunk/src/tools/openct-tool.c: - fixed several resource leaks (patches by Kevin Stefanik) 2003-10-30 12:32 okir * trunk/doc/openct.xml: - Added some instructions on building, and explain --prefix and --sysconfdir - Be a little more specific on where openct.conf is installed, based on the configure options. 2003-10-19 20:28 aet * trunk/src/ifd/conf.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/serial.c, trunk/src/include/openct/conf.h: - Rename hush_errors to suppress_errors, similar to OpenSC. 2003-10-19 13:49 aet * trunk/src/ifd/utils.c, trunk/src/include/openct/ifd.h: - Add somewhat working ifd_debug() for non-gcc compilers 2003-10-19 13:14 aet * trunk/src/ct/buffer.c, trunk/src/ct/client.c, trunk/src/ct/error.c, trunk/src/ct/tlv.c, trunk/src/ctapi/ctapi.c, trunk/src/ifd/device.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-smartboard.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/process.c, trunk/src/ifd/proto-sync.c, trunk/src/ifd/reader.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/utils.c, trunk/src/include/openct/apdu.h, trunk/src/include/openct/buffer.h, trunk/src/include/openct/conf.h, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/error.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/logging.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h, trunk/src/include/openct/server.h, trunk/src/include/openct/socket.h, trunk/src/include/openct/tlv.h, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: - C++ warning fixes and additions to public headers - Move ct_hexdump from libifd to libopenct 2003-10-19 12:59 aet * trunk/src/ifd/Makefile.am, trunk/src/ifd/confparse.c: - Remove empty file confparse.c 2003-10-18 21:09 aet * trunk/src/ifd/device.c, trunk/src/ifd/internal.h, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/usb.c, trunk/src/include/openct/device.h: - Remove obsolete ifd_device_open_channel / ifd_sysdep_channel_to_name - Some polishing for sysdep usb layer, as not all usb api implementations work on top of a file descriptor 2003-10-18 21:05 aet * trunk/src/ct/error.c: - Rename syslog identification string from ifdd to ifdhandler 2003-10-16 20:59 aet * trunk/etc/Makefile.am, trunk/src/pcsc/Makefile.am: - Move additional Info.plist from src/pcsc/ to etc/ instead 2003-10-16 20:40 aet * trunk/configure.ac, trunk/etc/Info.plist, trunk/macos/libtool-bundle, trunk/src/pcsc/Makefile.am: - Preliminary support for installing USB bundle package for pcsc-lite, should work for any platform with pcsc-lite 1.2.0-rc3 or later. TODO: Add all supported vendor/device IDs and friendlynames to src/pcsc/Info.plist 2003-10-16 16:59 aet * trunk/src/ctapi/Makefile.am: - Don't link with libifd 2003-10-16 15:51 aet * trunk/Makefile.am, trunk/configure.ac, trunk/macos, trunk/macos/.cvsignore, trunk/macos/Makefile.am, trunk/macos/libtool-bundle: - Merge bundle installation script from OpenSC 2003-10-16 14:16 aet * trunk/src/ctapi/Makefile.am: - PC/SC IFD installation fix for MacOS X 2003-10-16 14:00 aet * trunk/src/ifd/ifd-kaan.c: - Add missing sys/poll.h, any reason not to use usleep instead? 2003-10-16 13:29 aet * trunk/src/pcsc/Makefile.am: - Oops, include order is important in some environments 2003-10-16 13:15 aet * trunk/src/tools, trunk/src/tools/.cvsignore: - Add openct-control * trunk/configure.ac, trunk/src/Makefile.am, trunk/src/tools/Makefile.am: - Move openct-control from src/control to src/tools 2003-10-16 12:59 aet * trunk/src/ifd/Makefile.am, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/sys-null.c, trunk/src/ifd/utils.c, trunk/src/include/openct/ifd.h, trunk/src/tools/openct-control.c: - Start renewing the USB layer, move all OS specific functions to ifd/sys-*.c - Rename mgr_scan_usb to ifd_scan_usb, temporary - Move mgr_spawn_ifdhandler to libifd and rename it as ifd_spawn_handler - Add sys-null.c for platforms that don't have USB layer implemented yet, therefore provides support for using serial devices only 2003-10-16 11:34 okir * trunk/src/ifd/proto-sync.c: - disable probing of card length for now 2003-10-16 10:50 aet * trunk/src/pcsc/Makefile.am, trunk/src/pcsc/pcsc.c: - New PC/SC IFD handler implementation. Incomplete, but works. 2003-10-15 10:50 okir * trunk/src/ifd/ifd-kaan.c: - clarified kaan TLV encoding 2003-10-15 10:12 okir * trunk/src/ifd/ifd-kaan.c: - new B1 patch from Michael Haardt 2003-10-15 10:07 okir * trunk/src/include/openct/ifd.h: - added IFD_PROTOCOL_4401ff (mhaardt) 2003-10-13 16:04 aet * trunk/aclocal/acx_pthread.m4, trunk/configure.ac, trunk/src/pcsc/Makefile.am: - Merge PC/SC changes and pthread support from OpenSC 2003-10-12 19:24 aet * trunk/src/pcsc/ifdhandler.h: Merge ifdhandler.h from pcsc-lite 1.2.0 2003-10-09 19:08 okir * trunk/src/ifd/ifd-kaan.c: - merge some more diffs from Michael Haardt 2003-10-09 18:38 okir * trunk/src/ifd/proto-t1.c: - force a device flush in resynchronize 2003-10-08 11:56 aet * trunk/src/ctapi/ctapi.h, trunk/src/include/openct/apdu.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h, trunk/src/include/openct/server.h, trunk/src/include/openct/socket.h, trunk/src/include/openct/tlv.h: While at it, unify the copyright header a bit. 2003-10-08 11:33 okir * trunk/src/ctapi/Makefile.am: - install ctapi.h 2003-10-08 11:28 okir * trunk/src/ctapi/ctapi.h: - Patch from Michael Haardt: removed useless PORT_* macros, added ERR_HOST 2003-10-07 18:21 aet * trunk/src/ifd/ifd-smartboard.c, trunk/src/ifd/serial.c, trunk/src/include/openct/device.h: Minor warnings / portability fixes 2003-10-07 13:41 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-smartboard.c, trunk/src/ifd/init.c: - First implementation of Cherry Smartboard Driver 2003-10-07 13:40 okir * trunk/src/ifd/serial.c: - Added code to turn on detect parity errors on input (req'd by Smartboard) - Added ifd_serial_send_break - Fixed compiler warning 2003-10-07 13:38 okir * trunk/src/ifd/ifdhandler.c: - fixed uninitialized variable * trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/include/openct/ifd.h: - Add support for "block oriented" devices, such as the Cherry Smartboard, that will send T=0 and T=1 commands in one frame. 2003-10-07 13:36 okir * trunk/src/include/openct/device.h: - added check_parity field to device_params 2003-10-02 08:47 aet * trunk/src/ctapi/ctapi.c: Add bugfix update from Michael Haardt 2003-10-01 09:00 aet * trunk/src/ctapi/Makefile.am, trunk/src/pcsc/Makefile.am: - Backout @libdir@/openct installation - Rename openct-ctapi back to libopenctapi as requested by Michael Haardt 2003-09-28 15:06 aet * trunk/src/ctapi/Makefile.am, trunk/src/pcsc/Makefile.am: Fix openct-ctapi / openct-ifd linking 2003-09-28 14:44 aet * trunk/src/ctapi/Makefile.am: Rename libopenctapi.so back to openct-ctapi.so 2003-09-25 15:03 aet * trunk/src/tools/openct-tool.c: Fix hardcoded ifd.conf path into use of OPENCT_CONF_PATH 2003-09-24 10:17 aet * trunk/ChangeLog: Remove old ChangeLog, add URL to the new location. 2003-09-18 18:08 aet * trunk/src/include/openct/ifd.h: - Minor cleanups - Add temporary hack for ifd_debug to make it work with non-gcc compilers, needs a rewrite some other day. 2003-09-18 17:59 aet * trunk/src/ifd/process.c: Rewrite cmd_name handling to make it work with non-gcc compilers 2003-09-12 06:49 aet * trunk/configure.ac: Minor merge with OpenSC 2003-09-10 10:02 aet * trunk/configure.ac: Replace overly complex and old configure magic for connect() and friends, just check for socket() in libsocket. 2003-09-05 12:33 aet * trunk/src/ct/socket.c: Fix for the previous commit 2003-09-05 11:52 aet * trunk/src/ct/socket.c, trunk/src/ifd/conf.c, trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-sync.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/proto-trans.c, trunk/src/ifd/serial.c, trunk/src/ifd/usb.c, trunk/src/include/openct/openct.h: Build fixes for non-gcc compilers, untested. 2003-09-05 10:40 aet * trunk/src/ct/error.c: Rewrite ct_strerror to make it work with non-gcc compilers 2003-09-04 13:54 okir * trunk/src/ifd/ifd-egate.c: - Patch from Chaskiel: prevent USB stall 2003-09-04 08:37 aet * trunk/Makefile.am, trunk/configure.ac, trunk/src/Makefile.am, trunk/src/ifd/Makefile.am: Renaming / moving things update 2003-09-03 20:38 okir * trunk/src/ifd/ifd-kaan.c: - Merged patch from Michael Haardt to support Siemens B1 2003-09-03 15:22 aet * trunk/configure.ac: Build fix for MacOS X + fink 2003-09-03 12:32 aet * trunk/src/ct/client.c, trunk/src/ct/status.c, trunk/src/ifd/conf.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/serial.c, trunk/src/include/openct/driver.h, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: Build / warning fixes 2003-09-03 11:50 aet * trunk/configure.ac, trunk/src/ct/libopenct.pc.in, trunk/src/ifd/checksum.c, trunk/src/ifd/internal.h, trunk/src/ifd/modules.c, trunk/src/ifd/utils.c, trunk/src/include/openct, trunk/src/include/openct/.cvsignore, trunk/src/include/openct/Makefile.am, trunk/src/include/openct/socket.h: - Fix the ifdhandler path for OPENCT_IFDHANDLER_PATH - Generate system depended openct/types.h for portability, install it to exec_prefix/include - Build fixes 2003-09-03 11:46 aet * trunk/aclocal/ac_compile_check_sizeof.m4, trunk/aclocal/ac_create_stdint_h.m4: Add 3rdparty M4 macros 2003-09-02 05:25 okir * trunk/src/ctapi/ctapi.c: - bugfix update from Michael Haardt 2003-08-26 12:22 aet * trunk/src/ct/Makefile.am, trunk/src/ifd/Makefile.am: Add versioning to libopenct and libifd 2003-08-26 12:16 aet * trunk/Makefile.am, trunk/configure.ac, trunk/doc/Makefile.am, trunk/etc/Makefile.am, trunk/src/Makefile.am, trunk/src/ct/Makefile.am, trunk/src/ctapi/Makefile.am, trunk/src/ifd/Makefile.am, trunk/src/include/Makefile.am, trunk/src/include/openct/Makefile.am, trunk/src/pcsc/Makefile.am, trunk/src/pcsc/ifdhandler.h, trunk/src/pcsc/pcsc.c, trunk/src/tools/Makefile.am: Generic build cleanups PC/SC IFD build fixes 2003-08-26 11:17 aet * trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-sync.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/proto-trans.c, trunk/src/ifd/serial.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/utils.c: Move sys/time.h include to internal.h, it needs to be included there anyway because of ifd_time_elapsed() function prototype. 2003-08-26 10:54 aet * trunk/configure.ac, trunk/src/ct/buffer.c, trunk/src/ct/client.c, trunk/src/ct/error.c, trunk/src/ct/mainloop.c, trunk/src/ct/socket.c, trunk/src/ct/status.c, trunk/src/ct/tlv.c, trunk/src/ctapi/ctapi.c, trunk/src/ifd/apdu.c, trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/ifd/ctbcs.c, trunk/src/ifd/device.c, trunk/src/ifd/driver.c, trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/locks.c, trunk/src/ifd/manager.c, trunk/src/ifd/modules.c, trunk/src/ifd/process.c, trunk/src/ifd/proto-sync.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/proto-trans.c, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/ifd/serial.c, trunk/src/ifd/sys-bsd.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c, trunk/src/include/openct/Makefile.am, trunk/src/include/openct/conf.h, trunk/src/include/openct/pathnames.h, trunk/src/pcsc/pcsc.c, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: - Remove openct/pathnames.h, use autoconf + config.h instead - Include config.h in sources - Add minor portability fixes, many more to come 2003-08-25 10:24 aet * trunk/configure.ac: More merging with OpenSC 2003-08-22 19:13 aet * trunk/configure.ac: More OpenSC configure merges, now OpenCT ./configure at least runs on other operating systems than Linux. 2003-08-22 14:40 okir * trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-trans.c: - fixed t=0 and trans protocol handlers 2003-08-22 14:15 aet * trunk/etc/Makefile.am: Build fix 2003-08-22 13:48 aet * trunk/configure.ac: Merge PC/SC stuff from OpenSC. From now on, -lpcsclite won't be part of LIBS, so you may need to update other Makefiles. 2003-08-22 13:25 aj * trunk/src/ifd/sys-bsd.c: No, I'm not working at suse. Only a typo. 2003-08-22 13:01 aet * trunk/src/ifd/sys-bsd.c: Typo fixes 2003-08-22 11:46 aet * trunk/Makefile.am, trunk/aclocal/Makefile.am, trunk/bootstrap, trunk/configure.ac: - Merge configure stuff with OpenSC - Remove tools/, add aclocal/ 2003-08-22 11:43 aet * trunk, trunk/.cvsignore, trunk/aclocal, trunk/aclocal/.cvsignore, trunk/doc, trunk/doc/.cvsignore, trunk/etc, trunk/etc/.cvsignore, trunk/src, trunk/src/.cvsignore, trunk/src/ct, trunk/src/ct/.cvsignore, trunk/src/ctapi, trunk/src/ctapi/.cvsignore, trunk/src/ifd, trunk/src/ifd/.cvsignore, trunk/src/include, trunk/src/include/.cvsignore, trunk/src/include/openct, trunk/src/include/openct/.cvsignore, trunk/src/pcsc, trunk/src/pcsc/.cvsignore, trunk/src/tools, trunk/src/tools/.cvsignore: Add .cvsignore files 2003-08-20 09:54 aj * trunk/doc/openct.html, trunk/doc/openct.xml: Improvements and spelling fixes by Ville Skytt��. Note: The HTMl changes are quite big, as someone else has a slightly different toolchain, with slightly different results, I guess. things like moving to a new line. If you know hoe we can avoid this, please let me know. 2003-08-18 12:31 okir * trunk/src/ifd/ifd-kaan.c: - support for sync ICCs * trunk/src/ifd/proto-sync.c: - allow ifd_sync_detect_icc to be called with NULL atr ptr * trunk/src/ifd/internal.h: - made ifd_sync_probe_memory_size public 2003-08-18 06:14 aj * trunk/configure.ac: restore tools/ subdir, as the change to remove it was incomplete and broke the build process. 2003-08-15 11:51 aet * trunk/Makefile.am: Add ANNOUNCE to distribution tarball 2003-08-15 11:11 okir * trunk/src/ctapi/Makefile.am, trunk/src/ctapi/ctapi.c: - New CTAPI implementation from Michael Haardt 2003-08-15 10:53 okir * trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-t1.c, trunk/src/ifd/protocol.c, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h: - use ifd_protocol_resynchronize to request t=1 resync 2003-08-15 10:11 okir * trunk/src/tools/openct-tool.c: - previous changes broke printing async ATRs 2003-08-13 09:55 okir * trunk/configure.ac, trunk/src/ct/client.c, trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/process.c, trunk/src/ifd/proto-sync.c, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h: - initial support for synchronous ICCs 2003-08-13 09:50 okir * trunk/src/tools/openct-tool.c: - added command to dump sync ICCs 2003-08-13 09:49 okir * trunk/src/ct/socket.c, trunk/src/ifd/ifdhandler.c: - increased default socket buffer size 2003-08-13 09:48 okir * trunk/src/include/openct/socket.h: - allow to TLV encode more than 255 bytes of data - specify default socket buffer size 2003-08-13 09:47 okir * trunk/src/ct/tlv.c, trunk/src/include/openct/tlv.h: - allow to TLV encode more than 255 bytes of data 2003-08-13 09:45 okir * trunk/src/ifd/serial.c: - added some debugging output 2003-08-13 09:44 okir * trunk/src/ifd/proto-t1.c: - Perform a resynch if the initial state is RESYNCH 2003-08-13 08:37 okir * trunk/src/ct/error.c: - fixed typo in previous patch 2003-08-13 06:54 okir * trunk/src/ct/error.c: - implemented ct_strerror * trunk/src/include/openct/error.h: - additional error code 2003-08-12 16:13 okir * trunk/src/ifd/ifd-eutron.c, trunk/src/ifd/sys-linux.c: - fixed a few compiler warnings 2003-08-11 21:03 aj * trunk/src/ifd/conf.c: fix END_OF_FILE comparison on ppc. 2003-08-08 20:46 okir * trunk/ANNOUNCE: - Added announcement 2003-08-07 18:13 aj * trunk/etc/hotplug.openct.in: fix hotplug script. assume it is always called for usb devices. 2003-08-05 15:36 aj * trunk/src/ifd/ifd-eutron.c: Sleep between retries for 0.1 s key generation completed so far within 20 seconds. 2003-08-05 15:35 aj * trunk/src/ifd/proto-t0.c: increase timeout, as generating keys can take more than 40 seconds. 2003-08-01 12:53 okir * trunk/src/ifd/proto-t1.c: - Fixed size_t vs unsigned int mixup (barfs on 64bit archs) 2003-08-01 10:58 aj * trunk/configure.ac, trunk/src/ifd/sys-linux.c: autoconf test for new / old linux usb structures. 2003-08-01 08:26 aj * trunk/src/include/openct/ifd.h: undo a bogus change. 2003-08-01 07:11 aj * trunk/src/include/openct/apdu.h, trunk/src/include/openct/buffer.h, trunk/src/include/openct/conf.h, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/error.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/logging.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/pathnames.h, trunk/src/include/openct/protocol.h, trunk/src/include/openct/socket.h, trunk/src/include/openct/tlv.h: defines in headerfiles should reflect the filename. i.e. #include a/b.h -> #ifndef A_B_H ... 2003-07-31 19:27 aj * trunk/src/ifd/sys-linux.c: looks like that change was done in 2.5.2 http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.5/usb-devrequest-2.5.2-pre9.patch 2003-07-31 18:29 aj * trunk/src/ifd/sys-linux.c: My debian unstable headers are 2.4.20 and have the old structure - off by one I guess. 2003-07-31 12:51 okir * trunk/doc/Makefile.am: - build fix for systems that dont have docbook.xsl 2003-07-31 11:55 okir * trunk/src/ifd/sys-linux.c: - make it build on 2.4.21 2003-07-27 16:38 aj * trunk/src/ifd/proto-t1.c: further cleanup of t1 / error / resync handling. 2003-07-23 19:15 aj * trunk/src/tools/openct-tool.c: add "rwait" command to wait for a reader. useful for hot plugging. 2003-07-23 15:27 aj * trunk/configure.ac: fix usb / openct-control / cold plugging. this time realy. 2003-07-23 15:05 aj * trunk/src/tools/openct-control.c: #include "config.h" is required, as #ifdef HAVE_LIBUSB is used. 2003-07-23 14:58 aj * trunk/Makefile.am: remove config.status on "make distclean". 2003-07-22 21:39 aj * trunk/etc/hotplug.openct.in: changes $1 to $TYPE, as at least mandrake does not pass a first argument. Also we could change it to "usb" since our hotplug currently is only called for usb devices. 2003-07-22 15:42 aj * trunk/doc/openct.html, trunk/doc/openct.xml, trunk/etc/Makefile.am: Do not install openct.conf, so we don't overwrite valuable configuration. Do not install init script, so we don't overwrite valuable configuration. Add documentation how to install these files. 2003-07-22 14:50 aj * trunk/src/tools/openct-tool.c: fix usage text: main folder is selected by "mf" argument. 2003-07-22 14:49 aj * trunk/etc/Makefile.am: allways install openct.conf in /etc, as openct will always look for it in /etc. 2003-07-22 14:44 aj * trunk/etc/init-script.in: fixed .../sbin/sbin/... issue. 2003-07-21 12:59 aj * trunk/doc/openct.html, trunk/doc/openct.xml: add missing id, fix typo. 2003-07-21 12:52 aj * trunk/doc/openct.html, trunk/doc/openct.xml: small updates, mostly adding id's, removed print-atr, added Eutron CryptoIdendity IT-Sec documentation. 2003-07-21 11:11 aj * trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/serial.c, trunk/src/include/openct/device.h: add cts detection to serial device handler. the drivers return the atr length in the reset function. make that obvious. 2003-07-21 11:10 aj * trunk/src/ifd/ifd-eutron.c: Eutron driver is now working with these changes. * trunk/src/ifd/proto-t1.c: new fixed and clean resync handling. 2003-07-21 11:09 aj * trunk/doc/openct.html, trunk/doc/openct.xml: markus friedl helped with the bsd port. 2003-07-21 11:08 aj * trunk/etc/openct.conf.in: change the config file, so people do not need to edit it. 2003-07-19 16:28 aj * trunk/Makefile.am: Include LICENSE in tar file. (*party* *finaly* *we*have*a*license* :-) 2003-07-19 16:06 okir * trunk/LICENSE: - Added license 2003-07-19 10:48 aj * trunk/Makefile.am, trunk/README, trunk/bootstrap, trunk/configure.ac: Set automake option via Makefile.am remove requirement for automake, remove requirement comments from bootstrap, add pointer to docs/opensc.html to README. 2003-07-17 13:16 aj * trunk/src/ct/socket.c, trunk/src/ifd/modules.c, trunk/src/ifd/serial.c, trunk/src/ifd/sys-bsd.c: Improvements for the *BSD port. 2003-07-17 10:55 aj * trunk/configure.ac: forgot ) 2003-07-17 10:47 aj * trunk/src/tools/openct-control.c: Disable coldplugging unless libusb is available. 2003-07-17 10:45 aj * trunk/configure.ac: add HAVE_LIBUSB if it is available. 2003-07-17 10:38 aj * trunk/configure.ac: fix order. 2003-07-17 10:36 aj * trunk/configure.ac: 1.5.* does not support new style automake init. 2003-07-17 10:32 aj * trunk/bootstrap: use only autoreconf, no need to call libtoolize etc. 2003-07-16 20:29 aj * trunk/src/ifd/proto-t1.c: RESYNC code is buggy. now it works, but is very ugly. 2003-07-15 09:40 aj * trunk/src/ifd/ifd-eutron.c: Add driver for Eutron Crypto Idendity (IT-Sec, maybe others). Still work in progress, not working :-( 2003-07-15 09:13 aj * trunk/src/ifd/Makefile.am, trunk/src/ifd/init.c: Initial eutron support (defunct) 2003-07-15 09:11 aj * trunk/src/tools/openct-control.c: make coldplugging optional. -n will disable it. 2003-07-15 08:22 aj * trunk/src/ifd/sys-bsd.c: Initial BSD support (still incomplete / not working). 2003-07-15 08:21 aj * trunk/src/ifd/Makefile.am: Initial BSD support (still incomplete) 2003-07-15 08:17 aj * trunk/src/ifd/internal.h, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c, trunk/src/include/openct/device.h: all parameters of the usb control request are unsigned. 2003-07-15 08:14 aj * trunk/bootstrap, trunk/configure.ac, trunk/etc/Makefile.am: configure/makefile fixes: - require autoconf 2.57 - require automake 2.7.6 - test for lib dl (not required on *bsd) - test for lib usb (but code currently does not stop if it is not found. currently libusb is necessary, but could be changed.) 2003-07-12 17:05 aj * trunk/Makefile.am: Include bootstrap in distribution tar file. 2003-07-10 10:34 aj * trunk/configure.ac: updates configure to new init syntax. set automake strictness to foreign 2003-07-05 15:46 aj * trunk/doc/openct.html, trunk/doc/openct.xml: Even more documentation updates. 2003-07-05 15:30 aj * trunk/doc/openct.html, trunk/doc/openct.xml: Documentation update: - list all drivers, try to give a status. - add missing section on installation with hotplug utils (it somehow got lost, usbtoken had more detailed instructions). 2003-07-03 19:46 aj * trunk/doc/Makefile.am: Fix typo in makefile (s/sc/ct/g) 2003-07-03 19:24 aj * trunk/doc/openct.html, trunk/doc/openct.xml: how could cvs mess this up? the last version was very, very buggy. 2003-07-03 19:13 aj * trunk/doc/Makefile.am, trunk/doc/openct.css, trunk/doc/openct.html, trunk/doc/openct.xml, trunk/doc/openct.xsl: Improved documentation: - integrated what I had already documented for usbtoken. - deleted duplicates, improved some small parts. 2003-07-02 15:01 aj * trunk/doc/openct.html, trunk/doc/openct.xml: added some documentation on security and troubleshooting. still very incomplete :-( 2003-06-26 16:49 aj * trunk/doc/Makefile.am, trunk/doc/openct.html: run tidy on html files (ignore if tidy is not available). tidy html file, so it is human readable. 2003-06-25 08:20 aj * trunk/src/ifd/sys-linux.c: reference to usb.h is never used. 2003-06-25 08:16 aj * trunk/doc/Makefile.am, trunk/doc/openct.html: Ease the pain for developers: add the html document to cvs. I will always update both, so even other developers don't need to have docbook dtd, tools, stylesheets installed. 2003-06-25 08:06 aj * trunk/src/ifd/Makefile.am: libusb is not used here at all, no need to link with it. * trunk/src/ifd/Makefile.am: Don't forget the header files, without them in the dist tarball it will not compile. added ctbcs.h 2003-06-25 08:05 aj * trunk/src/ifd/sys-linux.c: return the number of bytes send or received, not len. 2003-06-23 12:50 okir * trunk/src/ct/client.c, trunk/src/ifd/Makefile.am, trunk/src/ifd/ctbcs.c, trunk/src/ifd/ctbcs.h, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/process.c, trunk/src/ifd/reader.c, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h: - added PERFORM VERIFY stuff * trunk/src/ct/buffer.c, trunk/src/include/openct/buffer.h: - added deferred overrun check 2003-06-23 12:49 okir * trunk/src/ifd/proto-t1.c: - attempt at better WTX handling 2003-06-23 12:48 okir * trunk/src/include/openct/error.h: - more error codes 2003-06-16 11:32 okir * trunk/src/ifd/sys-linux.c: - fixed return value of usb_control 2003-06-15 12:38 okir * trunk/src/include/openct/device.h: - added ifd_serial_get_{dsr,dtr} 2003-06-15 12:37 okir * trunk/src/ifd/ifd-cardman.c, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/reader.c, trunk/src/ifd/sys-linux.c: - get rid of compiler wwarnings 2003-06-15 12:36 okir * trunk/src/ifd/proto-t1.c: - resync after t1 error and retry command 2003-06-14 19:53 okir * trunk/src/ifd/reader.c: - minor cosmetic changes * trunk/src/ifd/ifd-cardman.c: - some T=0 stuff already working * trunk/src/tools/openct-tool.c: - cryptoflex needs special class byte in select file 2003-06-14 17:19 okir * trunk/etc/openct.conf.in: - added entry for omnikey cardman 2020 2003-06-14 17:17 okir * trunk/src/tools/openct-tool.c: - fixed usage message 2003-06-14 17:16 okir * trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/proto-t0.c, trunk/src/ifd/serial.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c: - redid usb_control handling * trunk/src/ifd/Makefile.am, trunk/src/ifd/ifd-cardman.c: - added cardman 2020 driver 2003-06-14 17:14 okir * trunk/src/include/openct/device.h: - redid usb_control stuff * trunk/src/ifd/reader.c, trunk/src/include/openct/ifd.h: - added ifd_atr_complete 2003-06-14 17:13 okir * trunk/src/ct/mainloop.c: - properly initialize socket list head 2003-06-02 21:23 okir * trunk/src/ifd/ifd-kaan.c: - more effective polling card_status polling (use FREEZE command) 2003-06-02 21:22 okir * trunk/src/ifd/serial.c: - Added ifd_serial_get_{dsr,dtr} 2003-05-27 15:27 aj * trunk/src/pcsc/Makefile.am: smaller ifdef context does not change anything, but makes older automake versions happy. 2003-05-26 09:31 aj * trunk/Makefile.am, trunk/configure.ac: move autoconf helper files to tools/ subdirectory. 2003-05-24 19:28 aj * trunk/etc/Makefile.am, trunk/etc/hotplug.openct, trunk/etc/hotplug.openct.in, trunk/etc/init-script, trunk/etc/init-script.in, trunk/etc/openct.conf, trunk/etc/openct.conf.in: replaces files with .in files: Makefile will substitute SBINDIR for the sbin dir. 2003-05-23 10:03 okir * trunk/src/ifd/proto-t0.c: - inserted a usleep(10msec) when receiving a wait extension character 2003-05-22 20:56 okir * trunk/src/ifd/ifd-egate.c: - fix for APDUs with 4 bytes (Chaskiel) 2003-05-19 15:48 okir * trunk/src/ifd/proto-t1.c: - properly retry operation if recv and/or checksum failed 2003-05-19 15:45 okir * trunk/src/ifd/proto-t1.c: - resynch after all t1 errors 2003-05-19 14:45 okir * trunk/src/ifd/ifdhandler.c: - updated usage message 2003-05-19 14:44 okir * trunk/src/ifd/proto-t1.c: - change max recv buffer handling in t1_xcv 2003-05-19 14:16 okir * trunk/src/ct/tlv.c: - avoid gcc warnings 2003-05-19 12:42 aj * trunk/TODO: openct-control is noisy. * trunk/src/ifd/Makefile.am, trunk/src/ifd/device.c, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-ikey3k.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/serial.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c: new driver ikey3k. changed send/recv buffer to unsigned char*. improved logging in usb.c 2003-05-19 12:41 aj * trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h: send and recv should have a unsigned char* buffer, not void* buffer. * trunk/etc/init-script, trunk/etc/openct.conf: new init script. new ikey3k in openct.conf put openct.conf entries in order. 2003-05-16 16:08 aj * trunk/Makefile.am, trunk/configure.ac, trunk/doc, trunk/doc/Makefile.am, trunk/doc/openct.xml, trunk/etc/Makefile.am, trunk/src/pcsc/Makefile.am: Added documentation. src/pcsc: fix rename in Makefile.am 2003-05-15 21:17 aj * trunk/etc/hotplug.openct: add demo hotplug script. 2003-05-15 21:16 aj * trunk/etc/Makefile.am: added demo hotplug script 2003-05-14 18:57 okir * trunk/src/tools/openct-control.c: - added status command 2003-05-14 06:51 okir * trunk/src/ctapi/Makefile.am, trunk/src/ifd/Makefile.am, trunk/src/pcsc/Makefile.am: - fixed botched build changes 2003-05-12 09:09 okir * trunk/src/pcsc/Makefile.am: - renamed module as suggested by aj 2003-05-12 09:06 okir * trunk/src/ct/libopenct.pc.in: - fixed cflags 2003-05-12 09:05 okir * trunk/src/ct/Makefile.am: - added pkgconfig target * trunk/etc/openct.conf: - another etoken ID 2003-05-12 09:04 okir * trunk/src/ifd/Makefile.am: - moved ifdhandler to /sbin 2003-05-12 08:29 okir * trunk/src/ctapi/Makefile.am: - renamed module as suggested by aj 2003-05-12 08:26 okir * trunk/src/ifd/Makefile.am, trunk/src/ifd/print-atr.c: - nixed print-atr 2003-05-08 11:40 aj * trunk/src/include/Makefile.am, trunk/src/pcsc/Makefile.am: remove generated files in "make maintainer-clean". 2003-05-08 11:01 okir * trunk/src/pcsc/ifdhandler.h: - missing header, required 2003-05-08 10:59 okir * trunk/configure.ac, trunk/src/ct/libopenct.pc.in: - automakefied thanks to Andreas Jellinghaus 2003-05-08 10:49 okir * trunk/AUTHORS, trunk/Makefile, trunk/Makefile.am, trunk/NEWS, trunk/bootstrap, trunk/etc/Makefile.am, trunk/src/Makefile, trunk/src/Makefile.am, trunk/src/ct/Makefile, trunk/src/ct/Makefile.am, trunk/src/ctapi/Makefile, trunk/src/ctapi/Makefile.am, trunk/src/ifd/Makefile, trunk/src/ifd/Makefile.am, trunk/src/include/Makefile, trunk/src/include/Makefile.am, trunk/src/include/openct/Makefile, trunk/src/include/openct/Makefile.am, trunk/src/pcsc/Makefile, trunk/src/pcsc/Makefile.am, trunk/src/pcsc/pcsc.c, trunk/src/tools/Makefile, trunk/src/tools/Makefile.am: - automakefied thanks to Andreas Jellinghaus 2003-04-17 18:02 okir * trunk/src/ifd/proto-t1.c: - t=1: fixed handling of S-block requests 2003-04-16 11:04 okir * trunk/src/ifd/proto-t0.c: - give slow operations a little more leeway 2003-04-12 21:26 okir * trunk/README, trunk/etc/openct.conf, trunk/src/ifd/Makefile, trunk/src/ifd/ifd-egate.c, trunk/src/ifd/init.c: - Merged egate driver from Chaskiel M Grundman 2003-04-11 15:31 okir * trunk/TODO: Update 2003-04-11 15:30 okir * trunk/src/include/openct/error.h: - added IFD_ERROR_NOT_CONNECTED 2003-04-11 15:29 okir * trunk/src/ct/socket.c: - SIGPIPE protection when writing to socket 2003-04-11 13:22 okir * trunk/src/ifd/ifdhandler.c, trunk/src/ifd/reader.c, trunk/src/include/openct/ifd.h: - don't poll for card status while client is talking to card (slows things down too much) 2003-04-11 13:21 okir * trunk/src/ifd/proto-t1.c: - fix for linux usb 2003-04-10 18:40 okir * trunk/src/ct/error.c, trunk/src/ct/status.c, trunk/src/include/openct/Makefile: - build fixes for newer gcc 2003-04-10 14:15 okir * trunk/TODO, trunk/src/ct/client.c, trunk/src/ifd/process.c, trunk/src/ifd/reader.c, trunk/src/include/openct/ifd.h, trunk/src/include/openct/protocol.h: - added a bunch of functions to ifd protocol 2003-04-10 13:50 okir * trunk/TODO, trunk/src/ifd/reader.c, trunk/src/include/openct/driver.h: - added card_eject 2003-04-10 13:46 okir * trunk/TODO: Update * trunk/src/Makefile: - daemon/ moved to control/ 2003-04-10 13:45 okir * trunk/src/ifd/ifdhandler.c: - clean status file slot on exit * trunk/src/ct/client.c: - added ct_reader_info * trunk/src/tools/openct-tool.c: - cleanup; added wait command 2003-04-10 13:28 okir * trunk/src/include/openct/ifd.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/pathnames.h: Update 2003-04-10 13:24 okir * trunk/src/tools/Makefile: - updated install target 2003-04-10 13:20 okir * trunk/src/tools/openct-control.c: - ifdmaster becomes openct-control 2003-04-10 13:19 okir * trunk/src/ifd/locks.c: - use ifd_debug instead of ct_debug * trunk/src/ifd/ifdhandler.c: - become a daemon 2003-04-10 13:18 okir * trunk/src/ct/status.c: - use lock file while allocating slot in status file 2003-04-10 11:53 okir * trunk/src/tools/Makefile: - openct-control obsolete 2003-04-10 11:51 okir * trunk/src/ifd/manager.c, trunk/src/tools/openct-tool.c: - renamed IFD_MAX_READERS -> OPENCT_MAX_READERS * trunk/src/tools/openct-control.c: - another day, another rewrite 2003-04-10 11:49 okir * trunk/src/ifd/ifdhandler.c: - poll for card status * trunk/src/ifd/ifd-kaan.c: - renamed IFD_MAX_SLOTS -> OPENCT_MAX_SLOTS 2003-04-10 11:48 okir * trunk/src/ifd/reader.c: - removed pid field from ifd_reader_t * trunk/src/ifd/ifd-towitoko.c: - activate reader prior to reset 2003-04-10 11:47 okir * trunk/src/ct/Makefile, trunk/src/ct/client.c, trunk/src/ct/status.c: - Put reader and slot status into public status file 2003-04-09 17:20 okir * trunk/src/ifd/Makefile: - install ifdhandler, too 2003-04-09 15:40 okir * trunk/Makefile, trunk/src/Makefile, trunk/src/ct/Makefile, trunk/src/ctapi/Makefile, trunk/src/ifd/Makefile, trunk/src/include/Makefile, trunk/src/include/openct/Makefile, trunk/src/pcsc/Makefile, trunk/src/tools/Makefile: - added install target 2003-04-09 15:30 okir * trunk/src/ct/client.c, trunk/src/ct/socket.c, trunk/src/ifd/conf.c, trunk/src/ifd/internal.h, trunk/src/include/openct/Makefile: - moved around include files 2003-04-09 15:15 okir * trunk/README: Update 2003-04-09 15:10 okir * trunk/src/ifd/ifd.conf: obsolete 2003-04-09 15:04 okir * trunk/etc/openct.conf, trunk/etc/opensc.conf: - check in right config file 2003-04-09 15:00 okir * trunk/src/ct/Makefile, trunk/src/ct/mainloop.c, trunk/src/ct/socket.c, trunk/src/ifd/Makefile, trunk/src/ifd/conf.c, trunk/src/ifd/device.c, trunk/src/ifd/driver.c, trunk/src/ifd/hotplug.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/ifdhandler.c, trunk/src/ifd/ifdhandler.h, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/locks.c, trunk/src/ifd/process.c, trunk/src/ifd/reader.c, trunk/src/ifd/sys-linux.c, trunk/src/include/openct/conf.h, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/pathnames.h, trunk/src/include/openct/server.h, trunk/src/tools/openct-control.c: - another major butchery for hotplug support 2003-04-09 12:36 okir * trunk/src/tools/Makefile: - added openct-control 2003-04-09 12:33 okir * trunk/src/ct/mainloop.c, trunk/src/ifd/ifdhandler.c, trunk/src/tools/openct-control.c: - Restructuring for hotplug 2003-04-09 12:32 okir * trunk/src/ifd/device.c, trunk/src/ifd/hotplug.c, trunk/src/ifd/internal.h, trunk/src/ifd/manager.c, trunk/src/ifd/reader.c, trunk/src/include/openct/device.h, trunk/src/include/openct/ifd.h: - USB hotplug related changes 2003-04-09 12:31 okir * trunk/src/ct/socket.c, trunk/src/include/openct/socket.h: - added socket permission parameter to ct_socket_listen - added puts/gets style functions for sending/receiving strings - ct_socket_flsbuf(..., 2) does a shutdown(SEND) 2003-04-09 12:30 okir * trunk/src/include/openct/error.h: - ERROR_NO_MEMORY * trunk/src/ct/error.c, trunk/src/include/openct/logging.h: - support logging to syslog 2003-04-09 12:29 okir * trunk/src/ct/client.c, trunk/src/include/openct/openct.h: - added ct_master_control * trunk/src/ct/buffer.c, trunk/src/include/openct/buffer.h: - added gets/puts functions 2003-04-08 18:52 okir * trunk/src/tools/openct-control.c: - started on hotplug support 2003-04-08 18:51 okir * trunk/src/ifd/internal.h, trunk/src/ifd/manager.c, trunk/src/ifd/usb.c: - added usb_poll_presence * trunk/src/ct/socket.c, trunk/src/include/openct/socket.h: - socket cleanup 2003-04-08 18:12 okir * trunk/src/ifd/internal.h, trunk/src/ifd/serial.c, trunk/src/ifd/usb.c: - added fd to ifd_device_t; got rid of special types ifd_serial_t and ifd_usb_t 2003-04-08 15:27 okir * trunk/TODO: - update 2003-04-08 15:13 okir * trunk/etc, trunk/etc/opensc.conf: - added sample config file 2003-04-08 15:12 okir * trunk/src/ifd/Makefile, trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/ifd/hotplug.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/print-atr.c, trunk/src/ifd/reader.c, trunk/src/ifd/sys-linux.c, trunk/src/include/openct/conf.h, trunk/src/include/openct/ifd.h, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: - changed config file handling and format 2003-04-08 14:17 okir * trunk/src/ct/Makefile, trunk/src/ct/client.c, trunk/src/ct/error.c: - moved conf.c back to libifd 2003-04-08 14:14 okir * trunk/src/ct/error.c, trunk/src/ifd/conf.c: - cleanup * trunk/src/ct/client.c: - use hard-coded socket dir 2003-04-08 10:54 okir * trunk/TODO: - added TODO list 2003-04-08 10:45 okir * trunk/src/ctapi/ctapi.c, trunk/src/ifd/apdu.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/internal.h, trunk/src/ifd/print-atr.c, trunk/src/ifd/process.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/proto-trans.c, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/include/openct/apdu.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/error.h, trunk/src/include/openct/ifd.h, trunk/src/pcsc/pcsc.c: - removed last traces of ifd_apdu_t 2003-04-08 09:00 okir * trunk/src/ifd/protocol.c, trunk/src/include/openct/ifd.h: - added ifd_protocol_get_parameter * trunk/src/ifd/proto-t1.c: - Fixed S-Block and error block handling 2003-04-08 08:59 okir * trunk/src/ifd/ifd-kaan.c: - misc Kaan fixes 2003-04-07 21:15 okir * trunk/src/ifd/ifd-kaan.c: - fix display command 2003-04-07 15:38 okir * trunk/src/pcsc/pcsc.c: - core.h -> ifd.h rename * trunk/src/ctapi/ctapi.c: - apdu changes 2003-04-07 15:31 okir * trunk/src/ct/error.c, trunk/src/include/openct/logging.h: - added ct_strerror 2003-04-07 15:30 okir * trunk/src/ifd/proto-t0.c: - renamed t0_data -> t0_state * trunk/src/ifd/confparse.c, trunk/src/ifd/driver.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/ifd/manager.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/protocol.c, trunk/src/ifd/usb.c: - debugging fixes 2003-04-07 15:05 okir * trunk/src/ct/client.c: - bugfix for ct_transact * trunk/src/ifd/apdu.c, trunk/src/ifd/device.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/ifd/print-atr.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/protocol.c, trunk/src/include/openct/apdu.h, trunk/src/include/openct/device.h, trunk/src/include/openct/ifd.h: - first steps to get rid of ct_apdu_t * trunk/src/ifd/usb.c: - minor debug fix * trunk/src/ifd/utils.c: - ct_hexdump: return empty string for len=0 2003-04-07 12:03 okir * trunk/src/ifd/internal.h, trunk/src/ifd/process.c, trunk/src/tools/openct-control.c: - renamed core.h -> ifd.h * trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/include/openct/device.h: - renamed core.h -> ifd.h 2003-04-07 11:55 okir * trunk/src/ct/buffer.c, trunk/src/ct/client.c, trunk/src/ct/error.c, trunk/src/ct/socket.c, trunk/src/ct/tlv.c, trunk/src/ctapi/ctapi.c, trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/ifd/driver.c, trunk/src/ifd/hotplug.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/ifd/locks.c, trunk/src/ifd/manager.c, trunk/src/ifd/modules.c, trunk/src/ifd/print-atr.c, trunk/src/ifd/process.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/proto-trans.c, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/ifd/serial.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c, trunk/src/include/openct/buffer.h, trunk/src/include/openct/conf.h, trunk/src/include/openct/error.h, trunk/src/include/openct/logging.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h, trunk/src/include/openct/socket.h, trunk/src/include/openct/tlv.h, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: - the great rename, part 2 2003-04-07 11:43 okir * trunk/src/ct/Makefile, trunk/src/ct/buffer.c, trunk/src/ct/client.c, trunk/src/ct/error.c, trunk/src/ct/socket.c, trunk/src/ct/tlv.c, trunk/src/ctapi/ctapi.c, trunk/src/ifd/Makefile, trunk/src/ifd/conf.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/ifd/locks.c, trunk/src/ifd/print-atr.c, trunk/src/ifd/process.c, trunk/src/include/Makefile, trunk/src/include/openct/Makefile, trunk/src/include/openct/device.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/socket.h, trunk/src/include/openct/tlv.h, trunk/src/pcsc/pcsc.c, trunk/src/tools/Makefile, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: - the great rename, part 1 2003-04-07 11:39 okir * trunk/README: - Update 2003-04-07 11:30 okir * trunk/src/ifd/process.c: - always activate reader before getting card status (is that right?) 2003-04-07 11:29 okir * trunk/src/ifd/ifd-towitoko.c: - debug fixes * trunk/src/ifd/device.c: - flush serial device before transaction * trunk/src/ct/socket.c: - implemented socket credentials 2003-04-07 11:03 okir * trunk/src/ctapi/Makefile, trunk/src/pcsc/Makefile: - build fixes * trunk/src/Makefile: - subdir rename * trunk/src/tools/openct-tool.c: - update * trunk/src/ifd/locks.c, trunk/src/ifd/process.c, trunk/src/tools/openct-control.c: - implemented new functions 2003-04-07 11:02 okir * trunk/src/ifd/conf.c, trunk/src/include/openct/pathnames.h: - IFD_FOO -> OPENCT_FOO renames * trunk/src/ct/socket.c, trunk/src/include/openct/socket.h: - added close callback * trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h: - locking related additions 2003-04-07 11:01 okir * trunk/src/include/openct/error.h: - added a few error codes * trunk/src/ct/client.c: - new commands * trunk/src/include/openct/buffer.h: - compile fix 2003-04-07 11:00 okir * trunk/src/ifd/internal.h, trunk/src/ifd/reader.c, trunk/src/include/openct/ifd.h: - remember whether reader was activated or not * trunk/src/ifd/confparse.c: - use OPENCT_CONFIG_PATH instead of hard-coded path 2003-04-07 06:42 okir * trunk/src/ctapi/Makefile, trunk/src/pcsc/Makefile, trunk/src/tools/Makefile: - Makefile fixes 2003-04-06 20:39 okir * trunk/src/Makefile: - added tools subdir 2003-04-06 20:37 okir * trunk/src/ct/Makefile, trunk/src/ct/client.c, trunk/src/ct/socket.c, trunk/src/ct/tlv.c, trunk/src/ifd/ifd.conf, trunk/src/ifd/process.c, trunk/src/include/openct/ifd.h, trunk/src/include/openct/openct.h, trunk/src/include/openct/protocol.h, trunk/src/include/openct/socket.h, trunk/src/include/openct/tlv.h, trunk/src/tools/openct-control.c, trunk/src/tools/openct-tool.c: - changes for OpenCT resource manager * trunk/src/ifd/proto-t1.c: - minor cleanup 2003-04-04 15:55 okir * trunk/src/ct/Makefile, trunk/src/ct/tlv.c, trunk/src/include/openct/protocol.h, trunk/src/include/openct/tlv.h: - added TLV functions 2003-04-04 14:43 okir * trunk/src/tools/openct-control.c: - forgot to call the server loop 2003-04-04 14:34 okir * trunk/src/include/openct/Makefile, trunk/src/include/openct/protocol.h: - added 2003-04-04 14:29 okir * trunk/src/include/Makefile: fixed * trunk/Makefile: - mkdir lib 2003-04-04 14:28 okir * trunk/src/Makefile, trunk/src/ct/Makefile, trunk/src/ct/buffer.c, trunk/src/ct/error.c, trunk/src/ifd/conf.c, trunk/src/ifd/process.c, trunk/src/include/openct/buffer.h, trunk/src/include/openct/conf.h, trunk/src/include/openct/error.h, trunk/src/include/openct/socket.h, trunk/src/tools, trunk/src/tools/openct-control.c: - added resource manager code 2003-04-04 12:18 okir * trunk/src/ifd/Makefile, trunk/src/ifd/confparse.c, trunk/src/ifd/internal.h, trunk/src/include/openct/pathnames.h: - added config.h 2003-04-04 12:02 okir * trunk/src/ct/Makefile, trunk/src/ct/socket.c, trunk/src/include/openct/socket.h: - added 2003-04-04 12:01 okir * trunk/src/ct/buffer.c, trunk/src/include/openct/buffer.h: - added ifd_buf_compact 2003-04-04 08:35 okir * trunk/src/ifd/ifd-kaan.c: - fixed handling of 6100 response - use ifd_iso_apdu_t instead of kaan_apdu_t 2003-04-04 08:25 okir * trunk/src/Makefile: - added pcsc subdir * trunk/src/ifd/Makefile: - fixed LDFLAGS 2003-04-03 19:27 okir * trunk/src/pcsc, trunk/src/pcsc/Makefile, trunk/src/pcsc/pcsc.c: - first stab at a PCSC ifd handler 2003-04-03 15:38 okir * trunk/src/ifd/print-atr.c: - fix compile warning 2003-04-03 15:35 okir * trunk/src/Makefile: - forgot makefile 2003-04-03 14:53 okir * trunk/src/ifd/manager.c, trunk/src/include/openct/ifd.h: - added ifd_reader_count to support reader enumeration 2003-04-03 14:52 okir * trunk/src/ifd/print-atr.c: - list command to list readers 2003-04-03 12:23 okir * trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c: - moved ifd_sysdep_usb_scan 2003-04-03 12:04 okir * trunk/src/include/Makefile: - libifd directory moved 2003-04-03 12:02 okir * trunk/src/ifd/hotplug.c, trunk/src/ifd/ifd.conf, trunk/src/ifd/internal.h, trunk/src/ifd/print-atr.c, trunk/src/ifd/usb.c, trunk/src/include/openct/device.h, trunk/src/include/openct/ifd.h: - added hotplug scan on startup * trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/include/openct/conf.h: - added hotplug_scan_on_startup * trunk/src/ifd/Makefile: - build fixes 2003-04-03 11:35 okir * trunk/README: - added README 2003-04-03 11:23 okir * trunk/src/ifd/ifd-etoken.c: - got rid of silly warning 2003-04-03 11:22 okir * trunk/src/ctapi/Makefile, trunk/src/ctapi/ctapi.c, trunk/src/ifd/Makefile, trunk/src/ifd/driver.c, trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/init.c, trunk/src/ifd/internal.h, trunk/src/ifd/print-atr.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/include/openct/buffer.h, trunk/src/include/openct/conf.h, trunk/src/include/openct/ifd.h: - The great restructuring * trunk/src/ifd/Makefile, trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/ifd/device.c, trunk/src/ifd/hotplug.c, trunk/src/ifd/ifd.conf, trunk/src/ifd/manager.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h: - added hotplug, rewrote USB handling 2003-04-02 22:01 okir * trunk/src/ct/buffer.c, trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/ifd/driver.c, trunk/src/ifd/ifd.conf, trunk/src/ifd/internal.h, trunk/src/ifd/manager.c, trunk/src/ifd/print-atr.c, trunk/src/ifd/sys-linux.c, trunk/src/ifd/usb.c: - added config file parsing; reader registration stuff 2003-04-02 22:00 okir * trunk/src/include/openct/ifd.h: - added ifd_reader_by_{handle,index} 2003-04-02 17:03 okir * trunk/src/ct/error.c, trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/ifd/manager.c, trunk/src/ifd/reader.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c, trunk/src/include/openct/conf.h, trunk/src/include/openct/device.h, trunk/src/include/openct/error.h: - added copyright message 2003-04-02 17:00 okir * trunk/src/ifd/apdu.c, trunk/src/ifd/print-atr.c: - fix compiler warnings 2003-04-02 16:23 okir * trunk/src/ctapi/ctapi.c, trunk/src/ifd/reader.c, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h: - added request_icc functionality to framework * trunk/src/ifd/apdu.c: - fixed le=0 case 2003-04-02 16:22 okir * trunk/src/ifd/Makefile: - fixed clean target 2003-04-02 15:20 okir * trunk/src/ctapi/ctapi.c, trunk/src/ifd/Attic/drivers/ctapi.c, trunk/src/ifd/internal.h: - renamed s/ifd_reader_ctbcs/ifd_ctapi_control/ 2003-04-02 15:11 okir * trunk/src/ifd/pcsc.c: - dead * trunk/src/ctapi/ctapi.c, trunk/src/ctapi/ctapi.h, trunk/src/ifd/Attic/drivers/Makefile, trunk/src/ifd/Attic/drivers/ctapi.c: - CTAPI fixes 2003-04-02 15:10 okir * trunk/src/ifd/pcsc.c: - blah * trunk/src/ifd/apdu.c: - added facilities to handle ISO apdus 2003-04-02 15:09 okir * trunk/src/ifd/reader.c: - renamed ifd_shutdown to ifd_close * trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c: - added .debug * trunk/src/ifd/proto-t0.c: - return number of bytes received 2003-04-01 07:09 okir * trunk/src/ctapi/ctapi.h, trunk/src/ifd/Attic/drivers/ctapi.c, trunk/src/ifd/Makefile, trunk/src/ifd/apdu.c, trunk/src/ifd/internal.h, trunk/src/include/openct/apdu.h, trunk/src/include/openct/ifd.h: - ctapi work 2003-03-28 22:52 okir * trunk/src/ifd/Attic/drivers/Makefile, trunk/src/ifd/ifd-etoken.c: - fixed compiler warning 2003-03-28 22:48 okir * trunk/src/ifd/t1.c: - obsolete 2003-03-28 17:06 okir * trunk/src/ctapi/ctapi.c, trunk/src/ifd/Makefile: - added ctapi.c 2003-03-28 16:59 okir * trunk/src/ctapi, trunk/src/ctapi/ctapi.h, trunk/src/ifd/Attic/drivers/Makefile, trunk/src/ifd/Attic/drivers/ctapi.c, trunk/src/ifd/pcsc.c, trunk/src/include/openct/ifd.h: - added missing prototype for ifd_close 2003-03-28 16:20 okir * trunk/src/ifd/print-atr.c, trunk/src/ifd/reader.c, trunk/src/include/openct/ifd.h: - renamed ifd_icc_command to ifd_card_command 2003-03-28 16:13 okir * trunk/src/ifd/device.c, trunk/src/ifd/sys-linux.c, trunk/src/include/openct/device.h: - added ifd_device_open_channel 2003-03-28 16:02 okir * trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/ifd-kaan.c, trunk/src/ifd/internal.h, trunk/src/ifd/protocol.c, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h: - fixed most compiler warnings 2003-03-26 22:45 okir * trunk/src/ifd/ifd-kaan.c: - display a string when initializing CT 2003-03-26 21:42 okir * trunk/src/ifd/internal.h, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/proto-trans.c, trunk/src/ifd/protocol.c: - changed DAD handling * trunk/src/ifd/ifd-kaan.c: - select MF works now 2003-03-26 09:49 okir * trunk/src/ifd/internal.h, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/include/openct/driver.h: - allow drivers to handle ICC commands directly * trunk/src/ifd/proto-t1.c: - t1_transceive returns # of bytes received 2003-03-26 09:48 okir * trunk/src/ifd/ifd-kaan.c: - almost works now 2003-03-26 09:47 okir * trunk/src/include/openct/ifd.h: - changed IFD_APDU_CASE macros 2003-03-26 09:46 okir * trunk/src/ifd/print-atr.c: - misc fixes 2003-03-26 09:45 okir * trunk/src/ifd/Makefile, trunk/src/ifd/proto-trans.c: - added proto-trans 2003-03-25 00:28 okir * trunk/src/ifd/Attic/drivers/Makefile, trunk/src/ifd/ifd-kaan.c: - added some code for Kobil Kaan * trunk/src/ifd/serial.c: - iflags fixes * trunk/src/ifd/protocol.c: - ifd_protocol_set_parameter 2003-03-25 00:27 okir * trunk/src/ifd/proto-t1.c: - added IFD_PROTOCOL_T1_RESYNCH * trunk/src/include/openct/ifd.h: - added driver data 2003-03-24 22:58 okir * trunk/src/ifd/protocol.c: - fix compile warning 2003-03-24 21:09 okir * trunk/src/ifd/usb.c: - added debugging code * trunk/src/ifd/proto-t1.c: - fixed T=1 2003-03-24 21:08 okir * trunk/src/ifd/ifd-etoken.c: - copied some magic stuff from Andreas etoken driver * trunk/src/include/openct/ifd.h: - added IFD_PROTOCOL_T1_CHECKSUM_{L,C}RC 2003-03-24 21:07 okir * trunk/src/ifd/print-atr.c: - better dump function 2003-03-21 11:28 okir * trunk/src/ifd/protocol.c: - minor fix in ATR parsing for protocol select 2003-03-20 21:45 okir * trunk/src/ifd/ifd-etoken.c, trunk/src/ifd/proto-t1.c: - still struggling to get t=1 and etoken to work 2003-03-20 13:40 okir * trunk/src/ifd/reader.c: - Cleanup 2003-03-20 13:27 okir * trunk/src/ifd/ifd-etoken.c: - initial stuff to get etoken working * trunk/src/ifd/usb.c: - added usb_control - misc fixes for scanning/opening 2003-03-20 13:26 okir * trunk/src/include/openct/device.h: - Added struct ifd_usb_cmsg * trunk/src/ifd/device.c: - ifd_device_open now recognizes devices types in the name 2003-03-20 12:27 okir * trunk/src/ifd/device.c, trunk/src/ifd/internal.h, trunk/src/include/openct/device.h: - added device control messages 2003-03-20 12:03 okir * trunk/src/ifd/Makefile, trunk/src/ifd/usb.c: - started to work on usb support * trunk/src/ifd/Attic/drivers/Makefile, trunk/src/ifd/ifd-etoken.c: - started to work on etoken 2003-03-20 12:02 okir * trunk/src/include/openct/ifd.h: - add per slot reader data * trunk/src/ifd/ifd-towitoko.c: - don't report default_protocol 2003-03-20 11:21 okir * trunk/src/ifd/Attic/drivers/Makefile, trunk/src/ifd/Makefile, trunk/src/ifd/device.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/print-atr.c, trunk/src/ifd/reader.c, trunk/src/ifd/sys-linux.c, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h: - generic ifd_open() function added 2003-03-20 10:48 okir * trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c: - fixed ATR handling 2003-03-19 19:36 okir * trunk/src/ifd/proto-t0.c: - warning fixes 2003-03-19 19:35 okir * trunk/src/ct/buffer.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/ifd/print-atr.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/include/openct/driver.h, trunk/src/include/openct/ifd.h: - new function ifd_buf_set * trunk/src/ifd/apdu.c: - return correct Le for case 4 apdus 2003-03-19 19:34 okir * trunk/src/ifd/Makefile: - clean also zaps application objects 2003-03-19 14:46 okir * trunk/src/ifd/internal.h, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/protocol.c, trunk/src/include/openct/ifd.h: - changed signature of protocol ops 2003-03-19 14:31 okir * trunk/src/ct/buffer.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/reader.c, trunk/src/ifd/serial.c: - fix misc compiler warnings 2003-03-19 12:37 okir * trunk/src/ifd/proto-t0.c: - more T=0 changes * trunk/src/ifd/Makefile, trunk/src/ifd/apdu.c, trunk/src/include/openct/ifd.h: - added ifd_apdu_case 2003-03-19 10:25 okir * trunk/src/ifd/proto-t0.c: - t0 now compiles * trunk/src/ct/buffer.c, trunk/src/ifd/internal.h: - added ifd_buf_{head,tail} 2003-03-18 20:31 okir * trunk/src/ifd/Makefile, trunk/src/ifd/proto-t0.c, trunk/src/ifd/proto-t1.c: - rough outline for T=0 2003-03-18 19:41 okir * trunk/src/ifd/Attic, trunk/src/ifd/Attic/drivers, trunk/src/ifd/Attic/drivers/Makefile: - added Makefile 2003-03-18 18:36 okir * trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/reader.c, trunk/src/include/openct/ifd.h: - added slot fields to ifd_reader_t 2003-03-18 18:35 okir * trunk/src/ct/error.c: - dont print debug messages unconditionally 2003-03-18 17:42 okir * trunk/src/ct/buffer.c, trunk/src/ct/error.c, trunk/src/ifd/Makefile, trunk/src/ifd/conf.c, trunk/src/ifd/confparse.c, trunk/src/ifd/device.c, trunk/src/ifd/driver.c, trunk/src/ifd/ifd-towitoko.c, trunk/src/ifd/internal.h, trunk/src/ifd/manager.c, trunk/src/ifd/modules.c, trunk/src/ifd/print-atr.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/protocol.c, trunk/src/ifd/reader.c, trunk/src/ifd/serial.c, trunk/src/ifd/usb.c, trunk/src/ifd/utils.c, trunk/src/include/openct/conf.h, trunk/src/include/openct/device.h, trunk/src/include/openct/driver.h, trunk/src/include/openct/error.h, trunk/src/include/openct/ifd.h, trunk/src/include/openct/logging.h: - we now get the ATR from the towitoko 2003-03-17 19:01 okir * trunk/src/ct, trunk/src/ct/buffer.c, trunk/src/ifd/Makefile, trunk/src/ifd/internal.h, trunk/src/ifd/proto-t1.c, trunk/src/include/openct/ifd.h: - T=1 implementation 2003-03-17 14:15 okir * trunk/Makefile, trunk/src/include/Makefile: - new makefiles 2003-03-17 10:03 okir * trunk/src, trunk/src/ifd, trunk/src/ifd/Makefile, trunk/src/ifd/checksum.c, trunk/src/ifd/device.c, trunk/src/ifd/internal.h, trunk/src/ifd/manager.c, trunk/src/ifd/proto-t1.c, trunk/src/ifd/reader.c, trunk/src/ifd/t1.c, trunk/src/include, trunk/src/include/openct, trunk/src/include/openct/ifd.h: Initial revision 2003-03-17 10:03 * branches, releases, trunk: New repository initialized by cvs2svn. openct-0.6.20/doc/nonpersistent/svn2cl.xsl0000755000175000017500000002255011043042742015433 00000000000000 ]> &newl; &newl; &space;&space; &newl;&newl; [r ]&space; &tab;*&space; &space; ,&space; :&space; . &newl; &newl;&tab;&space;&space; openct-0.6.20/doc/nonpersistent/wiki.out/0000777000175000017500000000000011336457577015347 500000000000000openct-0.6.20/doc/nonpersistent/wiki.out/LicenseText.html0000644000175000017500000000531411336457575020401 00000000000000 LicenseText – OpenCT
This license covers all files in the OpenCT source distribution
unless stated otherwise. The authors name and a short description
of the files content should be at the top of each file.

Somefile, some text summarizing what the code does
Copyright (C) YYYY, Firstname Lastname <email@example.com>

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 of the authors 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.

This license is approved by the Open Source Initiative as Open Source. See  http://www.opensource.org/licenses/bsd-license.php for details.

Please note that recently a few files for usb support where added from libusb, so now openct - if compiled with these files - is under LGPL license.

openct-0.6.20/doc/nonpersistent/wiki.out/index.html0000644000175000017500000001476511336457575017273 00000000000000 OpenCT

Welcome to OpenCT

OpenCT implements drivers for several smart card readers. It comes as driver in ifdhandler format for PC/SC-Lite, as CT-API driver, or as a small and lean middleware, so applications can use it with minimal overhead. OpenCT also has a primitive mechanism to export smart card readers to remote machines via tcp/ip.

See our OverView page for more details.

OpenCT was written by an international team and is licensed as  Open Source software under the  LGPL license. For a list of all authors and contributers as well as detailed license information see AuthorsAndCredits.

Linux Note

We found a number of problems with linux kernel, udev, and distribution setup. We document our findings and how to solve them in OperatingSystems and QuickStart.

Readers

All recent usb readers most likely implement the CCID specification and thus the generic USB CCID driver should work. Below the full list of all smart card readers supported.

Note: you need support for the smart card reader in OpenCT, and you still need some application that supports your specific smart card (for example OpenSC). Usb crypto tokens combine those two features, still you need support at both levels.

Tested:

Not well tested:

Starting Points

Also see our API documentation for writing new drivers in the source code (doc/api/ directory) and soon available at http://www.opensc-project.org/doc/openct/api/

Unsupported?

If your smart card reader isn't listed above, here is a list of websites with drivers for PC/SC-Lite. Maybe one of them has support for your reader:

Or if you feel like writing a new driver, it might help to capture a log file of the windows driver (usb only). See:

openct-0.6.20/doc/nonpersistent/wiki.out/CryptoIdentity.html0000644000175000017500000000223311336457575021141 00000000000000 CryptoIdentity – OpenCT

Eutron CryptoIdentity is "The Smart Card in a USB key"

CRYPTOIDENTITY is an ‘all-in-one’ device in a USB key that combines the functions of a Smart Card and its reader.

Thanks to its portability and user friendliness, CRYPTOIDENTITY is an innovative product that you can use instead of a smart card in all PKI solutions for digital signing, strong authentication, data encryption and e-mail protection.

 http://www.cryptoidentity.eutron.com

openct-0.6.20/doc/nonpersistent/wiki.out/AuthorsAndCredits.html0000644000175000017500000001376111336457575021545 00000000000000 AuthorsAndCredits – OpenCT

Authors and Credits

This page lists the authors of OpenCT and all those people who helped developing it or whose code was reused, in alphabetical order.

  • Alexandre Becoule
  • Alon Bar-Lev
  • Andreas Jellinghaus
  • Antoine Nguyen
  • Antti Andreimann
  • Antti Tapaninen
  • Carlos Henrique Bauer
  • Carlos Prados
  • Chaskiel Grundman
  • Dave Medin
  • David Corcoran
  • Harald Welte
  • Johannes Erdfelt
  • Juan Carlos Borras
  • Laurent Pinchart
  • Lorenz Knauer
  • Ludovic Rousseau
  • Markus Friedl
  • Matthias Bruestle
  • Michael Haardt
  • Olaf Kirch
  • Stef Hoeben
  • Ville Skyttä
  • William Wanders

Thanks to everyone. If we have forgotten anyone, please add yourself to this list.

Licensing

    OpenCT smart card reader drivers, middleware and library
    (C) 2003-2006 Copyright by the OpenCT Authors listed above

    This software is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library in the file "LGPL-2.1".

OpenCT as whole is licensend under  LGPL license.

Parts of the USB code and the Smartmouse/Phoenix driver are only under that license, most other parts (older code) is also licensed under the new  new BSD license:

   OpenCT smart card reader drivers, middleware and library
   (C) 2003-2006 Copyright by the OpenCT Authors listed above

   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.

In case that is important to you: you can use libopenct freely, as it is 100% BSD/LGPL dual licensed. If you need a BSD licensed ifdhandler however you would have to remove the LGPL'ed part (linux usb code and smph driver).

OpenCT contains svn2cl to create the changelog:

   Copyright (C) 2004, 2005 Arthur de Jong.

   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.
openct-0.6.20/doc/nonpersistent/wiki.out/FilesTools.html0000644000175000017500000000674211336457575020243 00000000000000 FilesTools – OpenCT

Files and Tools in OpenCT

OpenCT needs a config file. It is recommended to configure openct with "--sysconfdir=/etc" so the usual name is /etc/openct.conf.

OpenCT needs a directory -- /var/run/openct -- for it's files and sockets. During bootup OpenCT will create the file -- /var/run/openct/status -- for coordination of all tools. For each reader there will be a process called "ifdhandler" and a socket in this directory, the name for the first reader is usualy "0", for the second "1" and so on.

If the environment variable OPENCT_SOCKETDIR is set, that directory will be used instead of /var/run/openct. On Solaris the files are placed in UTDEVROOT/openct/ directory if the environment variable UTDEVROOT is set.

OpenCT needs an init.d script to be run at bootup and at shutdown. The script is usualy called /etc/init.d/openct and there are symlinks in the /etc/rc*.d/ directories pointing to it.

On linux systems with hotplugging, OpenCT also has these files:

  • /etc/hotplug/usb/openct.usermap -- tells the hotplug system which devices OpenCT knows about.
  • /etc/hotplug/usb/openct -- script called by hotplug for each device added or removed.

Recently some linux distribution changed the tool for hotplug event handling from "hotplug" shell scripts towards udev or hald. Hald is suggested by some developers, but there is not enough documentation so we don't know how to use it. Also hald seems to miss some features hotplug and udev have. Using udev is supported by OpenCT. You will need these files:

  • /etc/udev/rules.d/95-openct.rules -- tells udev which devices OpenCT knows about and to run
  • /etc/hotplug/usb/openct -- script run by udev for each device added or remove.

The hotplug script is a generic script that works in both situations without changes.

OpenCT is shipped with these tools:

  • openct-tool -- lists all readers, their names, the atr, waits for a reader or card etc. great for debugging.
  • openct-control -- usualy only called by the init.d script on boot and shutdown
  • ifdhandler -- does all the work in the background, called by openct-control or the hotplug script.

OpenCT is shipped with two plugins/drivers/shared objects:

  • libopenctapi.so -- a shared object in CT-API format, you can use this with every ct-api aware application.
  • openct-ifd.so -- a shared object in Ifdhandler v2 format, to be used by pcsc-lite as reader.

Shared library

If you want to write an application to use openct directly, you can do so using the shared library libopenct.so. OpenCT also has header files for you in $(prefix)/include/openct/ and it comes with a pkg-config file "libopenct.pc", see the pkg-config documentation how to use it in your Makefile or autoconf configure.in file. This should make linking with OpenCT easy, please send us some feedback.

openct-0.6.20/doc/nonpersistent/wiki.out/wbeiuu.html0000644000175000017500000000360311336457575017451 00000000000000 wbeiuu – OpenCT

WB Electronics' Infinity USB Unlimited

There is a native openct driver - under development - and there is a driver for the linux kernel that can be combined with the OpenCT "phoenix" driver.

Linux Kernel driver

A driver for the linux kernel is available at  http://eczema.ecze.com/iuu_phoenix.html This driver has been tested and reported as working fine. Compile the kernel module and install it and then use

insmod iuu_phoenix.ko cdmode=1

to load the module. Now you have an extra serial port and can use OpenCT phoenix driver with this serial port. Edit openct.conf and add this section:

reader iuu {
        driver = phoenix;
        device = serial:/dev/ttyUSB0;
};

and restart openct with

/etc/init.d/openct restart

and you are all set.

Native OpenCT driver

The native openct driver "wbeiuu" is under development and not working so far :-(

Test Results

Alain Degreffe reported the kernel driver plus openct working fine. (OpenCT 0.6.11) 2007-08-08

openct-0.6.20/doc/nonpersistent/wiki.out/pertosmart1030.html0000644000175000017500000000211411336457575020651 00000000000000 pertosmart1030 – OpenCT

PertoSmart - AC 1030 (USB and serial)

This driver will show up in the next OpenCT release.

The pertosmart1030 supports these readers:

  • Perto Smart USB and Serial smart card readers based on ACS AC-1030 chipset.
  • ACS ACR30 USB and Serial smart card readers.

Test results

  • Perto Smart USB and Serial smart card readers on Fedora Core - kernel 2.6.9-1.667 seems to work fine for T=1 protocol. T=0 protocol fails for APDUs bigger than 122 bytes.
openct-0.6.20/doc/nonpersistent/wiki.out/StartCom.html0000644000175000017500000000261011336457575017702 00000000000000 StartCom – OpenCT

StartCom is a software house and solution provider, located in the south of Israel. It is the vendor and producer of the  StartCom Linux operating system. StartCom developes applications and web-based solutions for its customers, specialized in Linux related implementations and operates  MediaHost™ since 1999. In addition to that, StartCom operates also the  StartCom Free SSL Certification Autority since the beginning of 2005.

openct-0.6.20/doc/nonpersistent/wiki.out/OperatingSystems.html0000644000175000017500000003130111336457575021465 00000000000000 OperatingSystems – OpenCT

Operating Systems: General Notes

Serial readers should work fine on all operating systems. USB needs hotplug support, so that you can plugin some new USB device, and if it is a smart card reader, OpenCT needs to be notified. Unfortunatly hotplug on Linux is currently moving from hotplug to udev or hald, so we document all three systems. FreeBSD has devd and no idea about all other systems. Readers in PCMCIA and PC-Card format are experimental and only supported under Linux so far, tested only with the udev setup (but adapting the setup should be easy).

Linux

The current recommended setup is using hal on linux. This way hal will notify openct if a new device is found. You do not need to compile OpenCT with libusb on linux, it should work well without.

For users prefering a setup with mdev, udev or the old hotplug, we still keep those in our documentation.

hald setup

Hald needs a fdi config file and an addon script it runs when something in the fdi config file matches. To install these files. It is recommended to use separate information and policy fdi files. Installation path for the addon is distro specific and there is no simple way to determine it (see  http://bugs.freedesktop.org/show_bug.cgi?id=15768). It may be /usr/bin, /usr/sbin, /usr/libexec, /usr/libexec/hal, /usr/lib/hal, /usr/lib64/hal, /usr/lib32/hal.

openct daemon needs correct permissions for your smart card device. If your openct daemon is running as root, you don't have to care about it. Otherwise you have to edit etc/openct.hald and properly set chown and eventually chmod.

mkdir -p /usr/share/hal/fdi/information/10freedesktop/
cp etc/openct.fdi /usr/share/hal/fdi/information/10freedesktop/10-usb-openct.fdi
cp openct-policy.fdi /usr/share/hal/fdi/policy/10osvendor/10-usb-openct.fdi 
cp etc/openct.hald /usr/lib/hal/hald-addon-openct # distro dependent
chmod 0755 /usr/lib/hal/hald-addon-openct # needs to be executable

If you are using hal, don't install udev rules.

Direct access to device nodes

If required, there are three possible types of policies for direct access to device nodes: * Only root can access. * Use standard UNIX UID/GID permissions by editing of etc/openct.fdi. * Use UNIX ACL for grating access. Latest hal and openct snapshots support smart-card-reader PolicyKit? policy. With such version of hal, direct access is permitted for local users with active terminal.

OpenCT allows those to access smart card via the daemon, that can access the openct socket directory, usualy /var/run/openct. So you can limit access to that directory to a group or a single user if you want. Several distributions do this by default and limit access to the "scard" group.

==== Incompatibilities =====

Different distributions need different setup. Here are most important differences: * Modern distributions use /dev/bus/usb, older distributions use /proc/bus/usb. You have to check, that your hal provide valid device nodes to the addon. * In older HAL versions USB is "bus", not "subsystem". You have to edit FDI files. * Device permissions are set in a different way in older distributions (e. g. using resmgr).

PCMCIA and PC-Card readers are not yet supported via hald, advice and patches are very welcome.

Hald documentation is available online at  http://people.freedesktop.org/~david/hal-spec/hal-spec.html

Disabling openct addon

If you want to disable openct addon without uninstallation of openct, you can copy etc/openct-disable.fdi to /etc/hal/fdi/policy/.

mdev setup

mdev is provided by busybox to handle hotplug events as udev replacement. It is handy for initramfs configurations.

In order to setup configuration:

  • Configure busybox with CONFIG_MDEV, CONFIG_FEATURE_MDEV_CONF, CONFIG_FEATURE_MDEV_EXEC.
  • Copy etc/openct_usb.mdev from build output to your initramfs at /lib/mdev/openct_usb.
  • Create /etc/mdev.conf at your initramfs with the following content:
    .* 0:0 0660 /lib/mdev/openct_usb
    
  • For simple installation, copy the following files into your initramfs, and all dependencies.
    /usr/sbin/openct-control
    /usr/sbin/ifdhandler
    /etc/openct.conf
    

udev Setup

Serial support needs nothing special (only the serial driver for your serial device), but USB support on Linux has a few requirements:

  • libusb needed during compilation and runtime.
  • CONFIG_HOTPLUG so the kernel can let us know if you plug in a reader or token.
  • udev needs to be installed. This comes with your distribution, and you are advised not to install or update it yourself.

OpenCT before 0.6.13 also needs:

  • CONFIG_USB_DEVICEFS so we can talk to USB devices from userspace.
  • mount usbfs (kernel 2.4: usbdevfs) at /proc/bus/usb, to do that put this line into your /etc/fstab:
    usbfs           /proc/bus/usb   usbfs   defaults                0       0
    
    (replace "usbfs" with "usbdevfs" for Linux kernel 2.4.* - will work on kernel 2.6.* too)

Also the udev files need to be installed (see QuickStart for full installation instructions):

# cp etc/openct.udev /etc/udev/rules.d/50-openct.rules
# cp etc/openct_usb /lib/udev/openct_usb
# cp etc/openct_pcmcia /lib/udev/openct_pcmcia
# cp etc/openct_serial /lib/udev/openct_serial

Some common problems with udev:

  • kernel versions and udev rules do not fit. Several kernels required new udev versions, so updating the kernel without udev will not work. Updating udev is something you shouldn't do yourself, best use the distribution udev. As a result you cannot update the kernel or need to update your whole distribution.
  • For a long time every distribution had usbfs mounted on /proc/bus/usb. Some stopped doing that and thus broke OpenCT. This is fixed in OpenCT 0.6.13+. Note: OpenSuse uses hal for connecting Linux kernel and OpenCT and thus should work without usbfs mounted on /proc/bus/usb.
  • Ubuntu 7.04 ("feisty") and maybe also older versions had usbfs mounted on /proc/bus/usb/.usbfs and a bind mount from /dev/bus/usb to /proc/bus/usb. This broken OpenCT as the device we wanted to open was always created too late. OpenCT 0.6.12 has added a work around for this. Ubuntu 7.10 will drop this practice (but maybe not have /proc/bus/usb at all).
  • Linux Kernel 2.6.22 has changes to the USB code that result in some uevents missing PRODUCT and TYPE and DEVICE information. This will be fixed in 2.6.23 and 2.6.22.5. Please update your kernel.
  • Linux Kernel 2.6.22+ has a new option CONFIG_USB_DEVICE_CLASS, which is marked deprecated. As long as it is on everything is fine. But if turned off there could be problems. This option doesn't harm OpenCT per se, but might break your udev code to generate /dev/bus/usb/xxx/yyy devices. As a result libusb will not find any device (because /dev/bus/usb exists it doesn't look at /proc/bus/usb even if that one is fine), and thus also our coldplug code run by "/etc/init.d/openct start" breaks.
  • People could compile their kernel without the CONFIG_USB_DEVICEFS option. This option was only needed for usbfs, and some might think with /dev/bus/usb it is no longer needed to have usbfs on /proc/bus/usb. But without this option the kernel also doesn't add the DEVICE information to the kernel events, and thus OpenCT can be notified by udev about new devices, but will not have the name of the new device and thus cannot process this information. OpenCT 0.6.13+ can work without CONFIG_USB_DEVICEFS.
  • udev has a mechanism as alternative to DEVICE, it is called DEVNAME. But it only works with the proper udev rules and on many distributions those are not in place, resulting in DEVNAME like /dev/2-1.7 - something OpenCT can't work with. A proper udev rules looks like this:
      SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
        NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
    
    OpenCT 0.6.13+ has this rule and a modified script so we can construct the device name from udev information stored from a previous event and read by udevinfo later.

Hotplug Setup

Serial support needs nothing special (only the serial driver for your serial device), but USB support on Linux has a few requirements:

  • libusb needed during compilation and runtime.
  • CONFIG_HOTPLUG so the kernel can let us know if you plugin a reader or token.
  • hotplug utilities will be called by the kernel and run openct.
  • CONFIG_USB_DEVICEFS so we can talk to USB devices from userspace.
  • mount usbfs (kernel 2.4: usbdevfs) at /proc/bus/usb, to do that put this line into your /etc/fstab:
    usbfs           /proc/bus/usb   usbfs   defaults                0       0
    
    (replace "usbfs" with "usbdevfs" for Linux kernel 2.4.* - will work on kernel 2.6.* too)

Also the hotplug files need to be installed (see QuickStart for full installation instructions):

# cp etc/openct.usermap /etc/hotplug/usb/openct.usermap
# cp etc/openct_usb /etc/hotplug/usb/openct

FreeBSD

On FreeBSD

  1. Install from ports
    • security/openct
    • security/opensc
  2. add to /etc/devd.conf or /usr/local/etc/devd/openct.conf (with appropriate device ids):
    # Aladdin eToken PRO USB crypto token
    attach 100 {
            device-name "ugen[0-9]+";
            match "vendor" "0x0529";
            match "product" "0x0514";
            action "/usr/local/sbin/openct-control attach usb:529/514 usb /dev/$device-name";
    };
    detach 100 {
            device-name "ugen[0-9]+";
            match "vendor" "0x0529";
            match "product" "0x0514";
            action "/usr/bin/pkill -fx '/usr/local/sbin/ifdhandler -H [a-z0-9]+ usb /dev/$device-name'";
    };
    
  3. reload devd config
    /etc/rc.d/devd restart
    

List of issues for FreeBSD:

  • the above has only examples for one vendor/product each. We could include example files for either or both in openct with all devices listed.

OpenBSD

install from ports
cd /usr/ports/security/openct
make install clean
cd /usr/ports/security/opensc
make install clean

Erase and key generation works so far, but OpenSSL does not: the OpenSSL shell exits after the engine load command for some unknown reason. Note you need to specify the engine shared object file as *.so.0.0 (on Linux it is simply *.so).

Also OpenBSD has a hotplugd, but so far it does not support USB devices. So you need to run

openct-control shutdown
openct-control init

every time you add or remove a USB crypto token.

Now OpenBSD Current (2005-07-20) passes all OpenSC regression tests with an Aladdin eToken PRO.

Other tokens however did not work, these problems need to be investigated, as well as how to get it to work without UGEN_DEBUG.

other BSD

OpenCT should work, but this wasn't tested for sometime. Latest OpenCT seems to not find libusb, we are working on it.

Solaris

Latest OpenCT supports Solaris fine and was tested to work.

Sunray

Sunray including client/server architecture was added to OpenCT (in version 0.6.5).

openct-0.6.20/doc/nonpersistent/wiki.out/ResourcesLinks.html0000644000175000017500000000466411336457575021134 00000000000000 ResourcesLinks – OpenCT

Resources, Links

Standard Documents

Smart cards are defined in ISO 7816 standards. You need to buy those from ISO, but  some pages have overviews on what is in those standards.

 PC/SC Workgroup defines the PC/SC standard that is used on windows, but thanks to PC/SC-Lite software also on Linux, Mac OS X and BSD. You can  download all parts of the specification.

The Multifunctioanal Card Terminal specification suite includes CT-API and it's co-specification CT-BCS. The whole suite is available for download in  english and  german.

Software

The  M.U.S.C.L.E. project offers the open source software PC/SC-Lite and links to many drivers in ifdhandler format, and also to some applications.

Some drivers in CT-API format are available for download at  Gregor's CT-API-Page.

OpenSC is a software to use cryptographic smart cards on Linux, Windows and Mac OS X. Developed by the same team as OpenCT.

openct-0.6.20/doc/nonpersistent/wiki.out/PageTemplates.html0000644000175000017500000000321511336457575020703 00000000000000 PageTemplates – OpenCT

Wiki Page Templates

(since  0.11)

The default content for a new wiki page can be chosen from a list of page templates.

That list is made up from all the existing wiki pages having a name starting with PageTemplates/. The initial content of a new page will simply be the content of the chosen template page, or a blank page if the special (blank page) entry is selected. When there's actually no wiki pages matching that prefix, the initial content will always be the blank page and the list selector will not be shown (i.e. this matches the behavior we had up to now).

To create a new template, simply create a new page having a name starting with PageTemplates/.

(Hint: one could even create a PageTemplates/Template for facilitating the creation of new templates!)

Available templates:


    See also: TracWiki

    openct-0.6.20/doc/nonpersistent/wiki.out/TroubleShooting.html0000644000175000017500000001745711336457575021314 00000000000000 TroubleShooting – OpenCT

    Troubleshooting and debugging

    If something doesn't work, please contact us on the opensc-users mailing lists. For details, please see MailingList?.

    If you subscribe to these mailing lists you can post directly, if not a moderator will review your posting first, so we can filter spam.

    So here are some step by step instructions to find your problem:

    If you try to use a USB device, please try this:

    • Is your /proc filesystem mounted? ls /proc will show some files and directories.
    • Is your linux kernel compiled with usb support? Does it work? "lsusb" should list your usb controller and all devices.
    • Is your linux kernel compiled with hotplugging support? cat /proc/sys/kernel/hotplug should output "/sbin/hotplug".
    • Do you have a hotplug script? ls /sbin/hotplug will list it or print an error message?
    • Did you create the directory /var/run/openct? What files are in there? What are the file permissions? ls -la /var/run/openct will tell you.

    Note that recently some linux distributions changed the hotplug system:

    • The kernel still needs to be compiled with CONFIG_HOTPLUG but "cat /proc/sys/kernel/hotplug" will not show anything.
    • The system is no longer using the hotplug scripts. Instead it is using either udev or udev with hald.
    • /proc/bus/usb might be empty. Instead the usb devices might show up in /dev/bus/usb.

    In all cases:

    • Did you install the openct init.d script? Did you run it?
    • Does openct-tool list show your reader?

    If you are using a usb smart card reader, and openct-tool does not list it: What is that readers USB vendor and product id? lsusb will tell you. Edit /etc/openct.conf and /etc/hotplug/usb/openct.usermap, check if that entry is listed, and add it if not. If the reader works after doing this, please contact opensc-devel@…, so we can add that id to OpenCT.

    USB / Linux Kernel "feature"

    This has been fixed in OpenCT 0.6.7 or even earlier.

    We found a problem with the linux kernel. If you plugin your usb token/reader/device and it sometimes works well, and it sometimes does not work well, and if syslog has an error message that open() failed: we were too fast, the kernel was not yet ready to allow us to use the device. Please edit /etc/hotplug/usb/openct and replace

    #!/bin/sh
    
    test "$ACTION" = "add" || exit 0
    
    if [ -e /var/run/openct/status ]
    then
            /usr/sbin/openct-control attach $DEVICE usb:$PRODUCT
    fi
    

    with

    #!/bin/sh
    
    test "$ACTION" = "add" || exit 0
    
    if [ -e /var/run/openct/status ]
    then
            sleep 1
            /usr/sbin/openct-control attach $DEVICE usb:$PRODUCT
    fi
    

    (i.e. add the line "sleep 1" before the "openct-control" line.)

    For reference: hotplug-devel mailing list, 2005-06-14  http://sourceforge.net/mailarchive/message.php?msg_id=12059902 and the response by Kay Sievers.

    Debugging Hotplug

    For many users the hotplug system on linux doesn't work as expected. Here are some tips how to debug it.

    Your linux kernel needs to be compiled with CONFIG_HOTPLUG.

    cat /proc/sys/kernel/hotplug 
    

    will tell you if your kernel does hotplugging.

    You can install a test script to see if it works as advertised:

    cat > /root/testplug <<EOF
    #!/bin/bash
    
    (echo \$0: \$*; export; echo) >> /root/testplug.log
    EOF
    chmod +x /root/testplug
    echo /root/testplug > /proc/sys/kernel/hotplug
    

    With this change you will generate a log file for all hotplug events. A typical log file entry for adding atoken looks like this:

    /root/testplug: usb
    declare -x ACTION="add"
    declare -x DEVPATH="/devices/pci0000:00/0000:00:1d.1/usb3/3-2"
    declare -x HOME="/"
    declare -x OLDPWD
    declare -x PATH="/sbin:/bin:/usr/sbin:/usr/bin"
    declare -x PHYSDEVBUS="usb"
    declare -x PHYSDEVDRIVER="usb"
    declare -x PWD="/"
    declare -x SEQNUM="2398"
    declare -x SHLVL="1"
    declare -x SUBSYSTEM="usb"
    
    /root/testplug: usb
    declare -x ACTION="add"
    declare -x DEVICE="/proc/bus/usb/003/063"
    declare -x DEVPATH="/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0"
    declare -x HOME="/"
    declare -x OLDPWD
    declare -x PATH="/sbin:/bin:/usr/sbin:/usr/bin"
    declare -x PHYSDEVBUS="usb"
    declare -x PRODUCT="973/1/100"
    declare -x PWD="/"
    declare -x SEQNUM="2399"
    declare -x SHLVL="1"
    declare -x SUBSYSTEM="usb"
    declare -x TYPE="255/0/0"
    

    You can ignore the first entry, only those of subsystem "usb" and ACTION="add" are important.

    You can test the hotplug scripts on your system like this:

    /root/testplug: usb
    export ACTION="add"
    export DEVICE="/proc/bus/usb/003/063"
    export DEVPATH="/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0"
    export PHYSDEVBUS="usb"
    export PRODUCT="973/1/100"
    export SUBSYSTEM="usb"
    export TYPE="255/0/0"
    sh -x /sbin/hotplug add 2>&1 |tee hotplug.log
    

    You only need those environment settings, but please change DEVICE and DEVPATH and PRODUCT to match your last log file entry. Not that if you remove and add a usb device, the DEVICE entry will change. This will start the hotplug scripts as usual, but using "sh -x" you can see what the shell script does.

    If no other software needs hotplugging, here is the fastest way to make sure it works with openct:

    echo /etc/hotplug/usb/openct > /proc/sys/kernel/hotplug
    

    Debugging OpenCT

    But if you are writing a new driver or you have some device and you are not sure whether it works, you might want to debug openct directly.

    First you need to start the init script and make sure that /var/run/opensc/status does exist.

    Second add your device. If hotplug does not work or the ifdhandler dies that is ok. Use lsbusb to find out which controller your usb device is attached to and what the device number is. Also you need to check if you have usb devices in /dev/bus/usb/ or in /proc/bus/usb/.

    Third start ifdhandler yourself as root. Here is an example for usb controller 002 and device 005 and the ccid driver:

    ifdhandler -FHddddd ccid /dev/bus/usb/002/005
    

    In this example:

    • "-F" tells ifdhandler to stay in foreground and write errors to stdout/stderror.
    • "-H" tells ifdhandler this is a hotplug device, it could vanish any second.
    • "-d" increases the debug level. 5 or 6 is usualy nice for debugging usb transactions.
    • "ccid" is the name of the driver. Make sure you use the right one, in doubt ask on the list.
    • "/dev/bus/usb/002/005" is the device file. Ifdhandler will open it and use ioctl() on it for sending and receiving usb packets.

    If you have any trouble, please contact us via our mailing lists (see MailingLists).

    openct-0.6.20/doc/nonpersistent/wiki.out/smartboard.html0000644000175000017500000000255311336457575020312 00000000000000 smartboard – OpenCT

    Cherry Smartboard

    The smartboard driver might support Cherry Smartboard keyboard, but its status is unknown and the original author has stopped working on it.

    Test results

    If you have tested one of these readers, please add a report here.

    I have tested this board, it works well using the ccid driver. I had to edit the /etc/openct.conf file and add a line usb:046a/0010 in the ccid section in order to get the keyboard recognized. I did not manage to use the securepinpad mode of the keyboard. I recommend this keyboard/reader for use with the Belgian eID under linux.

    Alternatives

    Some cherry usb keyboards implement the usb ccid norm, so they should work with the generic USB CCID driver.

    openct-0.6.20/doc/nonpersistent/wiki.out/epass3000.html0000644000175000017500000000164011336457575017566 00000000000000 epass3000 – OpenCT

    Feitian ePass3000

    Support for  Feitian ePass 3000 tokens exists in SVN trunk since [1082].

    openct-0.6.20/doc/nonpersistent/wiki.out/eutron.html0000644000175000017500000001463211336457575017471 00000000000000 eutron – OpenCT

    Eutron CryptoIdentity ITSEC-P

    The ITSEC-P token is supported by the "eutron" driver in OpenCT. Also see the  CryptoIdentity IT-SEC page in the OpenSC Wiki. The ITSEC-P contains a G&D Starcos card. Only test versions of these cards are eraseable, the Cards inside the Eutron are not eraseable.

    Eutron CryptoIdentity ITSEC-I

    (Andreas Jellinghaus:) I had one, wrote a driver for it, it worked fine. However somehow I locked it, and can't unlock it, so I can't test anymore. I guess they still work fine, but even for windows there is not unlock/format tool, as far as I can see.

    Note that Eutron has five different CryptoIdentity tokens and the other four were not tested at all and are unsupported.

    More detailed information on the progress of the Eutron support may be found at the  Eutron entry in the opensc Wiki.

    Test results

    If you have tested one of these readers, please add a report here.


    Eutron Customer Service comments follows:

    Please find below the link where you can download a tool to reinit CryptoIdentity ITSEC-I tokens.

    You must first check which Infineon chip is onboard on CryptoIdentity; to check for smartcard ATR run:  http://www.eutroninfosecurity.com/shared/test/CryptoIdentity/testatr2.exe (  http://www.eutroninfosecurity.com/shared/test/CryptoIdentity/testatr2.zip ) - if the ATR is "3b f2 98 00 ff c1 10 31 fe 55 c8 03 15", then the token is based on 320 chip, - if the ATR is "3b f2 98 00 ff c1 10 31 fe 55 c8 04 12", then the token is based on 322 chip

    *** CryptoIdentity ITSEC REINIT TOOLS (Company confidential, please do not redistribute) ***

    Please find below a link where you can download the tool for reinitialising tokens with inconsistent file systems. Note that this tool is not meant to be redistributed. Be aware that THIS TOOL WILL DESTROY ALL THE CONTENT OF THE TOKEN and revert it at manufacturing status.

     http://www.eutroninfosecurity.com/outgoing/ci5-itsec/_INTERNALUSEONLY_/unsupported/ReInit32x_2.4.x.zip

    ( To obtain the Username and Password required during the download, please contact Eutron at helpdesk@… )

    To use it, version 2.4.x of the Siemens API *must* be installed (see below for download instructions).

    To reinitialize the token, follow these steps: 1 - Unzip the content in a temporary folder 2 - Shut down the Siemens "SCmon" or "SiSCmon" executable that may have been loaded in memory 3 - Plug the token into the USB port 4 - Run one of the batch files available; see txt file for command line instructions 4.1 - If you token has onboard the Infineon 320 chip you must use "reinit_gdo1.bat" 4.2 - If you token has onboard the Infineon 322 chip you must use "reinit_gdo2.bat" ( both will revert the token with Eutron standard manufacturing settings )

    If required, download the latest release 2.4.0 build 10a of Siemens API from the following link: ( To obtain the Username and Password required during the download, please contact Eutron at helpdesk@… )

    - Cryptographic API's only:  http://www.eutroninfosecurity.com/outgoing/ci5-itsec/ci5-itsec_API_2.4.0_build10.exe or (zip format)  http://www.eutroninfosecurity.com/outgoing/ci5-itsec/ci5-itsec_API_2.4.0_build10.zip

    - Cryptographic API's + driver for CryptoIdentity token (official CD image):  http://www.eutroninfosecurity.com/outgoing/ci5-itsec/CD_ci5-itsec.zip

    The "readme" file contains additional important informations related to API installation and known issues:  http://www.eutroninfosecurity.com/outgoing/ci5-itsec/readme.txt

    For further technical information please send an email at helpdesk@…

    Please note, that the Eutron tool initializes the token for the commercial PKI software shipped together with the Eutron Tokens and is not helpful, if you want to initialize your token for PKCS#15/opensc. See further informations on the status of the initialization support for Eutron tokens in  Eutron entry in the opensc Wiki.

    openct-0.6.20/doc/nonpersistent/wiki.out/egate.html0000644000175000017500000000251011336457575017232 00000000000000 egate – OpenCT

    Schlumberger / Axalto e-gate tokens

    OpenCT supports Schlumberger/Axalto e-gate tokens fine. They have been tested with OpenSC and Cryptoflex 32k cards under Linux and work perfectly.

    Test Results

    OpenCT 0.6.4 and OpenSC 0.9.6 with Cryptoflex 32k cards work perfectly. Tested on Linux (Debian sarge, May 2005, Kernel 2.6.11.*). Also tested on FreeBSD 5.3 (compiled with libusb support).

    OpenCT 0.6.5 and OpenSC 0.9.6 is not working under FreeBSD 6.0 (either with libusb or without libusb)

     http://www.reflexreaders.com/Products/reflex_egate.html has the vendor information.

    openct-0.6.20/doc/nonpersistent/wiki.out/trac.css0000644000175000017500000004120411254653066016715 00000000000000body { background: #fff; color: #000; margin: 10px; padding: 0; } body, th, td { font: normal 13px Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif; } h1, h2, h3, h4 { font-family: Arial,Verdana,'Bitstream Vera Sans',Helvetica,sans-serif; font-weight: bold; letter-spacing: -0.018em; page-break-after: avoid; } h1 { font-size: 19px; margin: .15em 1em 0.5em 0 } h2 { font-size: 16px } h3 { font-size: 14px } hr { border: none; border-top: 1px solid #ccb; margin: 2em 0 } address { font-style: normal } img { border: none } .underline { text-decoration: underline } ol.loweralpha { list-style-type: lower-alpha } ol.upperalpha { list-style-type: upper-alpha } ol.lowerroman { list-style-type: lower-roman } ol.upperroman { list-style-type: upper-roman } ol.arabic { list-style-type: decimal } /* Link styles */ :link, :visited { text-decoration: none; color: #b00; border-bottom: 1px dotted #bbb; } :link:hover, :visited:hover { background-color: #eee; color: #555 } h1 :link, h1 :visited ,h2 :link, h2 :visited, h3 :link, h3 :visited, h4 :link, h4 :visited, h5 :link, h5 :visited, h6 :link, h6 :visited { color: inherit; } .trac-rawlink { border-bottom: none } /* Heading anchors */ .anchor:link, .anchor:visited { border: none; color: #d7d7d7; font-size: .8em; vertical-align: text-top; } * > .anchor:link, * > .anchor:visited { visibility: hidden; } h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { visibility: visible; } @media screen { a.ext-link .icon { background: url(../extlink.gif) center center no-repeat; padding-left: 12px; } a.mail-link .icon { background: url(../envelope.png) center center no-repeat; padding-left: 14px; } } /* Forms */ input, textarea, select { margin: 2px } input, select { vertical-align: middle } input[type=button], input[type=submit], input[type=reset] { background: #eee; color: #222; border: 1px outset #ccc; padding: .1em .5em; } input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover { background: #ccb; } input[type=button][disabled], input[type=submit][disabled], input[type=reset][disabled] { background: #f6f6f6; border-style: solid; color: #999; } input[type=text], input.textwidget, textarea { border: 1px solid #d7d7d7 } input[type=text], input.textwidget { padding: .25em .5em } input[type=text]:focus, input.textwidget:focus, textarea:focus { border: 1px solid #886; } option { border-bottom: 1px dotted #d7d7d7 } fieldset { border: 1px solid #d7d7d7; padding: .5em; margin: 1em 0 } form p.hint, form span.hint { color: #666; font-size: 85%; font-style: italic; margin: .5em 0; padding-left: 1em; } fieldset.iefix { background: transparent; border: none; padding: 0; margin: 0; } * html fieldset.iefix { width: 98% } fieldset.iefix p { margin: 0 } legend { color: #999; padding: 0 .25em; font-size: 90%; font-weight: bold } label.disabled { color: #d7d7d7 } .buttons { margin: .5em .5em .5em 0 } .buttons form, .buttons form div { display: inline } .buttons input { margin: 1em .5em .1em 0 } .inlinebuttons input { font-size: 70%; border-width: 1px; border-style: dotted; margin: 0 .1em; padding: 0.1em; background: none; } /* Header */ #header hr { display: none } #header h1 { margin: 1.5em 0 -1.5em; } #header img { border: none; margin: 0 0 -3em } #header :link, #header :visited, #header :link:hover, #header :visited:hover { background: transparent; color: #555; margin-bottom: 2px; border: none; } #header h1 :link:hover, #header h1 :visited:hover { color: #000 } /* Quick search */ #search { clear: both; font-size: 10px; height: 2.2em; margin: 0 0 1em; text-align: right; } #search input { font-size: 10px } #search label { display: none } /* Navigation */ .nav h2, .nav hr { display: none } .nav ul { font-size: 10px; list-style: none; margin: 0; text-align: right } .nav li { border-right: 1px solid #d7d7d7; display: inline; padding: 0 .75em; white-space: nowrap; } .nav li.last { border-right: none } /* Main navigation bar */ #mainnav { background: #f7f7f7 url(../topbar_gradient.png) 0 0; border: 1px solid #000; font: normal 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif; margin: .66em 0 .33em; padding: .2em 0; } #mainnav li { border-right: none; padding: .25em 0 } #mainnav :link, #mainnav :visited { background: url(../dots.gif) 0 0 no-repeat; border-right: 1px solid #fff; border-bottom: none; border-left: 1px solid #555; color: #000; padding: .2em 20px; } * html #mainnav :link, * html #mainnav :visited { background-position: 1px 0 } #mainnav :link:hover, #mainnav :visited:hover { background-color: #ccc; border-right: 1px solid #ddd; } #mainnav .active :link, #mainnav .active :visited { background: #333 url(../topbar_gradient2.png) 0 0 repeat-x; border-top: none; border-right: 1px solid #000; color: #eee; font-weight: bold; } #mainnav .active :link:hover, #mainnav .active :visited:hover { border-right: 1px solid #000; } /* Context-dependent navigation links */ #ctxtnav { height: 1em } #ctxtnav li ul { background: #f7f7f7; color: #ccc; border: 1px solid; padding: 0; display: inline; margin: 0; } #ctxtnav li li { padding: 0; } #ctxtnav li li :link, #ctxtnav li li :visited { padding: 0 1em } #ctxtnav li li :link:hover, #ctxtnav li li :visited:hover { background: #bba; color: #fff; } /* Alternate links */ #altlinks { clear: both; text-align: center } #altlinks h3 { font-size: 12px; letter-spacing: normal; margin: 0 } #altlinks ul { list-style: none; margin: 0; padding: 0 0 1em } #altlinks li { border-right: 1px solid #d7d7d7; display: inline; font-size: 11px; line-height: 1.5; padding: 0 1em; white-space: nowrap; } #altlinks li.last { border-right: none } #altlinks li :link, #altlinks li :visited { background-repeat: no-repeat; color: #666; border: none; padding: 0 0 2px; } #altlinks li a.ics { background-image: url(../ics.png); padding-left: 22px } #altlinks li a.rss { background-image: url(../feed.png); padding-left: 20px } /* Footer */ #footer { clear: both; color: #bbb; font-size: 10px; border-top: 1px solid; height: 31px; padding: .25em 0; } #footer :link, #footer :visited { color: #bbb; } #footer hr { display: none } #footer #tracpowered { border: 0; float: left } #footer #tracpowered:hover { background: transparent } #footer p { margin: 0 } #footer p.left { float: left; margin-left: 1em; padding: 0 1em; border-left: 1px solid #d7d7d7; border-right: 1px solid #d7d7d7; } #footer p.right { float: right; text-align: right; } #content { padding-bottom: 2em; position: relative } #help { clear: both; color: #999; font-size: 90%; margin: 1em; text-align: right; } #help :link, #help :visited { cursor: help } #help hr { display: none } /* Page preferences form */ #prefs { background: #f7f7f0; border: 1px outset #998; float: right; font-size: 9px; padding: .8em; position: relative; margin: 0 1em 1em; } * html #prefs { width: 26em } /* Set width only for IE */ #prefs input, #prefs select { font-size: 9px; vertical-align: middle } #prefs fieldset { background: transparent; border: none; margin: .5em; padding: 0; } #prefs fieldset legend { background: transparent; color: #000; font-size: 9px; font-weight: normal; margin: 0 0 0 -1.5em; padding: 0; } #prefs .buttons { text-align: right } /* Version information (browser, wiki, attachments) */ #info { margin: 1em 0 0 0; background: #f7f7f0; border: 1px solid #d7d7d7; border-collapse: collapse; border-spacing: 0; clear: both; width: 100%; } #info th, #info td { font-size: 85%; padding: 2px .5em; vertical-align: top } #info th { font-weight: bold; text-align: left; white-space: nowrap } #info td.message { width: 100% } #info .message ul { padding: 0; margin: 0 2em } #info .message p { margin: 0; padding: 0 } /* Wiki */ .wikipage { padding-left: 18px } .wikipage h1, .wikipage h2, .wikipage h3 { margin-left: -18px } a.missing:link, a.missing:visited, a.missing, span.missing, a.forbidden, span.forbidden { color: #998 } a.missing:hover { color: #000 } a.closed:link, a.closed:visited, span.closed { text-decoration: line-through } /* User-selectable styles for blocks */ .important { background: #fcb; border: 1px dotted #d00; color: #500; padding: 0 .5em 0 .5em; margin: .5em; } dl.wiki dt { font-weight: bold } dl.compact dt { float: left; padding-right: .5em } dl.compact dd { margin: 0; padding: 0 } pre.wiki, pre.literal-block { background: #f7f7f7; border: 1px solid #d7d7d7; margin: 1em 1.75em; padding: .25em; overflow: auto; } blockquote.citation { margin: -0.6em 0; border-style: solid; border-width: 0 0 0 2px; padding-left: .5em; border-color: #b44; } .citation blockquote.citation { border-color: #4b4; } .citation .citation blockquote.citation { border-color: #44b; } .citation .citation .citation blockquote.citation { border-color: #c55; } table.wiki { border: 2px solid #ccc; border-collapse: collapse; border-spacing: 0; } table.wiki td { border: 1px solid #ccc; padding: .1em .25em; } .wikitoolbar { margin-top: 0.3em; margin-left: 2px; border: solid #d7d7d7; border-width: 1px 1px 1px 0; height: 18px; width: 234px; } .wikitoolbar :link, .wikitoolbar :visited { background: transparent url(../edit_toolbar.png) no-repeat; border: 1px solid #fff; border-left-color: #d7d7d7; cursor: default; display: block; float: left; width: 24px; height: 16px; } .wikitoolbar :link:hover, .wikitoolbar :visited:hover { background-color: transparent; border: 1px solid #fb2; } .wikitoolbar a#em { background-position: 0 0 } .wikitoolbar a#strong { background-position: 0 -16px } .wikitoolbar a#heading { background-position: 0 -32px } .wikitoolbar a#link { background-position: 0 -48px } .wikitoolbar a#code { background-position: 0 -64px } .wikitoolbar a#hr { background-position: 0 -80px } .wikitoolbar a#np { background-position: 0 -96px } .wikitoolbar a#br { background-position: 0 -112px } .wikitoolbar a#img { background-position: 0 -128px } /* Styles for the form for adding attachments. */ #attachment .field { margin-top: 1.3em } #attachment label { padding-left: .2em } #attachment fieldset { margin-top: 2em } #attachment fieldset .field { float: left; margin: 0 1em .5em 0 } #attachment .options { float: left; padding: 0 0 1em 1em } #attachment br { clear: left } .attachment #preview { margin-top: 1em } /* Styles for the list of attachments. */ #attachments { border: 1px outset #996; padding: 1em } #attachments .attachments { margin-left: 2em; padding: 0 } #attachments dt { display: list-item; list-style: square; } #attachments dd { font-style: italic; margin-left: 0; padding-left: 0; } /* Styles for tabular listings such as those used for displaying directory contents and report results. */ table.listing { clear: both; border-bottom: 1px solid #d7d7d7; border-collapse: collapse; border-spacing: 0; margin-top: 1em; width: 100%; } table.listing th { text-align: left; padding: 0 1em .1em 0; font-size: 12px } table.listing thead { background: #f7f7f0 } table.listing thead th { border: 1px solid #d7d7d7; border-bottom-color: #999; font-size: 11px; font-weight: bold; padding: 2px .5em; vertical-align: bottom; } table.listing thead th :link:hover, table.listing thead th :visited:hover { background-color: transparent; } table.listing thead th a { border: none; padding-right: 12px } table.listing th.asc a, table.listing th.desc a { font-weight: bold } table.listing th.asc a, table.listing th.desc a { background-position: 100% 50%; background-repeat: no-repeat; } table.listing th.asc a { background-image: url(../asc.png) } table.listing th.desc a { background-image: url(../desc.png) } table.listing tbody td, table.listing tbody th { border: 1px dotted #ddd; padding: .3em .5em; vertical-align: top; } table.listing tbody td a:hover, table.listing tbody th a:hover { background-color: transparent; } table.listing tbody tr { border-top: 1px solid #ddd } table.listing tbody tr.even { background-color: #fcfcfc } table.listing tbody tr.odd { background-color: #f7f7f7 } table.listing tbody tr:hover { background: #eed !important } table.listing tbody tr.focus { background: #ddf !important } /* Styles for the page history table (extends the styles for "table.listing") */ #fieldhist td { padding: 0 .5em } #fieldhist td.date, #fieldhist td.diff, #fieldhist td.version, #fieldhist td.author { white-space: nowrap; } #fieldhist td.version { text-align: center } #fieldhist td.comment { width: 100% } /* Auto-completion interface */ .suggestions { background: #fff; border: 1px solid #886; color: #222; } .suggestions ul { font-family: sans-serif; max-height: 20em; min-height: 3em; list-style: none; margin: 0; overflow: auto; padding: 0; width: 440px; } * html .suggestions ul { height: 10em; } .suggestions li { background: #fff; cursor: pointer; padding: 2px 5px } .suggestions li.selected { background: #b9b9b9 } /* Styles for the error page (and rst errors) */ #content.error .message, div.system-message { background: #fdc; border: 2px solid #d00; color: #500; padding: .5em; margin: 1em 0; } #content.error div.message pre, div.system-message pre { margin-left: 1em; overflow: hidden; white-space: normal; } div.system-message p { margin: 0; } div.system-message p.system-message-title { font-weight: bold; } #warning.system-message { background: #ffb; border: 1px solid #000; } #warning.system-message li { list-style-type: square; } #notice.system-message { background: #dfd; border: 1px solid #000; } #notice.system-message li { list-style-type: square; } #content.error form.newticket { display: inline; } #content.error form.newticket textarea { display: none; } #content.error #systeminfo { margin: 1em; width: auto; } #content.error #systeminfo th { font-weight: bold; text-align: right; } #content.error #traceback { margin-left: 1em; } #content.error #traceback :link, #content.error #traceback :visited { border: none; } #content.error #tbtoggle { font-size: 80%; } #content.error #traceback div { margin-left: 1em; } #content.error #traceback h3 { font-size: 95%; margin: .5em 0 0; } #content.error #traceback :link var, #content.error #traceback :visited var { font-family: monospace; font-style: normal; font-weight: bold; } #content.error #traceback span.file { color: #666; font-size: 85%; } #content.error #traceback ul { list-style: none; margin: .5em 0; padding: 0; } #content.error #traceback ol { border: 1px dotted #d7d7d7; color: #999; font-size: 85%; line-height: 1; margin: .5em 0; } #content.error #traceback ol li { white-space: pre; } #content.error #traceback ol li.current { background: #e6e6e6; color: #333; } #content.error #traceback ol li code { color: #666; } #content.error #traceback ol li.current code { color: #000; } #content.error #traceback table { margin: .5em 0 1em; } #content.error #traceback th, #content.error #traceback td { font-size: 85%; padding: 1px; } #content.error #traceback th var { font-family: monospace; font-style: normal; } #content.error #traceback td code { white-space: pre; } #content.error #traceback pre { font-size: 95%; } #content .paging { margin: 0 0 2em; padding: .5em 0 0; font-size: 85%; line-height: 2em; text-align: center; } #content .paging .current { padding: .1em .3em; border: 1px solid #333; background: #999; color: #fff; } #content .paging :link, #content .paging :visited { padding: .1em .3em; border: 1px solid #666; background: transparent; color: #666; } #content .paging :link:hover, #content .paging :visited:hover { background: #999; color: #fff; border-color: #333; } #content .paging .previous a, #content .paging .next a { font-size: 150%; font-weight: bold; border: none; } #content .paging .previous a:hover, #content .paging .next a:hover { background: transparent; color: #666; } #content h2 .numresults { color: #666; font-size: 90%; } /* Styles for search word highlighting */ @media screen { .searchword0 { background: #ff9 } .searchword1 { background: #cfc } .searchword2 { background: #cff } .searchword3 { background: #ccf } .searchword4 { background: #fcf } } @media print { #header, #altlinks, #footer, #help { display: none } .nav, form, .buttons form, form .buttons, form .inlinebuttons, .noprint, .trac-rawlink { display: none; } form.printableform { display: block } } openct-0.6.20/doc/nonpersistent/wiki.out/gempc.html0000644000175000017500000000172311336457575017245 00000000000000 gempc – OpenCT

    Gemplus PC

    The gempc driver might support Gemplus GemPC devices, but it is marked work in progeess, and the original author has stopped working on it.

    Test results

    If you have tested one of these readers, please add a report here.

    Alternative

    GemPC usb readers should work with the generic USB CCID driver.

    openct-0.6.20/doc/nonpersistent/wiki.out/ikey3000.html0000644000175000017500000000206411336457575017415 00000000000000 ikey3000 – OpenCT

    Rainbow iKey 3000

    OpenCT supports Rainbow iKey 3000 tokens fine. They have been tested with OpenSC under Linux and work perfectly.

    Test Results

    OpenCT 0.6.4 and OpenSC 0.9.6 cards work perfectly. Tested on Linux (Debian sarge, May 2005, Kernel 2.6.11.*). (Note that OpenSC regression test pin0002 fails, but that is ok, we need to improve the test, the token is fine.)

    OpenCT 0.6.5 and OpenSC 0.9.6 is working on FreeBSD 6 - not forget to switch off the hotplug support.

    openct-0.6.20/doc/nonpersistent/wiki.out/smph.html0000644000175000017500000000303611336457575017120 00000000000000 smph – OpenCT

    Smartmouse / Phoenix

    OpenCT > 0.6.6 supports Smartmouse / Phoenix drivers. To be tested. The code was originaly published at  http://ngyn.kicks-ass.org/index.php?phoenix-openct and the new code was available via sourceforge at  https://sourceforge.net/projects/openct-phoenix/.

    The driver was written by Antoine Nguyen and it is based on the  SCTK project from Alexandre Becoulet, many thanks to him.

    This work was made for EDF, a french enterprise from the public sector. Many thanks to them for allowing me to publish this code!

    Test Results

    Waiting for a new release of OpenCT with this new driver.

    openct-0.6.20/doc/nonpersistent/wiki.out/ccid.html0000644000175000017500000000376111336457575017060 00000000000000 ccid – OpenCT

    USB CCID Readers

    CCID is the norm for usb smart card readers. Except for some very old readers, all ccid readers should work fine with OpenCT.

    Test results

    If you have tested one of these readers, please add a report here.

    • OMNIKEY CardMan 3021 on Fedora Core 5 with OpenCT 0.6.7: success.
    • OMNIKEY CardMan 3121 on Fedora Core 3 with OpenCT 0.6.5: success.
    • OMNIKEY CardMan 5121 on Debian with OpenCT 0.6.5: success (only the contact-based part, no RFID)
    • SCM SCR331
    • SCM SCR3310
    • HP SmartCard Keyboard
    • Cherry Smartboard G83-6744: success (not yet in secure pinpad mode however)

    Issues

    • the ccid parameter setting must be done in 2 passes, one that doesn't set Fi/Di to non-default values (before PTS is performed) and one that does (after we know the card accepts the non-default baudrate)
    • the pcsc ccid driver does validation of whether the reader supports a given baud rate, rather than blindly assuming that it will be able to deal with whatever preferred/maximum baud rate the card's atr specify's. We should do that too.

    Alternative

    If openct does not work, Ludovic Rousseau has a driver in ifdhandler format for pcsc-lite at  http://pcsclite.alioth.debian.org/ccid.html

    openct-0.6.20/doc/nonpersistent/wiki.out/MailingLists.html0000644000175000017500000000511111336457575020544 00000000000000 MailingLists – OpenCT

    Mailing lists

    • opensc-annouce - Announcements of new releases, bugfixes and security warnings
    • opensc-devel - Discussion of developement issues for OpenSC, OpenCT and SCB
    • opensc-user - Discussion of end-user questions for OpenSC, OpenCT and SCB
    • opensc-commits - commit notifications for all projects hosted at opensc-project.org

    To subscribe, unsubscribe or browse the archive, please visit our mailing list manager.

    Please:

    • Post to one of these mailing list.
    • Do not post to several lists, one is enough, we read all of them.
    • Do not send carbon copies to the developers. We read all postings on the mailing list.
    • Do not mail developers directly, we read all the mailing lists and the bugs address.

    Direct email on OpenCT and OpenSC is more work for us. Also see  this faq for explanations why.

    If you are subscribed to the mailing list, your posting will be distributed immideatly. If you are not subscribed, it will be put on hold, till someone has reviewed it so we can filter spam. We usualy review postings at least once a day, so be patient. You can also cancel the posting, subscribe to the mailing list and post again.

    Bug reports

    Please file bug reports using the new ticket link. You can also send bug reports to bugs@… via email.

    Greylisting

    The opensc-project.org and lists.opensc-project.org mail servers are protected from spam by using a mechanism called greylisting. Usualy this only causes a short delay for the first mail we receive from you, and no trouble at all. Still if for whatever reason you cannot send mail to opensc-project.org, please contact Andreas Jellinghaus at aj@…. Thanks.

    openct-0.6.20/doc/nonpersistent/wiki.out/ikey2032.html0000644000175000017500000000313711336457575017423 00000000000000 ikey2032 – OpenCT

    Rainbow iKey 2032

    OpenCT supports the Rainbow iKey 2032. However this driver was not tested ever, as there is no linux software for the smart card inside of it, and no documentation available.

    Test results

    I've followed instructions on the wiki. Using Ubuntu Hoary packages:

    $  cat /proc/bus/usb/devices
    [....]
    T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  6 Spd=1.5 MxCh= 0
    D:  Ver= 1.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=04b9 ProdID=1202 Rev= 1.00
    S:  Product=iKey 2032
    C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 56mA
    I:  If#= 0 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
    [....]
    
    #  openct-tool list
      0 Rainbow iKey 2032
    
    # openct-tool -r 0 atr
    Detected Rainbow iKey 2032
    Card present, status changed
    ATR: 3b ff 11 00 00 81 31 fe 4d 80 25 a0 00 00 00 56 57 44 4b 33 33 30 06 00 d0
    
    #  openct-control status
    No.   Name                         Info
    ===================================================
      0   Rainbow iKey 2032            slot0: card present
    
    
    openct-0.6.20/doc/nonpersistent/wiki.out/RemoteAccess.html0000644000175000017500000000476611336457575020541 00000000000000 RemoteAccess – OpenCT

    Remote Access to smart card readers

    NOTE: This page is completely untested.

    OpenCT includes a very simple facility to access smart card readers on a remote system. Please note that this mechanism has no security mechanisms in it at all. Therefore please use it only on trusted networks, or add a security wrapper like openssl to it.

    The setup needs to be done one two machines: the machine with the reader, and the machine with the software that wants to access the reader. We will call these machines "mwr" and "mws" in this example.

    On the machine with the reader, add it as usual to the openct.conf, here is an example for a serial reader:

    reader xiring {
            driver = xiring;
            device = serial:/dev/ttyS0;
    };
    

    In addition to that you need to start ifdproxy on the machine with the reader, and point the proxy to the machine with the software:

    root@mwr# ifdproxy export xiring /dev/ttyS0 mws:6666
    

    On the machine with the software, you need to edit openct.conf like this:

    ifdhandler = /usr/sbin/ifdhandler;
    ifdproxy {
            server-port     = /var/run/openct/proxy,
            device-port     = :6666;
    };
    reader xiring {
            driver = xiring;
            device = remote:serial1@/var/run/openct/proxy;
    };
    

    and then start openct via the init.d script as normal:

    root@mws# /etc/init.d/openct start
    root@mws# ifdproxy server
    

    now you should be able to see the remote reader using the ifproxy list command:

    root@mws# ifdproxy list
    Exported devices
      serial1          MachineB's_IP                 xiring
    

    Adding security

    As discussed, the setup above is completely unsecure. But with the openssl commands, it can be improved:

    TODO

    openct-0.6.20/doc/nonpersistent/wiki.out/pertosmart1038.html0000644000175000017500000000231311336457575020662 00000000000000 pertosmart1038 – OpenCT

    PertoSmart EMV, ACS ACR38U and others

    The pertosmart1038 supports these readers:

    • Perto Smart EMV smart card readers based on ACS AC-1038 chipset.
    • ACS ACR38 smart card readers (including variants, but not ACS38-CCID)
    • ACS ACR100 SIMFlash (with USB ID 072f/9007)
    • ACS CryptoMate
    • other readers based on the same chipset

    For the ACR100/CryptoMate and possible other products with this chipset, adding the USB IDS to /etc/openct.conf may be required.

    Test results

    Tested with ACR38, ACR38T, ACR100 and Cryptomate on openct-0.6.14 from Fedora 8 (x86_64)

    openct-0.6.20/doc/nonpersistent/wiki.out/cardman.html0000644000175000017500000000607311336457575017562 00000000000000 cardman – OpenCT

    Omnikey Cardman

    The cardman driver might support OMNIKEY CardMan 2020/6020/6120 devices, but it is not yet complete, and the original author has stopped working on it.

    The cm4000 driver supports OMNIKEY CardMan 4000. It is available in OpenCT 0.6.5 and later. You'll still need the kernel driver for this card, either the one from OMNIKEY. An updated version of that driver will be merged into the mainline kernel for 2.6.15.

    CardMan 4040 starts in OpenCT 0.6.6. It works with both the omnikey kernel driver as well as with the new open source kernel driver (included in linux kernel 2.6.15). Unfortunalty there is a bug in the kernel driver, so you might need kernel 2.6.16.17 or 2.6.17 to get it to work.

    Both cm4000 and cm4040 latest kernel drivers can be downloaded from  http://svn.gnumonks.org/trunk/omnikey_cardman/new/kernel/

    If you have any problems with cm4000, 4040, 3121 or 5121, please contact Harald Welte <laforge@…>.

    Test results

    If you have tested one of these readers, please add a report here.

    • CardMan 2020 on Fedora Core 3 and 4 with OpenCT 0.6.5 and earlier versions: failure
    • CardMan 4000 on Fedora Core 4test2 with OpenCT 0.6.5rc1: failure (well, it does read the ATR, see above).
    • CardMan 4000 on Debian unstable (ppc): working
    • CardMan 4000 on Debian unstable (x86_64): working
    • CardMan 4000 on Debian unstable (i386): working (tested with gnupg, pcscd, OpenCT 0.6.6 and the OpenPGP card)
    • CardMan 4040 on Debian unstable (x86_64,i386): working
    • CardMan 4040 on Fedora Core 5 (i386): working (need to uncomment the cm4040 part in /etc/openct.conf and a sudo mknod -m 666 /lib/udev/devices/cmx0 c 253 0)
    • CardMan 3121 on Debian unstable (x86_64): working (ifd-ccid)
    • CardMan 3121 on Ubuntu 7.10 (x86): working (ifd-ccid from  http://omnikey.aaitg.com/index.php?id=69)
    • CardMan 5121 on Debian unstable (x86_64): working (ifd-ccid, only the contact-based interface)
    • CardMan 6020 on Fedora Core 3 and 4test2 with OpenCT 0.6.5rc1: failure.

    Alternative

    Some recent OMNIKEY USB readers (like 3021, 3121, 5121) work with the generic USB CCID driver.

    openct-0.6.20/doc/nonpersistent/wiki.out/QuickStart.html0000644000175000017500000001545511336457575020253 00000000000000 QuickStart – OpenCT

    A quick installation guide to openct

    Please read OperatingSystems page first for the general concept and problems and then come back here for step by step instructions. Thanks.

    To install openct, please do as user,

    $ wget http://www.opensc-project.org/files/openct/openct-0.6.16.tar.gz
    $ tar xfvz openct-0.6.16.tar.gz
    $ cd openct-0.6.16
    
    $ ./configure --prefix=/usr --sysconfdir=/etc
    

    This will install openct in /usr, but put the config file into /etc. The configure out put is quite long, with many tests for software, versions and so on. At the end a summary is printed, it should look like this:

    OpenCT has been configured with the following options

    User binaries:       ${exec_prefix}/bin
    Configuration files: /etc
    
    Host:                i686-pc-linux-gnu
    Compiler:            gcc
    Compiler flags:      -Wall -g -O2 
    Preprocessor flags:  -I${top_builddir}/src/include -I${top_srcdir}/src/include 
    Linker flags:        
    Libraries:           -lpthread 
    
    PC/SC support:       yes
    Libusb used:         yes
    

    To use usb tokens and readers, libusb support is highly recommended. PC/SC support is only useful, if you want to use openct drivers with applications other than opensc, using the pcsc-lite middleware. This author does only use openct with opensc and thus would not need PC/SC support.

    Please note that OpenCT uses pkg-config to find libusb and pcsc-lite. pkg-config should be installed, and - if necessary - PKG_CONFIG_PATH environment set to directories with the *.pc files, like /usr/lib/pkgconfig/. If you cannot install pkg-config or for some reason you want to use a version of e.g. libusb that has no pkg-config file, you can work around this problem by setting environment variables, for example LIBUSB_CFLAGS="-I/path/to/your/libusb/include" and LIBUSB_LIBS="-L/path/to/your/libusb/lib -lusb". This will also work if your pkg-config files are broken for some reason.

    $ make
    $ su root
    

    and as root

    # make install
    

    will install all the files.

    At system boot, openct needs to create a status file and start a process for every permanent connected reader. For this you need to install the init script into /etc/init.d/ and create startup and shutdown symlinks.

    # cp etc/init-script /etc/init.d/openct
    # ln -s ../init.d/openct /etc/rc0.d/K50openct
    # ln -s ../init.d/openct /etc/rc1.d/S50openct
    # ln -s ../init.d/openct /etc/rc2.d/S50openct
    # ln -s ../init.d/openct /etc/rc3.d/S50openct
    # ln -s ../init.d/openct /etc/rc4.d/S50openct
    # ln -s ../init.d/openct /etc/rc5.d/S50openct
    # ln -s ../init.d/openct /etc/rc6.d/K20openct
    

    This init script will create the directory /var/run/openct/ when run. If you want to restrict access to openct, it might be best to edit the init script. We have put the mkdir command in the init script, as some distributions use a tmpfs on /var/run/ and thus all files and directories in it vanish after a reboot.

    Openct also supports hotplugging. If properly configured you can simply plugin a usb smart card reader and instantly access it, or remove it. Beware: never remove a smart card reader or usb crypto dongle while someone is using it. Incomplete transactions can leave some smart cards confused up to the point of being unusable. This is rare, but it happends (especially while a card is initialized).

    Over the time different mechanisms were developed for hotplugging - how the kernel can get the message "here is a new usb device" to the user space application that can make good use of it. OpenCT now suggests to use hald for this, as most distributions prefer this way and favor it.

     mkdir -p /usr/share/hal/fdi/information/10freedesktop/
    cp etc/openct.fdi /usr/share/hal/fdi/information/10freedesktop/10-usb-openct.fdi
    cp openct-policy.fdi /usr/share/hal/fdi/policy/10osvendor/10-usb-openct.fdi 
    cp etc/openct.hald /usr/lib/hal/hald-addon-openct # distro dependent
    chmod 0755 /usr/lib/hal/hald-addon-openct # needs to be executable
    

    Note that hald setup does not support readers in pcmcia or pc-card so far. But for usb it was tested and is working fine.

    See OperatingSystems for more details and information on other operating systems.

    Finaly, openct needs a config file to work correctly.

    cp etc/openct.conf /etc/openct.conf
    

    if you have serial readers (or anything else, not hotplugged), edit /etc/openct.conf and configure your reader. Here is an example for a Towitoko reader connected to the first serial port:

            reader towitoko {
                   driver = towitoko;
                   device = serial:/dev/ttyS0;
            };
    

    Now attach all those serial readers and start openct. Hotplug readers already attached will be found as well, but you can as well attach them later.

    /etc/init.d/openct start
    

    now you can test it as user:

    openct-tool list
      0 Towitoko Chipdrive Micro
      1 Schlumberger E-Gate
    

    As you can see I have a normal, serial reader (Towitoko Chipdrive Micro) and one usb token. If I remove the usb token, it will no longer be listed. If I add a new token, the new one will show up:

    openct-tool list
      0 Towitoko Chipdrive Micro
      1 Aladdin eToken PRO
    

    I tested this on systems with several usb ports, too. But this "screen shot" is from a system with only one usb port, my old laptop.

    If you have a card in the reader, you can get the answer to reset ("ATR"), which is a byte string containing some parameters, but can be used very well to identify a card. Default is reader 0, add "-r 1" to use reader 1.

    openct-tool -r 1 atr
    Detected Aladdin eToken PRO
    Card present, status changed
    ATR: 3b e2 00 ff c1 10 31 fe 55 c8 02 9c
    

    and similar commands. openct is ready.

    openct-0.6.20/doc/nonpersistent/wiki.out/OverView.html0000644000175000017500000000657611336457575017733 00000000000000 OverView – OpenCT

    Overview

    This is the easiest scenario and it is recommended:

    +----------------------------------------+
    |        Application, e.g. mozilla       |
    +------------------pkcs11----------------+
    |       PKCS11 library, e.g. OpenSC      |
    +----------------------------------------+
    |                 OpenCT                 |
    +----------------------------------------+
    |               Linux Kernel             |
    +----------------------------------------+
    

    Mozilla can load security modules implementing PKCS11, OpenSC does that, and OpenSC has a direct interface to use OpenCT.

    But sometimes you have this stacking:

    +----------------------------------------+
    |               Application              |
    +-----------------PC/SC------------------+
    |               PC-SC/Lite               |
    +---------------ifdhandler---------------+
    |                 Driver                 |
    +----------------------------------------+
    |                 Kernel                 |
    +----------------------------------------+
    

    PC/SC (also called winscard) is a standard API popular on windows, so many applications want to use it to talk to smart cards. PC/SC-Lite is a free software for Linux, Mac OS X and BSD and implements this standard. It needs drivers in ifdhandler format so Vendors usualy ship drivers for in this format. Some vendors ship drivers that require kernel modules or kernel modifications, others have a generic driver that works with any kernel.

    OpenCT has a driver in ifdhandler format, so you can use it in that place. But the direct mode combining for example OpenSC and OpenCT is prefered and a lot better tested.

    Also there is a third model:

    +----------------------------------------+
    |               Application              |
    +-----------------CT/API-----------------+
    |                 Driver                 |
    +----------------------------------------+
    

    This model is very, very simple, and was designed for DOS. It works well if you have only one application and one user. It is outdated. Still some applications want drivers in CT-API format and some vendors ship drivers in this format. OpenCT includes a CT-API driver, but it is not well tested, and not recommended for multi application or multi user environments.

    Why three faces?

    OpenCT implements three difference ways how an application can use it, for a maximum of compatibility. The prefered way for an application is to use libopenct which implements the direct OpenCT mode. This mode works without the big PC/SC-Lite middleware, its code is a lot smaller, and still it offers the same features. Because it is smaller, we can debug it easier and fix problems faster. Also we use it everyday, so it is well tested.

    openct-0.6.20/doc/nonpersistent/wiki.out/DevelopmentPolicy.html0000644000175000017500000000710411336457575021613 00000000000000 DevelopmentPolicy – OpenCT

    Development Policy

    It is easier for all developers if the whole software of a project is homogenous, follows the same basic rules for function names, coding style, and so on. None of the rules mentioned in this document are set in stone, however please follow the rules for now, and if you feel something should be changed: start a discussion on the opensc-devel mailing list.

    • Coding Style: we follow mostly the coding style as the linux kernel. So you can have a look at the "Documentation/CodingStyle" document in the linux kernel source for details, and use the "scripts/Lindent" script from linux kernel source to indent source files. ("-npro -kr -i8 -ts8 -sob -l80 -ss -ncs")

    Note that indenting is meant to make the code more readable. Please check if the indent tool actualy made it more readable, and only commit your changes if it did. Sometimes functions are too nested and it is very hard to rewrite the code with less nesting. It is prefectly fine to deviate from the norm in such cases.

    • usualy we define a "something_t" typedef for every "struct something" and use the something_t name.
    • build system: we use autoconf, automake and libtool to make the building as easy as possible. We test on debian sarge (autoconf 2.59, automake 1.9.5, libtool 1.5.6), if you have different versions of these tools and run into problems, please let us know. Note: for security reasons (insecure use of tmp files) automake 1.9+ is recommended.
    • we use and/or provide pkg-config files, to ease linking with our libraries and detecting libraries. While alternatives might be marginaly better, the additional work might be not worth it.
    • svn files: we store only files in subversion that are not generated in any way. bootstrap will generate most files like configure and Makefile.in. "make dist" will generate or update the documentation. To do that it uses wget to get snapshots of our wiki webpage.
    • "cvs is not a replacement for developer documentation." That rule works well for subversion, too. We think it is very important all changes are discussed first before commiting. We welcome new developers, but ask you to post any changes to the opensc-devel mailing list for peer review, if everything is fine one of the few developers with svn write access will commit the changes. Once we see someone is sending patches that can be applied without discussion we get lazy and hand out write access.
    • Things that you commit should at least compile, preferably on all supported platforms (Linux, Mac OS X, Windows and if possible Solaris). Conforming things to the Linux style is nice but take care not to increase the burden on other platforms.
    openct-0.6.20/doc/nonpersistent/wiki.out/kaan.html0000644000175000017500000000442111336457575017062 00000000000000 kaan – OpenCT

    Kobil Kaan Professional and Telesec B1

    The kaan driver might support Kobil Kaan Professional and Telesec B1 drivers.

    FIXME: "Telesec B1"? "Siemens B1"? please clarify, I'm confused.

    Test results

    If you have tested one of these readers, please add a report here.

    Kobil Kaan Professional works with

    reader kaan {
            driver = kaan;
            device = serial:/dev/ttyUSB0;
    };
    

    in /etc/openct.conf

    Telesec B1 works with

    reader sni_b1 {
           driver = b1;
           device = /dev/tts/1;
    };
    

    but only memory cards are tested to work at this point (OpenCT 0.6.0).

    OpenSC 0.6.7 will have an improved b1 driver thanks to Lorenz Knauer. But there is one remaining issue:

    I can only get cards to work with FI=DI=1 (etu=372). The B1 reader does not
    change the ICC communication etu after receiving the ATR.
    So I could not get my OpenPGP card to work. 
    I get the ATR, but no access to any of the commands.
    
    The problem is that changing the protocol with 80 60 01 00 03 22 01 02 (T=1)
    works,
    but changing FI and DI with "80 60 01 00 06 23 01 01 24 01 03" does not
    work. Instead it gives SW12 = 6A 80.
    

    Alternative

    Kobil Kann readers with a usb interface should work with the generic USB CCID driver.

     http://www.kobil.de/e/index.php?s=smartcard Manufacturer, but only the new usb readers on this site.

    openct-0.6.20/doc/nonpersistent/wiki.out/towitoko.html0000644000175000017500000000240011336457575020022 00000000000000 towitoko – OpenCT

    Towitoko Chipdriver

    The towitoko driver might support these readers:

    • Towitoko Chipdrive Micro
    • Towitoko Kartenzwerg
    • Towitoko Kartenzwerg II
    • Towitoko Chipdrive External
    • Towitoko Chipdrive Twin
    • Towitoko Chipdrive Internal

    and compatibles.

    Test Results

    "CHIPDRIVE micro 120 V4.30" with OpenCT 0.6.4 and OpenSC 0.9.6 with several different cards work perfectly. Tested on Linux (Debian sarge, May 2005, Kernel 2.6.11.*).

     http://www.chipdrive.de/ the manufacturer of these readers.

    openct-0.6.20/doc/nonpersistent/wiki.out/WritingDrivers.html0000644000175000017500000002343311336457575021136 00000000000000 WritingDrivers – OpenCT

    Writing a simple card reader driver for OpenCT

    Using an editor like anjuta, kdevelop or similar is handy since it allows you to quickly inspect data types definitions wherever they are defined in a project. It is beyond the intent of this document to show you how to do it, but I remember that using the import functionalities of the editor allowed me to get up to speed quickly.

    Download an openct release, openct-0.6.6 in the rest of this document, and unpack it:

    tar -xzvf openct-0.6.6.tar.gz
    

    Set a shell environment variable to be the directory. In my case:

    export OPENCT_SRC = $HOME/src/openct-0.6.6
    

    Go to the directory where all other card reader drivers are:

    cd $OPENCT_SRC/src/ifd
    

    Create the file that will hold the driver source code with your editor of choice:

    emacs ifd-wbeiuu.c
    

    And add what follows:

    #include "internal.h"
    
    static int wbeiuu_open(ifd_reader_t * reader, const char *device_name)
    { 
       ifd_device_t *dev;
       ifd_debug(1, "%s:%d wbeiuu_open()", __FILE__, __LINE__);
    
       reader->name = "Test driver. For illustration purposes only";
       reader->nslots = 1;
       if (!(dev = ifd_device_open(device_name)))
    	return -1;
    
       if (ifd_device_type(dev) != IFD_DEVICE_TYPE_USB) {
    	ct_error("test driver: device %s is not a USB device", device_name);
    	ifd_device_close(dev);
    	return -1;
       }
    
       reader->device = dev;
       dev->timeout = 1000;
    
       ifd_debug(1, "%s:%d Checkpoint", __FILE__, __LINE__);
       return 0;
    
    }
    
    static int wbeiuu_close(ifd_reader_t * reader)
    { ifd_debug(1, "%s:%d wbeiuu_close()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_activate(ifd_reader_t * reader)
    { ifd_debug(1, "%s:%d wbeiuu_activate()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_deactivate(ifd_reader_t * reader)
    { ifd_debug(1, "%s:%d wbeiuu_deactivate()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_change_parity(ifd_reader_t * reader, int parity)
    { ifd_debug(1, "%s:%d wbeiuu_change_parity()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_change_speed(ifd_reader_t * reader, 
                                   unsigned int speed)
    { ifd_debug(1, "%s:%d wbeiuu_change_speed()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_card_reset(ifd_reader_t * reader, int slot, void *atr, 
                                 size_t atr_len)
    { ifd_debug(1, "%s:%d wbeiuu_card_reset()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_card_status(ifd_reader_t * reader, int slot, 
                                  int *status)
    { ifd_debug(1, "%s:%d wbeiuu_card_status()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_send(ifd_reader_t * reader, unsigned int dad,
                           const unsigned char *buffer, size_t len)
    { ifd_debug(1, "%s:%d wbeiuu_send()", __FILE__, __LINE__); return 0; }
    
    static int wbeiuu_recv(ifd_reader_t * reader, unsigned int dad,
                           unsigned char *buffer, size_t len, long timeout)
    { ifd_debug(1, "%s:%d wbeiuu_recv()", __FILE__, __LINE__); return 0; }
    
    static struct ifd_driver_ops wbeiuu_driver;
    
    void ifd_wbeiuu_register(void)
    {
            wbeiuu_driver.open = wbeiuu_open;
            wbeiuu_driver.close = wbeiuu_close;
            wbeiuu_driver.activate = wbeiuu_activate;
            wbeiuu_driver.deactivate = wbeiuu_deactivate;
            wbeiuu_driver.card_reset = wbeiuu_card_reset;
            wbeiuu_driver.card_status = wbeiuu_card_status;
            wbeiuu_driver.change_parity = wbeiuu_change_parity;
            wbeiuu_driver.change_speed = wbeiuu_change_speed;
            wbeiuu_driver.send = wbeiuu_send;
            wbeiuu_driver.recv = wbeiuu_recv;
            ifd_driver_register("wbeiuu", &wbeiuu_driver);
    }
    
    

    Basically a driver is a structure whose members are the functions you need to implement for your card reader. In this case we just added some tracing code that will help us see how the functions are being executed. We will see later how to code a function that does actually something.

    Add the driver registration call to $OPENCT_SRC/src/ifd/init.c

            ifd_towitoko_register();
            ifd_wbeiuu_register();
            /* ccid last */
            ifd_ccid_register();
    

    Add the function prototype in $OPENCT_SRC/src/ifd/internal.h in order to avoid compiler warnings and errors:

           extern void ifd_towitoko_register(void);
           extern void ifd_wbeiuu_register(void);
    

    Unless you add the file to be compiled in the proper Makefile.in it will be ignored whe building openct. Therefore you must edit $OPENCT_SRC/src/ifd/Makefile.am and modify it accordingly:

    libifd_la_SOURCES = \
            apdu.c atr.c checksum.c conf.c ctbcs.c device.c driver.c \
            init.c locks.c manager.c modules.c pcmcia.c pcmcia-block.c process.c protocol.c \
            reader.c serial.c usb.c usb-descriptors.c utils.c \
            \
            ifd-acr30u.c ifd-cardman.c ifd-ccid.c ifd-cm4000.c ifd-egate.c \
            ifd-etoken.c ifd-etoken64.c ifd-eutron.c ifd-gempc.c ifd-ikey2k.c \
            ifd-ikey3k.c ifd-kaan.c ifd-pertosmart1030.c ifd-smartboard.c \
            ifd-towitoko.c cardman.h \
            ifd-wbeiuu.c\
            proto-gbp.c proto-sync.c proto-t0.c proto-t1.c \
            proto-trans.c \
            \
            sys-sunray.c sys-solaris.c sys-bsd.c sys-linux.c sys-null.c \
            \
            ria.c
    

    If your card reader is a usb device like the wbeiuu is then you need the USB Vendor and Product ID (in my case 0x104f and 0x0004 respectively). The lsusb -v command comes handy here to get that information. This is required in order to add some configuration information that will tell openct to react upon plugin the card reader in the system. In my case I did so adding the following lines to the end of $OPENCT_SRC/etc/openct.conf.in:

    driver pertosmart1030 {
            ids = {
                    usb:072f/0001,
                    usb:072f/8009,
            };
    };
    driver wbeiuu {
           ids = {
                   usb:104f/0004,
           };
    };
    

    Notice that here the string "wbeiuu" must be the same that the first parameter of ifd_driver_register() in ifd-wbeiuu.c

    $OPENCT_SRC/etc/openct.usermap

     # pertosmart1038
     openct               0x0003      0x072f   0x9000    0x0000       0x0000       0x00         0x00            0x00            0x0b            0x00               0x00               0x00000000
     openct               0x0003      0x072f   0x90d0    0x0000       0x0000       0x00         0x00            0x00            0x0b            0x00               0x00               0x00000000
    # wbeiuu
    openct               0x0003      0x104f   0x0004    0x0000       0x0000       0x00         0x00            0x00            0x0b         0x00               0x00               0x00000000
    

    And $OPENCT_SRC/etc/openct.udev

    SYSFS{idVendor}=="072f", SYSFS{idProduct}=="9000", RUN+="/etc/hotplug/usb/openct
    SYSFS{idVendor}=="072f", SYSFS{idProduct}=="90d0", RUN+="/etc/hotplug/usb/openct
    +# wbeiuu
    +SYSFS{idVendor}=="104f", SYSFS{idProduct}=="0004", RUN+="/etc/hotplug/usb/openct
    

    Go back to the base directory, update makefiles, rebuild and install (for the latter you will very likely need to be root):

    cd $OPENCT_SRC
    aclocal
    autoconf
    automake
    ./configure --prefix=/usr/local/openct-0.6.6
    make
    make install 
    

    It is useful to follow the QuickStart guidelines for installing openct

    Let's see if it works. Run:

    /etc/init.d/openct start
    /usr/local/openct-0.6.6/sbin/ifdhandler -d -d -d -d -d -H wbeiuu /proc/bus/usb/001/005
    

    Customized for your current usb setup. My configuration above was usb bus 1, device 5 but you should definitely check /proc/bus/usb/devices and the output of lsusb.

    Which should print something like:

    Debug: ifd_open: trying to open wbeiuu@/proc/bus/usb/001/005
    Debug: wbeiuu_open: ifd-wbeiuu.c:6
    Segmentation fault
    

    An wonderfully successful but absolutely useless card reader driver. That is, the driver actually works but it lack the logic to perform the communication between the usb device and the host (hence the crash).

    To make it do something useful one must actually implement the communication mechanisms between the host computer and the card reader. It is quite easy if you know what functions provided by openct to use when accessing USB devices.

    ifd_device_open(); // grabs USB devices and handles for you.
    
    ifd_usb_control(); // used to send USB control messages to the card reader.
    
    ifd_sysdep_usb_bulk(); // is used for both sending and receiving byte streams to 
                           // and from the USB devices. The USB endpoint used defines
                           // the direction in the communication.
    

    Feel free to take a look at the code of the files $OPENCT_SRC/src/ifd/ifd-*.c for further inspiration.

    openct-0.6.20/doc/nonpersistent/wiki.out/SecureSetup.html0000644000175000017500000000634611336457575020427 00000000000000 SecureSetup – OpenCT

    Secure Setup

    OpenCT was designed to be secure and allow system administrators to restrict access to smart card readers. You have the option to

    • install openct so it can be used by everyone.
    • limit access to openct to some group.
    • limit access to openct to some user.

    The access control is done via setting permissions on /var/run/openct directory.

    Not that in all setups the first user to access a reader will lock that reader, and no other user will be able to access the reader till it is unlocked.

    FIXME: how does locking work? does locking work for processes/connections and the build in module limit access to the user (all processes) even without a lock command? Is root able to bypass this security?

    OpenCT for everyone

    Access control to smart card readers supported by openct is managed using the ownership, group and permissions on the directory /var/run/openct/. Here are example commands how to setup smart card access open for everyone. This is also the default.

    Note however that recently some distributions have started using a so called "tmpfs" on /var/run/. The effect is that all files and directories are gone after a reboot, and thus need to be re-created during each system boot and permissions need to be setup properly. Therefore it is best to execute the following commands once, and also edit the openct init script /etc/init.d/openct so it executes the same commands each time the directory is re-created.

    chown root:root /var/run/openct/
    chmod 0755 /var/run/openct
    

    Note: this setup is used in the QuickStart documentation.

    OpenCT restricted to some group

    This example will restrict access to the scard group. This is the default setup on debian systems. You need to add each user that is allowed to use smart cards to the scard system group. Remember that adding someone to a group needs that user to logout and login again to get the effect.

    chown root:scard /var/run/openct
    chmod 0750 /var/run/openct
    

    OpenCT restricted to some user

    If you use openct with pc/sc-lite, then only pcscd needs to be able to access openct, and all users/application can use it via pc/sc-lite. In this case the restriction to one user is fine. pcscd usualy runs as root. Applications and tools might however print warnings if they cannot access the openct directory.

    chown someuser /var/run/openct
    chmod 0700 /var/run/openct
    
    openct-0.6.20/doc/nonpersistent/wiki.out/etoken.html0000644000175000017500000000320611336457575017435 00000000000000 etoken – OpenCT

    Aladdin eToken PRO

    OpenCT supports Aladdin eToken PRO tokens fine. They have been tested with OpenSC under Linux and work perfectly. Note however that on application layer the Aladdin software is using a different storage format than OpenSC. See the OpenSC wiki for details.

    Aladdin sponsored an OpenSC/OpenCT talk/workshop at the Chaos Communication Congress with some tokens. Thanks a lot!

    The cardos-info tool of OpenSC will show you additional details about your Aladdin eToken PRO.

    Test Results

    OpenCT 0.6.4 and OpenSC 0.9.6 work perfectly. Tested on Linux (Debian sarge, May 2005, Kernel 2.6.11.*).

    Aladdin eToken 64 support is new and will show up in the next openct release. It has not yet been tested.

     http://www.ealaddin.com/etoken/pro/usb.asp Aladdin Knowledge Systems / product page for eToken PRO.

    openct-0.6.20/doc/nonpersistent/Makefile.am0000644000175000017500000000257711141256277015545 00000000000000MAINTAINERCLEANFILES = \ $(srcdir)/Makefile.in wikidir=$(htmldir)/wiki dist_noinst_SCRIPTS = export-wiki.sh export-wiki.xsl \ svn2cl.xsl dist_wiki_DATA = wiki.out/* dist_noinst_DATA = ChangeLog if SVN_CHECKOUT wiki.out/*: wiki.out wiki.out: -rm -fr wiki.out test -n "$(WGET)" -a -n "$(SED)" -a -n "$(TR)" -a -n "$(XSLTPROC)" WGET="$(WGET)" WGET_OPTS="$(WGET_OPTS)" SED="$(SED)" TR="$(TR)" XSLTPROC="$(XSLTPROC)" \ PROJECT="@PACKAGE_NAME@" \ $(SHELL) "$(srcdir)/export-wiki.sh" "$(srcdir)" "wiki.tmp" mv wiki.tmp wiki.out ChangeLog: test -n "$(SVN)" -a -n "$(XSLTPROC)" if test -d "$(top_srcdir)/.svn"; then \ $(SVN) --verbose --xml log "$(top_srcdir)" | \ $(XSLTPROC) --nonet --stringparam linelen 75 \ --stringparam groupbyday no \ --stringparam include-rev no \ "$(srcdir)/svn2cl.xsl" - > ChangeLog.tmp; \ else \ echo "Warning: Unable to generate ChangeLog from none svn checkout" >&2; \ echo > ChangeLog.tmp; \ fi mv ChangeLog.tmp ChangeLog else wiki.out/*: $(abs_builddir)/wiki.out $(abs_builddir)/wiki.out: $(LN_S) "$(srcdir)/wiki.out" wiki.out ChangeLog: $(LN_S) "$(srcdir)/ChangeLog" ChangeLog endif distclean-local: -rm -rf wiki.tmp if test -L wiki.out; then \ rm -fr wiki.out; \ fi -rm -fr ChangeLog.tmp if test -L ChangeLog; then \ rm -fr ChangeLog; \ fi maintainer-clean-local: -rm -rf "$(srcdir)/wiki.out" -rm -rf "$(srcdir)/ChangeLog" openct-0.6.20/doc/nonpersistent/Makefile.in0000644000175000017500000003451311336457517015557 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/nonpersistent DIST_COMMON = $(dist_noinst_DATA) $(dist_noinst_SCRIPTS) \ $(dist_wiki_DATA) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(dist_noinst_SCRIPTS) 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)$(wikidir)" DATA = $(dist_noinst_DATA) $(dist_wiki_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = \ $(srcdir)/Makefile.in wikidir = $(htmldir)/wiki dist_noinst_SCRIPTS = export-wiki.sh export-wiki.xsl \ svn2cl.xsl dist_wiki_DATA = wiki.out/* dist_noinst_DATA = ChangeLog all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/nonpersistent/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/nonpersistent/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_wikiDATA: $(dist_wiki_DATA) @$(NORMAL_INSTALL) test -z "$(wikidir)" || $(MKDIR_P) "$(DESTDIR)$(wikidir)" @list='$(dist_wiki_DATA)'; test -n "$(wikidir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(wikidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(wikidir)" || exit $$?; \ done uninstall-dist_wikiDATA: @$(NORMAL_UNINSTALL) @list='$(dist_wiki_DATA)'; test -n "$(wikidir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(wikidir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(wikidir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(wikidir)"; 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_wikiDATA 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 \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_wikiDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dist_wikiDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-dist_wikiDATA @SVN_CHECKOUT_TRUE@wiki.out/*: wiki.out @SVN_CHECKOUT_TRUE@wiki.out: @SVN_CHECKOUT_TRUE@ -rm -fr wiki.out @SVN_CHECKOUT_TRUE@ test -n "$(WGET)" -a -n "$(SED)" -a -n "$(TR)" -a -n "$(XSLTPROC)" @SVN_CHECKOUT_TRUE@ WGET="$(WGET)" WGET_OPTS="$(WGET_OPTS)" SED="$(SED)" TR="$(TR)" XSLTPROC="$(XSLTPROC)" \ @SVN_CHECKOUT_TRUE@ PROJECT="@PACKAGE_NAME@" \ @SVN_CHECKOUT_TRUE@ $(SHELL) "$(srcdir)/export-wiki.sh" "$(srcdir)" "wiki.tmp" @SVN_CHECKOUT_TRUE@ mv wiki.tmp wiki.out @SVN_CHECKOUT_TRUE@ChangeLog: @SVN_CHECKOUT_TRUE@ test -n "$(SVN)" -a -n "$(XSLTPROC)" @SVN_CHECKOUT_TRUE@ if test -d "$(top_srcdir)/.svn"; then \ @SVN_CHECKOUT_TRUE@ $(SVN) --verbose --xml log "$(top_srcdir)" | \ @SVN_CHECKOUT_TRUE@ $(XSLTPROC) --nonet --stringparam linelen 75 \ @SVN_CHECKOUT_TRUE@ --stringparam groupbyday no \ @SVN_CHECKOUT_TRUE@ --stringparam include-rev no \ @SVN_CHECKOUT_TRUE@ "$(srcdir)/svn2cl.xsl" - > ChangeLog.tmp; \ @SVN_CHECKOUT_TRUE@ else \ @SVN_CHECKOUT_TRUE@ echo "Warning: Unable to generate ChangeLog from none svn checkout" >&2; \ @SVN_CHECKOUT_TRUE@ echo > ChangeLog.tmp; \ @SVN_CHECKOUT_TRUE@ fi @SVN_CHECKOUT_TRUE@ mv ChangeLog.tmp ChangeLog @SVN_CHECKOUT_FALSE@wiki.out/*: $(abs_builddir)/wiki.out @SVN_CHECKOUT_FALSE@$(abs_builddir)/wiki.out: @SVN_CHECKOUT_FALSE@ $(LN_S) "$(srcdir)/wiki.out" wiki.out @SVN_CHECKOUT_FALSE@ChangeLog: @SVN_CHECKOUT_FALSE@ $(LN_S) "$(srcdir)/ChangeLog" ChangeLog distclean-local: -rm -rf wiki.tmp if test -L wiki.out; then \ rm -fr wiki.out; \ fi -rm -fr ChangeLog.tmp if test -L ChangeLog; then \ rm -fr ChangeLog; \ fi maintainer-clean-local: -rm -rf "$(srcdir)/wiki.out" -rm -rf "$(srcdir)/ChangeLog" # 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: openct-0.6.20/doc/nonpersistent/export-wiki.xsl0000644000175000017500000000272611043042742016506 00000000000000 <xsl:value-of select="/html:html/html:head/html:title" /> Wiki Index

    Index of Wiki Pages

  • openct-0.6.20/doc/doxygen.conf.in0000644000175000017500000015320711043042742013513 00000000000000# Doxyfile 1.5.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file that # follow. The default is UTF-8 which is also the encoding used for all text before # the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into # libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of # possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = OpenCT # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = api.out # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = @top_srcdir@/src/include # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to # include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is # documented as struct with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code where the coding convention is that all structs are # typedef'ed and only the typedef is referenced never the struct's name. TYPEDEF_HIDES_STRUCT = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be extracted # and appear in the documentation as a namespace called 'anonymous_namespace{file}', # where file will be replaced with the base name of the file that contains the anonymous # namespace. By default anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = YES # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = NO # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text " # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @top_srcdir@/src/include # This tag can be used to specify the character encoding of the source files that # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default # input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. # See http://www.gnu.org/software/libiconv for the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = */.svn/* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the output. # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH # then you must also enable this option. If you don't then doxygen will produce # a warning and turn it on anyway SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = @srcdir@/doxygen-footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to # produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to # specify the directory where the mscgen tool resides. If left empty the tool is assumed to # be found in the default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will # generate a caller dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected # functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the number # of direct children of the root node in a graph is already larger than # MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO openct-0.6.20/doc/Makefile.am0000644000175000017500000000126611336456617012632 00000000000000MAINTAINERCLEANFILES = $(srcdir)/Makefile.in if ENABLE_DOC SUBDIRS = nonpersistent endif DIST_SUBDIRS = nonpersistent dist_doc_DATA = README dist_noinst_DATA = $(srcdir)/doxygen-footer.html $(srcdir)/*.gif if ENABLE_API_DOC dist_apidoc_DATA=api.out/html/* else dist_noinst_DATA+=api.out/html/* endif if SVN_CHECKOUT api.out/html/*: api.out api.out: $(top_srcdir)/src/include/openct/*.h \ $(srcdir)/*.gif \ doxygen.conf -rm -fr api.out $(DOXYGEN) doxygen.conf cp "$(srcdir)"/*.gif api.out/html else api.out/html/*: $(abs_builddir)/api.out $(abs_builddir)/api.out: $(LN_S) "$(srcdir)/api.out" api.out endif clean-local: if SVN_CHECKOUT -rm -fr api.out else -rm -f api.out endif openct-0.6.20/doc/Makefile.in0000644000175000017500000005301211336457517012637 00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_API_DOC_FALSE@am__append_1 = api.out/html/* subdir = doc DIST_COMMON = README $(am__dist_apidoc_DATA_DIST) \ $(am__dist_noinst_DATA_DIST) $(dist_doc_DATA) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/doxygen.conf.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = doxygen.conf CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__dist_apidoc_DATA_DIST = api.out/html/* 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)$(apidocdir)" "$(DESTDIR)$(docdir)" am__dist_noinst_DATA_DIST = $(srcdir)/doxygen-footer.html \ $(srcdir)/*.gif api.out/html/* DATA = $(dist_apidoc_DATA) $(dist_doc_DATA) $(dist_noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_NON_PRIVILEGED = @ENABLE_NON_PRIVILEGED@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LIBS = @LIBUSB_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTLIB_CFLAGS = @LTLIB_CFLAGS@ LTLIB_LIBS = @LTLIB_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENCT_LT_AGE = @OPENCT_LT_AGE@ OPENCT_LT_CURRENT = @OPENCT_LT_CURRENT@ OPENCT_LT_OLDEST = @OPENCT_LT_OLDEST@ OPENCT_LT_REVISION = @OPENCT_LT_REVISION@ OPENCT_SOCKET_PATH = @OPENCT_SOCKET_PATH@ OPENCT_VERSION_FIX = @OPENCT_VERSION_FIX@ OPENCT_VERSION_MAJOR = @OPENCT_VERSION_MAJOR@ OPENCT_VERSION_MINOR = @OPENCT_VERSION_MINOR@ OPTIONAL_LIBUSB_CFLAGS = @OPTIONAL_LIBUSB_CFLAGS@ OPTIONAL_LIBUSB_LIBS = @OPTIONAL_LIBUSB_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCSC_CFLAGS = @PCSC_CFLAGS@ PCSC_LIBS = @PCSC_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVN = @SVN@ TR = @TR@ VERSION = @VERSION@ WGET = @WGET@ WGET_OPTS = @WGET_OPTS@ XSLTPROC = @XSLTPROC@ 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_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ apidocdir = @apidocdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ bundledir = @bundledir@ daemon_groups = @daemon_groups@ daemon_user = @daemon_user@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ ifddir = @ifddir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ openctincludedir = @openctincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ 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@ udevdir = @udevdir@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in @ENABLE_DOC_TRUE@SUBDIRS = nonpersistent DIST_SUBDIRS = nonpersistent dist_doc_DATA = README dist_noinst_DATA = $(srcdir)/doxygen-footer.html $(srcdir)/*.gif \ $(am__append_1) @ENABLE_API_DOC_TRUE@dist_apidoc_DATA = api.out/html/* all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/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): doxygen.conf: $(top_builddir)/config.status $(srcdir)/doxygen.conf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_apidocDATA: $(dist_apidoc_DATA) @$(NORMAL_INSTALL) test -z "$(apidocdir)" || $(MKDIR_P) "$(DESTDIR)$(apidocdir)" @list='$(dist_apidoc_DATA)'; test -n "$(apidocdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(apidocdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(apidocdir)" || exit $$?; \ done uninstall-dist_apidocDATA: @$(NORMAL_UNINSTALL) @list='$(dist_apidoc_DATA)'; test -n "$(apidocdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(apidocdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(apidocdir)" && rm -f $$files install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(docdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(apidocdir)" "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_apidocDATA install-dist_docDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_apidocDATA uninstall-dist_docDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-local ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_apidocDATA install-dist_docDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-dist_apidocDATA \ uninstall-dist_docDATA @SVN_CHECKOUT_TRUE@api.out/html/*: api.out @SVN_CHECKOUT_TRUE@api.out: $(top_srcdir)/src/include/openct/*.h \ @SVN_CHECKOUT_TRUE@ $(srcdir)/*.gif \ @SVN_CHECKOUT_TRUE@ doxygen.conf @SVN_CHECKOUT_TRUE@ -rm -fr api.out @SVN_CHECKOUT_TRUE@ $(DOXYGEN) doxygen.conf @SVN_CHECKOUT_TRUE@ cp "$(srcdir)"/*.gif api.out/html @SVN_CHECKOUT_FALSE@api.out/html/*: $(abs_builddir)/api.out @SVN_CHECKOUT_FALSE@$(abs_builddir)/api.out: @SVN_CHECKOUT_FALSE@ $(LN_S) "$(srcdir)/api.out" api.out clean-local: @SVN_CHECKOUT_TRUE@ -rm -fr api.out @SVN_CHECKOUT_FALSE@ -rm -f api.out # 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: openct-0.6.20/doc/api.out/0000777000175000017500000000000011336457577012242 500000000000000openct-0.6.20/doc/api.out/html/0000777000175000017500000000000011336457577013206 500000000000000openct-0.6.20/doc/api.out/html/tab_r.gif0000644000175000017500000000503111336457575014675 00000000000000GIF89a,薴ŝɯͻ,,@pH,Ȥrl:ШtJZجv h d@L"F:򑐌$9 (8&Nz (GFB^!˨)WVl)1 w̥.wY0Ib|Hpf:e pJ}Ȧ6nz 80%"8v~ @JЂMBІ:D'ZPKF ּ&16юz HGJRb L5Җ0LgJӚ#(e>Ӟ@ PJԢHMRԦ:PTJժ&5;%Uծz` XJVCjYֶp\Uxͫ^׾i)$Mb:v, ಘͬf7z hGKҚMjWֺ*$SPͭnwm +Mr:E?9Zͮv9" xKbLz^A|ͯ0/LN(; n0'LaJ0{/{ؘG|(SCr. v1wc6@LdHNd/PLeOXp|+s2L_153M5t3_:wsgʹπp?/FFЎt!-JҖ1NӞuA-Pԝ>53UWծ4cYZѶsA׀5,aƶ3=e3~-3Sc6mo2Mq>7ӭn$D~7,y1m}v\/N3#S\gu-mO0C\'_S^|.c.0ל49~s=3d:u)?F;ˮW|;W)vt˽w|=xA;openct-0.6.20/doc/api.out/html/server_8h_source.html0000644000175000017500000000662411336457575017303 00000000000000 OpenCT: server.h Source File

    server.h

    00001 /*
    00002  * Server side functionality
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_SERVER_H
    00008 #define OPENCT_SERVER_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #include <sys/poll.h>
    00015 
    00016 extern void     ct_mainloop_add_socket(ct_socket_t *);
    00017 extern void     ct_mainloop(void);
    00018 extern void     ct_mainloop_leave(void);
    00019 
    00020 #ifdef __cplusplus
    00021 }
    00022 #endif
    00023 
    00024 #endif /* OPENCT_SERVER_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structifd__driver.html0000644000175000017500000000467211336457575017540 00000000000000 OpenCT: ifd_driver Struct Reference

    ifd_driver Struct Reference

    Data Fields

    const char * name
    struct ifd_driver_opsops

    Detailed Description

    Definition at line 39 of file ifd.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/tlv_8h_source.html0000644000175000017500000002163711336457575016603 00000000000000 OpenCT: tlv.h Source File

    tlv.h

    00001 /*
    00002  * Handle TLV encoded data
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_TLV_H
    00008 #define OPENCT_TLV_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #include <openct/protocol.h>
    00015 #include <openct/buffer.h>
    00016 
    00017 typedef unsigned char   ifd_tag_t;
    00018 
    00019 typedef struct ct_tlv_parser {
    00020         unsigned char   use_large_tags;
    00021         unsigned char * val[256];
    00022         unsigned int    len[256];
    00023 } ct_tlv_parser_t;
    00024 
    00025 typedef struct ct_tlv_builder {
    00026         int             error;
    00027         unsigned char   use_large_tags;
    00028         ct_buf_t *      buf;
    00029         unsigned int    len;
    00030         unsigned char * lenp;
    00031 } ct_tlv_builder_t;
    00032 
    00033 extern int      ct_tlv_parse(ct_tlv_parser_t *, ct_buf_t *);
    00034 /* ct_tlv_get return 0 == not there, 1 == there */
    00035 extern int      ct_tlv_get_int(ct_tlv_parser_t *,
    00036                                 ifd_tag_t, unsigned int *);
    00037 extern int      ct_tlv_get_string(ct_tlv_parser_t *,
    00038                                 ifd_tag_t, char *, size_t);
    00039 extern int      ct_tlv_get_opaque(ct_tlv_parser_t *,
    00040                                 ifd_tag_t, unsigned char **, size_t *);
    00041 /* or number of bytes */
    00042 extern int      ct_tlv_get_bytes(ct_tlv_parser_t *,
    00043                                 ifd_tag_t, void *, size_t);
    00044 
    00045 extern void     ct_tlv_builder_init(ct_tlv_builder_t *, ct_buf_t *, int);
    00046 extern void     ct_tlv_put_int(ct_tlv_builder_t *,
    00047                                 ifd_tag_t, unsigned int);
    00048 extern void     ct_tlv_put_string(ct_tlv_builder_t *,
    00049                                 ifd_tag_t, const char *);
    00050 extern void     ct_tlv_put_opaque(ct_tlv_builder_t *, ifd_tag_t,
    00051                                 const unsigned char *, size_t);
    00052 extern void     ct_tlv_put_tag(ct_tlv_builder_t *, ifd_tag_t);
    00053 extern void     ct_tlv_add_byte(ct_tlv_builder_t *, unsigned char);
    00054 extern void     ct_tlv_add_bytes(ct_tlv_builder_t *,
    00055                                 const unsigned char *, size_t);
    00056 
    00057 #ifdef __cplusplus
    00058 }
    00059 #endif
    00060 
    00061 #endif /* OPENCT_TLV_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/opensc-logo.gif0000644000175000017500000001106711336457575016041 00000000000000GIF89a2XKJL (+4cba $j̱5 14fr!ȩQȴQ˔{z{3賀uZ'4ɴ#zx$f$ӵ77btF cֵ naHR1Dpm+a  CsJ ZoDON"ǭ<@( Љ@!?, j AqŖ ,1\"d8mlE):Pc ]@GCpC] i!1`@8K\r@xhVB!ad8+㎳yCP05L矟nyӄY$yhD6`s r|:B T(|F{9K:5DW>Bw+qol5 ,t?(a^ } Q}Vmf \8:D¼!B0>@ڃ,H؂1$vb=? S@I& r\ے^iC>ew9h1K SC$'j@m@e7 |P{\uJ,  3)9x@kpi4! T 9!SwTxM~6hP&,{lZ, 2T5i ]@ψ08L&Z(9*Jf}bkkR > tc YS-^{JT@{:B#@w@-F!:(lʤ{@*hRpo1 ,:2YyF <[ C._k -0؆/;o@@@хbUmr%@ZFXh0,[L)Y1$jPq|M 䍁`ي+m #1+vSk7>r("+g=|yW tpAh='>*IG - 8dA(Bun.If@)7f1 >ax#|*L Ĉid"y P@tQ15ӅfTꕿ՚! $Z14=eu:@&>Jxķ.;3OYO O4D^A8yv$\ uŤ)M0+6Fp Dqh5@A}f VЬG &n P?p^j9C>5@ȼ1V_6rusj r & OHz0Xb0huMV+ /xk0J}NyA X#YKd^B  @s?rѤPa >9c}u]{W|~|]p8r Mx xחsGFYogofY4T YG.k~Uwk ) />ZAA[Q$l 2$2+  s6|G^#3w|۰ PBDp BPdSi}'jއDjUyL%Ё2~5iӳKat:O Ar`:575ME*4(>h0  ~Cw1cŗ(-R)" @V[4dtJ%R3)H@@ U5h2A 2 jC6 Wt0 Bb{} ۠0dQ Z  _@0 ezY0U PrZ YpTpꇋD4?`#˰4>76l !b:#nP0g0m0 p f0o a/< wp~4yySJH2vH%*)0 ԀJAIzv+W@ 2ʁY9pŦ w:Peh+ B?)P1x4S|| F1ay7U`UAV0jZG0  R3@%`*v Fn/ )ޢrp P#&L$-HaЂGG$J'^#| pyfZ@_ki_Dp( PYR$8~f(uy'( Jya۷\7^񁁥hCA| IPpm 빟뷰qL"Ycƺ;&# ̀]{⸽,KP 8W ©[u8 k(;openct-0.6.20/doc/api.out/html/apdu_8h_source.html0000644000175000017500000001302211336457575016714 00000000000000 OpenCT: apdu.h Source File

    apdu.h

    00001 /*
    00002  * APDU type definitions
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_APDU_H
    00008 #define OPENCT_APDU_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 typedef struct ifd_iso_apdu {
    00015         unsigned char           cse, cla, ins, p1, p2;
    00016         unsigned int            lc, le;
    00017         unsigned int            sw;
    00018         void *                  data;
    00019         size_t                  len;
    00020 
    00021         /* xxx go away */
    00022         unsigned char *         rcv_buf;
    00023         unsigned int            rcv_len;
    00024 } ifd_iso_apdu_t;
    00025 
    00026 enum {
    00027         IFD_APDU_CASE_1  = 0x00,
    00028         IFD_APDU_CASE_2S = 0x01,
    00029         IFD_APDU_CASE_3S = 0x02,
    00030         IFD_APDU_CASE_4S = 0x03,
    00031         IFD_APDU_CASE_2E = 0x10,
    00032         IFD_APDU_CASE_3E = 0x20,
    00033         IFD_APDU_CASE_4E = 0x30,
    00034 
    00035         IFD_APDU_BAD = -1
    00036 };
    00037 
    00038 #define IFD_APDU_CASE_LC(c)     ((c) & 0x02)
    00039 #define IFD_APDU_CASE_LE(c)     ((c) & 0x01)
    00040 
    00041 extern int      ifd_iso_apdu_parse(const void *, size_t, ifd_iso_apdu_t *);
    00042 extern int      ifd_apdu_case(const void *, size_t);
    00043 
    00044 #ifdef __cplusplus
    00045 }
    00046 #endif
    00047 
    00048 #endif /* OPENCT_APDU_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/ifd_8h_source.html0000644000175000017500000006111011336457575016526 00000000000000 OpenCT: ifd.h Source File

    ifd.h

    00001 /*
    00002  * Core functions of the IFD handler library
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_IFD_H
    00008 #define OPENCT_IFD_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #include <sys/types.h>
    00015 #include <openct/openct.h>
    00016 #include <openct/apdu.h>
    00017 
    00018 typedef struct ifd_device       ifd_device_t;
    00019 typedef union ifd_device_params ifd_device_params_t;
    00020 
    00021 enum {
    00022         IFD_PROTOCOL_DEFAULT = -1,
    00023         IFD_PROTOCOL_T0 = 0,
    00024         IFD_PROTOCOL_T1,
    00025         IFD_PROTOCOL_2WIRE = 16,
    00026         IFD_PROTOCOL_3WIRE,
    00027         IFD_PROTOCOL_I2C_SHORT,
    00028         IFD_PROTOCOL_I2C_LONG,
    00029         IFD_PROTOCOL_TLP,               /* older Gemplus protocol */
    00030         IFD_PROTOCOL_GBP,               /* Gemplus block protocol */
    00031         IFD_PROTOCOL_EUROCHIP,          /* Eurochip Countercard */
    00032         IFD_PROTOCOL_TCL,               /* ISO 14443-4 T=CL */
    00033         IFD_PROTOCOL_ESCAPE,            /* Virtual 'escape' protocol */
    00034         IFD_PROTOCOL_TRANSPARENT = 128
    00035 };
    00036 
    00037 typedef struct ifd_protocol     ifd_protocol_t;
    00038 
    00039 typedef struct ifd_driver {
    00040         const char *            name;
    00041         struct ifd_driver_ops * ops;
    00042 } ifd_driver_t;
    00043 
    00044 #define IFD_MAX_ATR_LEN         64
    00045 typedef struct ifd_slot {
    00046         unsigned int            handle;
    00047 
    00048         int                     status;
    00049         time_t                  next_update;
    00050 
    00051         unsigned char           dad;    /* address when using T=1 */
    00052         unsigned int            atr_len;
    00053         unsigned char           atr[IFD_MAX_ATR_LEN];
    00054 
    00055         ifd_protocol_t *        proto;
    00056         void *                  reader_data;
    00057 } ifd_slot_t;
    00058 
    00059 typedef struct ifd_reader {
    00060         unsigned int            num;
    00061         unsigned int            handle;
    00062 
    00063         const char *            name;
    00064         unsigned int            flags;
    00065         unsigned int            nslots;
    00066         ifd_slot_t              slot[OPENCT_MAX_SLOTS];
    00067 
    00068         const ifd_driver_t *    driver;
    00069         ifd_device_t *          device;
    00070         ct_info_t *             status;
    00071 
    00072         /* In case the IFD needs to keep state */
    00073         void *                  driver_data;
    00074 } ifd_reader_t;
    00075 
    00076 #define IFD_READER_ACTIVE       0x0001
    00077 #define IFD_READER_HOTPLUG      0x0002
    00078 #define IFD_READER_DISPLAY      0x0100
    00079 #define IFD_READER_KEYPAD       0x0200
    00080 
    00081 enum {
    00082         IFD_PROTOCOL_RECV_TIMEOUT = 0x0000,
    00083         IFD_PROTOCOL_BLOCK_ORIENTED,
    00084 
    00085         /* T=0 specific parameters */
    00086         __IFD_PROTOCOL_T0_PARAM_BASE = IFD_PROTOCOL_T0 << 16,
    00087 
    00088         /* T=1 specific parameters */
    00089         __IFD_PROTOCOL_T1_PARAM_BASE = IFD_PROTOCOL_T1 << 16,
    00090         IFD_PROTOCOL_T1_BLOCKSIZE,
    00091         IFD_PROTOCOL_T1_CHECKSUM_CRC,
    00092         IFD_PROTOCOL_T1_CHECKSUM_LRC,
    00093         IFD_PROTOCOL_T1_IFSC,
    00094         IFD_PROTOCOL_T1_IFSD,
    00095         IFD_PROTOCOL_T1_STATE,
    00096         IFD_PROTOCOL_T1_MORE
    00097 };
    00098 
    00099 enum {
    00100         IFD_DAD_HOST = 0,
    00101         IFD_DAD_IFD,
    00102         IFD_DAD_ICC1,
    00103         IFD_DAD_ICC2
    00104 };
    00105 
    00106 
    00107 extern int                      ifd_init(void);
    00108 
    00109 extern ifd_reader_t *           ifd_open(const char *driver_name,
    00110                                         const char *device_name);
    00111 extern void                     ifd_close(ifd_reader_t *);
    00112 extern int                      ifd_reader_count(void);
    00113 extern int                      ifd_attach(ifd_reader_t *);
    00114 extern void                     ifd_detach(ifd_reader_t *);
    00115 extern ifd_reader_t *           ifd_reader_by_handle(unsigned int handle);
    00116 extern ifd_reader_t *           ifd_reader_by_index(unsigned int index);
    00117 
    00118 extern int                      ifd_spawn_handler(const char *, const char *, int);
    00119 extern int                      ifd_scan_usb(void);
    00120 
    00121 extern int                      ifd_activate(ifd_reader_t *);
    00122 extern int                      ifd_deactivate(ifd_reader_t *);
    00123 extern int                      ifd_output(ifd_reader_t *, const char *);
    00124 
    00125 extern int                      ifd_atr_complete(const unsigned char *, size_t);
    00126 
    00127 extern int                      ifd_set_protocol(ifd_reader_t *reader,
    00128                                         unsigned int slot,
    00129                                         int id);
    00130 extern int                      ifd_card_command(ifd_reader_t *reader,
    00131                                         unsigned int slot,
    00132                                         const void *sbuf, size_t slen,
    00133                                         void *rbuf, size_t rlen);
    00134 extern int                      ifd_card_status(ifd_reader_t *reader,
    00135                                         unsigned int slot,
    00136                                         int *status);
    00137 extern int                      ifd_card_reset(ifd_reader_t *reader,
    00138                                         unsigned int slot,
    00139                                         void *atr_buf,
    00140                                         size_t atr_len);
    00141 extern int                      ifd_card_request(ifd_reader_t *reader,
    00142                                         unsigned int slot,
    00143                                         time_t timeout,
    00144                                         const char *message,
    00145                                         void *atr_buf,
    00146                                         size_t atr_len);
    00147 extern int                      ifd_card_eject(ifd_reader_t *reader,
    00148                                         unsigned int slot,
    00149                                         time_t timeout,
    00150                                         const char *message);
    00151 extern int                      ifd_card_perform_verify(ifd_reader_t *reader,
    00152                                         unsigned int slot,
    00153                                         time_t timeout,
    00154                                         const char *message,
    00155                                         const unsigned char *data, size_t data_len,
    00156                                         unsigned char *resp, size_t resp_len);
    00157 extern int                      ifd_card_read_memory(ifd_reader_t *,
    00158                                         unsigned int, unsigned short,
    00159                                         unsigned char *, size_t);
    00160 extern int                      ifd_card_write_memory(ifd_reader_t *,
    00161                                         unsigned int, unsigned short,
    00162                                         const unsigned char *, size_t);
    00163 
    00164 extern ifd_protocol_t *         ifd_protocol_new(int id,
    00165                                         ifd_reader_t *reader,
    00166                                         unsigned int dad);
    00167 extern int                      ifd_protocol_set_parameter(ifd_protocol_t *p,
    00168                                         int type,
    00169                                         long value);
    00170 extern int                      ifd_protocol_get_parameter(ifd_protocol_t *p,
    00171                                         int type,
    00172                                         long *value);
    00173 extern int                      ifd_protocol_read_memory(ifd_protocol_t *,
    00174                                         int, unsigned short,
    00175                                         unsigned char *, size_t);
    00176 extern int                      ifd_protocol_write_memory(ifd_protocol_t *,
    00177                                         int, unsigned short,
    00178                                         const unsigned char *, size_t);
    00179 extern void                     ifd_protocol_free(ifd_protocol_t *);
    00180 extern int                      ifd_before_command(ifd_reader_t *);
    00181 extern int                      ifd_after_command(ifd_reader_t *);
    00182 extern int                      ifd_get_eventfd(ifd_reader_t *, short *);
    00183 extern void                     ifd_poll(ifd_reader_t *);
    00184 extern int                      id_event(ifd_reader_t *);
    00185 
    00186 /* Debugging macro */
    00187 #ifdef __GNUC__
    00188 #define ifd_debug(level, fmt, args...) \
    00189         do { \
    00190                 if ((level) <= ct_config.debug) \
    00191                         ct_debug("%s: " fmt, __FUNCTION__ , ##args); \
    00192         } while (0)
    00193 #else
    00194 extern void                     ifd_debug(int level, const char *fmt, ...);
    00195 #endif
    00196 
    00197 #ifdef __cplusplus
    00198 }
    00199 #endif
    00200 
    00201 #endif /* OPENCT_IFD_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/index.html0000644000175000017500000000216211336457575015116 00000000000000 OpenCT: Main Page

    OpenCT Documentation

    0.6.20


    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/annotated.html0000644000175000017500000000635211336457575015771 00000000000000 OpenCT: Data Structures
    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/functions_vars.html0000644000175000017500000001045511336457575017056 00000000000000 OpenCT: Data Fields - Variables
     

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/doxygen.css0000644000175000017500000001473311336457575015317 00000000000000/* The standard CSS for doxygen */ body, table, div, p, dl { font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; font-size: 12px; } /* @group Heading Levels */ h1 { text-align: center; font-size: 150%; } h2 { font-size: 120%; } h3 { font-size: 100%; } dt { font-weight: bold; } div.multicol { -moz-column-gap: 1em; -webkit-column-gap: 1em; -moz-column-count: 3; -webkit-column-count: 3; } p.startli, p.startdd { margin-top: 2px; } p.endli { margin-bottom: 0px; } p.enddd { margin-bottom: 4px; } /* @end */ caption { font-weight: bold; } span.legend { font-size: 70%; text-align: center; } div.qindex, div.navtab{ background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; } div.qindex, div.navpath { width: 100%; line-height: 140%; } div.navtab { margin-right: 15px; } /* @group Link Styling */ a { color: #153788; font-weight: normal; text-decoration: none; } .contents a:visited { color: #1b77c5; } a:hover { text-decoration: underline; } a.qindex { font-weight: bold; } a.qindexHL { font-weight: bold; background-color: #6666cc; color: #ffffff; border: 1px double #9295C2; } .contents a.qindexHL:visited { color: #ffffff; } a.el { font-weight: bold; } a.elRef { } a.code { } a.codeRef { } /* @end */ dl.el { margin-left: -1cm; } .fragment { font-family: monospace, fixed; font-size: 105%; } pre.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; padding: 4px 6px; margin: 4px 8px 4px 2px; } div.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } div.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } div.groupText { margin-left: 16px; font-style: italic; } body { background: white; color: black; margin-right: 20px; margin-left: 20px; } td.indexkey { background-color: #e8eef2; font-weight: bold; border: 1px solid #CCCCCC; margin: 2px 0px 2px 0; padding: 2px 10px; } td.indexvalue { background-color: #e8eef2; border: 1px solid #CCCCCC; padding: 2px 10px; margin: 2px 0px; } tr.memlist { background-color: #f0f0f0; } p.formulaDsp { text-align: center; } img.formulaDsp { } img.formulaInl { vertical-align: middle; } div.center { text-align: center; margin-top: 0px; margin-bottom: 0px; padding: 0px; } div.center img { border: 0px; } img.footer { border: 0px; vertical-align: middle; } /* @group Code Colorization */ span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } span.vhdldigit { color: #ff00ff } span.vhdlchar { color: #000000 } span.vhdlkeyword { color: #700070 } span.vhdllogic { color: #ff0000 } /* @end */ .search { color: #003399; font-weight: bold; } form.search { margin-bottom: 0px; margin-top: 0px; } input.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } td.tiny { font-size: 75%; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #84b0c7; } th.dirtab { background: #e8eef2; font-weight: bold; } hr { height: 0; border: none; border-top: 1px solid #666; } /* @group Member Descriptions */ .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { background-color: #FAFAFA; border: none; margin: 4px; padding: 1px 0 0 8px; } .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; color: #555; } .memItemLeft, .memItemRight, .memTemplParams { border-top: 1px solid #ccc; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } .memTemplParams { color: #606060; white-space: nowrap; } /* @end */ /* @group Member Details */ /* Styles for detailed member documentation */ .memtemplate { font-size: 80%; color: #606060; font-weight: normal; margin-left: 3px; } .memnav { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .memitem { padding: 0; margin-bottom: 10px; } .memname { white-space: nowrap; font-weight: bold; } .memproto, .memdoc { border: 1px solid #84b0c7; } .memproto { padding: 0; background-color: #d5e1e8; font-weight: bold; -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; } .memdoc { padding: 2px 5px; background-color: #eef3f5; border-top-width: 0; -webkit-border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 8px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -moz-border-radius-bottomleft: 8px; -moz-border-radius-bottomright: 8px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; white-space: nowrap; } .paramname em { font-style: normal; } /* @end */ /* @group Directory (tree) */ /* for the tree view */ .ftvtree { font-family: sans-serif; margin: 0.5em; } /* these are for tree view when used as main index */ .directory { font-size: 9pt; font-weight: bold; } .directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } /* The following two styles can be used to replace the root node title with an image of your choice. Simply uncomment the next two styles, specify the name of your image and be sure to set 'height' to the proper pixel height of your image. */ /* .directory h3.swap { height: 61px; background-repeat: no-repeat; background-image: url("yourimage.gif"); } .directory h3.swap span { display: none; } */ .directory > h3 { margin-top: 0; } .directory p { margin: 0px; white-space: nowrap; } .directory div { display: none; margin: 0px; } .directory img { vertical-align: -30%; } /* these are for tree view when not used as main index */ .directory-alt { font-size: 100%; font-weight: bold; } .directory-alt h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } .directory-alt > h3 { margin-top: 0; } .directory-alt p { margin: 0px; white-space: nowrap; } .directory-alt div { display: none; margin: 0px; } .directory-alt img { vertical-align: -30%; } /* @end */ address { font-style: normal; color: #333; } openct-0.6.20/doc/api.out/html/protocol_8h_source.html0000644000175000017500000002146411336457575017635 00000000000000 OpenCT: protocol.h Source File

    protocol.h

    00001 /*
    00002  * Protocol for communication between application and
    00003  * resource manager
    00004  *
    00005  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00006  */
    00007 
    00008 #ifndef OPENCT_PROTOCOL_H
    00009 #define OPENCT_PROTOCOL_H
    00010 
    00011 #ifdef __cplusplus
    00012 extern "C" {
    00013 #endif
    00014 
    00015 /*
    00016  * A protocol message from client to server
    00017  * consists of
    00018  *  -   command byte
    00019  *  -   unit byte
    00020  *  -   optional data, TLV encoded
    00021  */
    00022 
    00023 #define CT_CMD_STATUS           0x00
    00024 #define CT_CMD_LOCK             0x01    /* prevent concurrent access */
    00025 #define CT_CMD_UNLOCK           0x02
    00026 #define CT_CMD_RESET            0x10
    00027 #define CT_CMD_REQUEST_ICC      0x11
    00028 #define CT_CMD_EJECT_ICC        0x12
    00029 #define CT_CMD_OUTPUT           0x13
    00030 #define CT_CMD_PERFORM_VERIFY   0x14
    00031 #define CT_CMD_CHANGE_PIN       0x15
    00032 #define CT_CMD_MEMORY_READ      0x16
    00033 #define CT_CMD_MEMORY_WRITE     0x17
    00034 #define CT_CMD_INPUT            0x18
    00035 #define CT_CMD_TRANSACT_OLD     0x20    /* transceive APDU */
    00036 #define CT_CMD_TRANSACT         0x21    /* transceive APDU */
    00037 #define CT_CMD_SET_PROTOCOL     0x22
    00038 
    00039 #define CT_UNIT_ICC1            0x00
    00040 #define CT_UNIT_ICC2            0x01
    00041 #define CT_UNIT_ICC3            0x02
    00042 #define CT_UNIT_ICC4            0x03
    00043 #define CT_UNIT_READER          0x10
    00044 #define CT_UNIT_DISPLAY         0x11
    00045 #define CT_UNIT_KEYPAD          0x12
    00046 
    00047 /*
    00048  * TLV items.
    00049  */
    00050 #define CT_TAG_READER_NAME      0x00    /* ASCII string */
    00051 #define CT_TAG_READER_UNITS     0x01    /* list CT_UNIT_* bytes */
    00052 #define CT_TAG_CARD_STATUS      0x02    /* IFD_CARD_* byte */
    00053 #define CT_TAG_ATR              0x03    /* Answer to reset */
    00054 #define CT_TAG_LOCK             0x04
    00055 #define CT_TAG_CARD_RESPONSE    0x05    /* Card response to VERIFY etc */
    00056 #define CT_TAG_TIMEOUT          0x80
    00057 #define CT_TAG_MESSAGE          0x81
    00058 #define CT_TAG_LOCKTYPE         0x82
    00059 #define CT_TAG_PIN_DATA         0x83    /* CTBCS verify APDU */
    00060 #define CT_TAG_CARD_REQUEST     0x84
    00061 #define CT_TAG_ADDRESS          0x85
    00062 #define CT_TAG_DATA             0x86
    00063 #define CT_TAG_COUNT            0x87
    00064 #define CT_TAG_PROTOCOL         0x88
    00065 
    00066 #define __CT_TAG_LARGE          0x40
    00067 
    00068 #ifdef __cplusplus
    00069 }
    00070 #endif
    00071 
    00072 #endif /* OPENCT_PROTOCOL_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structifd__iso__apdu.html0000644000175000017500000001240711336457575020202 00000000000000 OpenCT: ifd_iso_apdu Struct Reference

    ifd_iso_apdu Struct Reference

    Data Fields

    unsigned char cse
    unsigned char cla
    unsigned char ins
    unsigned char p1
    unsigned char p2
    unsigned int lc
    unsigned int le
    unsigned int sw
    void * data
    size_t len
    unsigned char * rcv_buf
    unsigned int rcv_len

    Detailed Description

    Definition at line 14 of file apdu.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/buffer_8h_source.html0000644000175000017500000001675711336457575017256 00000000000000 OpenCT: buffer.h Source File

    buffer.h

    00001 /*
    00002  * Buffer handling functions of the IFD handler library
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_BUFFER_H
    00008 #define OPENCT_BUFFER_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #include <sys/types.h>
    00015 
    00016 typedef struct ct_buf {
    00017         unsigned char *         base;
    00018         unsigned int            head, tail, size;
    00019         unsigned int            overrun;
    00020 } ct_buf_t;
    00021 
    00022 extern void             ct_buf_init(ct_buf_t *, void *, size_t);
    00023 extern void             ct_buf_set(ct_buf_t *, void *, size_t);
    00024 extern void             ct_buf_clear(ct_buf_t *);
    00025 extern int              ct_buf_get(ct_buf_t *, void *, size_t);
    00026 extern int              ct_buf_gets(ct_buf_t *, char *, size_t);
    00027 extern int              ct_buf_put(ct_buf_t *, const void *, size_t);
    00028 extern int              ct_buf_putc(ct_buf_t *, int);
    00029 extern int              ct_buf_puts(ct_buf_t *, const char *);
    00030 extern int              ct_buf_push(ct_buf_t *, const void *, size_t);
    00031 extern unsigned int     ct_buf_avail(ct_buf_t *);
    00032 extern unsigned int     ct_buf_tailroom(ct_buf_t *);
    00033 extern unsigned int     ct_buf_size(ct_buf_t *);
    00034 extern void *           ct_buf_head(ct_buf_t *);
    00035 extern void *           ct_buf_tail(ct_buf_t *);
    00036 extern int              ct_buf_read(ct_buf_t *, int);
    00037 extern void             ct_buf_compact(ct_buf_t *);
    00038 extern int              ct_buf_overrun(ct_buf_t *);
    00039 
    00040 #ifdef __cplusplus
    00041 }
    00042 #endif
    00043 
    00044 #endif /* OPENCT_BUFFER_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structifd__conf__node.html0000644000175000017500000000613411336457575020331 00000000000000 OpenCT: ifd_conf_node Struct Reference

    ifd_conf_node Struct Reference

    Data Fields

    struct ifd_conf_nodenext
    struct ifd_conf_nodechildren
    char * name
    char * value

    Detailed Description

    Definition at line 26 of file conf.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structifd__reader.html0000644000175000017500000001157711336457575017511 00000000000000 OpenCT: ifd_reader Struct Reference

    ifd_reader Struct Reference

    Data Fields

    unsigned int num
    unsigned int handle
    const char * name
    unsigned int flags
    unsigned int nslots
    ifd_slot_t slot [OPENCT_MAX_SLOTS]
    const ifd_driver_tdriver
    ifd_device_t * device
    ct_info_tstatus
    void * driver_data

    Detailed Description

    Definition at line 59 of file ifd.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structct__info.html0000644000175000017500000000712311336457575017036 00000000000000 OpenCT: ct_info Struct Reference

    ct_info Struct Reference

    Data Fields

    char ct_name [64]
    unsigned int ct_slots
    unsigned int ct_card [OPENCT_MAX_SLOTS]
    unsigned ct_display: 1
    unsigned ct_keypad: 1
    pid_t ct_pid

    Detailed Description

    Definition at line 20 of file openct.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structct__buf.html0000644000175000017500000000634611336457575016665 00000000000000 OpenCT: ct_buf Struct Reference

    ct_buf Struct Reference

    Data Fields

    unsigned char * base
    unsigned int head
    unsigned int tail
    unsigned int size
    unsigned int overrun

    Detailed Description

    Definition at line 16 of file buffer.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/device_8h_source.html0000644000175000017500000003636111336457575017235 00000000000000 OpenCT: device.h Source File

    device.h

    00001 /*
    00002  * Device functions of the IFD handler library
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_DEVICE_H
    00008 #define OPENCT_DEVICE_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #include <openct/ifd.h>
    00015 
    00016 struct pollfd; /* for poll_presence */
    00017 
    00018 /* Types of devices supported by libifd */
    00019 enum {
    00020         IFD_DEVICE_TYPE_SERIAL = 0,
    00021         IFD_DEVICE_TYPE_USB,
    00022         IFD_DEVICE_TYPE_PS2,
    00023         IFD_DEVICE_TYPE_PCMCIA,
    00024         IFD_DEVICE_TYPE_PCMCIA_BLOCK,
    00025         IFD_DEVICE_TYPE_OTHER
    00026 };
    00027 
    00028 union ifd_device_params {
    00029         struct {
    00030                 unsigned int    speed;
    00031                 int             bits;
    00032                 int             stopbits;
    00033                 int             parity;
    00034                 int             check_parity;
    00035                 unsigned int    rts : 1,
    00036                                 dtr : 1;
    00037         } serial;
    00038         struct {
    00039                 int configuration;
    00040                 int interface;
    00041                 int altsetting;
    00042                 int ep_o;
    00043                 int ep_i;
    00044                 int ep_intr;
    00045         } usb;
    00046 };
    00047 
    00048 enum {
    00049         IFD_SERIAL_PARITY_NONE = 0,
    00050         IFD_SERIAL_PARITY_ODD  = 1,
    00051         IFD_SERIAL_PARITY_EVEN = 2
    00052 };
    00053 #define IFD_SERIAL_PARITY_TOGGLE(n)     ((n)? ((n) ^ 3) : 0)
    00054 
    00055 #define IFD_MAX_DEVID_PARTS     5
    00056 typedef struct ifd_devid {
    00057         int             type;
    00058         unsigned int    num;
    00059         unsigned int    val[IFD_MAX_DEVID_PARTS];
    00060 } ifd_devid_t;
    00061 
    00062 /*
    00063  * Control messages to be sent through
    00064  * ifd_device_control must always have a guard word
    00065  * that contains the device type.
    00066  */
    00067 enum {
    00068         IFD_USB_URB_TYPE_ISO = 0,
    00069         IFD_USB_URB_TYPE_INTERRUPT = 1,
    00070         IFD_USB_URB_TYPE_CONTROL = 2,
    00071         IFD_USB_URB_TYPE_BULK = 3
    00072 };
    00073 typedef struct ifd_usb_capture ifd_usb_capture_t;
    00074 
    00075 extern ifd_device_t *   ifd_device_open(const char *);
    00076 extern void             ifd_device_close(ifd_device_t *);
    00077 extern int              ifd_device_type(ifd_device_t *);
    00078 extern int              ifd_device_reset(ifd_device_t *);
    00079 extern void             ifd_device_flush(ifd_device_t *);
    00080 extern void             ifd_device_send_break(ifd_device_t *, unsigned int);
    00081 extern int              ifd_device_identify(const char *, char *, size_t);
    00082 extern int              ifd_device_get_parameters(ifd_device_t *,
    00083                                 ifd_device_params_t *);
    00084 extern int              ifd_device_set_parameters(ifd_device_t *,
    00085                                 const ifd_device_params_t *);
    00086 extern int              ifd_device_transceive(ifd_device_t *,
    00087                                 const void *, size_t,
    00088                                 void *, size_t, long);
    00089 extern int              ifd_device_send(ifd_device_t *, const unsigned char *, size_t);
    00090 extern int              ifd_device_recv(ifd_device_t *, unsigned char *, size_t, long);
    00091 extern int              ifd_device_control(ifd_device_t *, void *, size_t);
    00092 extern void             ifd_device_set_hotplug(ifd_device_t *, int);
    00093 extern int              ifd_device_get_eventfd(ifd_device_t *, short *events);
    00094 extern int              ifd_device_poll_presence(ifd_device_t *,
    00095                                 struct pollfd *);
    00096 
    00097 extern int              ifd_device_id_parse(const char *, ifd_devid_t *);
    00098 extern int              ifd_device_id_match(const ifd_devid_t *,
    00099                                 const ifd_devid_t *);
    00100 
    00101 extern int              ifd_usb_control(ifd_device_t *,
    00102                                 unsigned int requesttype,
    00103                                 unsigned int request,
    00104                                 unsigned int value,
    00105                                 unsigned int index,
    00106                                 void *data, size_t len,
    00107                                 long timeout);
    00108 extern int              ifd_usb_begin_capture(ifd_device_t *,
    00109                                 int type, int endpoint,
    00110                                 size_t maxpacket,
    00111                                 ifd_usb_capture_t **);
    00112 extern int              ifd_usb_capture_event(ifd_device_t *,
    00113                                 ifd_usb_capture_t *,
    00114                                 void *buffer, size_t len);
    00115 extern int              ifd_usb_capture(ifd_device_t *,
    00116                                 ifd_usb_capture_t *,
    00117                                 void *buffer, size_t len,
    00118                                 long timeout);
    00119 extern int              ifd_usb_end_capture(ifd_device_t *,
    00120                                 ifd_usb_capture_t *);
    00121 
    00122 extern void             ifd_serial_send_break(ifd_device_t *, unsigned int usec);
    00123 extern int              ifd_serial_get_cts(ifd_device_t *);
    00124 extern int              ifd_serial_get_dsr(ifd_device_t *);
    00125 extern int              ifd_serial_get_dtr(ifd_device_t *);
    00126 
    00127 #ifdef __cplusplus
    00128 }
    00129 #endif
    00130 
    00131 #endif /* OPENCT_DEVICE_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/tab_l.gif0000644000175000017500000000130211336457575014664 00000000000000GIF89a ,薴ŝɯͻ, ,@P`H$!%CqVe2XJ(Ġ+3 2$ kv-u*"}|}|~q(" $f 'l(&&$r & !){rƲεҽͼиP?Bm A%V܈!k/Đ;^$Ɩ#Mf)f͇(WLK҄ I)L:eD Cx*4 Uh %A^NKbeXkx!2t !5t]$%X.i[]YfEkg`:zҞ;}jaaM׸c瞽vۺ8ȋ'?9積G_>yu_ߞ]zw߭Ǿm浏G~თ/>٫|W}v;openct-0.6.20/doc/api.out/html/tabs.css0000644000175000017500000000346411336457575014572 00000000000000/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ DIV.tabs { float : left; width : 100%; background : url("tab_b.gif") repeat-x bottom; margin-bottom : 4px; } DIV.tabs UL { margin : 0px; padding-left : 10px; list-style : none; } DIV.tabs LI, DIV.tabs FORM { display : inline; margin : 0px; padding : 0px; } DIV.tabs FORM { float : right; } DIV.tabs A { float : left; background : url("tab_r.gif") no-repeat right top; border-bottom : 1px solid #84B0C7; font-size : 80%; font-weight : bold; text-decoration : none; } DIV.tabs A:hover { background-position: 100% -150px; } DIV.tabs A:link, DIV.tabs A:visited, DIV.tabs A:active, DIV.tabs A:hover { color: #1A419D; } DIV.tabs SPAN { float : left; display : block; background : url("tab_l.gif") no-repeat left top; padding : 5px 9px; white-space : nowrap; } DIV.tabs #MSearchBox { float : right; display : inline; font-size : 1em; } DIV.tabs TD { font-size : 80%; font-weight : bold; text-decoration : none; } /* Commented Backslash Hack hides rule from IE5-Mac \*/ DIV.tabs SPAN {float : none;} /* End IE5-Mac hack */ DIV.tabs A:hover SPAN { background-position: 0% -150px; } DIV.tabs LI.current A { background-position: 100% -150px; border-width : 0px; } DIV.tabs LI.current SPAN { background-position: 0% -150px; padding-bottom : 6px; } DIV.navpath { background : none; border : none; border-bottom : 1px solid #84B0C7; text-align : center; margin : 2px; padding : 2px; } openct-0.6.20/doc/api.out/html/conf_8h_source.html0000644000175000017500000002115611336457575016717 00000000000000 OpenCT: conf.h Source File

    conf.h

    00001 /*
    00002  * Configuration stuff for IFD library
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_CONF_H
    00008 #define OPENCT_CONF_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 extern struct ct_config {
    00015         int                     debug;
    00016         int                     autoload;
    00017         int                     hotplug;
    00018         int                     suppress_errors;
    00019         const char *            ifdhandler;
    00020         const char *            modules_dir;
    00021         const char *            driver_modules_dir;
    00022         const char *            protocol_modules_dir;
    00023         const char *            socket_dir;
    00024 } ct_config;
    00025 
    00026 typedef struct ifd_conf_node {
    00027         struct ifd_conf_node *next;
    00028         struct ifd_conf_node *children;
    00029         char *          name;
    00030         char *          value;
    00031 } ifd_conf_node_t;
    00032 
    00033 extern int      ifd_config_parse(const char *);
    00034 extern int      ifd_conf_get_string(const char *, char **);
    00035 extern int      ifd_conf_get_integer(const char *, unsigned int *);
    00036 extern int      ifd_conf_get_bool(const char *, unsigned int *);
    00037 extern int      ifd_conf_get_string_list(const char *, char **, size_t);
    00038 extern int      ifd_conf_get_nodes(const char *, ifd_conf_node_t **, size_t);
    00039 extern int      ifd_conf_node_get_string(ifd_conf_node_t *,
    00040                                 const char *, char **);
    00041 extern int      ifd_conf_node_get_integer(ifd_conf_node_t *,
    00042                                 const char *, unsigned int *);
    00043 extern int      ifd_conf_node_get_bool(ifd_conf_node_t *,
    00044                                 const char *, unsigned int *);
    00045 extern int      ifd_conf_node_get_string_list(ifd_conf_node_t *,
    00046                                 const char *, char **, size_t);
    00047 extern int      ifd_conf_node_get_nodes(ifd_conf_node_t *,
    00048                                 const char *, ifd_conf_node_t **, size_t);
    00049 
    00050 #ifdef __cplusplus
    00051 }
    00052 #endif
    00053 
    00054 #endif /* OPENCT_CONF_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structifd__driver__ops.html0000644000175000017500000012006711336457575020555 00000000000000 OpenCT: ifd_driver_ops Struct Reference

    ifd_driver_ops Struct Reference

    Driver operations. More...

    #include <driver.h>

    Data Fields

    int default_protocol
    int(* open )(ifd_reader_t *reader, const char *name)
     Open the reader.
    int(* close )(ifd_reader_t *reader)
     Close the reader.
    int(* change_parity )(ifd_reader_t *reader, int parity)
     Change the communication protocol parity.
    int(* change_speed )(ifd_reader_t *reader, unsigned int speed)
     Change the communication protocol speed.
    int(* activate )(ifd_reader_t *reader)
     Activate the smart card reader.
    int(* deactivate )(ifd_reader_t *reader)
     Deactivate the smart card reader.
    int(* card_status )(ifd_reader_t *reader, int slot, int *status)
     Fetch the card status.
    int(* card_reset )(ifd_reader_t *reader, int slot, void *atr, size_t atr_len)
     Reset the card and fetch the ATR.
    int(* card_request )(ifd_reader_t *reader, int slot, time_t timeout, const char *message, void *atr, size_t atr_len)
     Prompts the insertion of a smart card in the reader and performs a card reset.
    int(* card_eject )(ifd_reader_t *reader, int slot, time_t timeout, const char *message)
     Eject the smart card.
    int(* output )(ifd_reader_t *reader, const char *message)
     Output a message on the reader's display.
    int(* perform_verify )(ifd_reader_t *reader, int slot, unsigned int timeout, const char *prompt, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len)
     Request the PIN and have the card verify it.
    int(* send )(ifd_reader_t *reader, unsigned int dad, const unsigned char *buffer, size_t len)
     Send an APDU using the currently selected protocol.
    int(* recv )(ifd_reader_t *reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout)
     Receive an APDU response using the currently selected protocol.
    int(* set_protocol )(ifd_reader_t *reader, int slot, int protocol)
     Select the smart card communication protocol.
    int(* transparent )(ifd_reader_t *reader, int slot, const void *sbuf, size_t slen, void *rbuf, size_t rlen)
     Transceive a protocol data unit.
    int(* sync_read )(ifd_reader_t *reader, int slot, int proto, unsigned short addr, unsigned char *rbuf, size_t rlen)
     Read data from a synchronous smart card.
    int(* sync_write )(ifd_reader_t *reader, int slot, int proto, unsigned short addr, const unsigned char *sbuf, size_t slen)
     Write data to a synchronous smart card.
    int(* escape )(ifd_reader_t *reader, int slot, const void *sbuf, const size_t slen, void *rbuf, size_t rlen)
    int(* before_command )(ifd_reader_t *)
     Execute before command.
    int(* after_command )(ifd_reader_t *)
     Execute after command.
    int(* get_eventfd )(ifd_reader_t *, short *events)
     Get event fd.
    int(* event )(ifd_reader_t *, int *status, size_t status_size)
     Event callback.
    int(* error )(ifd_reader_t *)
     Error callback.

    Detailed Description

    Driver operations.

    Definition at line 20 of file driver.h.


    Field Documentation

    int(* activate)(ifd_reader_t *reader)

    Activate the smart card reader.

    This function performs all necessary operations to activate the smart card reader. After activation, the reader must be able to accept card status commands (card_status).

    Reader activation is currently performed once at startup, before calling card_status in response to CT_CMD_STATUS (is it really needed, as the reader was activated at startup ?), and when probing for synchronous cards.

    Called by: ifd_activate.

    Returns:
    Error code <0 if failure.

    Execute after command.

    Provides a chance to setup device to accept events.

    Returns:
    Error code <0 if failure, 0 if success.

    Execute before command.

    Provides a chance to setup device to accept new commands.

    Returns:
    Error code <0 if failure, 0 if success.
    int(* card_eject)(ifd_reader_t *reader, int slot, time_t timeout, const char *message)

    Eject the smart card.

    This function ejects the smart card or prompt the user to remove the card by displaying the message message. The optional parameter timeout, if not equal to zero, gives the card removal timeout in seconds.

    It is not clear if this function should deactivate the smart card first, or if the caller must deactivate the card before calling card_eject.

    Called by: ifd_card_eject.

    Returns:
    Error code <0 if failure.
    int(* card_request)(ifd_reader_t *reader, int slot, time_t timeout, const char *message, void *atr, size_t atr_len)

    Prompts the insertion of a smart card in the reader and performs a card reset.

    This function prompts the user to insert a smart card in the reader. For card readers equipped with a display, the optional message message should be displayed to the user. The optional parameter timeout, if not equal to zero, gives the prompt timeout in seconds.

    If a card is inserted before the timeout elapses, the card is reset and the ATR is fetched. See card_reset for more information.

    Called by: ifd_card_request

    Returns:
    Error code <0 if failure, length of the ATR if success.
    int(* card_reset)(ifd_reader_t *reader, int slot, void *atr, size_t atr_len)

    Reset the card and fetch the ATR.

    This function resets the smart card and reads the Answer To Reset (ATR). The ATR will be stored in the slot structure by OpenCT, so the driver must not store the ATR itself in the slot structure.

    When resetting the card, the driver is allowed to select a protocol. If no protocol is selected when this function returns (assuming it returns successfully), OpenCT will try to select the protocol automatically (see set_protocol).

    Called by: ifd_card_request.

    Returns:
    Error code <0 if failure, length of the ATR if success.
    int(* card_status)(ifd_reader_t *reader, int slot, int *status)

    Fetch the card status.

    This function returns the current card status for a given slot. status is a bitfield which currently accepts the following flags:

    • IFD_CARD_PRESENT (1) A card is present in the slot.
    • IFD_CARD_STATUS_CHANGED (2) The slot status has changed since last call.

    Beside using IFD_CARD_STATUS_CHANGED, OpenCT checks if the card status has changed by comparing the current status value with the previous status value. If the value of the IFD_CARD_PRESENT has changed, OpenCT will set the IFD_CARD_STATUS_CHANGED on the client side.

    On the server side, setting IFD_CARD_STATUS_CHANGED will also set atr_len to 0 for the given slot. As atr_len is only checked in ifd_protocol_select, and as that function is only called in ifd_card_request right after assigning a value to atr_len, this is currently pointless and a reader driver should not set IFD_CARD_STATUS_CHANGED if its only source of information is a change of the IFD_CARD_PRESENT flag between the current call and the previous one.

    Called by: ifd_card_status.

    Returns:
    Error code <0 if failure.
    int(* change_parity)(ifd_reader_t *reader, int parity)

    Change the communication protocol parity.

    This function is only used for asynchronous smart cards with serial readers, and only if the reader doesn't auto-detect the protocol parity.

    Depending on the smart card communication protocol convention (either direct or inverse, see ISO-7816-3, 6.4), the communication between the reader and the smart card uses odd or even parity. If most readers handle smart card protocol convention transparently, the most simple ones map the smart card lines directly on the serial port or require the user to configure the reader according smart card communication protocol parity. For those readers, OpenCT will try both parities (starting with even) when reading the ATR.

    This function, if available, configures the reader and/or the serial port according to the smart card communication protocol parity. It is used by ifd_card_request only.

    Accepted values for parity are

    • IFD_SERIAL_PARITY_ODD (1)
    • IFD_SERIAL_PARITY_EVEN (2)

    Called by: ifd_card_request.

    Returns:
    Error code <0 if failure.
    int(* change_speed)(ifd_reader_t *reader, unsigned int speed)

    Change the communication protocol speed.

    It is not clear if this function was intended to change the communication speed between the host and the reader, the reader and the smart card, or both, as it is currently not used (ifd_set_speed is never called).

    Called by: ifd_set_speed.

    Returns:
    Error code <0 if failure.
    int(* close)(ifd_reader_t *reader)

    Close the reader.

    This function frees all the resources allocated by *open. If made possible by the hardware, the reader and all its slots must be powered off.

    The device will be closed by ifd_close, and must not be closed by this function.

    OpenCT currently never calls ifd_close, so the close function if not used.

    Called by: ifd_close.

    Returns:
    Error code <0 if failure.
    int(* deactivate)(ifd_reader_t *reader)

    Deactivate the smart card reader.

    Reader deactivation is currently performed only when probing for synchronous cards. OpenCT deactivates and reactivates the reader before trying to access the card.

    Called by: ifd_deactivate.

    Returns:
    Error code <0 if failure.
    int(* error)(ifd_reader_t *)

    Error callback.

    Will be called if an error is set on event fd. May be NULL if unsupported.

    Returns:
    Error code <0 if failure, 0 if success. If reader should be freed, return an error.
    int(* event)(ifd_reader_t *, int *status, size_t status_size)

    Event callback.

    Will be called if an event is set. May be NULL if unsupported.

    Returns:
    Error code <0 if failure, 0 if success.
    int(* get_eventfd)(ifd_reader_t *, short *events)

    Get event fd.

    This will allow the mainloop to wait for event instead of polling. May be NULL if unsupported.

    Returns:
    fd.
    int(* open)(ifd_reader_t *reader, const char *name)

    Open the reader.

    This function opens the device named name and initialize the reader structure. The slots' dad should be set here.

    OpenCT calls the open function once at startup.

    Called by: ifd_open.

    Returns:
    Error code <0 if failure.
    int(* output)(ifd_reader_t *reader, const char *message)

    Output a message on the reader's display.

    Called by: ifd_output.

    Returns:
    Error code <0 if failure.
    int(* perform_verify)(ifd_reader_t *reader, int slot, unsigned int timeout, const char *prompt, const unsigned char *data, size_t data_len, unsigned char *resp, size_t resp_len)

    Request the PIN and have the card verify it.

    This function prompts the user to enter his PIN code and have the smart card verify the code. The optional parameter timeout, if not equal to zero, gives the PIN request timeout.

    The two bytes status (SW1-SW2) is copied in the resp buffer. If the status indicates a known error (IFD_ERROR_USER_TIMEOUT, IFD_ERROR_USER_ABORT, IFD_ERROR_PIN_MISMATCH) the error code is returned. Otherwise the length of the response (2) is returned.

    Called by: ifd_perform_verify.

    Returns:
    Error code <0 if failure, size of the response (2) if success or unknown error.
    int(* recv)(ifd_reader_t *reader, unsigned int dad, unsigned char *buffer, size_t len, long timeout)

    Receive an APDU response using the currently selected protocol.

    This function is called by all non-transparent protocols to receive an APDU response from a device. The device address is set by the dad parameter which takes the same values as for the send function.

    The dad parameter is currently unused by all drivers, even the Kaan driver which takes care to initialize it correctly in the open function.

    Called by: ifd_recv_response.

    Returns:
    Error code <0 if failure, number of bytes received if success.
    int(* send)(ifd_reader_t *reader, unsigned int dad, const unsigned char *buffer, size_t len)

    Send an APDU using the currently selected protocol.

    This function is called by all non-transparent protocols to send an APDU to a device. The device address is set by the dad parameter which is one of

    • IFD_DAD_HOST (0) Host (PC) - what's the point ?
    • IFD_DAD_IFD (1) The APDU is sent to the reader
    • IFD_DAD_ICC1 (2) The APDU is sent to the first smart card
    • IFD_DAD_ICC2 (3) The APDU is sent to the second smart card

    The dad parameter is currently unused by all drivers, even the Kaan driver which takes care to initialize it correctly in the open function.

    Called by: ifd_send_command.

    Returns:
    Error code <0 if failure, number of bytes sent if success.
    int(* set_protocol)(ifd_reader_t *reader, int slot, int protocol)

    Select the smart card communication protocol.

    The smart card communication protocol is selected by OpenCT when the card is reset (either by reset_card or request_card), and can be overriden by the user by sending a CT_CMD_SET_PROTOCOL command.

    OpenCT doesn't perform a PPS exchange with the card itself, but selects the first protocol offered by the ATR at reset time by calling set_protocol. If the reader performs the PPS exchange with the card, the selected protocol can be set manually by the driver (by setting slot->proto) and set_protocol will not be called.

    It is not clear what the side effects of CT_CMD_SET_PROTOCOL (should it reset the card ?) should be and if that function is used at all by applications. Isn't the default protocol good enough ? I would have thought that set_protocol was meant to be called only right after reset, to select the protocol and instruct the driver to perform a PPS exchange.

    Called by: ifd_set_protocol, ifd_select_protocol.

    Returns:
    Error code <0 if failure.
    int(* sync_read)(ifd_reader_t *reader, int slot, int proto, unsigned short addr, unsigned char *rbuf, size_t rlen)

    Read data from a synchronous smart card.

    This function writes rlen bytes to the smart card, starting at address addr. The proto parameter specifies the desired communication protocol. The driver must set the protocol before reading data, or return an error if the protocol is not supported.

    Called by: sync_read at proto-sync.c, sync_write at proto-sync.c.

    Returns:
    Error code <0 if failure, number of bytes read if success.
    int(* sync_write)(ifd_reader_t *reader, int slot, int proto, unsigned short addr, const unsigned char *sbuf, size_t slen)

    Write data to a synchronous smart card.

    This function reads slen bytes from the smart card, starting at address addr. The proto parameter specifies the desired communication protocol. The driver must set the protocol before writing data, or return an error if the protocol is not supported.

    Called by: sync_write at proto-sync.c.

    Returns:
    Error code <0 if failure, number of bytes written if success.
    int(* transparent)(ifd_reader_t *reader, int slot, const void *sbuf, size_t slen, void *rbuf, size_t rlen)

    Transceive a protocol data unit.

    This function is used by the transparent protocol, when the driver and/or the reader accepts raw PDUs directly. When using the transparent protocol, the PDUs sent by the client are forwarded directly to the driver without being mangled by OpenCT. If the driver and/or the reader can't accept the PDUs directly (for instance when the reader doesn't support Case 4 APDUs in T=0 protocol), the driver should instanciate the appropriate protocol handler to pre-process the PDUs. In that case, the send and recv functions will be used instead of the transparent function.

    Called by: trans_transceive at proto-trans.c

    Returns:
    Error code <0 if failure, size of the response if success.

    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/types_8h_source.html0000644000175000017500000000610511336457575017133 00000000000000 OpenCT: types.h Source File

    types.h

    00001 #ifndef _SRC_INCLUDE_OPENCT_TYPES_H
    00002 #define _SRC_INCLUDE_OPENCT_TYPES_H 1
    00003 #ifndef _GENERATED_STDINT_H
    00004 #define _GENERATED_STDINT_H "openct 0.6.20"
    00005 /* generated using a gnu compiler version gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1 Copyright (C) 2009 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. */
    00006 
    00007 #include <stdint.h>
    00008 
    00009 
    00010 /* system headers have good uint64_t */
    00011 #ifndef _HAVE_UINT64_T
    00012 #define _HAVE_UINT64_T
    00013 #endif
    00014 
    00015   /* once */
    00016 #endif
    00017 #endif
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/logging_8h_source.html0000644000175000017500000000731311336457575017417 00000000000000 OpenCT: logging.h Source File

    logging.h

    00001 /*
    00002  * Logging functions
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_LOGGING_H
    00008 #define OPENCT_LOGGING_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 extern void             ct_log_destination(const char *);
    00015 
    00016 extern void             ct_error(const char *, ...);
    00017 extern void             ct_debug(const char *, ...);
    00018 
    00019 extern const char *     ct_hexdump(const void *, size_t);
    00020 
    00021 #ifdef __cplusplus
    00022 }
    00023 #endif
    00024 
    00025 #endif /* OPENCT_LOGGING_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structifd__slot.html0000644000175000017500000001020611336457575017214 00000000000000 OpenCT: ifd_slot Struct Reference

    ifd_slot Struct Reference

    Data Fields

    unsigned int handle
    int status
    time_t next_update
    unsigned char dad
    unsigned int atr_len
    unsigned char atr [IFD_MAX_ATR_LEN]
    ifd_protocol_t * proto
    void * reader_data

    Detailed Description

    Definition at line 45 of file ifd.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/driver_8h.html0000644000175000017500000001211711336457575015702 00000000000000 OpenCT: driver.h File Reference

    driver.h File Reference

    Internal driver API. More...

    #include <openct/device.h>

    Go to the source code of this file.

    Data Structures

    struct  ifd_driver_ops
     Driver operations. More...

    Functions

    void ifd_driver_register (const char *, struct ifd_driver_ops *)
    const ifd_driver_tifd_driver_get (const char *)
    int ifd_driver_add_id (const char *, const char *)
    const char * ifd_driver_for_id (ifd_devid_t *)
    ifd_protocol_t * ifd_protocol_select (ifd_reader_t *, int, int)
    int ifd_protocol_transceive (ifd_protocol_t *proto, int dad, const void *, size_t, void *, size_t)
    int ifd_protocol_resynchronize (ifd_protocol_t *, int)

    Detailed Description

    Internal driver API.

    Copyright (C) 2003, Olaf Kirch <okir@suse.de>

    Definition in file driver.h.


    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/socket_8h_source.html0000644000175000017500000003032011336457575017253 00000000000000 OpenCT: socket.h Source File

    socket.h

    00001 /*
    00002  * Socket type definitions
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_SOCKET_H
    00008 #define OPENCT_SOCKET_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #include <sys/types.h>
    00015 #include <openct/types.h>
    00016 #include <openct/buffer.h>
    00017 
    00018 /* forward decl */
    00019 struct pollfd;
    00020 
    00021 typedef struct header {
    00022         uint32_t        xid;
    00023         uint32_t        dest;
    00024         int16_t         error;
    00025         uint16_t        count;
    00026 } header_t;
    00027 
    00028 typedef struct ct_socket {
    00029         struct ct_socket *next, *prev;
    00030 
    00031         int             fd;
    00032         int             eof;
    00033         ct_buf_t        rbuf, sbuf;
    00034 
    00035         unsigned int    use_large_tags : 1,
    00036                         use_network_byte_order : 1,
    00037                         listener : 1;
    00038 
    00039         /* events to poll for */
    00040         int             events;
    00041 
    00042         void *          user_data;
    00043         int             (*poll)(struct ct_socket *, struct pollfd *);
    00044         int             (*error)(struct ct_socket *);
    00045         int             (*recv)(struct ct_socket *);
    00046         int             (*send)(struct ct_socket *);
    00047         int             (*process)(struct ct_socket *, header_t *,
    00048                                         ct_buf_t *, ct_buf_t *);
    00049         void            (*close)(struct ct_socket *);
    00050 
    00051         pid_t           client_id;
    00052         uid_t           client_uid;
    00053 } ct_socket_t;
    00054 
    00055 #define CT_SOCKET_BUFSIZ 4096
    00056 
    00057 extern ct_socket_t *    ct_socket_new(unsigned int);
    00058 extern void             ct_socket_free(ct_socket_t *);
    00059 extern void             ct_socket_reuseaddr(int);
    00060 extern int              ct_socket_connect(ct_socket_t *, const char *);
    00061 extern int              ct_socket_listen(ct_socket_t *, const char *, int);
    00062 extern ct_socket_t *    ct_socket_accept(ct_socket_t *);
    00063 extern void             ct_socket_close(ct_socket_t *);
    00064 extern int              ct_socket_call(ct_socket_t *, ct_buf_t *, ct_buf_t *);
    00065 extern int              ct_socket_flsbuf(ct_socket_t *, int);
    00066 extern int              ct_socket_filbuf(ct_socket_t *, long);
    00067 extern int              ct_socket_put_packet(ct_socket_t *,
    00068                                 header_t *, ct_buf_t *);
    00069 extern int              ct_socket_puts(ct_socket_t *, const char *);
    00070 extern int              ct_socket_get_packet(ct_socket_t *,
    00071                                 header_t *, ct_buf_t *);
    00072 extern int              ct_socket_gets(ct_socket_t *, char *, size_t);
    00073 extern int              ct_socket_send(ct_socket_t *, header_t *,
    00074                                 ct_buf_t *);
    00075 extern int              ct_socket_recv(ct_socket_t *, header_t *,
    00076                                 ct_buf_t *);
    00077 extern int              ct_socket_write(ct_socket_t *, void *, size_t);
    00078 extern int              ct_socket_read(ct_socket_t *, void *, size_t);
    00079 extern void             ct_socket_link(ct_socket_t *, ct_socket_t *);
    00080 extern void             ct_socket_unlink(ct_socket_t *);
    00081 extern int              ct_socket_getpeername(ct_socket_t *, char *, size_t);
    00082 
    00083 #ifdef __cplusplus
    00084 }
    00085 #endif
    00086 
    00087 #endif /* OPENCT_SOCKET_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structct__tlv__builder.html0000644000175000017500000000650511336457575020560 00000000000000 OpenCT: ct_tlv_builder Struct Reference

    ct_tlv_builder Struct Reference

    Data Fields

    int error
    unsigned char use_large_tags
    ct_buf_tbuf
    unsigned int len
    unsigned char * lenp

    Detailed Description

    Definition at line 25 of file tlv.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structct__tlv__parser.html0000644000175000017500000000533611336457575020427 00000000000000 OpenCT: ct_tlv_parser Struct Reference

    ct_tlv_parser Struct Reference

    Data Fields

    unsigned char use_large_tags
    unsigned char * val [256]
    unsigned int len [256]

    Detailed Description

    Definition at line 19 of file tlv.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/tab_b.gif0000644000175000017500000000004311336457575014653 00000000000000GIF89a,D;openct-0.6.20/doc/api.out/html/unionifd__device__params.html0000644000175000017500000000726211336457575021010 00000000000000 OpenCT: ifd_device_params Union Reference

    ifd_device_params Union Reference

    Data Fields

    struct {
       unsigned int   speed
       int   bits
       int   stopbits
       int   parity
       int   check_parity
       unsigned int   rts: 1
       unsigned int   dtr: 1
    serial
    struct {
       int   configuration
       int   interface
       int   altsetting
       int   ep_o
       int   ep_i
       int   ep_intr
    usb

    Detailed Description

    Definition at line 28 of file device.h.


    The documentation for this union was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/dirs.html0000644000175000017500000000242011336457575014745 00000000000000 OpenCT: Directory Hierarchy

    Directories

    This directory hierarchy is sorted roughly, but not completely, alphabetically:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/doxygen.png0000644000175000017500000000240111336457575015300 00000000000000PNG  IHDRd-ok>gAMAOX2tEXtSoftwareAdobe ImageReadyqe<]PLTEǾ"&ﶻޠ{ԍ눙נED9hg]_X<@:#mhU1tRNSvIDATxbC: d#h` @X",***LK.], X@t b @BD6%""  % B:Hf@ RPy"K`\PbC(!II!h(!Cąl!0[X\J\$TM(>a$S @ Ш@R.$LJBRAG1 (FPhhT%!`&q%u P    CT$B|Wl!B`R$( @A%%@,(%$RPmB U`1IYB  99\1 yCCCf"[N'=TGȒl8^K5<SRɤ%@@  b1qAXH&BR y nP4A j>  t!+(.WQA2MU܂ `1%`19F< 3cZ`e!\ D+. 83!lYYA -6EJV @XXX 4 @86`RdB4I " "@xrʌHA`f ȰC"XV0C b@2H ȓ p)!( 04)(%R $Tʀbb,s@7 Ѱ?f֗\PIx!I"Ȉ3 QYt^^gv- }>WJOAV`$&#88\FF SFJ$ƀƊ 4 - Hf ?5 k1d, ."FˀI"4Hgx|fm)))9. aMD& X@t b @%DK.], X@t b @d`ɽSOIENDB`openct-0.6.20/doc/api.out/html/dir_c35229a911af2f480aef06e8035e7826.html0000644000175000017500000001012511336457575021064 00000000000000 OpenCT: openct/ Directory Reference

    openct Directory Reference

    Files

    file  apdu.h [code]
    file  buffer.h [code]
    file  conf.h [code]
    file  device.h [code]
    file  driver.h [code]
     

    Internal driver API.


    file  error.h [code]
    file  ifd.h [code]
    file  logging.h [code]
    file  openct.h [code]
    file  path.h [code]
    file  protocol.h [code]
    file  server.h [code]
    file  socket.h [code]
    file  tlv.h [code]
    file  types.h [code]

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/openct_8h_source.html0000644000175000017500000003251611336457575017264 00000000000000 OpenCT: openct.h Source File

    openct.h

    00001 /*
    00002  * Main OpenCT include file
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_OPENCT_H
    00008 #define OPENCT_OPENCT_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #include <sys/types.h>
    00015 
    00016 /* Various implementation limits */
    00017 #define OPENCT_MAX_READERS      16
    00018 #define OPENCT_MAX_SLOTS        8
    00019 
    00020 typedef struct ct_info {
    00021         char            ct_name[64];
    00022         unsigned int    ct_slots;
    00023         unsigned int    ct_card[OPENCT_MAX_SLOTS];
    00024         unsigned        ct_display : 1,
    00025                         ct_keypad  : 1;
    00026         pid_t           ct_pid;
    00027 } ct_info_t;
    00028 
    00029 typedef struct ct_handle        ct_handle;
    00030 
    00031 #define IFD_CARD_PRESENT        0x0001
    00032 #define IFD_CARD_STATUS_CHANGED 0x0002
    00033 
    00034 /* Lock types
    00035  *  - shared locks allow concurrent access from
    00036  *    other applications run by the same user.
    00037  *    Used e.g. by pkcs11 login.
    00038  *  - exclusive locks deny any access by other
    00039  *    applications.
    00040  *
    00041  * When a lock is granted, a lock handle is passed
    00042  * to the client, which it must present in the
    00043  * subsequent unlock call.
    00044  */
    00045 typedef unsigned int    ct_lock_handle;
    00046 enum {
    00047         IFD_LOCK_SHARED,
    00048         IFD_LOCK_EXCLUSIVE
    00049 };
    00050 
    00051 /*
    00052  * PIN encoding types
    00053  */
    00054 enum {
    00055         IFD_PIN_ENCODING_BCD,
    00056         IFD_PIN_ENCODING_ASCII
    00057 };
    00058 
    00059 extern int              ct_status(const ct_info_t **);
    00060 
    00061 extern int              ct_reader_info(unsigned int, ct_info_t *);
    00062 extern ct_handle *      ct_reader_connect(unsigned int);
    00063 extern void             ct_reader_disconnect(ct_handle *);
    00064 extern int              ct_reader_status(ct_handle *, ct_info_t *);
    00065 extern int              ct_card_status(ct_handle *h, unsigned int slot, int *status);
    00066 extern int              ct_card_set_protocol(ct_handle *h, unsigned int slot,
    00067                                  unsigned int protocol);
    00068 extern int              ct_card_reset(ct_handle *h, unsigned int slot,
    00069                                 void *atr, size_t atr_len);
    00070 extern int              ct_card_request(ct_handle *h, unsigned int slot,
    00071                                 unsigned int timeout, const char *message,
    00072                                 void *atr, size_t atr_len);
    00073 extern int              ct_card_lock(ct_handle *h, unsigned int slot,
    00074                                 int type, ct_lock_handle *);
    00075 extern int              ct_card_unlock(ct_handle *h, unsigned int slot,
    00076                                 ct_lock_handle);
    00077 extern int              ct_card_transact(ct_handle *h, unsigned int slot,
    00078                                 const void *apdu, size_t apdu_len,
    00079                                 void *recv_buf, size_t recv_len);
    00080 extern int              ct_card_verify(ct_handle *h, unsigned int slot,
    00081                                 unsigned int timeout, const char *prompt,
    00082                                 unsigned int pin_encoding,
    00083                                 unsigned int pin_length,
    00084                                 unsigned int pin_offset,
    00085                                 const void *send_buf, size_t send_len,
    00086                                 void *recv_buf, size_t recv_len);
    00087 extern int              ct_card_read_memory(ct_handle *, unsigned int slot,
    00088                                 unsigned short address,
    00089                                 void *recv_buf, size_t recv_len);
    00090 extern int              ct_card_write_memory(ct_handle *, unsigned int slot,
    00091                                 unsigned short address,
    00092                                 const void *send_buf, size_t send_len);
    00093 
    00094 extern int              ct_status_destroy(void);
    00095 extern int              ct_status_clear(unsigned int, const char *);
    00096 extern ct_info_t *      ct_status_alloc_slot(int *);
    00097 extern int              ct_status_update(ct_info_t *);
    00098 
    00099 #ifdef __cplusplus
    00100 }
    00101 #endif
    00102 
    00103 #endif /* OPENCT_OPENCT_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structct__socket.html0000644000175000017500000002032711336457575017374 00000000000000 OpenCT: ct_socket Struct Reference

    ct_socket Struct Reference

    Data Fields

    struct ct_socketnext
    struct ct_socketprev
    int fd
    int eof
    ct_buf_t rbuf
    ct_buf_t sbuf
    unsigned int use_large_tags: 1
    unsigned int use_network_byte_order: 1
    unsigned int listener: 1
    int events
    void * user_data
    int(* poll )(struct ct_socket *, struct pollfd *)
    int(* error )(struct ct_socket *)
    int(* recv )(struct ct_socket *)
    int(* send )(struct ct_socket *)
    int(* process )(struct ct_socket *, header_t *, ct_buf_t *, ct_buf_t *)
    void(* close )(struct ct_socket *)
    pid_t client_id
    uid_t client_uid

    Detailed Description

    Definition at line 28 of file socket.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/files.html0000644000175000017500000000622011336457575015110 00000000000000 OpenCT: File Index

    File List

    Here is a list of all documented files with brief descriptions:
    apdu.h [code]
    buffer.h [code]
    conf.h [code]
    device.h [code]
    driver.h [code]Internal driver API
    error.h [code]
    ifd.h [code]
    logging.h [code]
    openct.h [code]
    path.h [code]
    protocol.h [code]
    server.h [code]
    socket.h [code]
    tlv.h [code]
    types.h [code]

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/error_8h_source.html0000644000175000017500000001541011336457575017117 00000000000000 OpenCT: error.h Source File

    error.h

    00001 /*
    00002  * Error codes
    00003  *
    00004  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_ERROR_H
    00008 #define OPENCT_ERROR_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 #define IFD_SUCCESS                     0
    00015 #define IFD_ERROR_GENERIC               -1
    00016 #define IFD_ERROR_TIMEOUT               -2
    00017 #define IFD_ERROR_INVALID_SLOT          -3
    00018 #define IFD_ERROR_NOT_SUPPORTED         -4
    00019 #define IFD_ERROR_COMM_ERROR            -5
    00020 #define IFD_ERROR_NO_CARD               -6
    00021 #define IFD_ERROR_LOCKED                -7
    00022 #define IFD_ERROR_NOLOCK                -8
    00023 #define IFD_ERROR_INVALID_ARG           -9
    00024 #define IFD_ERROR_NO_MEMORY             -10
    00025 #define IFD_ERROR_BUFFER_TOO_SMALL      -11
    00026 #define IFD_ERROR_USER_TIMEOUT          -12
    00027 #define IFD_ERROR_USER_ABORT            -13
    00028 #define IFD_ERROR_PIN_MISMATCH          -14
    00029 #define IFD_ERROR_NO_ATR                -15
    00030 #define IFD_ERROR_INCOMPATIBLE_DEVICE   -16
    00031 #define IFD_ERROR_DEVICE_DISCONNECTED   -17
    00032 #define IFD_ERROR_INVALID_ATR           -18
    00033 
    00034 /* for application/resource manager protocol */
    00035 #define IFD_ERROR_INVALID_MSG           -100
    00036 #define IFD_ERROR_INVALID_CMD           -101
    00037 #define IFD_ERROR_MISSING_ARG           -102
    00038 #define IFD_ERROR_NOT_CONNECTED         -103
    00039 
    00040 /* Specific error codes for proxy protocol */
    00041 #define IFD_ERROR_ALREADY_CLAIMED       -200
    00042 #define IFD_ERROR_DEVICE_BUSY           -201
    00043 #define IFD_ERROR_UNKNOWN_DEVICE        -202
    00044 
    00045 extern const char *     ct_strerror(int);
    00046 
    00047 #ifdef __cplusplus
    00048 }
    00049 #endif
    00050 
    00051 #endif /* OPENCT_ERROR_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structifd__devid.html0000644000175000017500000000531111336457575017327 00000000000000 OpenCT: ifd_devid Struct Reference

    ifd_devid Struct Reference

    Data Fields

    int type
    unsigned int num
    unsigned int val [IFD_MAX_DEVID_PARTS]

    Detailed Description

    Definition at line 56 of file device.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/driver_8h_source.html0000644000175000017500000004041411336457575017263 00000000000000 OpenCT: driver.h Source File

    driver.h

    Go to the documentation of this file.
    00001 
    00008 #ifndef OPENCT_DRIVER_H
    00009 #define OPENCT_DRIVER_H
    00010 
    00011 #ifdef __cplusplus
    00012 extern "C" {
    00013 #endif
    00014 
    00015 #include <openct/device.h>
    00016 
    00020 struct ifd_driver_ops {
    00021         int             default_protocol;
    00022 
    00034         int             (*open)(ifd_reader_t *reader, const char *name);
    00049         int             (*close)(ifd_reader_t * reader);
    00076         int             (*change_parity)(ifd_reader_t *reader, int parity);
    00087         int             (*change_speed)(ifd_reader_t *reader, unsigned int speed);
    00102         int             (*activate)(ifd_reader_t *reader);
    00113         int             (*deactivate)(ifd_reader_t *reader);
    00138         int             (*card_status)(ifd_reader_t *reader, int slot, int *status);
    00154         int             (*card_reset)(ifd_reader_t *reader, int slot, void *atr, size_t atr_len);
    00169         int             (*card_request)(ifd_reader_t *reader, int slot,
    00170                                 time_t timeout, const char *message,
    00171                                 void *atr, size_t atr_len);
    00185         int             (*card_eject)(ifd_reader_t *reader, int slot,
    00186                                 time_t timeout, const char *message);
    00193         int             (*output)(ifd_reader_t *reader, const char *message);
    00209         int             (*perform_verify)(ifd_reader_t *reader,
    00210                                 int slot, unsigned int timeout, const char *prompt,
    00211                                 const unsigned char *data, size_t data_len,
    00212                                 unsigned char *resp, size_t resp_len);
    00230         int             (*send)(ifd_reader_t *reader,
    00231                                 unsigned int dad,
    00232                                 const unsigned char *buffer,
    00233                                 size_t len);
    00247         int             (*recv)(ifd_reader_t *reader,
    00248                                 unsigned int dad,
    00249                                 unsigned char *buffer,
    00250                                 size_t len,
    00251                                 long timeout);
    00274         int             (*set_protocol)(ifd_reader_t *reader, int slot, int protocol);
    00290         int             (*transparent)(ifd_reader_t *reader, int slot,
    00291                                 const void *sbuf, size_t slen,
    00292                                 void *rbuf, size_t rlen);
    00304         int             (*sync_read)(ifd_reader_t *reader, int slot, int proto,
    00305                                 unsigned short addr,
    00306                                 unsigned char *rbuf, size_t rlen);
    00318         int             (*sync_write)(ifd_reader_t *reader, int slot, int proto,
    00319                                 unsigned short addr,
    00320                                 const unsigned char *sbuf, size_t slen);
    00321 
    00322         /*Support for transparent access to "escape" */
    00323         int             (*escape)(ifd_reader_t *reader, int slot,
    00324                                 const void *sbuf, const size_t slen,
    00325                                 void *rbuf, size_t rlen);
    00326 
    00334         int (*before_command) (ifd_reader_t *);
    00335 
    00343         int (*after_command) (ifd_reader_t *);
    00344 
    00353         int (*get_eventfd) (ifd_reader_t *, short *events);
    00354 
    00363         int (*event) (ifd_reader_t *, int *status, size_t status_size);
    00364 
    00374         int (*error) (ifd_reader_t *);
    00375 };
    00376 
    00377 extern void             ifd_driver_register(const char *,
    00378                                 struct ifd_driver_ops *);
    00379 extern const ifd_driver_t *ifd_driver_get(const char *);
    00380 extern int              ifd_driver_add_id(const char *, const char *);
    00381 extern const char *     ifd_driver_for_id(ifd_devid_t *);
    00382 
    00383 /*
    00384  * Protocol handling for card terminal drivers
    00385  */
    00386 extern ifd_protocol_t * ifd_protocol_select(ifd_reader_t *, int, int);
    00387 extern int              ifd_protocol_transceive(ifd_protocol_t *proto,
    00388                                 int dad,
    00389                                 const void *, size_t,
    00390                                 void *, size_t);
    00391 extern int              ifd_protocol_resynchronize(ifd_protocol_t *, int);
    00392 
    00393 #ifdef __cplusplus
    00394 }
    00395 #endif
    00396 
    00397 #endif /* OPENCT_DRIVER_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/classes.html0000644000175000017500000000675011336457575015453 00000000000000 OpenCT: Alphabetical List

    Data Structure Index

    C | H | I
      C  
    ct_socket   header   ifd_devid   ifd_iso_apdu   
    ct_buf   ct_tlv_builder   
      I  
    ifd_driver   ifd_reader   
    ct_config   ct_tlv_parser   ifd_conf_node   ifd_driver_ops   ifd_slot   
    ct_info   
      H  
    ifd_device_params   
    C | H | I

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/path_8h_source.html0000644000175000017500000000614211336457575016724 00000000000000 OpenCT: path.h Source File

    path.h

    00001 /*
    00002  * Path handling routines
    00003  *
    00004  * Copyright (C) 2006, Andreas Jellinghaus <aj@dungeon.inka.de>
    00005  */
    00006 
    00007 #ifndef OPENCT_PATH_H
    00008 #define OPENCT_PATH_H
    00009 
    00010 #ifdef __cplusplus
    00011 extern "C" {
    00012 #endif
    00013 
    00014 extern int ct_format_path(char *path, const size_t pathlen, const char *file);
    00015 
    00016 #ifdef __cplusplus
    00017 }
    00018 #endif
    00019 #endif                          /* OPENCT_PATH_H */
    

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structct__config.html0000644000175000017500000001074311336457575017352 00000000000000 OpenCT: ct_config Struct Reference

    ct_config Struct Reference

    Data Fields

    int debug
    int autoload
    int hotplug
    int suppress_errors
    const char * ifdhandler
    const char * modules_dir
    const char * driver_modules_dir
    const char * protocol_modules_dir
    const char * socket_dir

    Detailed Description

    Definition at line 14 of file conf.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/functions.html0000644000175000017500000001062011336457575016015 00000000000000 OpenCT: Data Fields
    Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/api.out/html/structheader.html0000644000175000017500000000565411336457575016515 00000000000000 OpenCT: header Struct Reference

    header Struct Reference

    Data Fields

    uint32_t xid
    uint32_t dest
    int16_t error
    uint16_t count

    Detailed Description

    Definition at line 21 of file socket.h.


    The documentation for this struct was generated from the following file:

    libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo
    openct-0.6.20/doc/README0000644000175000017500000000123110422076712011433 00000000000000This directory contains a snapshot of the OpenCT Wiki ===================================================== The original wiki page is at http://www.opensc-project.org/openct/ and includes a bug tracker and source browser. The wiki was transformed to html using the export-wiki shell script and xsl style sheet. The original version is at http://www.twdata.org/trac-howto/ To update the documentation run "make dist" in the top directory of the source code. Note: to do so files are fetched from the network using wget and xsltproc is needed to transform the files. Also the API documentation is updated using doxygen. Make sure all these tools are installed. openct-0.6.20/config.guess0000755000175000017500000013226411336457517012354 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2009-04-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: