-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 NotDashEscaped: You need GnuPG to verify this message This is a patch file to create version 0.7.2 from 0.7.1. Please check the signature of this patch file: zcat somepath/pinentry-0.7.1-0.7.2.diff.gz | gpg --verify Change to directory pinentry-0.7.1 (or however you renamed it) and give this command: zcat somepath/pinentry-0.7.1-0.7.2.diff.gz | patch -p1 It is a good idea to rename your current directory to pinentry-0.7.2 now. Prereq: 0.7.1 diff -urpP pinentry-0.7.1/ChangeLog pinentry-0.7.2/ChangeLog --- pinentry-0.7.1/ChangeLog 2004-04-21 19:32:49.000000000 +0000 +++ pinentry-0.7.2/ChangeLog 2005-01-27 08:10:17.000000000 +0000 @@ -1,3 +1,123 @@ +2005-01-27 Werner Koch + + Released 0.7.2. + + * gtk+-2/Makefile.am: Removed padlock-keyhole.xpm. + + * configure.ac: Use AC_GNU_SOURCE instead of the custom define. + Prefer gtk2 pinentry over qt. + +2005-01-21 Marcus Brinkmann + + * doc/pinentry.texi: Fix spelling errors. + Submitted by Ville Skyttä. + +2004-12-23 Werner Koch + + * w32/pinentry-w32.rc: Remove the default texts for description, + prompt and error. Make it system modal. Enlarge the description + field. + +2004-12-22 Timo Schulz + + * w32/main.c: Remove all helper functions and use a callback + to set the dialog items directly. + (dlg_proc): Set 'result' to -1 to indicate cancel. + (ok_button_clicked): Adjusted. Set 'result' to the len of + the PIN to indicate success. + +2004-12-22 Werner Koch + + * w32/main.c: Simplified. + * w32/dialog.h, w32/dialog.c, w32/controller.h, w32/controller.c: + Removed + + * w32/resource.h, w32/pinentry-w32.rc, w32/main.c, w32/dialog.h + * w32/dialog.c, w32/controller.h, w32/controller.c + * w32/Makefile.am: New. Based on Timo's work. + + Update to automake 1.9. + + * autogen.sh (configure_ac): Add --build-w32 option. + * Makefile.am: Support for the W32 pinentry. + * configure.ac: Ditto. Reformatted some error messages. + Define the usual conditionals for W32. + Check for a couple of more usually required headers. + + * pinentry/pinentry.h (sleep) [W32]: New. + + * pinentry/pinentry.c: Include langinfo.h only if available. + (pinentry_loop) [DOSISH]: Don't do uid check. + + * secmem/util.c [DOSISH]: Disable UID stuff. + +2004-09-27 Marcus Brinkmann + + * acinclude.m4 (IU_LIB_NCURSES, IU_LIB_CURSES, IU_LIB_TERMCAP): + Moved to m4/curses.m4. + (AM_ICONV): Moved to m4/iconv.m4. + (AM_PATH_GLIB): Moved to m4/glib.m4. + (QT_FIND_FILE, QT_PATH_MOC, QT_PATH_X, QT_PRINT_PROGRAM, + QT_CHECK_VERSION, QT_PATH_1_3, QT_PATH, QT_CHECK_COMPILER_FLAG, + QT_REMOVE_FORBIDDEN, QT_VALIDIFY_CXXFLAGS, QT_CHECK_COMPILERS, + QT_CHECK_RPATH, QT_CHECK_LIBPTHREAD, QT_CHECK_PTHREAD_OPTION, + QT_CHECK_THREADING): Move to m4/qt.m4. + +2004-09-21 Marcus Brinkmann + + * qt/Makefile.am (pinentry_qt_LDFLAGS): Add $(QT_RPATH). + Requested by Leo Savernik . + +2004-09-02 Marcus Brinkmann + + * gtk+-2/padlock-keyhole.xpm: File removed. + * gtk+-2/pinentry-gtk-2.c (create_window): Use stock icon. + * gtk+-2/gtksecentry.h, gtk+-2/gtksecentry.c: Fix copyright notice. + + Submitted by Albrecht Dress albrecht.dress@arcor.de. + +2004-08-17 Marcus Brinkmann + + * configure.ac: Invoke AC_PROG_LN_S. + (PINENTRY_DEFAULT): New variable. Substitute it. Fail if no + default can be determined. + * Makefile.am (install-exec-local): Install pinentry default link. + + * configure.ac: Check for Gtk+-2. + * gtk+-2: New directory with gtk+-2 pinentry. + * gtk+-2/Makefile.am, gtk+-2/gtksecentry.h, gtk+-2/gtksecentry.c, + gtk+-2/pinentry-gtk-2.c, gtk+-2/padlock-keyhole.xpm: New files. + * Makefile.am (pinentry_gtk_2): New variable. + (SUBDIRS): Add pinentry_gtk_2. + + Submitted by Albrecht Dress albrecht.dress@arcor.de. + +2004-08-04 Werner Koch + + * pinentry/pinentry.c (usage): Print help to stdout. + +2004-07-30 Moritz Schulte + + * qt/Makefile.am (ncurses_include): Removed + -I$(top_srcdir)/pinentry ... + (AM_CPPFLAGS): ... added: -I$(top_srcdir)/pinentry. Thanks to + Peter Eisentraut. + + * pinentry/pinentry.c (pinentry_utf8_to_local): Declare INPUT + const. + (pinentry_local_to_utf8): Likewise. + (pinentry_utf8_to_local, pinentry_local_to_utf8): Compile only, if + either Curses or GTK+ support is enabled. + * configure.ac: Do also check for libiconv when the GTK+ version + of pinentry is to be build. Define PINENTRY_CURSES, PINENTRY_GTK, + PINENTRY_QT depending on which versions of pinentry should be + build. + +2004-05-21 Marcus Brinkmann + + * acinclude.m4 (QT_CHECK_DIRECT): Removed. + (QT_PATH_1_3): Do never invoke QT_CHECK_DIRECT. + 2004-04-21 Werner Koch Released 0.7.1. diff -urpP pinentry-0.7.1/INSTALL pinentry-0.7.2/INSTALL --- pinentry-0.7.1/INSTALL 2001-11-25 22:33:21.000000000 +0000 +++ pinentry-0.7.2/INSTALL 2004-12-22 11:08:37.000000000 +0000 @@ -1,27 +1,43 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + Basic Installation ================== - These are generic installation instructions. +These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. The simplest way to compile this package is: @@ -31,34 +47,45 @@ The simplest way to compile this package `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. - Running `configure' takes a while. While running, it prints some + Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. - 3. Type `make install' to install the programs and any data files and + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and documentation. - 4. You can remove the program binaries and object files from the - source code directory by typing `make clean'. + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. Compilers and Options ===================== - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== - You can compile the package for more than one kind of computer at the +You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the @@ -66,26 +93,31 @@ directory where you want the object file the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. Installation Names ================== - By default, `make install' will install the package's files in +By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. +option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. +give `configure' the option `--exec-prefix=PREFIX', the package will +use PREFIX as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. @@ -93,7 +125,7 @@ option `--program-prefix=PREFIX' or `--p Optional Features ================= - Some packages pay attention to `--enable-FEATURE' options to +Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -108,60 +140,92 @@ you can use the `configure' options `--x Specifying the System Type ========================== - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + CPU-COMPANY-SYSTEM -See the file `config.sub' for the possible values of each field. If +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't -need to know the host type. +need to know the machine type. - If you are building compiler tools for cross-compiling, you can also + If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. Sharing Defaults ================ - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. -Operation Controls +Defining Variables ================== - `configure' recognizes the following options to control how it -operates. +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. `--help' +`-h' Print a summary of the options to `configure', and exit. +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + `--quiet' `--silent' `-q' - Do not print messages saying which checks are being made. + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. diff -urpP pinentry-0.7.1/Makefile.am pinentry-0.7.2/Makefile.am --- pinentry-0.7.1/Makefile.am 2003-12-23 08:49:04.000000000 +0000 +++ pinentry-0.7.2/Makefile.am 2004-12-22 10:48:43.000000000 +0000 @@ -35,14 +35,26 @@ else pinentry_gtk = endif +if BUILD_PINENTRY_GTK_2 +pinentry_gtk_2 = gtk+-2 +else +pinentry_gtk_2 = +endif + if BUILD_PINENTRY_QT pinentry_qt = qt else pinentry_qt = endif +if BUILD_PINENTRY_W32 +pinentry_w32 = w32 +else +pinentry_w32 = +endif + SUBDIRS = assuan secmem pinentry ${pinentry_curses} \ - ${pinentry_gtk} ${pinentry_qt} doc + ${pinentry_gtk} ${pinentry_gtk_2} ${pinentry_qt} ${pinentry_w32} doc signed-dist: $(distdir).tar.gz.sig @@ -54,3 +66,7 @@ install-exec-local: echo " $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'` || true; \ done + + (cd $(DESTDIR)$(bindir); \ + rm -f pinentry; \ + $(LN_S) $(PINENTRY_DEFAULT) pinentry) diff -urpP pinentry-0.7.1/Makefile.in pinentry-0.7.2/Makefile.in --- pinentry-0.7.1/Makefile.in 2004-04-21 19:33:22.000000000 +0000 +++ pinentry-0.7.2/Makefile.in 2005-01-27 08:11:59.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -32,7 +32,6 @@ # 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 - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -40,7 +39,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -54,7 +52,48 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + THANKS TODO config.guess config.sub depcomp install-sh missing \ + mkinstalldirs +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.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 configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = assuan secmem pinentry curses gtk gtk+-2 qt w32 doc +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -67,10 +106,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -93,9 +136,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,6 +159,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -125,6 +176,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -140,6 +193,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -148,6 +202,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -155,6 +210,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -175,6 +232,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -185,59 +243,57 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - ACLOCAL_AMFLAGS = -I m4 - EXTRA_DIST = autogen.sh README.CVS Manifest - -@BUILD_PINENTRY_CURSES_TRUE@pinentry_curses = curses @BUILD_PINENTRY_CURSES_FALSE@pinentry_curses = +@BUILD_PINENTRY_CURSES_TRUE@pinentry_curses = curses @BUILD_PINENTRY_GTK_FALSE@pinentry_gtk = - @BUILD_PINENTRY_GTK_TRUE@pinentry_gtk = gtk +@BUILD_PINENTRY_GTK_2_FALSE@pinentry_gtk_2 = +@BUILD_PINENTRY_GTK_2_TRUE@pinentry_gtk_2 = gtk+-2 @BUILD_PINENTRY_QT_FALSE@pinentry_qt = - @BUILD_PINENTRY_QT_TRUE@pinentry_qt = qt - +@BUILD_PINENTRY_W32_FALSE@pinentry_w32 = +@BUILD_PINENTRY_W32_TRUE@pinentry_w32 = w32 SUBDIRS = assuan secmem pinentry ${pinentry_curses} \ - ${pinentry_gtk} ${pinentry_qt} doc + ${pinentry_gtk} ${pinentry_gtk_2} ${pinentry_qt} ${pinentry_w32} doc -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \ - COPYING ChangeLog INSTALL Makefile.am NEWS THANKS TODO \ - acinclude.m4 aclocal.m4 config.guess config.h.in config.sub \ - configure configure.ac depcomp install-sh missing mkinstalldirs -DIST_SUBDIRS = assuan secmem pinentry curses gtk qt doc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: - -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) +.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: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac acinclude.m4 +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @@ -249,10 +305,10 @@ config.h: stamp-h1 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: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) - touch $(srcdir)/config.h.in + rm -f stamp-h1 + touch $@ distclean-hdr: -rm -f config.h stamp-h1 @@ -317,14 +373,6 @@ ctags-recursive: test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -333,19 +381,22 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + 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 && \ + test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -355,10 +406,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -381,23 +433,11 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = . -distdir = $(PACKAGE)-$(VERSION) - -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } - -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) + $(mkdir_p) $(distdir)/m4 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -409,7 +449,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -426,13 +466,15 @@ distdir: $(DISTFILES) done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ @@ -443,19 +485,46 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + 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 - $(am__remove_distdir) - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst @@ -475,19 +544,20 @@ distcheck: dist distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ - (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ + (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-gzip \ - && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) - @echo "$(distdir).tar.gz is ready for distribution" | \ - sed 'h;s/./=/g;p;x;p;x' + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -511,7 +581,6 @@ check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: - install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -531,7 +600,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -549,6 +618,8 @@ dvi: dvi-recursive dvi-am: +html: html-recursive + info: info-recursive info-am: @@ -585,22 +656,20 @@ uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-recursive ctags ctags-recursive dist \ - dist-all dist-gzip distcheck distclean distclean-generic \ - distclean-hdr distclean-recursive distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am dvi-recursive info \ - info-am info-recursive install install-am install-data \ - install-data-am install-data-recursive install-exec \ - install-exec-am install-exec-local install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-recursive ctags \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ + dist-tarZ dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-recursive distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am \ + install-exec-local install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ - ps-recursive tags tags-recursive uninstall uninstall-am \ - uninstall-info-am uninstall-info-recursive uninstall-recursive + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am signed-dist: $(distdir).tar.gz.sig @@ -613,6 +682,10 @@ install-exec-local: echo " $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'` || true; \ done + + (cd $(DESTDIR)$(bindir); \ + rm -f pinentry; \ + $(LN_S) $(PINENTRY_DEFAULT) pinentry) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -urpP pinentry-0.7.1/NEWS pinentry-0.7.2/NEWS --- pinentry-0.7.1/NEWS 2004-04-21 19:32:00.000000000 +0000 +++ pinentry-0.7.2/NEWS 2005-01-27 07:59:47.000000000 +0000 @@ -1,3 +1,18 @@ +Noteworthy changes in version 0.7.2 (2005-01-27) +------------------------------------------------ + + * Remove bug in configure script that would use installed version of + Qt even if another path was explicitely specified with QTDIR. + + * Honor the rpath setting for Qt. + + * Add GTK+-2 pinentry. + + * Install a symbolic link under the name "pinentry" that defaults to + pinentry-gtk, pinentry-qt, pinentry-gtk-2, or pinentry-curses, in + that order. + + Noteworthy changes in version 0.7.1 (2004-04-21) ------------------------------------------------ diff -urpP pinentry-0.7.1/README pinentry-0.7.2/README --- pinentry-0.7.1/README 2002-06-26 07:10:16.000000000 +0000 +++ pinentry-0.7.2/README 2004-09-27 18:20:25.000000000 +0000 @@ -9,20 +9,23 @@ There are programs for different toolkit is automatically detected which modules can be built, but it can also be requested explicitely. -GUI OPTION DEPENDENCIES -Curses --enable-pinentry-curses Curses library, for example ncurses -GTK+ --enable-pinentry-gtk Gimp Toolkit Library, eg libgtk and libglib -Qt --enable-pinentry-qt Qt, eg libqt-mt - -The GTK+ and Qt pinentry can fall back to the curses mode. The option -to enable this is --enable-fallback-curses, but this is also detected -automatically in the same way --enable-pinentry-curses is. The -fallback to curses also works if --disable-pinentry-curses is +GUI OPTION DEPENDENCIES +Curses --enable-pinentry-curses Curses library, for example ncurses +GTK+ V1.2 --enable-pinentry-gtk Gimp Toolkit Library Version 1.2 + eg. libgtk-1.2 and libglib-1.2 +GTK+ V2.0 --enable-pinentry-gtk2 Gimp Toolkit Library, Version 2.0 + eg. libgtk-x11-2.0 and libglib-2.0 +Qt --enable-pinentry-qt Qt, eg. libqt or libqt-mt + +The GTK+ and Qt pinentries can fall back to the curses mode. The +option to enable this is --enable-fallback-curses, but this is also +detected automatically in the same way --enable-pinentry-curses is. +The fallback to curses also works if --disable-pinentry-curses is specified. So to disable linking to curses completely you have to pass --disable-fallback-curses to the configure script as well. Examples: -* To only build the GTK+ pinentry with curses support: +* To only build the GTK+ 1.2 pinentry with curses support: ./configure --enable-pinentry-gtk --enable-fallback-curses \ --disable-pinentry-curses --disable-pinentry-qt diff -urpP pinentry-0.7.1/THANKS pinentry-0.7.2/THANKS --- pinentry-0.7.1/THANKS 2004-04-20 10:13:22.000000000 +0000 +++ pinentry-0.7.2/THANKS 2004-08-17 18:21:03.000000000 +0000 @@ -1,3 +1,4 @@ +Albrecht Dress albrecht.dress@arcor.de Alexander Zangerl az at snafu.priv.at Michael Nottebrock michaelnottebrock at gmx.net - +Peter Eisentraut peter_e@gmx.net diff -urpP pinentry-0.7.1/TODO pinentry-0.7.2/TODO --- pinentry-0.7.1/TODO 2004-04-20 05:04:46.000000000 +0000 +++ pinentry-0.7.2/TODO 2004-08-17 18:21:03.000000000 +0000 @@ -13,3 +13,5 @@ * A heartbeat status message should be sent every few seconds, so that the gpg-agent is better able to cope with jammed pinentries. + +* The gtk+-2 pinentry needs auditing. diff -urpP pinentry-0.7.1/acinclude.m4 pinentry-0.7.2/acinclude.m4 --- pinentry-0.7.1/acinclude.m4 2003-12-22 09:34:53.000000000 +0000 +++ pinentry-0.7.2/acinclude.m4 2004-12-22 11:12:09.000000000 +0000 @@ -2,213 +2,11 @@ dnl Autoconf macros used by PINENTRY dnl dnl Copyright (C) 2002 g10 Code GmbH dnl -dnl IU_LIB_NCURSES, IU_LIB_CURSES and IU_LIB_TERMCAP are: -dnl Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. -dnl Written by Miles Bader -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -dnl - -dnl IU_LIB_NCURSES -- check for, and configure, ncurses -dnl -dnl If libncurses is found to exist on this system and the --disable-ncurses -dnl flag wasn't specified, defines LIBNCURSES with the appropriate linker -dnl specification, and possibly defines NCURSES_INCLUDE with the appropriate -dnl -I flag to get access to ncurses include files. -dnl -AC_DEFUN([IU_LIB_NCURSES], [ - AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses], - , enable_ncurses=yes) - if test "$enable_ncurses" = yes; then - AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses") - if test "$LIBNCURSES"; then - # Use ncurses header files instead of the ordinary ones, if possible; - # is there a better way of doing this, that avoids looking in specific - # directories? - AC_ARG_WITH(ncurses-include-dir, -[ --with-ncurses-include-dir=DIR - Set directory containing the include files for - use with -lncurses, when it isn't installed as - the default curses library. If DIR is "none", - then no special ncurses include files are used. - --without-ncurses-include-dir - Equivalent to --with-ncurses-include-dir=none])dnl - if test "${with_ncurses_include_dir+set}" = set; then - AC_MSG_CHECKING(for ncurses include dir) - case "$with_ncurses_include_dir" in - no|none) - inetutils_cv_includedir_ncurses=none;; - *) - inetutils_cv_includedir_ncurses="$with_ncurses_include_dir";; - esac - AC_MSG_RESULT($inetutils_cv_includedir_ncurses) - else - AC_CACHE_CHECK(for ncurses include dir, - inetutils_cv_includedir_ncurses, - for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do - if test -d $D/ncurses; then - inetutils_cv_includedir_ncurses="$D/ncurses" - break - fi - test "$inetutils_cv_includedir_ncurses" \ - || inetutils_cv_includedir_ncurses=none - done) - fi - if test "$inetutils_cv_includedir_ncurses" = none; then - NCURSES_INCLUDE="" - else - NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses" - fi - fi - fi - AC_SUBST(NCURSES_INCLUDE) - AC_SUBST(LIBNCURSES)])dnl - -dnl IU_LIB_TERMCAP -- check for various termcap libraries -dnl -dnl Checks for various common libraries implementing the termcap interface, -dnl including ncurses (unless --disable ncurses is specified), curses (which -dnl does on some systems), termcap, and termlib. If termcap is found, then -dnl LIBTERMCAP is defined with the appropriate linker specification. -dnl -AC_DEFUN([IU_LIB_TERMCAP], [ - AC_REQUIRE([IU_LIB_NCURSES]) - if test "$LIBNCURSES"; then - LIBTERMCAP="$LIBNCURSES" - else - AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses) - if test "$ac_cv_lib_curses_tgetent" = no; then - AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap) - fi - if test "$ac_cv_lib_termcap_tgetent" = no; then - AC_CHECK_LIB(termlib, tgetent, LIBTERMCAP=-ltermlib) - fi - fi - AC_SUBST(LIBTERMCAP)])dnl - -dnl IU_LIB_CURSES -- checke for curses, and associated libraries -dnl -dnl Checks for varions libraries implementing the curses interface, and if -dnl found, defines LIBCURSES to be the appropriate linker specification, -dnl *including* any termcap libraries if needed (some versions of curses -dnl don't need termcap). -dnl -AC_DEFUN([IU_LIB_CURSES], [ - AC_REQUIRE([IU_LIB_TERMCAP]) - AC_REQUIRE([IU_LIB_NCURSES]) - if test "$LIBNCURSES"; then - LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap - else - _IU_SAVE_LIBS="$LIBS" - LIBS="$LIBTERMCAP" - AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses") - if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then - AC_CACHE_CHECK(whether curses needs $LIBTERMCAP, - inetutils_cv_curses_needs_termcap, - LIBS="$LIBCURSES" - AC_TRY_LINK([#include ], [initscr ();], - [inetutils_cv_curses_needs_termcap=no], - [inetutils_cv_curses_needs_termcap=yes])) - if test $inetutils_cv_curses_needs_termcap = yes; then - LIBCURSES="$LIBCURSES $LIBTERMCAP" - fi - fi - LIBS="$_IU_SAVE_LIBS" - fi - AC_SUBST(LIBCURSES)])dnl -dnl additional configure macros - -# -# From /usr/share/aclocal/iconv.m4. -# -#serial AM2 - -dnl From Bruno Haible. - -AC_DEFUN([AM_ICONV], -[ - dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and - dnl those with the standalone portable GNU libiconv installed). - - AC_ARG_WITH([libiconv-prefix], -[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ - for dir in `echo "$withval" | tr : ' '`; do - if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi - if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi - done - ]) - - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_func_iconv=yes) - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS -liconv" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) - LIBS="$am_save_LIBS" - fi - ]) - if test "$am_cv_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_TRY_COMPILE([ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) - am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, - [Define as const if the declaration of iconv() needs const.]) - fi - LIBICONV= - if test "$am_cv_lib_iconv" = yes; then - LIBICONV="-liconv" - fi - AC_SUBST(LIBICONV) -]) - - dnl dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME) dnl Check whether a typedef exists and create a #define $2 if it exists dnl -AC_DEFUN(GNUPG_CHECK_TYPEDEF, +AC_DEFUN([GNUPG_CHECK_TYPEDEF], [ AC_MSG_CHECKING(for $1 typedef) AC_CACHE_VAL(gnupg_cv_typedef_$1, [AC_TRY_COMPILE([#define _GNU_SOURCE 1 @@ -232,7 +30,7 @@ AC_DEFUN(GNUPG_CHECK_TYPEDEF, ###################################################################### dnl GNUPG_CHECK_MLOCK dnl -define(GNUPG_CHECK_MLOCK, +define([GNUPG_CHECK_MLOCK], [ AC_CHECK_FUNCS(mlock) if test "$ac_cv_func_mlock" = "no"; then AC_CHECK_HEADERS(sys/mman.h) @@ -317,1158 +115,3 @@ define(GNUPG_CHECK_MLOCK, fi fi ]) - -# Configure paths for GLIB -# Owen Taylor 97-11-3 - -dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or -dnl gthread is specified in MODULES, pass to glib-config -dnl -AC_DEFUN(AM_PATH_GLIB, -[dnl -dnl Get the cflags and libraries from the glib-config script -dnl -AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], - glib_config_prefix="$withval", glib_config_prefix="") -AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], - glib_config_exec_prefix="$withval", glib_config_exec_prefix="") -AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], - , enable_glibtest=yes) - - if test x$glib_config_exec_prefix != x ; then - glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config - fi - fi - if test x$glib_config_prefix != x ; then - glib_config_args="$glib_config_args --prefix=$glib_config_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_prefix/bin/glib-config - fi - fi - - for module in . $4 - do - case "$module" in - gmodule) - glib_config_args="$glib_config_args gmodule" - ;; - gthread) - glib_config_args="$glib_config_args gthread" - ;; - esac - done - - AC_PATH_PROG(GLIB_CONFIG, glib-config, no) - min_glib_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) - no_glib="" - if test "$GLIB_CONFIG" = "no" ; then - no_glib=yes - else - GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` - GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` - glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" -dnl -dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of glib-config to some extent -dnl - rm -f conf.glibtest - AC_TRY_RUN([ -#include -#include -#include - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.glibtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } - - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If glib-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); - printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the glib-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); - printf("*** correct copy of glib-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$GLIB_CONFIG" = "no" ; then - echo "*** The glib-config script installed by GLIB could not be found" - echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GLIB_CONFIG environment variable to the" - echo "*** full path to glib-config." - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB was incorrectly installed" - echo "*** or that you have moved GLIB since it was installed. In the latter case, you" - echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - rm -f conf.glibtest -]) - - -# Configure paths for GTK+ -# Owen Taylor 97-11-3 - -dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS -dnl -AC_DEFUN(AM_PATH_GTK, -[dnl -dnl Get the cflags and libraries from the gtk-config script -dnl -AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], - gtk_config_prefix="$withval", gtk_config_prefix="") -AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], - gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") -AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], - , enable_gtktest=yes) - - for module in . $4 - do - case "$module" in - gthread) - gtk_config_args="$gtk_config_args gthread" - ;; - esac - done - - if test x$gtk_config_exec_prefix != x ; then - gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config - fi - fi - if test x$gtk_config_prefix != x ; then - gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_prefix/bin/gtk-config - fi - fi - - AC_PATH_PROG(GTK_CONFIG, gtk-config, no) - min_gtk_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) - no_gtk="" - if test "$GTK_CONFIG" = "no" ; then - no_gtk=yes - else - GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` - GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` - gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_gtktest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" -dnl -dnl Now check if the installed GTK is sufficiently new. (Also sanity -dnl checks the results of gtk-config to some extent -dnl - rm -f conf.gtktest - AC_TRY_RUN([ -#include -#include -#include - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.gtktest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_gtk_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - exit(1); - } - - if ((gtk_major_version != $gtk_config_major_version) || - (gtk_minor_version != $gtk_config_minor_version) || - (gtk_micro_version != $gtk_config_micro_version)) - { - printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", - $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If gtk-config was correct, then it is best\n"); - printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); - printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } -#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) - else if ((gtk_major_version != GTK_MAJOR_VERSION) || - (gtk_minor_version != GTK_MINOR_VERSION) || - (gtk_micro_version != GTK_MICRO_VERSION)) - { - printf("*** GTK+ header files (version %d.%d.%d) do not match\n", - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - } -#endif /* defined (GTK_MAJOR_VERSION) ... */ - else - { - if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); - printf("*** correct copy of gtk-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_gtk" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$GTK_CONFIG" = "no" ; then - echo "*** The gtk-config script installed by GTK could not be found" - echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GTK_CONFIG environment variable to the" - echo "*** full path to gtk-config." - else - if test -f conf.gtktest ; then - : - else - echo "*** Could not run GTK test program, checking why..." - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK or finding the wrong" - echo "*** version of GTK. If it is not finding GTK, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GTK was incorrectly installed" - echo "*** or that you have moved GTK since it was installed. In the latter case, you" - echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GTK_CFLAGS="" - GTK_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GTK_CFLAGS) - AC_SUBST(GTK_LIBS) - rm -f conf.gtktest -]) -## -*- autoconf -*- - - -dnl This file is part of the KDE libraries/packages -dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) -dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) -dnl (C) 2002 g10 Code GmbH -dnl Modified for PINENTRY by Marcus Brinkmann. -dnl -dnl This file is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Library General Public -dnl License as published by the Free Software Foundation; either -dnl version 2 of the License, or (at your option) any later version. - -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Library General Public License for more details. - -dnl You should have received a copy of the GNU Library General Public License -dnl along with this library; see the file COPYING.LIB. If not, write to -dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -dnl Boston, MA 02111-1307, USA. - -dnl ------------------------------------------------------------------------ -dnl Find a file (or one of more files in a list of dirs) -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_FIND_FILE, -[ -$3=NO -for i in $2; -do - for j in $1; - do - echo "configure: __oline__: $i/$j" >&AS_MESSAGE_LOG_FD - if test -r "$i/$j"; then - echo "taking that" >&AS_MESSAGE_LOG_FD - $3=$i - break 2 - fi - done -done -]) - -dnl ------------------------------------------------------------------------ -dnl Find the meta object compiler in the PATH, -dnl in $QTDIR/bin, and some more usual places -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_PATH_MOC, -[ - qt_bindirs="" - for dir in $qt_dirs; do - qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc" - done - qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin" - if test ! "$ac_qt_bindir" = "NO"; then - qt_bindirs="$ac_qt_bindir:$qt_bindirs" - fi - - AC_PATH_PROG(MOC, moc, no, [$qt_bindirs]) - if test "$MOC" = no; then - #AC_MSG_ERROR([No Qt meta object compiler (moc) found! - #Please check whether you installed Qt correctly. - #You need to have a running moc binary. - #configure tried to run $ac_cv_path_moc and the test didn't - #succeed. If configure shouldn't have tried this one, set - #the environment variable MOC to the right one before running - #configure. - #]) - have_moc="no" - else - have_moc="yes" - AC_SUBST(MOC) - fi -]) - - -dnl ------------------------------------------------------------------------ -dnl Find the header files and libraries for the X Window System. -dnl Extended the macro AC_PATH_XTRA. -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_PATH_X, -[ -AC_ARG_ENABLE( - embedded, - [ --enable-embedded link to Qt-embedded, don't use X], - qt_use_emb=$enableval, - qt_use_emb=no -) - -AC_ARG_ENABLE( - palmtop, - [ --enable-palmtop link to Qt-embedded, don't use X, link to the Qt Palmtop Environment], - qt_use_emb_palm=$enableval, - qt_use_emb_palm=no -) - -if test "$qt_use_emb" = "no"; then - AC_PATH_X - AC_PATH_XTRA - if test "$no_x" = yes; then - AC_MSG_ERROR([Can't find X. Please check your installation and add the correct paths!]) - fi - QT_CXXFLAGS="$X_CFLAGS" - QT_LDFLAGS="$X_LIBS" - QT_LIBS="$X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS" - QTE_NORTTI="" -else - dnl We're using QT Embedded - QT_CXXFLAGS="-fno-rtti -DQWS" - QT_LDFLAGS="-DQWS" - QT_LIBS="" - QTE_NORTTI="-fno-rtti -DQWS" -fi -AC_SUBST(QT_CXXFLAGS) -AC_SUBST(QT_LDFLAGS) -AC_SUBST(QT_LIBS) -AC_SUBST(QTE_NORTTI) -]) - -AC_DEFUN(QT_PRINT_PROGRAM, -[ -AC_REQUIRE([QT_CHECK_VERSION]) -cat > conftest.$ac_ext < -#include -EOF -if test "$qt_ver" = "2"; then -cat >> conftest.$ac_ext < -#include -#include -EOF - -if test $qt_subver -gt 0; then -cat >> conftest.$ac_ext < -EOF -fi -fi - -if test "$qt_ver" = "3"; then -cat >> conftest.$ac_ext < -#include -#include -EOF -fi - -echo "#if ! ($qt_verstring)" >> conftest.$ac_ext -cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD -fi - -rm -f conftest* -CXXFLAGS="$ac_cxxflags_safe" -LDFLAGS="$ac_ldflags_safe" -LIBS="$ac_libs_safe" - -LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" -export LD_LIBRARY_PATH -LIBRARY_PATH="$ac_LIBRARY_PATH" -export LIBRARY_PATH -AC_LANG_POP(C++) -]) - -if test "$kde_cv_qt_direct" = "yes"; then - AC_MSG_RESULT(yes) - $1 -else - AC_MSG_RESULT(no) - $2 -fi -]) - -dnl ------------------------------------------------------------------------ -dnl Try to find the Qt headers and libraries. -dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed) -dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed) -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_PATH_1_3, -[ -AC_REQUIRE([QT_PATH_X]) -AC_REQUIRE([QT_CHECK_VERSION]) - -dnl ------------------------------------------------------------------------ -dnl Add configure flag to enable linking to MT version of Qt library. -dnl ------------------------------------------------------------------------ - -AC_ARG_ENABLE( - mt, - [ --disable-mt link to non-threaded Qt (deprecated)], - qt_use_mt=$enableval, - [ - if test $qt_ver = 3; then - qt_use_mt=yes - else - qt_use_mt=no - fi - ] -) - -USING_QT_MT="" - -dnl ------------------------------------------------------------------------ -dnl If we not get --disable-qt-mt then adjust some vars for the host. -dnl ------------------------------------------------------------------------ - -QT_MT_LDFLAGS= -QT_MT_LIBS= -if test "x$qt_use_mt" = "xyes"; then - QT_CHECK_THREADING - if test "x$qt_use_threading" = "xyes"; then - QT_CXXFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $QT_CXXFLAGS" - QT_MT_LDFLAGS="$USE_THREADS" - QT_MT_LIBS="$LIBPTHREAD" - else - qt_use_mt=no - fi -fi -AC_SUBST(QT_MT_LDFLAGS) -AC_SUBST(QT_MT_LIBS) - -dnl ------------------------------------------------------------------------ -dnl If we haven't been told how to link to Qt, we work it out for ourselves. -dnl ------------------------------------------------------------------------ -if test -z "$LIBQT_GLOB"; then - if test "x$qt_use_emb" = "xyes"; then - LIBQT_GLOB="libqte.*" - else - LIBQT_GLOB="libqt.*" - fi -fi - -if test -z "$LIBQT"; then -dnl ------------------------------------------------------------ -dnl If we got --enable-embedded then adjust the Qt library name. -dnl ------------------------------------------------------------ - if test "x$qt_use_emb" = "xyes"; then - qtlib="qte" - else - qtlib="qt" - fi -fi - -if test -z "$LIBQPE"; then -dnl ------------------------------------------------------------ -dnl If we got --enable-palmtop then add -lqpe to the link line -dnl ------------------------------------------------------------ - if test "x$qt_use_emb" = "xyes"; then - if test "x$qt_use_emb_palm" = "xyes"; then - LIB_QPE="-lqpe" - else - LIB_QPE="" - fi - else - LIB_QPE="" - fi -fi - -dnl ------------------------------------------------------------------------ -dnl If we got --enable-qt-mt then adjust the Qt library name for the host. -dnl ------------------------------------------------------------------------ - -if test "x$qt_use_mt" = "xyes"; then - if test -z "$LIBQT"; then - LIBQT="-l$qtlib-mt" - else - LIBQT="$qtlib-mt" - fi - LIBQT_GLOB="lib$qtlib-mt.*" - USING_QT_MT="using -mt" -else - LIBQT="-l$qtlib" -fi - -AC_MSG_CHECKING([for Qt]) - -QT_LIBS="$LIBQT $QT_LIBS" -test -z "$QT_MT_LIBS" || QT_LIBS="$QT_LIBS $QT_MT_LIBS" - -ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO -qt_libraries="" -qt_includes="" -AC_ARG_WITH(qt-dir, - [ --with-qt-dir=DIR where the root of Qt is installed ], - [ ac_qt_includes="$withval"/include - ac_qt_libraries="$withval"/lib - ac_qt_bindir="$withval"/bin - ]) - -AC_ARG_WITH(qt-includes, - [ --with-qt-includes=DIR where the Qt includes are. ], - [ - ac_qt_includes="$withval" - ]) - -kde_qt_libs_given=no - -AC_ARG_WITH(qt-libraries, - [ --with-qt-libraries=DIR where the Qt library is installed.], - [ ac_qt_libraries="$withval" - kde_qt_libs_given=yes - ]) - -AC_CACHE_VAL(ac_cv_have_qt, -[#try to guess Qt locations - -qt_incdirs="" -for dir in $qt_dirs; do - qt_incdirs="$qt_incdirs $dir/include $dir" -done -qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes" -if test ! "$ac_qt_includes" = "NO"; then - qt_incdirs="$ac_qt_includes $qt_incdirs" -fi - -if test "$qt_ver" != "1"; then - kde_qt_header=qstyle.h -else - kde_qt_header=qglobal.h -fi - -QT_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) -ac_qt_includes="$qt_incdir" - -qt_libdirs="" -for dir in $qt_dirs; do - qt_libdirs="$qt_libdirs $dir/lib $dir" -done -qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries" -if test ! "$ac_qt_libraries" = "NO"; then - qt_libdir=$ac_qt_libraries -else - qt_libdirs="$ac_qt_libraries $qt_libdirs" - # if the Qt was given, the chance is too big that libqt.* doesn't exist - qt_libdir=NONE - for dir in $qt_libdirs; do - try="ls -1 $dir/${LIBQT_GLOB}" - if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AS_MESSAGE_LOG_FD; fi - done -fi - -ac_qt_libraries="$qt_libdir" - -AC_LANG_PUSH(C++) - -ac_cxxflags_safe="$CXXFLAGS" -ac_ldflags_safe="$LDFLAGS" -ac_libs_safe="$LIBS" - -CXXFLAGS="$CXXFLAGS -I$qt_incdir $QT_CXXFLAGS" -LDFLAGS="$LDFLAGS -L$qt_libdir $QT_LDFLAGS" -LIBS="$LIBS $QT_LIBS" - -QT_PRINT_PROGRAM - -if AC_TRY_EVAL(ac_link) && test -s conftest; then - rm -f conftest* -else - echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD - ac_qt_libraries="NO" -fi -rm -f conftest* -CXXFLAGS="$ac_cxxflags_safe" -LDFLAGS="$ac_ldflags_safe" -LIBS="$ac_libs_safe" - -AC_LANG_POP(C++) -if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then - ac_cv_have_qt="have_qt=no" - ac_qt_notfound="" - missing_qt_mt="" - if test "$ac_qt_includes" = NO; then - if test "$ac_qt_libraries" = NO; then - ac_qt_notfound="(headers and libraries)"; - else - ac_qt_notfound="(headers)"; - fi - else - if test "x$qt_use_mt" = "xyes"; then - missing_qt_mt=" -Make sure that you have compiled Qt with thread support!" - ac_qt_notfound="(library $qtlib-mt)"; - else - ac_qt_notfound="(library $qtlib)"; - fi - fi - - #AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation! - #For more details about this problem, look at the end of config.log.$missing_qt_mt]) - have_qt="no" -else - have_qt="yes" -fi -]) - -eval "$ac_cv_have_qt" - -if test "$have_qt" != yes; then - AC_MSG_RESULT([$have_qt]); -else - ac_cv_have_qt="have_qt=yes \ - ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" - AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) - - qt_libraries="$ac_qt_libraries" - qt_includes="$ac_qt_includes" -fi - -if test ! "$kde_qt_libs_given" = "yes"; then -QT_CHECK_DIRECT(qt_libraries= ,[]) -fi - -AC_SUBST(qt_libraries) -AC_SUBST(qt_includes) - -if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then - QT_INCLUDES="" -else - QT_INCLUDES="-I$qt_includes" -fi - -if test "$qt_libraries" != "$x_libraries" && test -n "$qt_libraries"; then - QT_LDFLAGS="$QT_LDFLAGS -L$qt_libraries" -fi -test -z "$QT_MT_LDFLAGS" || QT_LDFLAGS="$QT_LDFLAGS $QT_MT_LDFLAGS" - -AC_SUBST(QT_INCLUDES) -QT_PATH_MOC - - -AC_SUBST(LIB_QPE) -]) - -AC_DEFUN(QT_PATH, -[ -QT_PATH_1_3 -QT_CHECK_RPATH -]) - - -AC_DEFUN(QT_CHECK_COMPILER_FLAG, -[ -AC_MSG_CHECKING(whether $CXX supports -$1) -kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` -AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, -[ - AC_LANG_PUSH(C++) - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -$1" - AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) - CXXFLAGS="$save_CXXFLAGS" - AC_LANG_POP(C++) -]) -if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then - AC_MSG_RESULT(yes) - : - $2 -else - AC_MSG_RESULT(no) - : - $3 -fi -]) - -dnl QT_REMOVE_FORBIDDEN removes forbidden arguments from variables -dnl use: QT_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) -dnl it's all white-space separated -AC_DEFUN(QT_REMOVE_FORBIDDEN, -[ __val=$$1 - __forbid=" $2 " - if test -n "$__val"; then - __new="" - ac_save_IFS=$IFS - IFS=" " - for i in $__val; do - case "$__forbid" in - *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; - *) # Careful to not add spaces, where there were none, because otherwise - # libtool gets confused, if we change e.g. CXX - if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; - esac - done - IFS=$ac_save_IFS - $1=$__new - fi -]) - -dnl QT_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given -AC_DEFUN(QT_VALIDIFY_CXXFLAGS, -[dnl -if test "x$qt_use_emb" != "xyes"; then - QT_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) - QT_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) -else - QT_REMOVE_FORBIDDEN(CXX, [-rpath]) - QT_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) -fi -]) - -AC_DEFUN(QT_CHECK_COMPILERS, -[ - AC_PROG_CXX - - QT_CHECK_COMPILER_FLAG(fexceptions,[QT_CXXFLAGS="$QT_CXXFLAGS -fexceptions"]) - - case "$host" in - *-*-irix*) test "$GXX" = yes && QT_CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $QT_CXXFLAGS" ;; - *-*-sysv4.2uw*) QT_CXXFLAGS="-D_UNIXWARE $QT_CXXFLAGS";; - *-*-sysv5uw7*) QT_CXXFLAGS="-D_UNIXWARE7 $QT_CXXFLAGS";; - *-*-solaris*) - if test "$GXX" = yes; then - libstdcpp=`$CXX -print-file-name=libstdc++.so` - if test ! -f $libstdcpp; then - AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with the Qt pinentry. Please recompile gcc with --enable-shared to receive a libstdc++.so]) - fi - fi - ;; - esac - - QT_VALIDIFY_CXXFLAGS - - AC_PROG_CXXCPP -]) - -AC_DEFUN(QT_CHECK_RPATH, -[ -AC_MSG_CHECKING(for rpath) -AC_ARG_ENABLE(rpath, - [ --disable-rpath do not use the rpath feature of ld], - USE_RPATH=$enableval, USE_RPATH=yes) - -if test -z "$QT_RPATH" && test "$USE_RPATH" = "yes"; then - - QT_RPATH="" - if test -n "$qt_libraries"; then - QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(qt_libraries)" - fi - dnl $x_libraries is set to /usr/lib in case - if test -n "$X_LIBS"; then - QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(x_libraries)" - fi -fi -AC_SUBST(x_libraries) -AC_SUBST(QT_RPATH) -AC_MSG_RESULT($USE_RPATH) -]) - - -AC_DEFUN(QT_CHECK_LIBPTHREAD, -[ -AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] ) -AC_SUBST(LIBPTHREAD) -]) - -AC_DEFUN(QT_CHECK_PTHREAD_OPTION, -[ - AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.], - kde_use_kernthreads=$enableval, kde_use_kernthreads=no) - - if test "$kde_use_kernthreads" = "yes"; then - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_CFLAGS="$CXXFLAGS" - CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS" - CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS" - AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h) - CXXFLAGS="$ac_save_CXXFLAGS" - CFLAGS="$ac_save_CFLAGS" - if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then - kde_use_kernthreads=no - else - dnl Add proper -I and -l statements - AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD - if test "x$LIBPTHREAD" = "x"; then - kde_use_kernthreads=no - else - USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads" - fi - fi - else - USE_THREADS="" - if test -z "$LIBPTHREAD"; then - QT_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] ) - fi - fi - - case $host_os in - solaris*) - QT_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) - QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" - ;; - freebsd*) - QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" - ;; - aix*) - QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" - LIBPTHREAD="$LIBPTHREAD -lc_r" - ;; - linux*) QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT" - if test "$CXX" = "KCC"; then - QT_CXXFLAGS="$QT_CXXFLAGS --thread_safe" - fi - ;; - *) - ;; - esac - AC_SUBST(USE_THREADS) - AC_SUBST(LIBPTHREAD) -]) - -AC_DEFUN(QT_CHECK_THREADING, -[ - AC_REQUIRE([QT_CHECK_LIBPTHREAD]) - AC_REQUIRE([QT_CHECK_PTHREAD_OPTION]) - dnl default is yes if libpthread is found and no if no libpthread is available - if test -z "$LIBPTHREAD"; then - if test -z "$USE_THREADS"; then - kde_check_threading_default=no - else - kde_check_threading_default=yes - fi - else - kde_check_threading_default=yes - fi - AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ], - qt_use_threading=$enableval, qt_use_threading=$kde_check_threading_default) - if test "x$qt_use_threading" = "xyes"; then - AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) - fi -]) diff -urpP pinentry-0.7.1/aclocal.m4 pinentry-0.7.2/aclocal.m4 --- pinentry-0.7.1/aclocal.m4 2004-04-21 19:33:17.000000000 +0000 +++ pinentry-0.7.2/aclocal.m4 2005-01-27 08:05:34.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.7.9 -*- Autoconf -*- +# generated automatically by aclocal 1.9.4 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,1630 +11,830 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -dnl Autoconf macros used by PINENTRY -dnl -dnl Copyright (C) 2002 g10 Code GmbH -dnl -dnl IU_LIB_NCURSES, IU_LIB_CURSES and IU_LIB_TERMCAP are: -dnl Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. -dnl Written by Miles Bader -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -dnl - -dnl IU_LIB_NCURSES -- check for, and configure, ncurses -dnl -dnl If libncurses is found to exist on this system and the --disable-ncurses -dnl flag wasn't specified, defines LIBNCURSES with the appropriate linker -dnl specification, and possibly defines NCURSES_INCLUDE with the appropriate -dnl -I flag to get access to ncurses include files. -dnl -AC_DEFUN([IU_LIB_NCURSES], [ - AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses], - , enable_ncurses=yes) - if test "$enable_ncurses" = yes; then - AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses") - if test "$LIBNCURSES"; then - # Use ncurses header files instead of the ordinary ones, if possible; - # is there a better way of doing this, that avoids looking in specific - # directories? - AC_ARG_WITH(ncurses-include-dir, -[ --with-ncurses-include-dir=DIR - Set directory containing the include files for - use with -lncurses, when it isn't installed as - the default curses library. If DIR is "none", - then no special ncurses include files are used. - --without-ncurses-include-dir - Equivalent to --with-ncurses-include-dir=none])dnl - if test "${with_ncurses_include_dir+set}" = set; then - AC_MSG_CHECKING(for ncurses include dir) - case "$with_ncurses_include_dir" in - no|none) - inetutils_cv_includedir_ncurses=none;; - *) - inetutils_cv_includedir_ncurses="$with_ncurses_include_dir";; - esac - AC_MSG_RESULT($inetutils_cv_includedir_ncurses) - else - AC_CACHE_CHECK(for ncurses include dir, - inetutils_cv_includedir_ncurses, - for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do - if test -d $D/ncurses; then - inetutils_cv_includedir_ncurses="$D/ncurses" - break - fi - test "$inetutils_cv_includedir_ncurses" \ - || inetutils_cv_includedir_ncurses=none - done) - fi - if test "$inetutils_cv_includedir_ncurses" = none; then - NCURSES_INCLUDE="" - else - NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses" - fi - fi - fi - AC_SUBST(NCURSES_INCLUDE) - AC_SUBST(LIBNCURSES)])dnl - -dnl IU_LIB_TERMCAP -- check for various termcap libraries -dnl -dnl Checks for various common libraries implementing the termcap interface, -dnl including ncurses (unless --disable ncurses is specified), curses (which -dnl does on some systems), termcap, and termlib. If termcap is found, then -dnl LIBTERMCAP is defined with the appropriate linker specification. -dnl -AC_DEFUN([IU_LIB_TERMCAP], [ - AC_REQUIRE([IU_LIB_NCURSES]) - if test "$LIBNCURSES"; then - LIBTERMCAP="$LIBNCURSES" - else - AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses) - if test "$ac_cv_lib_curses_tgetent" = no; then - AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap) - fi - if test "$ac_cv_lib_termcap_tgetent" = no; then - AC_CHECK_LIB(termlib, tgetent, LIBTERMCAP=-ltermlib) - fi - fi - AC_SUBST(LIBTERMCAP)])dnl - -dnl IU_LIB_CURSES -- checke for curses, and associated libraries -dnl -dnl Checks for varions libraries implementing the curses interface, and if -dnl found, defines LIBCURSES to be the appropriate linker specification, -dnl *including* any termcap libraries if needed (some versions of curses -dnl don't need termcap). -dnl -AC_DEFUN([IU_LIB_CURSES], [ - AC_REQUIRE([IU_LIB_TERMCAP]) - AC_REQUIRE([IU_LIB_NCURSES]) - if test "$LIBNCURSES"; then - LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap - else - _IU_SAVE_LIBS="$LIBS" - LIBS="$LIBTERMCAP" - AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses") - if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then - AC_CACHE_CHECK(whether curses needs $LIBTERMCAP, - inetutils_cv_curses_needs_termcap, - LIBS="$LIBCURSES" - AC_TRY_LINK([#include ], [initscr ();], - [inetutils_cv_curses_needs_termcap=no], - [inetutils_cv_curses_needs_termcap=yes])) - if test $inetutils_cv_curses_needs_termcap = yes; then - LIBCURSES="$LIBCURSES $LIBTERMCAP" - fi - fi - LIBS="$_IU_SAVE_LIBS" - fi - AC_SUBST(LIBCURSES)])dnl -dnl additional configure macros - -# -# From /usr/share/aclocal/iconv.m4. -# -#serial AM2 - -dnl From Bruno Haible. - -AC_DEFUN([AM_ICONV], -[ - dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and - dnl those with the standalone portable GNU libiconv installed). - - AC_ARG_WITH([libiconv-prefix], -[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ - for dir in `echo "$withval" | tr : ' '`; do - if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi - if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi - done - ]) - - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_func_iconv=yes) - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS -liconv" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) - LIBS="$am_save_LIBS" - fi - ]) - if test "$am_cv_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_TRY_COMPILE([ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) - am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, - [Define as const if the declaration of iconv() needs const.]) - fi - LIBICONV= - if test "$am_cv_lib_iconv" = yes; then - LIBICONV="-liconv" - fi - AC_SUBST(LIBICONV) -]) - - -dnl -dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME) -dnl Check whether a typedef exists and create a #define $2 if it exists -dnl -AC_DEFUN(GNUPG_CHECK_TYPEDEF, - [ AC_MSG_CHECKING(for $1 typedef) - AC_CACHE_VAL(gnupg_cv_typedef_$1, - [AC_TRY_COMPILE([#define _GNU_SOURCE 1 - #include - #include ], [ - #undef $1 - int a = sizeof($1); - ], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )]) - AC_MSG_RESULT($gnupg_cv_typedef_$1) - if test "$gnupg_cv_typedef_$1" = yes; then - AC_DEFINE($2,1,[Defined if a `]$1[' is typedef'd]) - fi - ]) - - -# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock -# is not called from uid 0 (not tested whether uid 0 works) -# For DECs Tru64 we have also to check whether mlock is in librt -# mlock is there a macro using memlk() -dnl GNUPG_CHECK_MLOCK -dnl -define(GNUPG_CHECK_MLOCK, - [ AC_CHECK_FUNCS(mlock) - if test "$ac_cv_func_mlock" = "no"; then - AC_CHECK_HEADERS(sys/mman.h) - if test "$ac_cv_header_sys_mman_h" = "yes"; then - # Add librt to LIBS: - AC_CHECK_LIB(rt, memlk) - AC_CACHE_CHECK([whether mlock is in sys/mman.h], - gnupg_cv_mlock_is_in_sys_mman, - [AC_TRY_LINK([ - #include - #ifdef HAVE_SYS_MMAN_H - #include - #endif - ], [ - int i; - - /* glibc 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_mlock) || defined (__stub___mlock) - choke me - #else - mlock(&i, 4); - #endif - ; return 0; - ], - gnupg_cv_mlock_is_in_sys_mman=yes, - gnupg_cv_mlock_is_in_sys_mman=no)]) - if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then - AC_DEFINE(HAVE_MLOCK,1, - [Defined if the system supports an mlock() call]) - fi - fi - fi - if test "$ac_cv_func_mlock" = "yes"; then - AC_MSG_CHECKING(whether mlock is broken) - AC_CACHE_VAL(gnupg_cv_have_broken_mlock, - AC_TRY_RUN([ - #include - #include - #include - #include - #include - #include - - int main() - { - char *pool; - int err; - long int pgsize = getpagesize(); - - pool = malloc( 4096 + pgsize ); - if( !pool ) - return 2; - pool += (pgsize - ((long int)pool % pgsize)); - - err = mlock( pool, 4096 ); - if( !err || errno == EPERM ) - return 0; /* okay */ - - return 1; /* hmmm */ - } - - ], - gnupg_cv_have_broken_mlock="no", - gnupg_cv_have_broken_mlock="yes", - gnupg_cv_have_broken_mlock="assume-no" - ) - ) - if test "$gnupg_cv_have_broken_mlock" = "yes"; then - AC_DEFINE(HAVE_BROKEN_MLOCK,1, - [Defined if the mlock() call does not work]) - AC_MSG_RESULT(yes) - AC_CHECK_FUNCS(plock) - else - if test "$gnupg_cv_have_broken_mlock" = "no"; then - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(assuming no) - fi - fi - fi - ]) - -# Configure paths for GLIB -# Owen Taylor 97-11-3 - -dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or -dnl gthread is specified in MODULES, pass to glib-config -dnl -AC_DEFUN(AM_PATH_GLIB, -[dnl -dnl Get the cflags and libraries from the glib-config script -dnl -AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], - glib_config_prefix="$withval", glib_config_prefix="") -AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], - glib_config_exec_prefix="$withval", glib_config_exec_prefix="") -AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], - , enable_glibtest=yes) - - if test x$glib_config_exec_prefix != x ; then - glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config - fi - fi - if test x$glib_config_prefix != x ; then - glib_config_args="$glib_config_args --prefix=$glib_config_prefix" - if test x${GLIB_CONFIG+set} != xset ; then - GLIB_CONFIG=$glib_config_prefix/bin/glib-config - fi - fi - - for module in . $4 - do - case "$module" in - gmodule) - glib_config_args="$glib_config_args gmodule" - ;; - gthread) - glib_config_args="$glib_config_args gthread" - ;; - esac - done - - AC_PATH_PROG(GLIB_CONFIG, glib-config, no) - min_glib_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) - no_glib="" - if test "$GLIB_CONFIG" = "no" ; then - no_glib=yes - else - GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` - GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` - glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_glibtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$GLIB_LIBS $LIBS" -dnl -dnl Now check if the installed GLIB is sufficiently new. (Also sanity -dnl checks the results of glib-config to some extent -dnl - rm -f conf.glibtest - AC_TRY_RUN([ -#include -#include -#include - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.glibtest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_glib_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_glib_version"); - exit(1); - } - - if ((glib_major_version != $glib_config_major_version) || - (glib_minor_version != $glib_config_minor_version) || - (glib_micro_version != $glib_config_micro_version)) - { - printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", - $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, - glib_major_version, glib_minor_version, glib_micro_version); - printf ("*** was found! If glib-config was correct, then it is best\n"); - printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); - printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } - else if ((glib_major_version != GLIB_MAJOR_VERSION) || - (glib_minor_version != GLIB_MINOR_VERSION) || - (glib_micro_version != GLIB_MICRO_VERSION)) - { - printf("*** GLIB header files (version %d.%d.%d) do not match\n", - GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - glib_major_version, glib_minor_version, glib_micro_version); - } - else - { - if ((glib_major_version > major) || - ((glib_major_version == major) && (glib_minor_version > minor)) || - ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", - glib_major_version, glib_minor_version, glib_micro_version); - printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the glib-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); - printf("*** correct copy of glib-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_glib" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$GLIB_CONFIG" = "no" ; then - echo "*** The glib-config script installed by GLIB could not be found" - echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GLIB_CONFIG environment variable to the" - echo "*** full path to glib-config." - else - if test -f conf.glibtest ; then - : - else - echo "*** Could not run GLIB test program, checking why..." - CFLAGS="$CFLAGS $GLIB_CFLAGS" - LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GLIB or finding the wrong" - echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GLIB was incorrectly installed" - echo "*** or that you have moved GLIB since it was installed. In the latter case, you" - echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GLIB_CFLAGS="" - GLIB_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) - rm -f conf.glibtest -]) - - -# Configure paths for GTK+ -# Owen Taylor 97-11-3 - -dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS -dnl -AC_DEFUN(AM_PATH_GTK, -[dnl -dnl Get the cflags and libraries from the gtk-config script -dnl -AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], - gtk_config_prefix="$withval", gtk_config_prefix="") -AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], - gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") -AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], - , enable_gtktest=yes) - - for module in . $4 - do - case "$module" in - gthread) - gtk_config_args="$gtk_config_args gthread" - ;; - esac - done - - if test x$gtk_config_exec_prefix != x ; then - gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config - fi - fi - if test x$gtk_config_prefix != x ; then - gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" - if test x${GTK_CONFIG+set} != xset ; then - GTK_CONFIG=$gtk_config_prefix/bin/gtk-config - fi - fi - - AC_PATH_PROG(GTK_CONFIG, gtk-config, no) - min_gtk_version=ifelse([$1], ,0.99.7,$1) - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) - no_gtk="" - if test "$GTK_CONFIG" = "no" ; then - no_gtk=yes +# lib-ld.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` - GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` - gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_gtktest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$GTK_LIBS $LIBS" -dnl -dnl Now check if the installed GTK is sufficiently new. (Also sanity -dnl checks the results of gtk-config to some extent -dnl - rm -f conf.gtktest - AC_TRY_RUN([ -#include -#include -#include - -int -main () -{ - int major, minor, micro; - char *tmp_version; - - system ("touch conf.gtktest"); - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = g_strdup("$min_gtk_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - exit(1); - } - - if ((gtk_major_version != $gtk_config_major_version) || - (gtk_minor_version != $gtk_config_minor_version) || - (gtk_micro_version != $gtk_config_micro_version)) - { - printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", - $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf ("*** was found! If gtk-config was correct, then it is best\n"); - printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); - printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } -#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) - else if ((gtk_major_version != GTK_MAJOR_VERSION) || - (gtk_minor_version != GTK_MINOR_VERSION) || - (gtk_micro_version != GTK_MICRO_VERSION)) - { - printf("*** GTK+ header files (version %d.%d.%d) do not match\n", - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - printf("*** library (version %d.%d.%d)\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - } -#endif /* defined (GTK_MAJOR_VERSION) ... */ - else - { - if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); - printf("*** correct copy of gtk-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; -} -],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_gtk" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$GTK_CONFIG" = "no" ; then - echo "*** The gtk-config script installed by GTK could not be found" - echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GTK_CONFIG environment variable to the" - echo "*** full path to gtk-config." - else - if test -f conf.gtktest ; then - : - else - echo "*** Could not run GTK test program, checking why..." - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GTK or finding the wrong" - echo "*** version of GTK. If it is not finding GTK, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps gtk gtk-devel" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GTK was incorrectly installed" - echo "*** or that you have moved GTK since it was installed. In the latter case, you" - echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - GTK_CFLAGS="" - GTK_LIBS="" - ifelse([$3], , :, [$3]) + PATH_SEPARATOR=: fi - AC_SUBST(GTK_CFLAGS) - AC_SUBST(GTK_LIBS) - rm -f conf.gtktest -]) - - -dnl This file is part of the KDE libraries/packages -dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) -dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) -dnl (C) 2002 g10 Code GmbH -dnl Modified for PINENTRY by Marcus Brinkmann. -dnl -dnl This file is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Library General Public -dnl License as published by the Free Software Foundation; either -dnl version 2 of the License, or (at your option) any later version. - -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Library General Public License for more details. - -dnl You should have received a copy of the GNU Library General Public License -dnl along with this library; see the file COPYING.LIB. If not, write to -dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -dnl Boston, MA 02111-1307, USA. - -dnl ------------------------------------------------------------------------ -dnl Find a file (or one of more files in a list of dirs) -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_FIND_FILE, -[ -$3=NO -for i in $2; -do - for j in $1; - do - echo "configure: __oline__: $i/$j" >&AS_MESSAGE_LOG_FD - if test -r "$i/$j"; then - echo "taking that" >&AS_MESSAGE_LOG_FD - $3=$i - break 2 - fi - done -done -]) - -dnl ------------------------------------------------------------------------ -dnl Find the meta object compiler in the PATH, -dnl in $QTDIR/bin, and some more usual places -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_PATH_MOC, -[ - qt_bindirs="" - for dir in $qt_dirs; do - qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc" - done - qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin" - if test ! "$ac_qt_bindir" = "NO"; then - qt_bindirs="$ac_qt_bindir:$qt_bindirs" - fi - - AC_PATH_PROG(MOC, moc, no, [$qt_bindirs]) - if test "$MOC" = no; then - #AC_MSG_ERROR([No Qt meta object compiler (moc) found! - #Please check whether you installed Qt correctly. - #You need to have a running moc binary. - #configure tried to run $ac_cv_path_moc and the test didn't - #succeed. If configure shouldn't have tried this one, set - #the environment variable MOC to the right one before running - #configure. - #]) - have_moc="no" - else - have_moc="yes" - AC_SUBST(MOC) - fi -]) - - -dnl ------------------------------------------------------------------------ -dnl Find the header files and libraries for the X Window System. -dnl Extended the macro AC_PATH_XTRA. -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_PATH_X, -[ -AC_ARG_ENABLE( - embedded, - [ --enable-embedded link to Qt-embedded, don't use X], - qt_use_emb=$enableval, - qt_use_emb=no -) - -AC_ARG_ENABLE( - palmtop, - [ --enable-palmtop link to Qt-embedded, don't use X, link to the Qt Palmtop Environment], - qt_use_emb_palm=$enableval, - qt_use_emb_palm=no -) - -if test "$qt_use_emb" = "no"; then - AC_PATH_X - AC_PATH_XTRA - if test "$no_x" = yes; then - AC_MSG_ERROR([Can't find X. Please check your installation and add the correct paths!]) - fi - QT_CXXFLAGS="$X_CFLAGS" - QT_LDFLAGS="$X_LIBS" - QT_LIBS="$X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS" - QTE_NORTTI="" -else - dnl We're using QT Embedded - QT_CXXFLAGS="-fno-rtti -DQWS" - QT_LDFLAGS="-DQWS" - QT_LIBS="" - QTE_NORTTI="-fno-rtti -DQWS" + rm -f conf$$.sh fi -AC_SUBST(QT_CXXFLAGS) -AC_SUBST(QT_LDFLAGS) -AC_SUBST(QT_LIBS) -AC_SUBST(QTE_NORTTI) -]) - -AC_DEFUN(QT_PRINT_PROGRAM, -[ -AC_REQUIRE([QT_CHECK_VERSION]) -cat > conftest.$ac_ext < -#include -EOF -if test "$qt_ver" = "2"; then -cat >> conftest.$ac_ext < -#include -#include -EOF - -if test $qt_subver -gt 0; then -cat >> conftest.$ac_ext < -EOF -fi -fi - -if test "$qt_ver" = "3"; then -cat >> conftest.$ac_ext < -#include -#include -EOF -fi - -echo "#if ! ($qt_verstring)" >> conftest.$ac_ext -cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path 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 - qt_subver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'` - # following is the check if subversion isn´t found in passed argument - if test "$qt_subver" = "$1"; then - qt_subver=1 - fi - qt_ver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'` - if test "$qt_ver" = "1"; then - qt_subver=42 - fi + AC_MSG_CHECKING([for non-GNU ld]) fi - -if test -z "$2"; then - if test "$qt_ver" = "2"; then - if test $qt_subver -gt 0; then - qt_minversion=">= Qt 2.2.2" - else - qt_minversion=">= Qt 2.0.2" +AC_CACHE_VAL(acl_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac fi - fi - if test "$qt_ver" = "3"; then - qt_minversion=">= Qt 3.0.1" - fi - if test "$qt_ver" = "1"; then - qt_minversion=">= 1.42 and < 2.0" - fi -else - qt_minversion=$2 -fi - -if test -z "$3"; then - if test $qt_ver = 3; then - qt_verstring="QT_VERSION >= 301" - fi - if test $qt_ver = 2; then - if test $qt_subver -gt 0; then - qt_verstring="QT_VERSION >= 222" - else - qt_verstring="QT_VERSION >= 200" - fi - fi - if test $qt_ver = 1; then - qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" - fi -else - qt_verstring=$3 -fi - -if test $qt_ver = 3; then - qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt" -fi -if test $qt_ver = 2; then - qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt" -fi -if test $qt_ver = 1; then - qt_dirs="$QTDIR /usr/lib/qt" -fi -]) - - -AC_DEFUN(QT_CHECK_DIRECT, -[ -AC_REQUIRE([QT_CHECK_VERSION]) -AC_MSG_CHECKING([if Qt compiles without flags]) -AC_CACHE_VAL(kde_cv_qt_direct, -[ -AC_LANG_PUSH(C++) -ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH -ac_LIBRARY_PATH="$LIBRARY_PATH" -ac_cxxflags_safe="$CXXFLAGS" -ac_ldflags_safe="$LDFLAGS" -ac_libs_safe="$LIBS" - -CXXFLAGS="$CXXFLAGS -I$qt_includes" -LDFLAGS="$LDFLAGS $QT_LDFLAGS" -LIBS="$QT_LIBS" -LD_LIBRARY_PATH= -export LD_LIBRARY_PATH -LIBRARY_PATH= -export LIBRARY_PATH - -QT_PRINT_PROGRAM - -if AC_TRY_EVAL(ac_link) && test -s conftest; then - kde_cv_qt_direct="yes" + done + IFS="$ac_save_ifs" else - kde_cv_qt_direct="no" - echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD -fi - -rm -f conftest* -CXXFLAGS="$ac_cxxflags_safe" -LDFLAGS="$ac_ldflags_safe" -LIBS="$ac_libs_safe" - -LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" -export LD_LIBRARY_PATH -LIBRARY_PATH="$ac_LIBRARY_PATH" -export LIBRARY_PATH -AC_LANG_POP(C++) -]) - -if test "$kde_cv_qt_direct" = "yes"; then - AC_MSG_RESULT(yes) - $1 + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) - $2 fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU ]) -dnl ------------------------------------------------------------------------ -dnl Try to find the Qt headers and libraries. -dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed) -dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed) -dnl ------------------------------------------------------------------------ -dnl -AC_DEFUN(QT_PATH_1_3, -[ -AC_REQUIRE([QT_PATH_X]) -AC_REQUIRE([QT_CHECK_VERSION]) +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. -dnl ------------------------------------------------------------------------ -dnl Add configure flag to enable linking to MT version of Qt library. -dnl ------------------------------------------------------------------------ - -AC_ARG_ENABLE( - mt, - [ --disable-mt link to non-threaded Qt (deprecated)], - qt_use_mt=$enableval, - [ - if test $qt_ver = 3; then - qt_use_mt=yes - else - qt_use_mt=no - fi - ] -) - -USING_QT_MT="" - -dnl ------------------------------------------------------------------------ -dnl If we not get --disable-qt-mt then adjust some vars for the host. -dnl ------------------------------------------------------------------------ - -QT_MT_LDFLAGS= -QT_MT_LIBS= -if test "x$qt_use_mt" = "xyes"; then - QT_CHECK_THREADING - if test "x$qt_use_threading" = "xyes"; then - QT_CXXFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $QT_CXXFLAGS" - QT_MT_LDFLAGS="$USE_THREADS" - QT_MT_LIBS="$LIBPTHREAD" - else - qt_use_mt=no - fi -fi -AC_SUBST(QT_MT_LDFLAGS) -AC_SUBST(QT_MT_LIBS) - -dnl ------------------------------------------------------------------------ -dnl If we haven't been told how to link to Qt, we work it out for ourselves. -dnl ------------------------------------------------------------------------ -if test -z "$LIBQT_GLOB"; then - if test "x$qt_use_emb" = "xyes"; then - LIBQT_GLOB="libqte.*" - else - LIBQT_GLOB="libqt.*" - fi -fi +dnl From Bruno Haible. -if test -z "$LIBQT"; then -dnl ------------------------------------------------------------ -dnl If we got --enable-embedded then adjust the Qt library name. -dnl ------------------------------------------------------------ - if test "x$qt_use_emb" = "xyes"; then - qtlib="qte" +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) else - qtlib="qt" - fi -fi - -if test -z "$LIBQPE"; then -dnl ------------------------------------------------------------ -dnl If we got --enable-palmtop then add -lqpe to the link line -dnl ------------------------------------------------------------ - if test "x$qt_use_emb" = "xyes"; then - if test "x$qt_use_emb_palm" = "xyes"; then - LIB_QPE="-lqpe" + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no else - LIB_QPE="" + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi fi - else - LIB_QPE="" - fi -fi - -dnl ------------------------------------------------------------------------ -dnl If we got --enable-qt-mt then adjust the Qt library name for the host. -dnl ------------------------------------------------------------------------ - -if test "x$qt_use_mt" = "xyes"; then - if test -z "$LIBQT"; then - LIBQT="-l$qtlib-mt" - else - LIBQT="$qtlib-mt" - fi - LIBQT_GLOB="lib$qtlib-mt.*" - USING_QT_MT="using -mt" -else - LIBQT="-l$qtlib" -fi - -AC_MSG_CHECKING([for Qt]) - -QT_LIBS="$LIBQT $QT_LIBS" -test -z "$QT_MT_LIBS" || QT_LIBS="$QT_LIBS $QT_MT_LIBS" - -ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO -qt_libraries="" -qt_includes="" -AC_ARG_WITH(qt-dir, - [ --with-qt-dir=DIR where the root of Qt is installed ], - [ ac_qt_includes="$withval"/include - ac_qt_libraries="$withval"/lib - ac_qt_bindir="$withval"/bin - ]) - -AC_ARG_WITH(qt-includes, - [ --with-qt-includes=DIR where the Qt includes are. ], - [ - ac_qt_includes="$withval" - ]) - -kde_qt_libs_given=no - -AC_ARG_WITH(qt-libraries, - [ --with-qt-libraries=DIR where the Qt library is installed.], - [ ac_qt_libraries="$withval" - kde_qt_libs_given=yes - ]) - -AC_CACHE_VAL(ac_cv_have_qt, -[#try to guess Qt locations - -qt_incdirs="" -for dir in $qt_dirs; do - qt_incdirs="$qt_incdirs $dir/include $dir" -done -qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes" -if test ! "$ac_qt_includes" = "NO"; then - qt_incdirs="$ac_qt_includes $qt_incdirs" -fi - -if test "$qt_ver" != "1"; then - kde_qt_header=qstyle.h -else - kde_qt_header=qglobal.h -fi - -QT_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) -ac_qt_includes="$qt_incdir" - -qt_libdirs="" -for dir in $qt_dirs; do - qt_libdirs="$qt_libdirs $dir/lib $dir" -done -qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries" -if test ! "$ac_qt_libraries" = "NO"; then - qt_libdir=$ac_qt_libraries -else - qt_libdirs="$ac_qt_libraries $qt_libdirs" - # if the Qt was given, the chance is too big that libqt.* doesn't exist - qt_libdir=NONE - for dir in $qt_libdirs; do - try="ls -1 $dir/${LIBQT_GLOB}" - if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AS_MESSAGE_LOG_FD; fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done done -fi - -ac_qt_libraries="$qt_libdir" - -AC_LANG_PUSH(C++) - -ac_cxxflags_safe="$CXXFLAGS" -ac_ldflags_safe="$LDFLAGS" -ac_libs_safe="$LIBS" - -CXXFLAGS="$CXXFLAGS -I$qt_incdir $QT_CXXFLAGS" -LDFLAGS="$LDFLAGS -L$qt_libdir $QT_LDFLAGS" -LIBS="$LIBS $QT_LIBS" - -QT_PRINT_PROGRAM - -if AC_TRY_EVAL(ac_link) && test -s conftest; then - rm -f conftest* -else - echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD - ac_qt_libraries="NO" -fi -rm -f conftest* -CXXFLAGS="$ac_cxxflags_safe" -LDFLAGS="$ac_ldflags_safe" -LIBS="$ac_libs_safe" - -AC_LANG_POP(C++) -if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then - ac_cv_have_qt="have_qt=no" - ac_qt_notfound="" - missing_qt_mt="" - if test "$ac_qt_includes" = NO; then - if test "$ac_qt_libraries" = NO; then - ac_qt_notfound="(headers and libraries)"; - else - ac_qt_notfound="(headers)"; - fi - else - if test "x$qt_use_mt" = "xyes"; then - missing_qt_mt=" -Make sure that you have compiled Qt with thread support!" - ac_qt_notfound="(library $qtlib-mt)"; + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else - ac_qt_notfound="(library $qtlib)"; + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done fi fi - - #AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation! - #For more details about this problem, look at the end of config.log.$missing_qt_mt]) - have_qt="no" -else - have_qt="yes" -fi -]) - -eval "$ac_cv_have_qt" - -if test "$have_qt" != yes; then - AC_MSG_RESULT([$have_qt]); -else - ac_cv_have_qt="have_qt=yes \ - ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" - AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) - - qt_libraries="$ac_qt_libraries" - qt_includes="$ac_qt_includes" -fi - -if test ! "$kde_qt_libs_given" = "yes"; then -QT_CHECK_DIRECT(qt_libraries= ,[]) -fi - -AC_SUBST(qt_libraries) -AC_SUBST(qt_includes) - -if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then - QT_INCLUDES="" -else - QT_INCLUDES="-I$qt_includes" -fi - -if test "$qt_libraries" != "$x_libraries" && test -n "$qt_libraries"; then - QT_LDFLAGS="$QT_LDFLAGS -L$qt_libraries" -fi -test -z "$QT_MT_LDFLAGS" || QT_LDFLAGS="$QT_LDFLAGS $QT_MT_LDFLAGS" - -AC_SUBST(QT_INCLUDES) -QT_PATH_MOC - - -AC_SUBST(LIB_QPE) -]) - -AC_DEFUN(QT_PATH, -[ -QT_PATH_1_3 -QT_CHECK_RPATH -]) - - -AC_DEFUN(QT_CHECK_COMPILER_FLAG, -[ -AC_MSG_CHECKING(whether $CXX supports -$1) -kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` -AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, -[ - AC_LANG_PUSH(C++) - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -$1" - AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) - CXXFLAGS="$save_CXXFLAGS" - AC_LANG_POP(C++) -]) -if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then - AC_MSG_RESULT(yes) - : - $2 -else - AC_MSG_RESULT(no) - : - $3 -fi -]) - -dnl QT_REMOVE_FORBIDDEN removes forbidden arguments from variables -dnl use: QT_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) -dnl it's all white-space separated -AC_DEFUN(QT_REMOVE_FORBIDDEN, -[ __val=$$1 - __forbid=" $2 " - if test -n "$__val"; then - __new="" - ac_save_IFS=$IFS - IFS=" " - for i in $__val; do - case "$__forbid" in - *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; - *) # Careful to not add spaces, where there were none, because otherwise - # libtool gets confused, if we change e.g. CXX - if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; - esac + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done - IFS=$ac_save_IFS - $1=$__new fi ]) -dnl QT_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given -AC_DEFUN(QT_VALIDIFY_CXXFLAGS, -[dnl -if test "x$qt_use_emb" != "xyes"; then - QT_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) - QT_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) -else - QT_REMOVE_FORBIDDEN(CXX, [-rpath]) - QT_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) -fi -]) - -AC_DEFUN(QT_CHECK_COMPILERS, +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], [ - AC_PROG_CXX - - QT_CHECK_COMPILER_FLAG(fexceptions,[QT_CXXFLAGS="$QT_CXXFLAGS -fexceptions"]) - - case "$host" in - *-*-irix*) test "$GXX" = yes && QT_CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $QT_CXXFLAGS" ;; - *-*-sysv4.2uw*) QT_CXXFLAGS="-D_UNIXWARE $QT_CXXFLAGS";; - *-*-sysv5uw7*) QT_CXXFLAGS="-D_UNIXWARE7 $QT_CXXFLAGS";; - *-*-solaris*) - if test "$GXX" = yes; then - libstdcpp=`$CXX -print-file-name=libstdc++.so` - if test ! -f $libstdcpp; then - AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with the Qt pinentry. Please recompile gcc with --enable-shared to receive a libstdc++.so]) - fi - fi - ;; - esac - - QT_VALIDIFY_CXXFLAGS - - AC_PROG_CXXCPP + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done ]) -AC_DEFUN(QT_CHECK_RPATH, -[ -AC_MSG_CHECKING(for rpath) -AC_ARG_ENABLE(rpath, - [ --disable-rpath do not use the rpath feature of ld], - USE_RPATH=$enableval, USE_RPATH=yes) - -if test -z "$QT_RPATH" && test "$USE_RPATH" = "yes"; then - - QT_RPATH="" - if test -n "$qt_libraries"; then - QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(qt_libraries)" - fi - dnl $x_libraries is set to /usr/lib in case - if test -n "$X_LIBS"; then - QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(x_libraries)" - fi -fi -AC_SUBST(x_libraries) -AC_SUBST(QT_RPATH) -AC_MSG_RESULT($USE_RPATH) -]) +# lib-prefix.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. +dnl From Bruno Haible. -AC_DEFUN(QT_CHECK_LIBPTHREAD, +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], [ -AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] ) -AC_SUBST(LIBPTHREAD) -]) - -AC_DEFUN(QT_CHECK_PTHREAD_OPTION, + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], [ - AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.], - kde_use_kernthreads=$enableval, kde_use_kernthreads=no) - - if test "$kde_use_kernthreads" = "yes"; then - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_CFLAGS="$CXXFLAGS" - CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS" - CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS" - AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h) - CXXFLAGS="$ac_save_CXXFLAGS" - CFLAGS="$ac_save_CFLAGS" - if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then - kde_use_kernthreads=no + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) else - dnl Add proper -I and -l statements - AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD - if test "x$LIBPTHREAD" = "x"; then - kde_use_kernthreads=no - else - USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads" - fi - fi - else - USE_THREADS="" - if test -z "$LIBPTHREAD"; then - QT_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] ) + additional_includedir="$withval/include" + additional_libdir="$withval/lib" fi fi - - case $host_os in - solaris*) - QT_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) - QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" - ;; - freebsd*) - QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" - ;; - aix*) - QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" - LIBPTHREAD="$LIBPTHREAD -lc_r" - ;; - linux*) QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT" - if test "$CXX" = "KCC"; then - QT_CXXFLAGS="$QT_CXXFLAGS --thread_safe" - fi - ;; - *) - ;; - esac - AC_SUBST(USE_THREADS) - AC_SUBST(LIBPTHREAD) ]) - -AC_DEFUN(QT_CHECK_THREADING, -[ - AC_REQUIRE([QT_CHECK_LIBPTHREAD]) - AC_REQUIRE([QT_CHECK_PTHREAD_OPTION]) - dnl default is yes if libpthread is found and no if no libpthread is available - if test -z "$LIBPTHREAD"; then - if test -z "$USE_THREADS"; then - kde_check_threading_default=no - else - kde_check_threading_default=yes + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi fi - else - kde_check_threading_default=yes - fi - AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ], - qt_use_threading=$enableval, qt_use_threading=$kde_check_threading_default) - if test "x$qt_use_threading" = "xyes"; then - AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) - fi -]) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- - -# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_PREREQ([2.52]) - -# serial 6 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - -# Do all the work for Automake. -*- Autoconf -*- - -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 10 - -AC_PREREQ([2.54]) - -# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow -# the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl - -# 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl - AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_MISSING_PROG(AMTAR, tar) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -# 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([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 -]) + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi ]) +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) -# Copyright 2002 Free Software Foundation, Inc. +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1654,172 +854,18 @@ echo "timestamp for $1" >`AS_DIRNAME([$1 # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.7.9])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright 2001, 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# -# Check to make sure that the build environment is sane. -# - -# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# -*- Autoconf -*- - - -# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) + [AM_AUTOMAKE_VERSION([1.9.4])]) # AM_AUX_DIR_EXPAND -# Copyright 2001 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1874,81 +920,16 @@ fi # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. -# Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50]) - -AC_DEFUN([AM_AUX_DIR_EXPAND], [ +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_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. - -# Copyright 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# AM_PROG_INSTALL_STRIP - -# Copyright 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# AM_CONDITIONAL -*- Autoconf -*- -# -*- Autoconf -*- -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1964,25 +945,35 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. - -# serial 1 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. + +# serial 6 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' else - am__leading_dot=_ + $1_TRUE='#' + $1_FALSE= fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) -# serial 5 -*- Autoconf -*- +# serial 7 -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2066,7 +1057,9 @@ AC_CACHE_CHECK([dependency style of $dep : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h + # 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 @@ -2094,9 +1087,14 @@ AC_CACHE_CHECK([dependency style of $dep grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + # 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 @@ -2130,8 +1128,8 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}d # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking Speeds up one-time builds - --enable-dependency-tracking Do not reject slow dependency extractors]) +[ --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='\' @@ -2142,7 +1140,8 @@ AC_SUBST([AMDEPBACKSLASH]) # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2178,27 +1177,21 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS else continue fi - grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + # 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 -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # 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 -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + 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 @@ -2211,18 +1204,266 @@ 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"]) -]) +# 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"]) +]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 7 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 11 + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- @@ -2287,9 +1528,10 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# AM_CONDITIONAL -*- Autoconf -*- +# -*- Autoconf -*- -# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2306,35 +1548,109 @@ rm -f confinc confmf # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -# serial 5 +# serial 3 -AC_PREREQ(2.52) +# 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_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " else - $1_TRUE='#' - $1_FALSE= + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) 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])]) +]) -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. + +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- -# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2353,20 +1669,243 @@ fi])]) # serial 2 -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/curses.m4]) +m4_include([m4/glib.m4]) +m4_include([m4/gtk.m4]) +m4_include([m4/iconv.m4]) +m4_include([m4/qt.m4]) +m4_include([acinclude.m4]) diff -urpP pinentry-0.7.1/assuan/ChangeLog pinentry-0.7.2/assuan/ChangeLog --- pinentry-0.7.1/assuan/ChangeLog 2004-04-20 10:04:47.000000000 +0000 +++ pinentry-0.7.2/assuan/ChangeLog 2004-12-22 11:49:17.000000000 +0000 @@ -1,3 +1,9 @@ +2004-12-22 Werner Koch + + * assuan.h (assuan_error_t, assuan_context_t): New aliases. + * assuan-buffer.c (readline): Renamed EOF to ISEOF to avoid + compiler warnings. + 2004-04-20 Werner Koch * mkerrors: Add missing last LF. diff -urpP pinentry-0.7.1/assuan/Makefile.in pinentry-0.7.2/assuan/Makefile.in --- pinentry-0.7.1/assuan/Makefile.in 2004-04-21 19:33:50.000000000 +0000 +++ pinentry-0.7.2/assuan/Makefile.in 2005-01-27 08:11:57.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -33,6 +33,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +SOURCES = $(libassuan_a_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -40,7 +42,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -54,7 +55,41 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +subdir = assuan +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +libassuan_a_AR = $(AR) $(ARFLAGS) +libassuan_a_LIBADD = +am_libassuan_a_OBJECTS = assuan-util.$(OBJEXT) assuan-errors.$(OBJEXT) \ + assuan-buffer.$(OBJEXT) assuan-handler.$(OBJEXT) \ + assuan-listen.$(OBJEXT) assuan-pipe-server.$(OBJEXT) +libassuan_a_OBJECTS = $(am_libassuan_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libassuan_a_SOURCES) +DIST_SOURCES = $(libassuan_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -67,10 +102,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -93,9 +132,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,6 +155,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -125,6 +172,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -140,6 +189,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -148,6 +198,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -155,6 +206,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -175,6 +228,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -185,12 +239,10 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - EXTRA_DIST = mkerrors Manifest INCLUDES = -I.. -I$(top_srcdir)/include BUILT_SOURCES = assuan-errors.c MOSTLYCLEANFILES = assuan-errors.c - noinst_LIBRARIES = libassuan.a #libassuan_a_LDFLAGS = @@ -204,49 +256,40 @@ libassuan_a_SOURCES = \ assuan-listen.c \ assuan-pipe-server.c -subdir = assuan -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - -libassuan_a_AR = $(AR) cru -libassuan_a_LIBADD = -am_libassuan_a_OBJECTS = assuan-util.$(OBJEXT) assuan-errors.$(OBJEXT) \ - assuan-buffer.$(OBJEXT) assuan-handler.$(OBJEXT) \ - assuan-listen.$(OBJEXT) assuan-pipe-server.$(OBJEXT) -libassuan_a_OBJECTS = $(am_libassuan_a_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/assuan-buffer.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/assuan-errors.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/assuan-handler.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/assuan-listen.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/assuan-pipe-server.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/assuan-util.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libassuan_a_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in ChangeLog Makefile.am -SOURCES = $(libassuan_a_SOURCES) - all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu assuan/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu assuan/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -AR = ar +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -256,7 +299,7 @@ libassuan.a: $(libassuan_a_OBJECTS) $(li $(RANLIB) libassuan.a mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -269,36 +312,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assuan-util.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -307,6 +334,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -318,10 +346,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -344,10 +373,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -361,7 +386,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -380,7 +405,6 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) - installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am @@ -403,7 +427,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -423,6 +447,8 @@ dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -458,13 +484,14 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am assuan-errors.c : assuan.h diff -urpP pinentry-0.7.1/assuan/assuan-buffer.c pinentry-0.7.2/assuan/assuan-buffer.c --- pinentry-0.7.1/assuan/assuan-buffer.c 2002-04-24 00:51:38.000000000 +0000 +++ pinentry-0.7.2/assuan/assuan-buffer.c 2004-12-22 11:41:49.000000000 +0000 @@ -71,12 +71,11 @@ writen ( int fd, const char *buffer, siz /* read an entire line */ static int -readline (int fd, char *buf, size_t buflen, int *r_nread, int *eof) +readline (int fd, char *buf, size_t buflen, int *r_nread, int *iseof) { - size_t nleft = buflen; - char *p; + size_t nleft = buflen; char *p; - *eof = 0; + *iseof = 0; *r_nread = 0; while (nleft > 0) { @@ -93,7 +92,7 @@ readline (int fd, char *buf, size_t bufl } else if (!n) { - *eof = 1; + *iseof = 1; break; /* allow incomplete lines */ } p = buf; diff -urpP pinentry-0.7.1/assuan/assuan.h pinentry-0.7.2/assuan/assuan.h --- pinentry-0.7.1/assuan/assuan.h 2004-01-30 18:30:21.000000000 +0000 +++ pinentry-0.7.2/assuan/assuan.h 2004-12-22 11:48:52.000000000 +0000 @@ -101,7 +101,9 @@ typedef enum { ASSUAN_Card_Not_Present = 404, ASSUAN_Invalid_Id = 405 -} AssuanError; +} assuan_error_t; + +typedef assuan_error_t AssuanError; /* Deprecated. */ /* This is a list of pre-registered ASSUAN commands */ typedef enum { @@ -122,7 +124,8 @@ typedef enum { #define ASSUAN_LINELENGTH 1002 /* 1000 + [CR,]LF */ struct assuan_context_s; -typedef struct assuan_context_s *ASSUAN_CONTEXT; +typedef struct assuan_context_s *assuan_context_t; +typedef struct assuan_context_s *ASSUAN_CONTEXT; /* Deprecated. */ /*-- assuan-handler.c --*/ int assuan_register_command (ASSUAN_CONTEXT ctx, diff -urpP pinentry-0.7.1/autogen.sh pinentry-0.7.2/autogen.sh --- pinentry-0.7.1/autogen.sh 2004-04-20 05:04:46.000000000 +0000 +++ pinentry-0.7.2/autogen.sh 2004-12-22 11:29:16.000000000 +0000 @@ -29,6 +29,67 @@ check_version () { } +# ***** W32 build script ******* +# Used to cross-compile for Windows. +if test "$1" = "--build-w32"; then + tmp=`dirname $0` + tsdir=`cd "$tmp"; pwd` + shift + if [ ! -f $tsdir/config.guess ]; then + echo "$tsdir/config.guess not found" >&2 + exit 1 + fi + build=`$tsdir/config.guess` + + [ -z "$w32root" ] && w32root="$HOME/w32root" + echo "Using $w32root as standard install directory" >&2 + + # See whether we have the Debian cross compiler package or the + # old mingw32/cpd system + if i586-mingw32msvc-gcc --version >/dev/null 2>&1 ; then + host=i586-mingw32msvc + crossbindir=/usr/$host/bin + else + host=i386--mingw32 + if ! mingw32 --version >/dev/null; then + echo "We need at least version 0.3 of MingW32/CPD" >&2 + exit 1 + fi + crossbindir=`mingw32 --install-dir`/bin + # Old autoconf version required us to setup the environment + # with the proper tool names. + CC=`mingw32 --get-path gcc` + CPP=`mingw32 --get-path cpp` + AR=`mingw32 --get-path ar` + RANLIB=`mingw32 --get-path ranlib` + export CC CPP AR RANLIB + fi + + if [ -f "$tsdir/config.log" ]; then + if ! head $tsdir/config.log | grep "$host" >/dev/null; then + echo "Pease run a 'make distclean' first" >&2 + exit 1 + fi + fi + + ./configure --enable-maintainer-mode --prefix=${w32root} \ + --host=i586-mingw32msvc --build=${build} \ + --disable-pinentry-gtk \ + --disable-pinentry-gtk2 \ + --disable-pinentry-qt + + rc=$? + # Ugly hack to overcome a gettext problem. Someone should look into + # gettext to figure out why the po directory is not ignored as it used + # to be. + [ $rc = 0 ] && touch $tsdir/po/all + exit $rc +fi +# ***** end W32 build script ******* + + + + # Grep the required versions from configure.ac autoconf_vers=`sed -n '/^AC_PREREQ(/ { s/^.*(\(.*\))/\1/p diff -urpP pinentry-0.7.1/config.guess pinentry-0.7.2/config.guess --- pinentry-0.7.1/config.guess 2002-11-12 19:32:32.000000000 +0000 +++ pinentry-0.7.2/config.guess 2004-12-22 11:08:37.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2002-11-08' +timestamp='2004-08-13' # 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 @@ -53,7 +53,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -98,14 +98,18 @@ trap 'exit 1' 1 2 15 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -# This shell variable is my proudest work .. or something. --bje +# Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; -(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) - || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; -dummy=$tmpdir/dummy ; -files="$dummy.c $dummy.o $dummy.rel $dummy" ; -trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +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 -q "$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 @@ -113,15 +117,13 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in CC_FOR_BUILD="$c"; break ; fi ; done ; - rm -f $files ; 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 ; -unset files' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -178,21 +180,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ ;; esac # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # 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 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -208,86 +227,76 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} + echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi + ;; + *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. - eval $set_cc_for_build - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null - if test "$?" = 0 ; then - case `$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - 3-1307) - UNAME_MACHINE="alphaev7" - ;; - esac - fi - rm -f $dummy.s $dummy && rmdir $tmpdir - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? @@ -310,6 +319,9 @@ EOF *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -327,6 +339,9 @@ EOF NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; @@ -399,6 +414,9 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -439,8 +457,7 @@ EOF EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) @@ -449,7 +466,7 @@ EOF Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS) + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -524,8 +541,7 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -624,10 +640,20 @@ EOF } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy && rmdir $tmpdir + test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) @@ -661,8 +687,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -720,21 +745,26 @@ EOF CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; 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 0 ;; + 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; @@ -745,19 +775,7 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c && rmdir $tmpdir - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -768,14 +786,17 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks exit 0 ;; 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 i386-pc-interix + echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin @@ -787,17 +808,28 @@ EOF echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + *: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 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -818,8 +850,26 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c && rmdir $tmpdir - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + 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 | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu @@ -855,6 +905,9 @@ EOF s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -912,9 +965,11 @@ EOF LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c && rmdir $tmpdir test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; @@ -932,6 +987,26 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; + 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 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; 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 @@ -966,9 +1041,6 @@ EOF echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -998,9 +1070,9 @@ EOF M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; - M68*:*:R3V[567]*:*) + M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*: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) + 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` @@ -1017,9 +1089,6 @@ EOF mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; @@ -1101,7 +1170,12 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1114,7 +1188,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1137,11 +1211,6 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - 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 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; @@ -1160,12 +1229,19 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms && exit 0 ;; + I*) echo ia64-dec-vms && exit 0 ;; + V*) echo vax-dec-vms && exit 0 ;; + esac esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1286,8 +1362,7 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 -rm -f $dummy.c $dummy && rmdir $tmpdir +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. diff -urpP pinentry-0.7.1/config.h.in pinentry-0.7.2/config.h.in --- pinentry-0.7.1/config.h.in 2004-04-21 19:33:47.000000000 +0000 +++ pinentry-0.7.2/config.h.in 2005-01-27 08:06:00.000000000 +0000 @@ -1,11 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ - -/* We need this, because some autoconf tests rely on this (e.g. stpcpy) - and it should be used for new programs anyway */ -#define _GNU_SOURCE 1 - - /* The GUI pinentries should fall back to curses if X is not available. */ #undef FALLBACK_CURSES @@ -15,6 +9,13 @@ /* Defined if a `byte' is typedef'd */ #undef HAVE_BYTE_TYPEDEF +/* Defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2) + with special properties like no file modes */ +#undef HAVE_DOSISH_SYSTEM + +/* defined if we must run on a stupid file system */ +#undef HAVE_DRIVE_LETTERS + /* Defined if GTK is available */ #undef HAVE_GTK @@ -24,12 +25,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + /* Define if you have a working libpthread (will enable threaded code) */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -73,12 +80,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIO_H + /* Defined if a `ulong' is typedef'd */ #undef HAVE_ULONG_TYPEDEF /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Defined if we run on a W32 API based system */ +#undef HAVE_W32_SYSTEM + /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST @@ -100,14 +113,31 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* The Curses version of Pinentry is to be build */ +#undef PINENTRY_CURSES + +/* The GTK+ version of Pinentry is to be build */ +#undef PINENTRY_GTK + +/* The Qt version of Pinentry is to be build */ +#undef PINENTRY_QT + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* The capabilities support library is installed */ #undef USE_CAPABILITIES +/* set this to limit filenames to the 8.3 format */ +#undef USE_ONLY_8DOT3 + /* Version number of package */ #undef VERSION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif diff -urpP pinentry-0.7.1/config.sub pinentry-0.7.2/config.sub --- pinentry-0.7.1/config.sub 2002-11-12 19:32:32.000000000 +0000 +++ pinentry-0.7.2/config.sub 2004-12-22 11:08:37.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -timestamp='2002-11-08' +timestamp='2004-06-24' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,7 @@ Report bugs and patches to &5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pinentry $as_me 0.7.1, which was +It was created by pinentry $as_me 0.7.2, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1373,7 +1377,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" -am__api_version="1.7" +am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -1536,7 +1540,6 @@ _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed - # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -1550,6 +1553,39 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -1628,7 +1664,7 @@ else fi rmdir .tst 2>/dev/null - # test to see if srcdir already configured +# test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 @@ -1676,9 +1712,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_ru MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -AMTAR=${AMTAR-"${am_missing_run}tar"} - install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user @@ -1771,10 +1804,23 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(inst # 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 -' + + + +cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 @@ -2902,7 +2948,9 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h + # 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 @@ -2930,9 +2978,14 @@ else grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + # 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 @@ -3750,7 +3803,9 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h + # 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 @@ -3778,9 +3833,14 @@ else grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi @@ -3811,6 +3871,173 @@ else fi +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_WINDRES"; then + ac_ct_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_WINDRES"; then + ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_WINDRES="windres" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_WINDRES" && ac_cv_prog_ac_ct_WINDRES=":" +fi +fi +ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES +if test -n "$ac_ct_WINDRES"; then + echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5 +echo "${ECHO_T}$ac_ct_WINDRES" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + WINDRES=$ac_ct_WINDRES +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + + +have_dosish_system=no +have_w32_system=no +case "${host}" in + *-mingw32*) + +cat >>confdefs.h <<\_ACEOF +#define USE_ONLY_8DOT3 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DRIVE_LETTERS 1 +_ACEOF + + have_dosish_system=yes + have_w32_system=yes + ;; + i?86-emx-os2 | i?86-*-os2*emx ) + # OS/2 with the EMX environment + cat >>confdefs.h <<\_ACEOF +#define HAVE_DRIVE_LETTERS 1 +_ACEOF + + have_dosish_system=yes + ;; + + i?86-*-msdosdjgpp*) + # DOS with the DJGPP environment + cat >>confdefs.h <<\_ACEOF +#define HAVE_DRIVE_LETTERS 1 +_ACEOF + + have_dosish_system=yes + ;; +esac + +if test "$have_dosish_system" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOSISH_SYSTEM 1 +_ACEOF + +fi + + +if test "$have_dosish_system" = yes; then + HAVE_DOSISH_SYSTEM_TRUE= + HAVE_DOSISH_SYSTEM_FALSE='#' +else + HAVE_DOSISH_SYSTEM_TRUE='#' + HAVE_DOSISH_SYSTEM_FALSE= +fi + + +if test "$have_w32_system" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_W32_SYSTEM 1 +_ACEOF + +fi + + +if test "$have_w32_system" = yes; then + HAVE_W32_SYSTEM_TRUE= + HAVE_W32_SYSTEM_FALSE='#' +else + HAVE_W32_SYSTEM_TRUE='#' + HAVE_W32_SYSTEM_FALSE= +fi + + + + if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" @@ -3818,15 +4045,27 @@ if test "$GCC" = yes; then fi +# Checks for header files. + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep -for ac_func in seteuid stpcpy mmap -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3835,54 +4074,22 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif +#include +#include +#include +#include int main () { -return f != $ac_func; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3895,243 +4102,60 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_var=yes" + ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +ac_cv_header_stdc=no fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no fi -done +rm -f conftest* +fi -for ac_func in mlock -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func +#include -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - if test "$ac_cv_func_mlock" = "no"; then - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* +_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 @@ -4276,7 +4300,11 @@ done -for ac_header in sys/mman.h + + + + +for ac_header in string.h unistd.h langinfo.h termio.h locale.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -4424,34 +4452,65 @@ fi done - if test "$ac_cv_header_sys_mman_h" = "yes"; then - # Add librt to LIBS: -echo "$as_me:$LINENO: checking for memlk in -lrt" >&5 -echo $ECHO_N "checking for memlk in -lrt... $ECHO_C" >&6 -if test "${ac_cv_lib_rt_memlk+set}" = set; then + + + +for ac_func in seteuid stpcpy mmap +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lrt $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char memlk (); +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + int main () { -memlk (); +return f != $ac_func; ; return 0; } @@ -4477,187 +4536,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_rt_memlk=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_rt_memlk=no +eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_rt_memlk" >&5 -echo "${ECHO_T}$ac_cv_lib_rt_memlk" >&6 -if test $ac_cv_lib_rt_memlk = yes; then +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRT 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - LIBS="-lrt $LIBS" - -fi - - echo "$as_me:$LINENO: checking whether mlock is in sys/mman.h" >&5 -echo $ECHO_N "checking whether mlock is in sys/mman.h... $ECHO_C" >&6 -if test "${gnupg_cv_mlock_is_in_sys_mman+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - #include - #ifdef HAVE_SYS_MMAN_H - #include - #endif - -int -main () -{ - - int i; - - /* glibc 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_mlock) || defined (__stub___mlock) - choke me - #else - mlock(&i, 4); - #endif - ; return 0; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gnupg_cv_mlock_is_in_sys_mman=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gnupg_cv_mlock_is_in_sys_mman=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $gnupg_cv_mlock_is_in_sys_mman" >&5 -echo "${ECHO_T}$gnupg_cv_mlock_is_in_sys_mman" >&6 - if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MLOCK 1 -_ACEOF - - fi - fi - fi - if test "$ac_cv_func_mlock" = "yes"; then - echo "$as_me:$LINENO: checking whether mlock is broken" >&5 -echo $ECHO_N "checking whether mlock is broken... $ECHO_C" >&6 - if test "${gnupg_cv_have_broken_mlock+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - gnupg_cv_have_broken_mlock="assume-no" - -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - #include - #include - #include - #include - #include - #include - - int main() - { - char *pool; - int err; - long int pgsize = getpagesize(); - - pool = malloc( 4096 + pgsize ); - if( !pool ) - return 2; - pool += (pgsize - ((long int)pool % pgsize)); - - err = mlock( pool, 4096 ); - if( !err || errno == EPERM ) - return 0; /* okay */ - - return 1; /* hmmm */ - } - - -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gnupg_cv_have_broken_mlock="no" -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -gnupg_cv_have_broken_mlock="yes" -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - fi +done - if test "$gnupg_cv_have_broken_mlock" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_BROKEN_MLOCK 1 -_ACEOF - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -for ac_func in plock +for ac_func in mlock do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -4757,44 +4657,31 @@ _ACEOF fi done - else - if test "$gnupg_cv_have_broken_mlock" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - else - echo "$as_me:$LINENO: result: assuming no" >&5 -echo "${ECHO_T}assuming no" >&6 - fi - fi - fi - - - + if test "$ac_cv_func_mlock" = "no"; then - echo "$as_me:$LINENO: checking for byte typedef" >&5 -echo $ECHO_N "checking for byte typedef... $ECHO_C" >&6 - if test "${gnupg_cv_typedef_byte+set}" = set; then +for ac_header in sys/mman.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _GNU_SOURCE 1 - #include - #include -int -main () -{ - - #undef byte - int a = sizeof(byte); - - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -4817,141 +4704,119 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gnupg_cv_typedef_byte=yes + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gnupg_cv_typedef_byte=no +ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - echo "$as_me:$LINENO: result: $gnupg_cv_typedef_byte" >&5 -echo "${ECHO_T}$gnupg_cv_typedef_byte" >&6 - if test "$gnupg_cv_typedef_byte" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_BYTE_TYPEDEF 1 -_ACEOF - - fi +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 - echo "$as_me:$LINENO: checking for ulong typedef" >&5 -echo $ECHO_N "checking for ulong typedef... $ECHO_C" >&6 - if test "${gnupg_cv_typedef_ulong+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _GNU_SOURCE 1 - #include - #include -int -main () -{ - - #undef ulong - int a = sizeof(ulong); - - ; - return 0; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gnupg_cv_typedef_ulong=yes + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gnupg_cv_typedef_ulong=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_header_preproc=no fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 - echo "$as_me:$LINENO: result: $gnupg_cv_typedef_ulong" >&5 -echo "${ECHO_T}$gnupg_cv_typedef_ulong" >&6 - if test "$gnupg_cv_typedef_ulong" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ULONG_TYPEDEF 1 -_ACEOF - - fi - - -# Extract the first word of "setcap", so it can be a program name with args. -set dummy setcap; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SETCAP+set}" = set; then +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## -------------------------------- ## +## Report this to gpa-dev@gnupg.org ## +## -------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $SETCAP in - [\\/]* | ?:[\\/]*) - ac_cv_path_SETCAP="$SETCAP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy=""$PATH:/sbin:/usr/sbin"" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_SETCAP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - test -z "$ac_cv_path_SETCAP" && ac_cv_path_SETCAP=":" - ;; -esac fi -SETCAP=$ac_cv_path_SETCAP +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -if test -n "$SETCAP"; then - echo "$as_me:$LINENO: result: $SETCAP" >&5 -echo "${ECHO_T}$SETCAP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi -echo "$as_me:$LINENO: checking for cap_set_proc in -lcap" >&5 -echo $ECHO_N "checking for cap_set_proc in -lcap... $ECHO_C" >&6 -if test "${ac_cv_lib_cap_cap_set_proc+set}" = set; then +done + + if test "$ac_cv_header_sys_mman_h" = "yes"; then + # Add librt to LIBS: + +echo "$as_me:$LINENO: checking for memlk in -lrt" >&5 +echo $ECHO_N "checking for memlk in -lrt... $ECHO_C" >&6 +if test "${ac_cv_lib_rt_memlk+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lcap $LIBS" +LIBS="-lrt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4965,11 +4830,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char cap_set_proc (); +char memlk (); int main () { -cap_set_proc (); +memlk (); ; return 0; } @@ -4995,82 +4860,62 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_cap_cap_set_proc=yes + ac_cv_lib_rt_memlk=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_cap_cap_set_proc=no +ac_cv_lib_rt_memlk=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_set_proc" >&5 -echo "${ECHO_T}$ac_cv_lib_cap_cap_set_proc" >&6 -if test $ac_cv_lib_cap_cap_set_proc = yes; then - - -cat >>confdefs.h <<\_ACEOF -#define USE_CAPABILITIES 1 +echo "$as_me:$LINENO: result: $ac_cv_lib_rt_memlk" >&5 +echo "${ECHO_T}$ac_cv_lib_rt_memlk" >&6 +if test $ac_cv_lib_rt_memlk = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRT 1 _ACEOF - LIBCAP=-lcap + LIBS="-lrt $LIBS" fi - - -# Check whether --enable-pinentry-curses or --disable-pinentry-curses was given. -if test "${enable_pinentry_curses+set}" = set; then - enableval="$enable_pinentry_curses" - pinentry_curses=$enableval -else - pinentry_curses=maybe -fi; -# Check whether --enable-fallback-curses or --disable-fallback-curses was given. -if test "${enable_fallback_curses+set}" = set; then - enableval="$enable_fallback_curses" - fallback_curses=$enableval -else - fallback_curses=maybe -fi; - -if test "$pinentry_curses" != "no" -o "$fallback_curses" != "no"; then - - # Check whether --enable-ncurses or --disable-ncurses was given. -if test "${enable_ncurses+set}" = set; then - enableval="$enable_ncurses" - -else - enable_ncurses=yes -fi; - if test "$enable_ncurses" = yes; then - echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 -echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6 -if test "${ac_cv_lib_ncurses_initscr+set}" = set; then + echo "$as_me:$LINENO: checking whether mlock is in sys/mman.h" >&5 +echo $ECHO_N "checking whether mlock is in sys/mman.h... $ECHO_C" >&6 +if test "${gnupg_cv_mlock_is_in_sys_mman+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char initscr (); + #include + #ifdef HAVE_SYS_MMAN_H + #include + #endif + int main () { -initscr (); + + int i; + + /* glibc 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_mlock) || defined (__stub___mlock) + choke me + #else + mlock(&i, 4); + #endif + ; return 0; + ; return 0; } @@ -5096,168 +4941,160 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_ncurses_initscr=yes + gnupg_cv_mlock_is_in_sys_mman=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ncurses_initscr=no +gnupg_cv_mlock_is_in_sys_mman=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6 -if test $ac_cv_lib_ncurses_initscr = yes; then - LIBNCURSES="-lncurses" fi +echo "$as_me:$LINENO: result: $gnupg_cv_mlock_is_in_sys_mman" >&5 +echo "${ECHO_T}$gnupg_cv_mlock_is_in_sys_mman" >&6 + if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then - if test "$LIBNCURSES"; then - # Use ncurses header files instead of the ordinary ones, if possible; - # is there a better way of doing this, that avoids looking in specific - # directories? +cat >>confdefs.h <<\_ACEOF +#define HAVE_MLOCK 1 +_ACEOF -# Check whether --with-ncurses-include-dir or --without-ncurses-include-dir was given. -if test "${with_ncurses_include_dir+set}" = set; then - withval="$with_ncurses_include_dir" + fi + fi + fi + if test "$ac_cv_func_mlock" = "yes"; then + echo "$as_me:$LINENO: checking whether mlock is broken" >&5 +echo $ECHO_N "checking whether mlock is broken... $ECHO_C" >&6 + if test "${gnupg_cv_have_broken_mlock+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + gnupg_cv_have_broken_mlock="assume-no" -fi; if test "${with_ncurses_include_dir+set}" = set; then - echo "$as_me:$LINENO: checking for ncurses include dir" >&5 -echo $ECHO_N "checking for ncurses include dir... $ECHO_C" >&6 - case "$with_ncurses_include_dir" in - no|none) - inetutils_cv_includedir_ncurses=none;; - *) - inetutils_cv_includedir_ncurses="$with_ncurses_include_dir";; - esac - echo "$as_me:$LINENO: result: $inetutils_cv_includedir_ncurses" >&5 -echo "${ECHO_T}$inetutils_cv_includedir_ncurses" >&6 - else - echo "$as_me:$LINENO: checking for ncurses include dir" >&5 -echo $ECHO_N "checking for ncurses include dir... $ECHO_C" >&6 -if test "${inetutils_cv_includedir_ncurses+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do - if test -d $D/ncurses; then - inetutils_cv_includedir_ncurses="$D/ncurses" - break - fi - test "$inetutils_cv_includedir_ncurses" \ - || inetutils_cv_includedir_ncurses=none - done -fi -echo "$as_me:$LINENO: result: $inetutils_cv_includedir_ncurses" >&5 -echo "${ECHO_T}$inetutils_cv_includedir_ncurses" >&6 - fi - if test "$inetutils_cv_includedir_ncurses" = none; then - NCURSES_INCLUDE="" - else - NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses" - fi - fi - fi - - - - - if test "$LIBNCURSES"; then - LIBTERMCAP="$LIBNCURSES" - else - echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 -echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6 -if test "${ac_cv_lib_curses_tgetent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent (); -int -main () -{ -tgetent (); - ; - return 0; -} + #include + #include + #include + #include + #include + #include + + int main() + { + char *pool; + int err; + long int pgsize = getpagesize(); + + pool = malloc( 4096 + pgsize ); + if( !pool ) + return 2; + pool += (pgsize - ((long int)pool % pgsize)); + + err = mlock( pool, 4096 ); + if( !err || errno == EPERM ) + return 0; /* okay */ + + return 1; /* hmmm */ + } + + _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext +rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_curses_tgetent=yes + gnupg_cv_have_broken_mlock="no" else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_curses_tgetent=no +( exit $ac_status ) +gnupg_cv_have_broken_mlock="yes" fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6 -if test $ac_cv_lib_curses_tgetent = yes; then - LIBTERMCAP=-lcurses + fi - if test "$ac_cv_lib_curses_tgetent" = no; then - echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 -echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6 -if test "${ac_cv_lib_termcap_tgetent+set}" = set; then + if test "$gnupg_cv_have_broken_mlock" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_BROKEN_MLOCK 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +for ac_func in plock +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltermcap $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char tgetent (); +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + int main () { -tgetent (); +return f != $ac_func; ; return 0; } @@ -5283,57 +5120,68 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_termcap_tgetent=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_termcap_tgetent=no +eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6 -if test $ac_cv_lib_termcap_tgetent = yes; then - LIBTERMCAP=-ltermcap +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + fi +done + else + if test "$gnupg_cv_have_broken_mlock" = "no"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + else + echo "$as_me:$LINENO: result: assuming no" >&5 +echo "${ECHO_T}assuming no" >&6 + fi + fi fi - if test "$ac_cv_lib_termcap_tgetent" = no; then - echo "$as_me:$LINENO: checking for tgetent in -ltermlib" >&5 -echo $ECHO_N "checking for tgetent in -ltermlib... $ECHO_C" >&6 -if test "${ac_cv_lib_termlib_tgetent+set}" = set; then + + + + + echo "$as_me:$LINENO: checking for byte typedef" >&5 +echo $ECHO_N "checking for byte typedef... $ECHO_C" >&6 + if test "${gnupg_cv_typedef_byte+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ltermlib $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent (); +#define _GNU_SOURCE 1 + #include + #include int main () { -tgetent (); + + #undef byte + int a = sizeof(byte); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5346,72 +5194,60 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_termlib_tgetent=yes + gnupg_cv_typedef_byte=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_termlib_tgetent=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +gnupg_cv_typedef_byte=no fi -echo "$as_me:$LINENO: result: $ac_cv_lib_termlib_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_termlib_tgetent" >&6 -if test $ac_cv_lib_termlib_tgetent = yes; then - LIBTERMCAP=-ltermlib +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - fi - fi - + echo "$as_me:$LINENO: result: $gnupg_cv_typedef_byte" >&5 +echo "${ECHO_T}$gnupg_cv_typedef_byte" >&6 + if test "$gnupg_cv_typedef_byte" = yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_BYTE_TYPEDEF 1 +_ACEOF + fi - if test "$LIBNCURSES"; then - LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap - else - _IU_SAVE_LIBS="$LIBS" - LIBS="$LIBTERMCAP" - echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 -echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6 -if test "${ac_cv_lib_curses_initscr+set}" = set; then + echo "$as_me:$LINENO: checking for ulong typedef" >&5 +echo $ECHO_N "checking for ulong typedef... $ECHO_C" >&6 + if test "${gnupg_cv_typedef_ulong+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char initscr (); +#define _GNU_SOURCE 1 + #include + #include int main () { -initscr (); + + #undef ulong + int a = sizeof(ulong); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5424,47 +5260,99 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' + { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_curses_initscr=yes + gnupg_cv_typedef_ulong=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_curses_initscr=no +gnupg_cv_typedef_ulong=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6 -if test $ac_cv_lib_curses_initscr = yes; then - LIBCURSES="-lcurses" + + echo "$as_me:$LINENO: result: $gnupg_cv_typedef_ulong" >&5 +echo "${ECHO_T}$gnupg_cv_typedef_ulong" >&6 + if test "$gnupg_cv_typedef_ulong" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ULONG_TYPEDEF 1 +_ACEOF + + fi + + +# Extract the first word of "setcap", so it can be a program name with args. +set dummy setcap; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SETCAP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $SETCAP in + [\\/]* | ?:[\\/]*) + ac_cv_path_SETCAP="$SETCAP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy=""$PATH:/sbin:/usr/sbin"" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_SETCAP="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_SETCAP" && ac_cv_path_SETCAP=":" + ;; +esac fi +SETCAP=$ac_cv_path_SETCAP - if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then - echo "$as_me:$LINENO: checking whether curses needs $LIBTERMCAP" >&5 -echo $ECHO_N "checking whether curses needs $LIBTERMCAP... $ECHO_C" >&6 -if test "${inetutils_cv_curses_needs_termcap+set}" = set; then +if test -n "$SETCAP"; then + echo "$as_me:$LINENO: result: $SETCAP" >&5 +echo "${ECHO_T}$SETCAP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +echo "$as_me:$LINENO: checking for cap_set_proc in -lcap" >&5 +echo $ECHO_N "checking for cap_set_proc in -lcap... $ECHO_C" >&6 +if test "${ac_cv_lib_cap_cap_set_proc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - LIBS="$LIBCURSES" - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcap $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char cap_set_proc (); int main () { -initscr (); +cap_set_proc (); ; return 0; } @@ -5490,121 +5378,82 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - inetutils_cv_curses_needs_termcap=no + ac_cv_lib_cap_cap_set_proc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -inetutils_cv_curses_needs_termcap=yes +ac_cv_lib_cap_cap_set_proc=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $inetutils_cv_curses_needs_termcap" >&5 -echo "${ECHO_T}$inetutils_cv_curses_needs_termcap" >&6 - if test $inetutils_cv_curses_needs_termcap = yes; then - LIBCURSES="$LIBCURSES $LIBTERMCAP" - fi - fi - LIBS="$_IU_SAVE_LIBS" - fi +echo "$as_me:$LINENO: result: $ac_cv_lib_cap_cap_set_proc" >&5 +echo "${ECHO_T}$ac_cv_lib_cap_cap_set_proc" >&6 +if test $ac_cv_lib_cap_cap_set_proc = yes; then -fi -if test "$LIBCURSES"; then - if test "$pinentry_curses" != "no"; then - pinentry_curses=yes - fi - if test "$fallback_curses" != "no"; then - fallback_curses=yes cat >>confdefs.h <<\_ACEOF -#define FALLBACK_CURSES 1 +#define USE_CAPABILITIES 1 _ACEOF - fi -else - if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then - { { echo "$as_me:$LINENO: error: -*** The curses library is required. The latest version of -*** ncurses is always available from ftp://ftp.gnu.org/gnu/ncurses/. -" >&5 -echo "$as_me: error: -*** The curses library is required. The latest version of -*** ncurses is always available from ftp://ftp.gnu.org/gnu/ncurses/. -" >&2;} - { (exit 1); exit 1; }; } - fi - pinentry_curses=no - fallback_curses=no -fi - + LIBCAP=-lcap -if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then - BUILD_LIBPINENTRY_CURSES_TRUE= - BUILD_LIBPINENTRY_CURSES_FALSE='#' -else - BUILD_LIBPINENTRY_CURSES_TRUE='#' - BUILD_LIBPINENTRY_CURSES_FALSE= fi -if test "$pinentry_curses" = "yes"; then - BUILD_PINENTRY_CURSES_TRUE= - BUILD_PINENTRY_CURSES_FALSE='#' +# Check whether --enable-pinentry-curses or --disable-pinentry-curses was given. +if test "${enable_pinentry_curses+set}" = set; then + enableval="$enable_pinentry_curses" + pinentry_curses=$enableval else - BUILD_PINENTRY_CURSES_TRUE='#' - BUILD_PINENTRY_CURSES_FALSE= -fi - - - -if test "$fallback_curses" = "yes"; then - FALLBACK_CURSES_TRUE= - FALLBACK_CURSES_FALSE='#' + pinentry_curses=maybe +fi; +# Check whether --enable-fallback-curses or --disable-fallback-curses was given. +if test "${enable_fallback_curses+set}" = set; then + enableval="$enable_fallback_curses" + fallback_curses=$enableval else - FALLBACK_CURSES_TRUE='#' - FALLBACK_CURSES_FALSE= -fi - - -if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then - - + fallback_curses=maybe +fi; -# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then - withval="$with_libiconv_prefix" +if test "$pinentry_curses" != "no" -o "$fallback_curses" != "no"; then - for dir in `echo "$withval" | tr : ' '`; do - if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi - if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi - done + # Check whether --enable-ncurses or --disable-ncurses was given. +if test "${enable_ncurses+set}" = set; then + enableval="$enable_ncurses" +else + enable_ncurses=yes fi; - - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 -if test "${am_cv_func_iconv+set}" = set; then + if test "$enable_ncurses" = yes; then + echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 +echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6 +if test "${ac_cv_lib_ncurses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char initscr (); int main () { -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); +initscr (); ; return 0; } @@ -5630,31 +5479,100 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - am_cv_func_iconv=yes + ac_cv_lib_ncurses_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_ncurses_initscr=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS -liconv" - cat >conftest.$ac_ext <<_ACEOF +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6 +if test $ac_cv_lib_ncurses_initscr = yes; then + LIBNCURSES="-lncurses" +fi + + if test "$LIBNCURSES"; then + # Use ncurses header files instead of the ordinary ones, if possible; + # is there a better way of doing this, that avoids looking in specific + # directories? + +# Check whether --with-ncurses-include-dir or --without-ncurses-include-dir was given. +if test "${with_ncurses_include_dir+set}" = set; then + withval="$with_ncurses_include_dir" + +fi; if test "${with_ncurses_include_dir+set}" = set; then + echo "$as_me:$LINENO: checking for ncurses include dir" >&5 +echo $ECHO_N "checking for ncurses include dir... $ECHO_C" >&6 + case "$with_ncurses_include_dir" in + no|none) + inetutils_cv_includedir_ncurses=none;; + *) + inetutils_cv_includedir_ncurses="$with_ncurses_include_dir";; + esac + echo "$as_me:$LINENO: result: $inetutils_cv_includedir_ncurses" >&5 +echo "${ECHO_T}$inetutils_cv_includedir_ncurses" >&6 + else + echo "$as_me:$LINENO: checking for ncurses include dir" >&5 +echo $ECHO_N "checking for ncurses include dir... $ECHO_C" >&6 +if test "${inetutils_cv_includedir_ncurses+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do + if test -d $D/ncurses; then + inetutils_cv_includedir_ncurses="$D/ncurses" + break + fi + test "$inetutils_cv_includedir_ncurses" \ + || inetutils_cv_includedir_ncurses=none + done +fi +echo "$as_me:$LINENO: result: $inetutils_cv_includedir_ncurses" >&5 +echo "${ECHO_T}$inetutils_cv_includedir_ncurses" >&6 + fi + if test "$inetutils_cv_includedir_ncurses" = none; then + NCURSES_INCLUDE="" + else + NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses" + fi + fi + fi + + + + + if test "$LIBNCURSES"; then + LIBTERMCAP="$LIBNCURSES" + else + echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 +echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6 +if test "${ac_cv_lib_curses_tgetent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char tgetent (); int main () { -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); +tgetent (); ; return 0; } @@ -5680,63 +5598,56 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - am_cv_lib_iconv=yes - am_cv_func_iconv=yes + ac_cv_lib_curses_tgetent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_curses_tgetent=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi - +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6 +if test $ac_cv_lib_curses_tgetent = yes; then + LIBTERMCAP=-lcurses fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 - if test "$am_cv_func_iconv" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ICONV 1 -_ACEOF - echo "$as_me:$LINENO: checking for iconv declaration" >&5 -echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 - if test "${am_cv_proto_iconv+set}" = set; then + if test "$ac_cv_lib_curses_tgetent" = no; then + echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 +echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6 +if test "${ac_cv_lib_termcap_tgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermcap $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -extern +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); +extern "C" #endif - +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char tgetent (); int main () { - +tgetent (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5749,58 +5660,324 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - am_cv_proto_iconv_arg1="" + ac_cv_lib_termcap_tgetent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_proto_iconv_arg1="const" +ac_cv_lib_termcap_tgetent=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 +echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6 +if test $ac_cv_lib_termcap_tgetent = yes; then + LIBTERMCAP=-ltermcap fi - am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - echo "$as_me:$LINENO: result: ${ac_t:- - }$am_cv_proto_iconv" >&5 -echo "${ECHO_T}${ac_t:- - }$am_cv_proto_iconv" >&6 + fi + if test "$ac_cv_lib_termcap_tgetent" = no; then + echo "$as_me:$LINENO: checking for tgetent in -ltermlib" >&5 +echo $ECHO_N "checking for tgetent in -ltermlib... $ECHO_C" >&6 +if test "${ac_cv_lib_termlib_tgetent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermlib $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -cat >>confdefs.h <<_ACEOF -#define ICONV_CONST $am_cv_proto_iconv_arg1 +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char tgetent (); +int +main () +{ +tgetent (); + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_termlib_tgetent=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - fi - LIBICONV= - if test "$am_cv_lib_iconv" = yes; then - LIBICONV="-liconv" - fi +ac_cv_lib_termlib_tgetent=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_termlib_tgetent" >&5 +echo "${ECHO_T}$ac_cv_lib_termlib_tgetent" >&6 +if test $ac_cv_lib_termlib_tgetent = yes; then + LIBTERMCAP=-ltermlib +fi + fi + fi -fi -# Check whether --enable-pinentry-gtk or --disable-pinentry-gtk was given. -if test "${enable_pinentry_gtk+set}" = set; then - enableval="$enable_pinentry_gtk" - pinentry_gtk=$enableval -else - pinentry_gtk=maybe -fi; -if test "$pinentry_gtk" != "no"; then -# Check whether --with-glib-prefix or --without-glib-prefix was given. -if test "${with_glib_prefix+set}" = set; then - withval="$with_glib_prefix" - glib_config_prefix="$withval" + if test "$LIBNCURSES"; then + LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap + else + _IU_SAVE_LIBS="$LIBS" + LIBS="$LIBTERMCAP" + echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 +echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6 +if test "${ac_cv_lib_curses_initscr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - glib_config_prefix="" + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char initscr (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_curses_initscr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_curses_initscr=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6 +if test $ac_cv_lib_curses_initscr = yes; then + LIBCURSES="-lcurses" +fi + + if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then + echo "$as_me:$LINENO: checking whether curses needs $LIBTERMCAP" >&5 +echo $ECHO_N "checking whether curses needs $LIBTERMCAP... $ECHO_C" >&6 +if test "${inetutils_cv_curses_needs_termcap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + LIBS="$LIBCURSES" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + inetutils_cv_curses_needs_termcap=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +inetutils_cv_curses_needs_termcap=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $inetutils_cv_curses_needs_termcap" >&5 +echo "${ECHO_T}$inetutils_cv_curses_needs_termcap" >&6 + if test $inetutils_cv_curses_needs_termcap = yes; then + LIBCURSES="$LIBCURSES $LIBTERMCAP" + fi + fi + LIBS="$_IU_SAVE_LIBS" + fi + +fi +if test "$LIBCURSES"; then + if test "$pinentry_curses" != "no"; then + pinentry_curses=yes + fi + if test "$fallback_curses" != "no"; then + fallback_curses=yes + +cat >>confdefs.h <<\_ACEOF +#define FALLBACK_CURSES 1 +_ACEOF + + fi +else + if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then + { { echo "$as_me:$LINENO: error: +*** +*** The curses library is required. The latest version of +*** ncurses is always available from ftp://ftp.gnu.org/gnu/ncurses/. +***" >&5 +echo "$as_me: error: +*** +*** The curses library is required. The latest version of +*** ncurses is always available from ftp://ftp.gnu.org/gnu/ncurses/. +***" >&2;} + { (exit 1); exit 1; }; } + fi + pinentry_curses=no + fallback_curses=no +fi + + +if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then + BUILD_LIBPINENTRY_CURSES_TRUE= + BUILD_LIBPINENTRY_CURSES_FALSE='#' +else + BUILD_LIBPINENTRY_CURSES_TRUE='#' + BUILD_LIBPINENTRY_CURSES_FALSE= +fi + + + +if test "$pinentry_curses" = "yes"; then + BUILD_PINENTRY_CURSES_TRUE= + BUILD_PINENTRY_CURSES_FALSE='#' +else + BUILD_PINENTRY_CURSES_TRUE='#' + BUILD_PINENTRY_CURSES_FALSE= +fi + + + +if test "$fallback_curses" = "yes"; then + FALLBACK_CURSES_TRUE= + FALLBACK_CURSES_FALSE='#' +else + FALLBACK_CURSES_TRUE='#' + FALLBACK_CURSES_FALSE= +fi + + +if test "$pinentry_curses" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define PINENTRY_CURSES 1 +_ACEOF + +fi + + +# Check whether --enable-pinentry-gtk or --disable-pinentry-gtk was given. +if test "${enable_pinentry_gtk+set}" = set; then + enableval="$enable_pinentry_gtk" + pinentry_gtk=$enableval +else + pinentry_gtk=maybe +fi; + +if test "$pinentry_gtk" != "no"; then + +# Check whether --with-glib-prefix or --without-glib-prefix was given. +if test "${with_glib_prefix+set}" = set; then + withval="$with_glib_prefix" + glib_config_prefix="$withval" +else + glib_config_prefix="" fi; # Check whether --with-glib-exec-prefix or --without-glib-exec-prefix was given. @@ -6104,13 +6281,15 @@ rm -f conftest.err conftest.$ac_objext \ GLIB_LIBS="" if test "$pinentry_gtk" = "yes"; then { { echo "$as_me:$LINENO: error: +*** *** GLIB 1.2.0 or newer is required. The latest version of GLIB *** is always available from ftp://ftp.gtk.org/. -" >&5 +***" >&5 echo "$as_me: error: +*** *** GLIB 1.2.0 or newer is required. The latest version of GLIB *** is always available from ftp://ftp.gtk.org/. -" >&2;} +***" >&2;} { (exit 1); exit 1; }; } else pinentry_gtk=no @@ -6436,40 +6615,933 @@ rm -f conftest.err conftest.$ac_objext \ GTK_LIBS="" if test "$pinentry_gtk" = "yes"; then { { echo "$as_me:$LINENO: error: +*** *** GTK+ 1.2.0 or newer is required. The latest version of GTK+ *** is always available form ftp://ftp.gtk.org/. -" >&5 +***" >&5 echo "$as_me: error: +*** *** GTK+ 1.2.0 or newer is required. The latest version of GTK+ *** is always available form ftp://ftp.gtk.org/. -" >&2;} +***" >&2;} { (exit 1); exit 1; }; } else - pinentry_gtk=no + pinentry_gtk=no +fi + fi + + + rm -f conf.gtktest + +fi + +if test "$pinentry_gtk" != "no"; then + pinentry_gtk=yes +fi + + +if test "$pinentry_gtk" = "yes"; then + BUILD_PINENTRY_GTK_TRUE= + BUILD_PINENTRY_GTK_FALSE='#' +else + BUILD_PINENTRY_GTK_TRUE='#' + BUILD_PINENTRY_GTK_FALSE= +fi + +if test "$pinentry_gtk" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define PINENTRY_GTK 1 +_ACEOF + +fi + +if test "$pinentry_curses" = "yes" \ + -o "$fallback_curses" = "yes" \ + -o "$pinentry_gtk" = "yes"; then + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld or --without-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; +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&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. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path 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 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${acl_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${acl_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi; + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6 +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6 + if test "$am_cv_func_iconv" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + fi + if test "$am_cv_lib_iconv" = yes; then + echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + if test "${am_cv_proto_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_proto_iconv_arg1="" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_proto_iconv_arg1="const" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + echo "$as_me:$LINENO: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +echo "${ECHO_T}${ac_t:- + }$am_cv_proto_iconv" >&6 + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + +fi + + + +# Check whether --enable-pinentry-gtk2 or --disable-pinentry-gtk2 was given. +if test "${enable_pinentry_gtk2+set}" = set; then + enableval="$enable_pinentry_gtk2" + pinentry_gtk_2=$enableval +else + pinentry_gtk_2=maybe +fi; + +if test "$pinentry_gtk_2" != "no"; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_PKGCONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PKGCONFIG"; then + ac_cv_prog_PKGCONFIG="$PKGCONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PKGCONFIG="yes" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_PKGCONFIG" && ac_cv_prog_PKGCONFIG="no" +fi +fi +PKGCONFIG=$ac_cv_prog_PKGCONFIG +if test -n "$PKGCONFIG"; then + echo "$as_me:$LINENO: result: $PKGCONFIG" >&5 +echo "${ECHO_T}$PKGCONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi + if test x"$PKGCONFIG" != xyes ; then + pinentry_gtk_2=no + fi +fi - rm -f conf.gtktest +if test "$pinentry_gtk_2" != "no"; then + echo "$as_me:$LINENO: checking for gtk+-2" >&5 +echo $ECHO_N "checking for gtk+-2... $ECHO_C" >&6 + pkg-config --exists gtk+-2.0 + if test $? -ne 0 ; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: WARNING: pkg-config could not find the module gtk+-2.0" >&5 +echo "$as_me: WARNING: pkg-config could not find the module gtk+-2.0" >&2;} + pinentry_gtk_2=no + else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + echo "$as_me:$LINENO: checking gtk+-2 version >= 2.4.0" >&5 +echo $ECHO_N "checking gtk+-2 version >= 2.4.0... $ECHO_C" >&6 + modvers=`pkg-config --modversion gtk+-2.0` + echo "$as_me:$LINENO: result: $modvers" >&5 +echo "${ECHO_T}$modvers" >&6 + pkg-config --atleast-version=2.4.0 gtk+-2.0 + if test $? -ne 0 ; then + { echo "$as_me:$LINENO: WARNING: building GTK+-2 pinentry disabled" >&5 +echo "$as_me: WARNING: building GTK+-2 pinentry disabled" >&2;} + pinentry_gtk_2=no + else + GTK2CFLAGS=`pkg-config --cflags gtk+-2.0` + GTK2LIBS=`pkg-config --libs gtk+-2.0` -fi -if test "$pinentry_gtk" != "no"; then - pinentry_gtk=yes + pinentry_gtk_2=yes + fi + fi fi -if test "$pinentry_gtk" = "yes"; then - BUILD_PINENTRY_GTK_TRUE= - BUILD_PINENTRY_GTK_FALSE='#' +if test "$pinentry_gtk_2" = "yes"; then + BUILD_PINENTRY_GTK_2_TRUE= + BUILD_PINENTRY_GTK_2_FALSE='#' else - BUILD_PINENTRY_GTK_TRUE='#' - BUILD_PINENTRY_GTK_FALSE= + BUILD_PINENTRY_GTK_2_TRUE='#' + BUILD_PINENTRY_GTK_2_FALSE= fi - # Check whether --enable-pinentry-qt or --disable-pinentry-qt was given. if test "${enable_pinentry_qt+set}" = set; then enableval="$enable_pinentry_qt" @@ -6872,7 +7944,9 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - : > sub/conftst$i.h + # 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 @@ -6900,9 +7974,14 @@ else grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # (even with -Werror). So we grep stderr for any message - # that says an option was ignored. - if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi @@ -7319,55 +8398,296 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Check whether --enable-embedded or --disable-embedded was given. +if test "${enable_embedded+set}" = set; then + enableval="$enable_embedded" + qt_use_emb=$enableval +else + qt_use_emb=no + +fi; + +# Check whether --enable-palmtop or --disable-palmtop was given. +if test "${enable_palmtop+set}" = set; then + enableval="$enable_palmtop" + qt_use_emb_palm=$enableval +else + qt_use_emb_palm=no + +fi; + +if test "$qt_use_emb" = "no"; then + echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + +ac_path_x_has_been_run=yes + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + +fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'_ACEOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for a specified header file. + # First, try using that file with no special directory specified. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XtMalloc (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no -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 - - - -# Check whether --enable-embedded or --disable-embedded was given. -if test "${enable_embedded+set}" = set; then - enableval="$enable_embedded" - qt_use_emb=$enableval +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" else - qt_use_emb=no + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi -fi; + fi + eval "$ac_cv_have_x" +fi # $with_x != no -# Check whether --enable-palmtop or --disable-palmtop was given. -if test "${enable_palmtop+set}" = set; then - enableval="$enable_palmtop" - qt_use_emb_palm=$enableval +if test "$have_x" != yes; then + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 + no_x=yes else - qt_use_emb_palm=no + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + # It might be that x_includes is empty (headers are found in the + # standard search path. Then output the corresponding message + ac_out_x_includes=$x_includes + test "x$x_includes" = x && ac_out_x_includes="in standard search path" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6 +fi -fi; -if test "$qt_use_emb" = "no"; then +if test "x$ac_path_x_has_been_run" != xyes; then echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 +ac_path_x_has_been_run=yes # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -7460,7 +8780,7 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for a specified header file. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7594,11 +8914,16 @@ else # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 + # It might be that x_includes is empty (headers are found in the + # standard search path. Then output the corresponding message + ac_out_x_includes=$x_includes + test "x$x_includes" = x && ac_out_x_includes="in standard search path" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6 fi - if test "$no_x" = yes; then +fi +if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF @@ -9492,7 +10817,7 @@ for i in $qt_incdirs; do for j in $kde_qt_header; do - echo "configure: 9495: $i/$j" >&5 + echo "configure: 10820: $i/$j" >&5 if test -r "$i/$j"; then echo "taking that" >&5 qt_incdir=$i @@ -9666,140 +10991,6 @@ echo "${ECHO_T}libraries $ac_qt_librarie qt_includes="$ac_qt_includes" fi -if test ! "$kde_qt_libs_given" = "yes"; then - - -echo "$as_me:$LINENO: checking if Qt compiles without flags" >&5 -echo $ECHO_N "checking if Qt compiles without flags... $ECHO_C" >&6 -if test "${kde_cv_qt_direct+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH -ac_LIBRARY_PATH="$LIBRARY_PATH" -ac_cxxflags_safe="$CXXFLAGS" -ac_ldflags_safe="$LDFLAGS" -ac_libs_safe="$LIBS" - -CXXFLAGS="$CXXFLAGS -I$qt_includes" -LDFLAGS="$LDFLAGS $QT_LDFLAGS" -LIBS="$QT_LIBS" -LD_LIBRARY_PATH= -export LD_LIBRARY_PATH -LIBRARY_PATH= -export LIBRARY_PATH - - - -cat > conftest.$ac_ext < -#include -EOF -if test "$qt_ver" = "2"; then -cat >> conftest.$ac_ext < -#include -#include -EOF - -if test $qt_subver -gt 0; then -cat >> conftest.$ac_ext < -EOF -fi -fi - -if test "$qt_ver" = "3"; then -cat >> conftest.$ac_ext < -#include -#include -EOF -fi - -echo "#if ! ($qt_verstring)" >> conftest.$ac_ext -cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest; then - kde_cv_qt_direct="yes" -else - kde_cv_qt_direct="no" - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi - -rm -f conftest* -CXXFLAGS="$ac_cxxflags_safe" -LDFLAGS="$ac_ldflags_safe" -LIBS="$ac_libs_safe" - -LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" -export LD_LIBRARY_PATH -LIBRARY_PATH="$ac_LIBRARY_PATH" -export LIBRARY_PATH -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 - - -if test "$kde_cv_qt_direct" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - qt_libraries= -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - -fi - -fi - @@ -9913,10 +11104,18 @@ echo "${ECHO_T}$USE_RPATH" >&6 if test $have_qt = "no"; then if test $pinentry_qt = "yes"; then - { { echo "$as_me:$LINENO: error: Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation! - For more details about this problem, look at the end of config.log.$missing_qt_mt" >&5 -echo "$as_me: error: Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation! - For more details about this problem, look at the end of config.log.$missing_qt_mt" >&2;} + { { echo "$as_me:$LINENO: error: +*** +*** Qt ($qt_minversion) $ac_qt_notfound not found. Please check your +*** installation! For more details about this problem, look at the +*** end of config.log.$missing_qt_mt +***" >&5 +echo "$as_me: error: +*** +*** Qt ($qt_minversion) $ac_qt_notfound not found. Please check your +*** installation! For more details about this problem, look at the +*** end of config.log.$missing_qt_mt +***" >&2;} { (exit 1); exit 1; }; } else pinentry_qt="no" @@ -9924,22 +11123,26 @@ echo "$as_me: error: Qt ($qt_minversion) fi if test $have_moc = "no"; then if test $pinentry_qt = "yes"; then - { { echo "$as_me:$LINENO: error: No Qt meta object compiler (moc) found! - Please check whether you installed Qt correctly. - You need to have a running moc binary. - configure tried to run $ac_cv_path_moc and the test didn't - succeed. If configure shouldn't have tried this one, set - the environment variable MOC to the right one before running - configure. - " >&5 -echo "$as_me: error: No Qt meta object compiler (moc) found! - Please check whether you installed Qt correctly. - You need to have a running moc binary. - configure tried to run $ac_cv_path_moc and the test didn't - succeed. If configure shouldn't have tried this one, set - the environment variable MOC to the right one before running - configure. - " >&2;} + { { echo "$as_me:$LINENO: error: +*** +*** No Qt meta object compiler (moc) found! +*** Please check whether you installed Qt correctly. +*** You need to have a running moc binary. +*** configure tried to run $ac_cv_path_moc and the test didn't +*** succeed. If configure shouldn't have tried this one, set +*** the environment variable MOC to the right one before running +*** configure. +***" >&5 +echo "$as_me: error: +*** +*** No Qt meta object compiler (moc) found! +*** Please check whether you installed Qt correctly. +*** You need to have a running moc binary. +*** configure tried to run $ac_cv_path_moc and the test didn't +*** succeed. If configure shouldn't have tried this one, set +*** the environment variable MOC to the right one before running +*** configure. +***" >&2;} { (exit 1); exit 1; }; } else pinentry_qt="no" @@ -9961,9 +11164,64 @@ else fi +if test "$pinentry_qt" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define PINENTRY_QT 1 +_ACEOF + +fi + + + +# +# Check whether we should build the W32 pinentry. This is actually +# the simplest check as we do this only for that platform. +# +pinentry_w32=no +test $have_w32_system = yes && pinentry_w32=yes + + +if test "$pinentry_w32" = "yes"; then + BUILD_PINENTRY_W32_TRUE= + BUILD_PINENTRY_W32_FALSE='#' +else + BUILD_PINENTRY_W32_TRUE='#' + BUILD_PINENTRY_W32_FALSE= +fi + + + +# +# Figure out the default pinentry +# +if test "$pinentry_gtk" = "yes"; then + PINENTRY_DEFAULT=pinentry-gtk +else + if test "$pinentry_gtk_2" = "yes"; then + PINENTRY_DEFAULT=pinentry-gtk-2 + else + if test "$pinentry_qt" = "yes"; then + PINENTRY_DEFAULT=pinentry-qt + else + if test "$pinentry_curses" = "yes"; then + PINENTRY_DEFAULT=pinentry-curses + else + if test "$pinentry_w32" = "yes"; then + PINENTRY_DEFAULT=pinentry-w32 + else + { { echo "$as_me:$LINENO: error: No pinentry enabled." >&5 +echo "$as_me: error: No pinentry enabled." >&2;} + { (exit 1); exit 1; }; } + fi + fi + fi + fi +fi + - ac_config_files="$ac_config_files assuan/Makefile secmem/Makefile pinentry/Makefile curses/Makefile gtk/Makefile qt/Makefile doc/Makefile Makefile" + ac_config_files="$ac_config_files assuan/Makefile secmem/Makefile pinentry/Makefile curses/Makefile gtk/Makefile gtk+-2/Makefile qt/Makefile w32/Makefile doc/Makefile Makefile" cat >confcache <<\_ACEOF @@ -10085,6 +11343,20 @@ echo "$as_me: error: conditional \"am__f Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${HAVE_DOSISH_SYSTEM_TRUE}" && test -z "${HAVE_DOSISH_SYSTEM_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_DOSISH_SYSTEM\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_DOSISH_SYSTEM\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_W32_SYSTEM_TRUE}" && test -z "${HAVE_W32_SYSTEM_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_W32_SYSTEM\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_W32_SYSTEM\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${BUILD_LIBPINENTRY_CURSES_TRUE}" && test -z "${BUILD_LIBPINENTRY_CURSES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_LIBPINENTRY_CURSES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -10113,6 +11385,13 @@ echo "$as_me: error: conditional \"BUILD Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${BUILD_PINENTRY_GTK_2_TRUE}" && test -z "${BUILD_PINENTRY_GTK_2_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_PINENTRY_GTK_2\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_PINENTRY_GTK_2\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -10127,6 +11406,13 @@ echo "$as_me: error: conditional \"BUILD Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${BUILD_PINENTRY_W32_TRUE}" && test -z "${BUILD_PINENTRY_W32_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_PINENTRY_W32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_PINENTRY_W32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -10398,7 +11684,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by pinentry $as_me 0.7.1, which was +This file was extended by pinentry $as_me 0.7.2, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10461,7 +11747,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -pinentry config.status 0.7.1 +pinentry config.status 0.7.2 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -10576,7 +11862,9 @@ do "pinentry/Makefile" ) CONFIG_FILES="$CONFIG_FILES pinentry/Makefile" ;; "curses/Makefile" ) CONFIG_FILES="$CONFIG_FILES curses/Makefile" ;; "gtk/Makefile" ) CONFIG_FILES="$CONFIG_FILES gtk/Makefile" ;; + "gtk+-2/Makefile" ) CONFIG_FILES="$CONFIG_FILES gtk+-2/Makefile" ;; "qt/Makefile" ) CONFIG_FILES="$CONFIG_FILES qt/Makefile" ;; + "w32/Makefile" ) CONFIG_FILES="$CONFIG_FILES w32/Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; @@ -10677,14 +11965,17 @@ s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t -s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t @@ -10721,6 +12012,13 @@ s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s,@LN_S@,$LN_S,;t t +s,@WINDRES@,$WINDRES,;t t +s,@ac_ct_WINDRES@,$ac_ct_WINDRES,;t t +s,@HAVE_DOSISH_SYSTEM_TRUE@,$HAVE_DOSISH_SYSTEM_TRUE,;t t +s,@HAVE_DOSISH_SYSTEM_FALSE@,$HAVE_DOSISH_SYSTEM_FALSE,;t t +s,@HAVE_W32_SYSTEM_TRUE@,$HAVE_W32_SYSTEM_TRUE,;t t +s,@HAVE_W32_SYSTEM_FALSE@,$HAVE_W32_SYSTEM_FALSE,;t t s,@EGREP@,$EGREP,;t t s,@SETCAP@,$SETCAP,;t t s,@LIBCAP@,$LIBCAP,;t t @@ -10734,7 +12032,6 @@ s,@BUILD_PINENTRY_CURSES_TRUE@,$BUILD_PI s,@BUILD_PINENTRY_CURSES_FALSE@,$BUILD_PINENTRY_CURSES_FALSE,;t t s,@FALLBACK_CURSES_TRUE@,$FALLBACK_CURSES_TRUE,;t t s,@FALLBACK_CURSES_FALSE@,$FALLBACK_CURSES_FALSE,;t t -s,@LIBICONV@,$LIBICONV,;t t s,@GLIB_CONFIG@,$GLIB_CONFIG,;t t s,@GLIB_CFLAGS@,$GLIB_CFLAGS,;t t s,@GLIB_LIBS@,$GLIB_LIBS,;t t @@ -10743,6 +12040,13 @@ s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t s,@GTK_LIBS@,$GTK_LIBS,;t t s,@BUILD_PINENTRY_GTK_TRUE@,$BUILD_PINENTRY_GTK_TRUE,;t t s,@BUILD_PINENTRY_GTK_FALSE@,$BUILD_PINENTRY_GTK_FALSE,;t t +s,@LIBICONV@,$LIBICONV,;t t +s,@LTLIBICONV@,$LTLIBICONV,;t t +s,@PKGCONFIG@,$PKGCONFIG,;t t +s,@GTK2CFLAGS@,$GTK2CFLAGS,;t t +s,@GTK2LIBS@,$GTK2LIBS,;t t +s,@BUILD_PINENTRY_GTK_2_TRUE@,$BUILD_PINENTRY_GTK_2_TRUE,;t t +s,@BUILD_PINENTRY_GTK_2_FALSE@,$BUILD_PINENTRY_GTK_2_FALSE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@X_CFLAGS@,$X_CFLAGS,;t t s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t @@ -10765,6 +12069,9 @@ s,@x_libraries@,$x_libraries,;t t s,@QT_RPATH@,$QT_RPATH,;t t s,@BUILD_PINENTRY_QT_TRUE@,$BUILD_PINENTRY_QT_TRUE,;t t s,@BUILD_PINENTRY_QT_FALSE@,$BUILD_PINENTRY_QT_FALSE,;t t +s,@BUILD_PINENTRY_W32_TRUE@,$BUILD_PINENTRY_W32_TRUE,;t t +s,@BUILD_PINENTRY_W32_FALSE@,$BUILD_PINENTRY_W32_FALSE,;t t +s,@PINENTRY_DEFAULT@,$PINENTRY_DEFAULT,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF @@ -11390,27 +12697,21 @@ echo X"$mf" | else continue fi - grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + # 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 -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # 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 -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + 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 @@ -11495,16 +12796,24 @@ fi Curses Pinentry: $pinentry_curses GTK+ Pinentry: $pinentry_gtk + GTK+-2 Pinentry: $pinentry_gtk_2 Qt Pinentry: $pinentry_qt + W32 Pinentry: $pinentry_w32 Fallback to Curses: $fallback_curses + + Default Pinentry: $PINENTRY_DEFAULT " >&5 echo "$as_me: Pinentry v${VERSION} has been configured as follows: Curses Pinentry: $pinentry_curses GTK+ Pinentry: $pinentry_gtk + GTK+-2 Pinentry: $pinentry_gtk_2 Qt Pinentry: $pinentry_qt + W32 Pinentry: $pinentry_w32 Fallback to Curses: $fallback_curses + + Default Pinentry: $PINENTRY_DEFAULT " >&6;} diff -urpP pinentry-0.7.1/configure.ac pinentry-0.7.2/configure.ac --- pinentry-0.7.1/configure.ac 2004-04-21 19:31:46.000000000 +0000 +++ pinentry-0.7.2/configure.ac 2005-01-27 08:04:19.000000000 +0000 @@ -24,15 +24,13 @@ min_automake_version="1.7.6" # Remember to remove the "-cvs" suffix *before* a release and to bump the # version number immediately *after* a release and to re-append the suffix. -AC_INIT(pinentry, 0.7.1, [gpa-dev@gnupg.org]) +AC_INIT(pinentry, 0.7.2, [gpa-dev@gnupg.org]) AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(pinentry/pinentry.h) AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION) -AH_TOP([ -/* We need this, because some autoconf tests rely on this (e.g. stpcpy) - and it should be used for new programs anyway */ -#define _GNU_SOURCE 1 -]) + +AC_GNU_SOURCE + AM_MAINTAINER_MODE AC_CANONICAL_HOST @@ -51,6 +49,49 @@ AC_PROG_RANLIB # We need to check for cplusplus here becuase we may not do the test # for Qt and autoconf does does not allow that. AC_PROG_CXX +AC_PROG_LN_S +AC_CHECK_TOOL(WINDRES, windres, :) + + +have_dosish_system=no +have_w32_system=no +case "${host}" in + *-mingw32*) + AC_DEFINE(USE_ONLY_8DOT3,1, + [set this to limit filenames to the 8.3 format]) + AC_DEFINE(HAVE_DRIVE_LETTERS,1, + [defined if we must run on a stupid file system]) + have_dosish_system=yes + have_w32_system=yes + ;; + i?86-emx-os2 | i?86-*-os2*emx ) + # OS/2 with the EMX environment + AC_DEFINE(HAVE_DRIVE_LETTERS) + have_dosish_system=yes + ;; + + i?86-*-msdosdjgpp*) + # DOS with the DJGPP environment + AC_DEFINE(HAVE_DRIVE_LETTERS) + have_dosish_system=yes + ;; +esac + +if test "$have_dosish_system" = yes; then + AC_DEFINE(HAVE_DOSISH_SYSTEM,1, + [Defined if we run on some of the PCDOS like systems + (DOS, Windoze. OS/2) with special properties like + no file modes]) +fi +AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) + +if test "$have_w32_system" = yes; then + AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) +fi +AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) + + + dnl Checks for compiler features. if test "$GCC" = yes; then @@ -58,6 +99,11 @@ if test "$GCC" = yes; then CPPFLAGS="$CPPFLAGS -Wall" fi + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h) + dnl Checks for library functions. AC_CHECK_FUNCS(seteuid stpcpy mmap) GNUPG_CHECK_MLOCK @@ -101,27 +147,30 @@ if test "$LIBCURSES"; then if test "$fallback_curses" != "no"; then fallback_curses=yes AC_DEFINE(FALLBACK_CURSES, 1, - [The GUI pinentries should fall back to curses if X is not available.]) + [The GUI pinentries should fall back to curses if X is not available.]) fi else if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then AC_MSG_ERROR([[ +*** *** The curses library is required. The latest version of *** ncurses is always available from ftp://ftp.gnu.org/gnu/ncurses/. -]]) +***]]) fi pinentry_curses=no fallback_curses=no fi -AM_CONDITIONAL(BUILD_LIBPINENTRY_CURSES, test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes") +AM_CONDITIONAL(BUILD_LIBPINENTRY_CURSES, + test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes") AM_CONDITIONAL(BUILD_PINENTRY_CURSES, test "$pinentry_curses" = "yes") AM_CONDITIONAL(FALLBACK_CURSES, test "$fallback_curses" = "yes") -if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then -dnl Additional checks for Curses pinentry. -AM_ICONV +if test "$pinentry_curses" = "yes"; then + AC_DEFINE(PINENTRY_CURSES, 1, + [The Curses version of Pinentry is to be build]) fi + dnl dnl Check for GTK+ pinentry program. dnl @@ -136,9 +185,10 @@ if test "$pinentry_gtk" != "no"; then AM_PATH_GLIB(1.2.0,, if test "$pinentry_gtk" = "yes"; then AC_MSG_ERROR([[ +*** *** GLIB 1.2.0 or newer is required. The latest version of GLIB *** is always available from ftp://ftp.gtk.org/. -]]) +***]]) else pinentry_gtk=no fi) @@ -149,9 +199,10 @@ AM_PATH_GTK(1.2.0, AC_DEFINE(HAVE_GTK, 1, [Defined if GTK is available]), if test "$pinentry_gtk" = "yes"; then AC_MSG_ERROR([[ +*** *** GTK+ 1.2.0 or newer is required. The latest version of GTK+ *** is always available form ftp://ftp.gtk.org/. -]]) +***]]) else pinentry_gtk=no fi) @@ -162,6 +213,16 @@ if test "$pinentry_gtk" != "no"; then pinentry_gtk=yes fi AM_CONDITIONAL(BUILD_PINENTRY_GTK, test "$pinentry_gtk" = "yes") +if test "$pinentry_gtk" = "yes"; then + AC_DEFINE(PINENTRY_GTK, 1, [The GTK+ version of Pinentry is to be build]) +fi + +if test "$pinentry_curses" = "yes" \ + -o "$fallback_curses" = "yes" \ + -o "$pinentry_gtk" = "yes"; then +dnl Additional checks pinentry Curses/GTK+. +AM_ICONV +fi dnl if test "$pinentry_gtk" = "yes"; then dnl Additional checks for GTK+ pinentry. @@ -170,6 +231,50 @@ dnl fi dnl +dnl Check for GTK+-2 pinentry program. +dnl +AC_ARG_ENABLE(pinentry-gtk2, + AC_HELP_STRING([--enable-pinentry-gtk2], [build GTK+-2 pinentry]), + pinentry_gtk_2=$enableval, pinentry_gtk_2=maybe) + +dnl check for pkg-config +if test "$pinentry_gtk_2" != "no"; then + AC_CHECK_PROG(PKGCONFIG, pkg-config, [yes], [no]) + if test x"$PKGCONFIG" != xyes ; then + pinentry_gtk_2=no + fi +fi + +dnl check if the module gtk+-2.0 exists +if test "$pinentry_gtk_2" != "no"; then + AC_MSG_CHECKING([for gtk+-2]) + pkg-config --exists gtk+-2.0 + if test $? -ne 0 ; then + AC_MSG_RESULT([no]) + AC_MSG_WARN([pkg-config could not find the module gtk+-2.0]) + pinentry_gtk_2=no + else + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([gtk+-2 version >= 2.4.0]) + modvers=`pkg-config --modversion gtk+-2.0` + AC_MSG_RESULT([$modvers]) + pkg-config --atleast-version=2.4.0 gtk+-2.0 + if test $? -ne 0 ; then + AC_MSG_WARN([building GTK+-2 pinentry disabled]) + pinentry_gtk_2=no + else + GTK2CFLAGS=`pkg-config --cflags gtk+-2.0` + GTK2LIBS=`pkg-config --libs gtk+-2.0` + AC_SUBST(GTK2CFLAGS) + AC_SUBST(GTK2LIBS) + pinentry_gtk_2=yes + fi + fi +fi +AM_CONDITIONAL(BUILD_PINENTRY_GTK_2, test "$pinentry_gtk_2" = "yes") + + +dnl dnl Check for Qt pinentry program. dnl AC_ARG_ENABLE(pinentry-qt, @@ -183,22 +288,28 @@ QT_CHECK_COMPILERS QT_PATH if test $have_qt = "no"; then if test $pinentry_qt = "yes"; then - AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation! - For more details about this problem, look at the end of config.log.$missing_qt_mt]) + AC_MSG_ERROR([[ +*** +*** Qt ($qt_minversion) $ac_qt_notfound not found. Please check your +*** installation! For more details about this problem, look at the +*** end of config.log.$missing_qt_mt +***]]) else pinentry_qt="no" fi fi if test $have_moc = "no"; then if test $pinentry_qt = "yes"; then - AC_MSG_ERROR([No Qt meta object compiler (moc) found! - Please check whether you installed Qt correctly. - You need to have a running moc binary. - configure tried to run $ac_cv_path_moc and the test didn't - succeed. If configure shouldn't have tried this one, set - the environment variable MOC to the right one before running - configure. - ]) + AC_MSG_ERROR([[ +*** +*** No Qt meta object compiler (moc) found! +*** Please check whether you installed Qt correctly. +*** You need to have a running moc binary. +*** configure tried to run $ac_cv_path_moc and the test didn't +*** succeed. If configure shouldn't have tried this one, set +*** the environment variable MOC to the right one before running +*** configure. +***]]) else pinentry_qt="no" fi @@ -211,19 +322,61 @@ if test "$pinentry_qt" != "no"; then fi AM_CONDITIONAL(BUILD_PINENTRY_QT, test "$pinentry_qt" = "yes") +if test "$pinentry_qt" = "yes"; then + AC_DEFINE(PINENTRY_QT, 1, [The Qt version of Pinentry is to be build]) +fi + dnl if test "$pinentry_qt" = "yes"; then dnl dnl Additional checks for Qt pinentry. dnl dnl End of checks for Qt pinentry. dnl fi +# +# Check whether we should build the W32 pinentry. This is actually +# the simplest check as we do this only for that platform. +# +pinentry_w32=no +test $have_w32_system = yes && pinentry_w32=yes +AM_CONDITIONAL(BUILD_PINENTRY_W32, test "$pinentry_w32" = "yes") + + +# +# Figure out the default pinentry +# +if test "$pinentry_gtk" = "yes"; then + PINENTRY_DEFAULT=pinentry-gtk +else + if test "$pinentry_gtk_2" = "yes"; then + PINENTRY_DEFAULT=pinentry-gtk-2 + else + if test "$pinentry_qt" = "yes"; then + PINENTRY_DEFAULT=pinentry-qt + else + if test "$pinentry_curses" = "yes"; then + PINENTRY_DEFAULT=pinentry-curses + else + if test "$pinentry_w32" = "yes"; then + PINENTRY_DEFAULT=pinentry-w32 + else + AC_MSG_ERROR([[No pinentry enabled.]]) + fi + fi + fi + fi +fi +AC_SUBST(PINENTRY_DEFAULT) + + AC_CONFIG_FILES([ assuan/Makefile secmem/Makefile pinentry/Makefile curses/Makefile gtk/Makefile +gtk+-2/Makefile qt/Makefile +w32/Makefile doc/Makefile Makefile ]) @@ -235,7 +388,11 @@ AC_MSG_NOTICE([ Curses Pinentry: $pinentry_curses GTK+ Pinentry: $pinentry_gtk + GTK+-2 Pinentry: $pinentry_gtk_2 Qt Pinentry: $pinentry_qt + W32 Pinentry: $pinentry_w32 Fallback to Curses: $fallback_curses + + Default Pinentry: $PINENTRY_DEFAULT ]) diff -urpP pinentry-0.7.1/curses/Makefile.in pinentry-0.7.2/curses/Makefile.in --- pinentry-0.7.1/curses/Makefile.in 2004-04-21 19:33:59.000000000 +0000 +++ pinentry-0.7.2/curses/Makefile.in 2005-01-27 08:11:58.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -33,6 +33,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +SOURCES = $(pinentry_curses_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -40,7 +42,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -54,7 +55,44 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +bin_PROGRAMS = pinentry-curses$(EXEEXT) +subdir = curses +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_pinentry_curses_OBJECTS = pinentry-curses.$(OBJEXT) +pinentry_curses_OBJECTS = $(am_pinentry_curses_OBJECTS) +pinentry_curses_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +pinentry_curses_DEPENDENCIES = ../pinentry/libpinentry.a \ + ../pinentry/libpinentry-curses.a ../assuan/libassuan.a \ + ../secmem/libsecmem.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(pinentry_curses_SOURCES) +DIST_SOURCES = $(pinentry_curses_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -67,10 +105,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -93,9 +135,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,6 +158,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -125,6 +175,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -140,6 +192,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -148,6 +201,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -155,6 +209,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -175,6 +231,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -185,66 +242,56 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - EXTRA_DIST = Manifest - -bin_PROGRAMS = pinentry-curses - AM_CPPFLAGS = $(NCURSES_INCLUDE) -I$(top_srcdir)/pinentry LDADD = ../pinentry/libpinentry.a ../pinentry/libpinentry-curses.a \ ../assuan/libassuan.a ../secmem/libsecmem.a \ $(LIBCAP) $(LIBCURSES) $(LIBICONV) - pinentry_curses_SOURCES = pinentry-curses.c -subdir = curses -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = pinentry-curses$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_pinentry_curses_OBJECTS = pinentry-curses.$(OBJEXT) -pinentry_curses_OBJECTS = $(am_pinentry_curses_OBJECTS) -pinentry_curses_LDADD = $(LDADD) -pinentry_curses_DEPENDENCIES = ../pinentry/libpinentry.a \ - ../pinentry/libpinentry-curses.a ../assuan/libassuan.a \ - ../secmem/libsecmem.a -pinentry_curses_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/pinentry-curses.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(pinentry_curses_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(pinentry_curses_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu curses/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu curses/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done @@ -252,8 +299,8 @@ uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @@ -263,7 +310,7 @@ pinentry-curses$(EXEEXT): $(pinentry_cur $(LINK) $(pinentry_curses_LDFLAGS) $(pinentry_curses_OBJECTS) $(pinentry_curses_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -271,36 +318,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-curses.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -309,6 +340,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -320,10 +352,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -346,10 +379,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -363,7 +392,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -381,9 +410,10 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -403,7 +433,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -422,6 +452,8 @@ dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -457,11 +489,11 @@ uninstall-am: uninstall-binPROGRAMS unin .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am diff -urpP pinentry-0.7.1/depcomp pinentry-0.7.2/depcomp --- pinentry-0.7.1/depcomp 2003-12-09 10:06:56.000000000 +0000 +++ pinentry-0.7.2/depcomp 2004-12-22 11:08:37.000000000 +0000 @@ -1,7 +1,9 @@ #! /bin/sh - # depcomp - compile a program generating dependencies as side-effects -# Copyright 1999, 2000 Free Software Foundation, Inc. + +scriptversion=2004-05-31.23 + +# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,22 +27,45 @@ # Originally written by Alexandre Oliva . +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit 0 + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit 0 + ;; +esac + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi -# `libtool' can also be set to `yes' or `no'. - -if test -z "$depfile"; then - base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` - dir=`echo "$object" | sed 's,/.*$,/,'` - if test "$dir" = "$object"; then - dir= - fi - # FIXME: should be _deps on DOS. - depfile="$dir.deps/$base" -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" @@ -172,19 +197,25 @@ sgi) aix) # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. 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. - stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" - outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi - stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + if test $stat -eq 0; then : else rm -f "$tmpdepfile" @@ -192,6 +223,7 @@ aix) fi if test -f "$tmpdepfile"; then + outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. @@ -255,31 +287,40 @@ tru64) base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then + # Dependencies are output in .lo.d with libtool 1.4. + # With libtool 1.5 they are output both in $dir.libs/$base.o.d + # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the + # latter, because the former will be cleaned when $dir.libs is + # erased. tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir.libs/$base.d" + tmpdepfile2="$dir$base.o.d" + tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" + tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else - rm -f "$tmpdepfile1" "$tmpdepfile2" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" - else + elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" + else + tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a space and a tab in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$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 @@ -292,7 +333,7 @@ tru64) dashmstdout) # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout, regardless of -o. + # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. @@ -388,7 +429,7 @@ makedepend) cpp) # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout. + # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. @@ -430,7 +471,7 @@ cpp) msvisualcpp) # Important note: in order to support this mode, a compiler *must* - # always write the proprocessed file to stdout, regardless of -o, + # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " @@ -470,3 +511,12 @@ none) esac exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -urpP pinentry-0.7.1/doc/Makefile.in pinentry-0.7.2/doc/Makefile.in --- pinentry-0.7.1/doc/Makefile.in 2004-04-21 19:34:09.000000000 +0000 +++ pinentry-0.7.2/doc/Makefile.in 2005-01-27 08:11:58.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -31,7 +31,6 @@ # 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 - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -39,7 +38,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -53,7 +51,38 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +subdir = doc +DIST_COMMON = $(pinentry_TEXINFOS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/stamp-vti \ + $(srcdir)/version.texi mdate-sh texinfo.tex +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +INFO_DEPS = $(srcdir)/pinentry.info +am__TEXINFO_TEX_DIR = $(srcdir) +DVIS = pinentry.dvi +PDFS = pinentry.pdf +PSS = pinentry.ps +HTMLS = pinentry.html +TEXINFOS = pinentry.texi +TEXI2DVI = texi2dvi +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +am__installdirs = "$(DESTDIR)$(infodir)" +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -66,10 +95,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -92,9 +125,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -109,6 +148,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -124,6 +165,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -139,6 +182,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -147,6 +191,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -154,6 +199,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -174,6 +221,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -184,76 +232,109 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - info_TEXINFOS = pinentry.texi - pinentry_TEXINFOS = gpl.texi - DISTCLEANFILES = pinentry.tmp pinentry.ops -subdir = doc -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -am__TEXINFO_TEX_DIR = $(srcdir) -INFO_DEPS = pinentry.info -DVIS = pinentry.dvi -PDFS = pinentry.pdf -PSS = pinentry.ps -TEXINFOS = pinentry.texi -DIST_COMMON = $(pinentry_TEXINFOS) $(srcdir)/Makefile.in Makefile.am \ - mdate-sh stamp-vti texinfo.tex version.texi all: all-am .SUFFIXES: -.SUFFIXES: .dvi .info .pdf .ps .texi -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +.SUFFIXES: .dvi .html .info .pdf .ps .texi +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh .texi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9] - $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && cd $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + cd $(srcdir); \ + else \ + rc=$$?; \ + cd $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; exit $$rc .texi.dvi: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$< + $(TEXI2DVI) $< .texi.pdf: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$< -pinentry.info: pinentry.texi version.texi $(pinentry_TEXINFOS) -pinentry.dvi: pinentry.texi version.texi $(pinentry_TEXINFOS) -pinentry.pdf: pinentry.texi version.texi $(pinentry_TEXINFOS) -version.texi: @MAINTAINER_MODE_TRUE@ stamp-vti -stamp-vti: pinentry.texi $(top_srcdir)/configure + $(TEXI2PDF) $< + +.texi.html: + rm -rf $(@:.html=.htp) + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $(@:.html=.htp) $<; \ + then \ + rm -rf $@; \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ + else \ + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ + exit 1; \ + fi +$(srcdir)/pinentry.info: pinentry.texi $(srcdir)/version.texi $(pinentry_TEXINFOS) +pinentry.dvi: pinentry.texi $(srcdir)/version.texi $(pinentry_TEXINFOS) +pinentry.pdf: pinentry.texi $(srcdir)/version.texi $(pinentry_TEXINFOS) +pinentry.html: pinentry.texi $(srcdir)/version.texi $(pinentry_TEXINFOS) +$(srcdir)/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/stamp-vti +$(srcdir)/stamp-vti: pinentry.texi $(top_srcdir)/configure @(dir=.; test -f ./pinentry.texi || dir=$(srcdir); \ set `$(SHELL) $(srcdir)/mdate-sh $$dir/pinentry.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp - @cmp -s vti.tmp version.texi \ - || (echo "Updating version.texi"; \ - cp vti.tmp version.texi) + @cmp -s vti.tmp $(srcdir)/version.texi \ + || (echo "Updating $(srcdir)/version.texi"; \ + cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp - @cp version.texi $@ + @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: -@MAINTAINER_MODE_TRUE@ -rm -f stamp-vti version.texi -TEXI2DVI = texi2dvi - -TEXI2PDF = $(TEXI2DVI) --pdf --batch -DVIPS = dvips +@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: $(DVIPS) -o $@ $< @@ -264,8 +345,8 @@ uninstall-info-am: list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \ - install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @@ -273,15 +354,19 @@ uninstall-info-am: for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ - (if cd $(DESTDIR)$(infodir); then \ + (if cd "$(DESTDIR)$(infodir)"; then \ echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ for file in $$d/$$base*; do \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ @@ -291,10 +376,10 @@ dist-info: $(INFO_DEPS) done mostlyclean-aminfo: - -rm -f pinentry.aux pinentry.cp pinentry.cps pinentry.fn pinentry.ky \ + -rm -rf pinentry.aux pinentry.cp pinentry.cps pinentry.fn pinentry.ky \ pinentry.log pinentry.op pinentry.ops pinentry.pg \ pinentry.tmp pinentry.toc pinentry.tp pinentry.vr \ - pinentry.dvi pinentry.pdf pinentry.ps + pinentry.dvi pinentry.pdf pinentry.ps pinentry.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ @@ -308,10 +393,6 @@ TAGS: ctags: CTAGS CTAGS: -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -325,7 +406,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -346,9 +427,10 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(infodir) + for dir in "$(DESTDIR)$(infodir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -368,7 +450,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @@ -386,6 +468,10 @@ dvi: dvi-am dvi-am: $(DVIS) +html: html-am + +html-am: $(HTMLS) + info: info-am info-am: $(INFO_DEPS) @@ -398,17 +484,21 @@ install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ + test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ - echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \ - $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \ + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ else : ; fi; \ done; \ done @@ -418,8 +508,8 @@ install-info-am: $(INFO_DEPS) list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: @@ -446,11 +536,11 @@ ps-am: $(PSS) uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic dist-info \ - distclean distclean-generic distdir dvi dvi-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-aminfo \ + distclean distclean-generic distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-info-am diff -urpP pinentry-0.7.1/doc/mdate-sh pinentry-0.7.2/doc/mdate-sh --- pinentry-0.7.1/doc/mdate-sh 2003-12-09 10:06:57.000000000 +0000 +++ pinentry-0.7.2/doc/mdate-sh 2004-12-22 11:08:36.000000000 +0000 @@ -1,5 +1,8 @@ #!/bin/sh # Get modification time of a file or directory and pretty-print it. + +scriptversion=2003-11-09.00 + # Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # @@ -22,6 +25,31 @@ # 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 file. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification time of FILE. + +Report bugs to . +EOF + exit 0 + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit 0 + ;; +esac + # Prevent date giving response in another language. LANG=C export LANG @@ -131,3 +159,12 @@ esac # The result. echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -urpP pinentry-0.7.1/doc/pinentry.texi pinentry-0.7.2/doc/pinentry.texi --- pinentry-0.7.1/doc/pinentry.texi 2003-12-22 17:05:32.000000000 +0000 +++ pinentry-0.7.2/doc/pinentry.texi 2005-01-27 07:58:03.000000000 +0000 @@ -5,7 +5,7 @@ @include version.texi @macro copyrightnotice -Copyright @copyright{} 2002 g10 Code GmbH +Copyright @copyright{} 2002, 2005 g10 Code GmbH @end macro @macro permissionnotice Permission is granted to copy, distribute and/or modify this document @@ -67,7 +67,7 @@ section entitled ``Copying''. This file documents the use and the internals of the @pinentry{}. This is edition @value{EDITION}, last updated @value{UPDATED}, of -@cite{The `PINEnrty' Manual}, for version @value{VERSION}. +@cite{The `PINEntry' Manual}, for version @value{VERSION}. @sp 1 Published by g10 Code GmbH@* Hüttenstr. 61@* @@ -111,7 +111,7 @@ passphrases. It is usually invoked by @s @pinentry{} comes in 3 flavors to fit the look and feel of the used GUI toolkit: A @sc{GTK+} based one named @code{pinentry-gtk}, a @sc{Qt} based one named @code{pinentry-qt} and a non-graphical one based -on curser and named @code{pinentry-curses}. Not all of them might be +on curses and named @code{pinentry-curses}. Not all of them might be available on your installation. If curses is supported on your system, the GUI based flavors fall back to curses when the @code{DISPLAY} variable is not set. @@ -128,7 +128,7 @@ Miscellaneous * Copying:: GNU General Public License says how you can copy and share PIN-Entry - as well as this manulal. + as well as this manual. Indices @@ -141,7 +141,7 @@ Indices @c man begin DESCRIPTION -You may run @pinentry{} directly from the commandline and pass the +You may run @pinentry{} directly from the command line and pass the commands according to the Assuan protocol via stdin/stdout. @@ -158,7 +158,7 @@ Print the program version and licensing @item --help @opindex help -Print a usage message summarizing the most usefule command-line options. +Print a usage message summarizing the most useful command line options. @item --debug @itemx -d @@ -199,7 +199,7 @@ Note, that this is not fully supported b @opindex lc-type @opindex lc-messa These options are used to pass localization information to -@pinentry{}. They are required because @pinentry{} is usally called +@pinentry{}. They are required because @pinentry{} is usually called by some background process which does not have any information on the locale and terminal to use. Assuan protocol options are an alternative way to pass these information. @@ -229,7 +229,7 @@ correctness. Note that all strings are expected to be encoded as UTF-8; @pinentry{} takes care of converting it to the locally used codeset. To include -lienfeeds or other special characters, you may percent-escape them +linefeeds or other special characters, you may percent-escape them (i.e. a line feed is encoded as @code{%0A}, the percent sign itself is encoded as @code{%25}). @@ -252,15 +252,15 @@ passphrase entry. @end example @item Set the button texts -There are two text with can be set to overide the English defaults: +There are two text with can be set to override the English defaults: -To set the text for the button signalling confirmation (in UTF-8). +To set the text for the button signaling confirmation (in UTF-8). @example C: SETOK Yes S: OK @end example -To set the text for the button signalling cancellation or disagreement +To set the text for the button signaling cancellation or disagreement (in UTF-8). @example C: SETCANCEL No @@ -285,7 +285,7 @@ this command: S: OK @end example Note that the passphrase is transmitted in clear using standard data -responses. Expect it to be in utf-8. +responses. Expect it to be in UTF-8. @item Ask for confirmation To ask for a confirmation (yes or no), you can use this command: diff -urpP pinentry-0.7.1/doc/stamp-vti pinentry-0.7.2/doc/stamp-vti --- pinentry-0.7.1/doc/stamp-vti 2004-04-21 19:34:09.000000000 +0000 +++ pinentry-0.7.2/doc/stamp-vti 2005-01-27 08:06:25.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 22 December 2003 -@set UPDATED-MONTH December 2003 -@set EDITION 0.7.1 -@set VERSION 0.7.1 +@set UPDATED 27 January 2005 +@set UPDATED-MONTH January 2005 +@set EDITION 0.7.2 +@set VERSION 0.7.2 diff -urpP pinentry-0.7.1/doc/texinfo.tex pinentry-0.7.2/doc/texinfo.tex --- pinentry-0.7.1/doc/texinfo.tex 2003-12-09 10:06:57.000000000 +0000 +++ pinentry-0.7.2/doc/texinfo.tex 2004-12-22 11:08:36.000000000 +0000 @@ -3,10 +3,11 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2003-05-04.08} +\def\texinfoversion{2004-10-31.06} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, -% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software +% Foundation, Inc. % % This texinfo.tex file is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -23,21 +24,16 @@ % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, % Boston, MA 02111-1307, USA. % -% In other words, you are welcome to use, share and improve this program. -% You are forbidden to forbid anyone else to use, share and improve -% what you give them. Help stamp out software-hoarding! +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex -% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % ftp://tug.org/tex/texinfo.tex -% (and all CTAN mirrors, see http://www.ctan.org), -% and /home/gd/gnu/doc/texinfo.tex on the GNU machines. -% -% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. -% -% The texinfo.tex in any given Texinfo distribution could well be out +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a @@ -59,6 +55,9 @@ % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + \message{Loading texinfo [version \texinfoversion]:} @@ -85,10 +84,13 @@ \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! +\let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent +\let\ptexnoindent=\noindent +\let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexplus=+ @@ -101,6 +103,15 @@ % starts a new line in the output. \newlinechar = `^^J +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi @@ -139,43 +150,81 @@ \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi -\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi % In some macros, we cannot use the `\? notation---the left quote is % in some cases the escape char. \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dotChar = `\. -\chardef\equalChar = `\= \chardef\exclamChar= `\! \chardef\questChar = `\? \chardef\semiChar = `\; -\chardef\spaceChar = `\ % \chardef\underChar = `\_ +\chardef\spaceChar = `\ % +\chardef\spacecat = 10 +\def\spaceisspace{\catcode\spaceChar=\spacecat} + % Ignore a token. % \def\gobble#1{} -% True if #1 is the empty string, i.e., called like `\ifempty{}'. -% -\def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}% -\def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}% +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. -\hyphenation{ap-pen-dix} -\hyphenation{eshell} -\hyphenation{mini-buf-fer mini-buf-fers} -\hyphenation{time-stamp} -\hyphenation{white-space} +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make @@ -200,7 +249,7 @@ \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex - \errorcontextlines\maxdimen + \errorcontextlines16 }% % add check for \lastpenalty to plain's definitions. If the last thing @@ -258,7 +307,7 @@ % the page break happens to be in the middle of an example. \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. - \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize @@ -339,132 +388,162 @@ % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % -\def\parsearg#1{% - \let\next = #1% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\next{#2}% \begingroup \obeylines - \futurelet\temp\parseargx -} - -% If the next token is an obeyed space (from an @example environment or -% the like), remove it and recurse. Otherwise, we're done. -\def\parseargx{% - % \obeyedspace is defined far below, after the definition of \sepspaces. - \ifx\obeyedspace\temp - \expandafter\parseargdiscardspace - \else - \expandafter\parseargline - \fi + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. } -% Remove a single space (as the delimiter token to the macro call). -{\obeyspaces % - \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} - {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. - % - % First remove any @c comment, then any @comment. - % Result of each macro is put in \toks0. - \argremovec #1\c\relax % - \expandafter\argremovecomment \the\toks0 \comment\relax % - % - % Call the caller's macro, saved as \next in \parsearg. - \expandafter\next\expandafter{\the\toks0}% + \argremovecomment #1\comment\ArgTerm% }% } -% Since all \c{,omment} does is throw away the argument, we can let TeX -% do that for us. The \relax here is matched by the \relax in the call -% in \parseargline; it could be more or less anything, its purpose is -% just to delimit the argument to the \c. -\def\argremovec#1\c#2\relax{\toks0 = {#1}} -\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} -% \argremovec{,omment} might leave us with trailing spaces, though; e.g., +% Each occurence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., % @end itemize @c foo -% will have two active spaces as part of the argument with the -% `itemize'. Here we remove all active spaces from #1, and assign the -% result to \toks0. -% -% This loses if there are any *other* active characters besides spaces -% in the argument -- _ ^ +, for example -- since they get expanded. -% Fortunately, Texinfo does not define any such commands. (If it ever -% does, the catcode of the characters in questionwill have to be changed -% here.) But this means we cannot call \removeactivespaces as part of -% \argremovec{,omment}, since @c uses \parsearg, and thus the argument -% that \parsearg gets might well have any character at all in it. +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. % -\def\removeactivespaces#1{% - \begingroup - \ignoreactivespaces - \edef\temp{#1}% - \global\toks0 = \expandafter{\temp}% - \endgroup +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % We cannot use \next here, as it holds the macro to run; + % thus we reuse \temp. + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm } -% Change the active space to expand to nothing. +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \next. +% (Similarily, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. % -\begingroup - \obeyspaces - \gdef\ignoreactivespaces{\obeyspaces\let =\empty} -\endgroup +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}} +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 -\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} -%% These are used to keep @begin/@end levels from running away -%% Call \inENV within environments (after a \begingroup) -\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} -\def\ENVcheck{% -\ifENV\errmessage{Still within an environment; press RETURN to continue} -\endgroup\fi} % This is not perfect, but it should reduce lossage +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } -% @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Press RETURN to continue.} + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} -\outer\def\begin{\parsearg\beginxxx} -\def\beginxxx #1{% -\expandafter\ifx\csname #1\endcsname\relax -{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else -\csname #1\endcsname\fi} +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} -% @end foo executes the definition of \Efoo. +% Define the framework for environments in texinfo.tex. It's used like this: % -\def\end{\parsearg\endxxx} -\def\endxxx #1{% - \removeactivespaces{#1}% - \edef\endthing{\the\toks0}% - % - \expandafter\ifx\csname E\endthing\endcsname\relax - \expandafter\ifx\csname \endthing\endcsname\relax - % There's no \foo, i.e., no ``environment'' foo. - \errhelp = \EMsimple - \errmessage{Undefined command `@end \endthing'}% - \else - \unmatchedenderror\endthing - \fi +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as enviroments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At runtime, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp \else - % Everything's ok; the right environment has been started. - \csname E\endthing\endcsname + \badenverr \fi } -% There is an environment #1, but it hasn't been started. Give an error. -% -\def\unmatchedenderror#1{% +% Evironment mismatch, #1 expected: +\def\badenverr{% \errhelp = \EMsimple - \errmessage{This `@end #1' doesn't have a matching `@#1'}% + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi } -% Define the control sequence \E#1 to give an unmatched @end error. +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv % -\def\defineunmatchedend#1{% - \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi } +\newhelp\EMsimple{Press RETURN to continue.} + %% Simple single-character @ commands @@ -496,6 +575,9 @@ !gdef!rbraceatcmd[@}]% !endgroup +% @comma{} to avoid , parsing problems. +\let\comma = , + % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \c @@ -505,10 +587,12 @@ \let\ubaraccent = \b \let\udotaccent = \d -% Other special characters: @questiondown @exclamdown +% Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} @@ -521,6 +605,25 @@ \fi\fi } +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and @@ -574,59 +677,14 @@ \newbox\groupbox \def\vfilllimit{0.7} % -\def\group{\begingroup - \ifnum\catcode13=\active \else +\envdef\group{% + \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi - % - % The \vtop we start below produces a box with normal height and large - % depth; thus, TeX puts \baselineskip glue before it, and (when the - % next line of text is done) \lineskip glue after it. (See p.82 of - % the TeXbook.) Thus, space below is not quite equal to space - % above. But it's pretty close. - \def\Egroup{% - \egroup % End the \vtop. - % \dimen0 is the vertical size of the group's box. - \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox - % \dimen2 is how much space is left on the page (more or less). - \dimen2 = \pageheight \advance\dimen2 by -\pagetotal - % if the group doesn't fit on the current page, and it's a big big - % group, force a page break. - \ifdim \dimen0 > \dimen2 - \ifdim \pagetotal < \vfilllimit\pageheight - \page - \fi - \fi - \copy\groupbox - \endgroup % End the \group. - }% + \startsavinginserts % \setbox\groupbox = \vtop\bgroup - % We have to put a strut on the last line in case the @group is in - % the midst of an example, rather than completely enclosing it. - % Otherwise, the interline space between the last line of the group - % and the first line afterwards is too small. But we can't put the - % strut in \Egroup, since there it would be on a line by itself. - % Hence this just inserts a strut at the beginning of each line. - \everypar = {\strut}% - % - % Since we have a strut on every line, we don't need any of TeX's - % normal interline spacing. - \offinterlineskip - % - % OK, but now we have to do something about blank - % lines in the input in @example-like environments, which normally - % just turn into \lisppar, which will insert no space now that we've - % turned off the interline space. Simplest is to make them be an - % empty paragraph. - \ifx\par\lisppar - \edef\par{\leavevmode \par}% - % - % Reset ^^M's definition to new definition of \par. - \obeylines - \fi - % % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after @@ -636,6 +694,32 @@ \comment } % +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % @@ -648,10 +732,8 @@ where each line of input produces a line \newdimen\mil \mil=0.001in -\def\need{\parsearg\needx} - % Old definition--didn't work. -%\def\needx #1{\par % +%\parseargdef\need{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% @@ -659,7 +741,7 @@ where each line of input produces a line %\prevdepth=-1000pt %}} -\def\needx#1{% +\parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par @@ -698,35 +780,10 @@ where each line of input produces a line \fi } -% @br forces paragraph break +% @br forces paragraph break (and is undocumented). \let\br = \par -% @dots{} output an ellipsis using the current font. -% We do .5em per period so that it has the same spacing in a typewriter -% font as three actual period characters. -% -\def\dots{% - \leavevmode - \hbox to 1.5em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% -} - -% @enddots{} is an end-of-sentence ellipsis. -% -\def\enddots{% - \leavevmode - \hbox to 2em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% - \spacefactor=3000 -} - % @page forces the start of a new page. % \def\page{\par\vfill\supereject} @@ -739,13 +796,11 @@ where each line of input produces a line \newskip\exdentamount % This defn is used inside fill environments such as @defun. -\def\exdent{\parsearg\exdentyyy} -\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. -\def\nofillexdent{\parsearg\nofillexdentyyy} -\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount -\leftline{\hskip\leftskip{\rm#1}}}} +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion @@ -797,8 +852,19 @@ where each line of input produces a line } % @include file insert text of that file as input. -% Allow normal characters that we make active in the argument (a file name). -\def\include{\begingroup +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable + \def\temp{\input #1 }% + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other @@ -807,33 +873,50 @@ where each line of input produces a line \catcode`<=\other \catcode`>=\other \catcode`+=\other - \parsearg\includezzz} -% Restore active chars for included file. -\def\includezzz#1{\endgroup\begingroup - % Read the included file in a group so nested @include's work. - \def\thisfile{#1}% - \let\value=\expandablevalue - \input\thisfile -\endgroup} + \catcode`-=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} \def\thisfile{} % @center line % outputs that line, centered. % -\def\center{\parsearg\docenter} -\def\docenter#1{{% - \ifhmode \hfil\break \fi - \advance\hsize by -\leftskip - \advance\hsize by -\rightskip - \line{\hfil \ignorespaces#1\unskip \hfil}% - \ifhmode \break \fi -}} +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space -\def\sp{\parsearg\spxxx} -\def\spxxx #1{\vskip #1\baselineskip} +\parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment @@ -854,8 +937,7 @@ where each line of input produces a line \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % -\def\paragraphindent{\parsearg\doparagraphindent} -\def\doparagraphindent#1{% +\parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -872,8 +954,7 @@ where each line of input produces a line % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. -\def\exampleindent{\parsearg\doexampleindent} -\def\doexampleindent#1{% +\parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -887,21 +968,18 @@ where each line of input produces a line % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph -% after a section heading. If WORD is `insert', then do indentat such +% after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling -% \suppressfirstparagraphindent, which the sectioning commands do. We -% switch the definition of this back and forth according to WORD. By -% default, we suppress indentation. +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} -\newdimen\currentparindent -% \def\insertword{insert} % -\def\firstparagraphindent{\parsearg\dofirstparagraphindent} -\def\dofirstparagraphindent#1{% +\parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent @@ -921,15 +999,24 @@ where each line of input produces a line % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% - \global\let\indent=\ptexindent - \global\everypar = {}% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent }% \global\everypar = {% - \kern-\parindent - \global\let\indent=\ptexindent - \global\everypar = {}% + \kern -\parindent + \restorefirstparagraphindent }% -}% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} % @asis just yields its argument. Used with @table, for example. @@ -937,23 +1024,18 @@ where each line of input produces a line \def\asis#1{#1} % @math outputs its argument in math mode. -% We don't use $'s directly in the definition of \math because we need -% to set catcodes according to plain TeX first, to allow for subscripts, -% superscripts, special math chars, etc. -% -\let\implicitmath = $%$ font-lock fix % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make -% _ within @math be active (mathcode "8000), and distinguish by seeing -% if the current family is \slfam, which is what @var uses. -% -{\catcode\underChar = \active -\gdef\mathunderscore{% - \catcode\underChar=\active - \def_{\ifnum\fam=\slfam \_\else\sb\fi}% -}} -% +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode\underChar = \active + \gdef\mathunderscore{% + \catcode\underChar=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} % Another complication: we want \\ (and @\) to output a \ character. % FYI, plain.tex uses \\ as a temporary control sequence (why?), but % this is not advertised and we don't care. Texinfo does not @@ -964,15 +1046,16 @@ where each line of input produces a line % \def\math{% \tex - \mathcode`\_="8000 \mathunderscore + \mathunderscore \let\\ = \mathbackslash \mathactive - \implicitmath\finishmath} -\def\finishmath#1{#1\implicitmath\Etex} + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. -% We have to reset their definitions in case the @math was an -% argument to a command which set the catcodes (such as @item or @section). +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active @@ -988,8 +1071,33 @@ where each line of input produces a line } % @bullet and @minus need the same treatment as @math, just above. -\def\bullet{\implicitmath\ptexbullet\implicitmath} -\def\minus{\implicitmath-\implicitmath} +\def\bullet{$\ptexbullet$} +\def\minus{$-$} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil + .\hfil.\hfil.% + \hskip 0pt plus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=3000 +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma = , % @refill is a no-op. \let\refill=\relax @@ -1005,20 +1113,20 @@ where each line of input produces a line % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks - \readauxfile + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. - % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf - \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi - \closein1 - \temp + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 % \comment % Ignore the actual filename. } @@ -1054,17 +1162,23 @@ where each line of input produces a line \newif\ifpdf \newif\ifpdfmakepagedest +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. \ifx\pdfoutput\undefined - \pdffalse - \let\pdfmkdest = \gobble - \let\pdfurl = \gobble - \let\endlink = \relax - \let\linkcolor = \relax - \let\pdfmakeoutlines = \relax \else - \pdftrue - \pdfoutput = 1 + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi +% +\ifpdf \input pdfcolor + \pdfcatalog{/PageMode /UseOutlines}% \def\dopdfimage#1#2#3{% \def\imagewidth{#2}% \def\imageheight{#3}% @@ -1085,7 +1199,13 @@ where each line of input produces a line \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} - \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code in a section title + % aren't expanded. + \atdummies + \normalturnoffactive + \pdfdest name{#1} xyz% + }} \def\pdfmkpgn#1{#1} \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} @@ -1094,48 +1214,94 @@ where each line of input produces a line \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax - \advance\tempnum by1 + \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} - \def\pdfmakeoutlines{{% - \openin 1 \jobname.toc - \ifeof 1\else\begingroup - \closein 1 + % + % #1 is the section text. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node + % text, which might be empty if this toc entry had no + % corresponding node. #4 is the page number. + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worthwhile, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}% + } + % + \def\pdfmakeoutlines{% + \begingroup % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % - \def\chapentry ##1##2##3{} - \def\secentry ##1##2##3##4{\advancenumber{chap##2}} - \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} - \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} - \let\appendixentry = \chapentry - \let\unnumbchapentry = \chapentry - \let\unnumbsecentry = \secentry - \let\unnumbsubsecentry = \subsecentry - \let\unnumbsubsubsecentry = \subsubsecentry + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \let\thissecnum\empty + \let\thissubsecnum\empty + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \let\thissubsecnum\empty + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \let\thischapnum\empty + \let\thissecnum\empty + \let\thissubsecnum\empty + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% \input \jobname.toc - \def\chapentry ##1##2##3{% - \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} - \def\secentry ##1##2##3##4{% - \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} - \def\subsecentry ##1##2##3##4##5{% - \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} - \def\subsubsecentry ##1##2##3##4##5##6{% - \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} - \let\appendixentry = \chapentry - \let\unnumbchapentry = \chapentry - \let\unnumbsecentry = \secentry - \let\unnumbsubsecentry = \subsecentry - \let\unnumbsubsubsecentry = \subsubsecentry % - % Make special characters normal for writing to the pdf file. + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. \indexnofonts - \let\tt=\relax \turnoffactive \input \jobname.toc - \endgroup\fi - }} + \endgroup + } + % \def\makelinks #1,{% \def\params{#1}\def\E{END}% \ifx\params\E @@ -1166,7 +1332,6 @@ where each line of input produces a line \def\ppn#1{\pgn=#1\gobble} \def\ppnn{\pgn=\first} \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces @@ -1184,18 +1349,17 @@ where each line of input produces a line \def\pdfurl#1{% \begingroup \normalturnoffactive\def\@{@}% - \let\value=\expandablevalue + \makevalueexpandable \leavevmode\Red \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% - % #1 \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS| + \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 @@ -1215,20 +1379,44 @@ where each line of input produces a line \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \linkcolor #1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\fi % \ifx\pdfoutput +\else + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\linkcolor = \relax + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput \message{fonts,} -% Font-change commands. + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}} +\def\tt{\fam=\ttfam \setfontstyle{tt}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf analogous to plain's \rm, etc. +% So we set up a \sf. \newfam\sffam -\def\sf{\fam=\sffam \tensf} +\def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. -% We don't need math for this one. -\def\ttsl{\tenttsl} +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} % Default leading. \newdimen\textleading \textleading = 13.2pt @@ -1279,6 +1467,7 @@ where each line of input produces a line \def\scshape{csc} \def\scbshape{csc} +% Text fonts (11.2pt, magstep1). \newcount\mainmagstep \ifx\bigger\relax % not really supported. @@ -1290,10 +1479,6 @@ where each line of input produces a line \setfont\textrm\rmshape{10}{\mainmagstep} \setfont\texttt\ttshape{10}{\mainmagstep} \fi -% Instead of cmb10, you may want to use cmbx10. -% cmbx10 is a prettier font on its own, but cmb10 -% looks better when embedded in a line with cmr10 -% (in Bob's opinion). \setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep} @@ -1303,10 +1488,11 @@ where each line of input produces a line \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep -% A few fonts for @defun, etc. -\setfont\defbf\bxshape{10}{\magstep1} %was 1314 +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1} \setfont\deftt\ttshape{10}{\magstep1} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} +\setfont\defttsl\ttslshape{10}{\magstep1} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \setfont\smallrm\rmshape{9}{1000} @@ -1332,7 +1518,7 @@ where each line of input produces a line \font\smalleri=cmmi8 \font\smallersy=cmsy8 -% Fonts for title page: +% Fonts for title page (20.4pt): \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} \setfont\titlesl\slbshape{10}{\magstep4} @@ -1378,11 +1564,21 @@ where each line of input produces a line \setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{\magstep1} +\setfont\ssecsc\scbshape{10}{1315} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 -% The smallcaps and symbol fonts should actually be scaled \magstep1.5, -% but that is not a standard magnification. + +% Reduced fonts for @acro in text (10pt). +\setfont\reducedrm\rmshape{10}{1000} +\setfont\reducedtt\ttshape{10}{1000} +\setfont\reducedbf\bfshape{10}{1000} +\setfont\reducedit\itshape{10}{1000} +\setfont\reducedsl\slshape{10}{1000} +\setfont\reducedsf\sfshape{10}{1000} +\setfont\reducedsc\scshape{10}{1000} +\setfont\reducedttsl\ttslshape{10}{1000} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since @@ -1397,50 +1593,72 @@ where each line of input produces a line } % The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this so that font changes will continue to work -% in math mode, where it is the current \fam that is relevant in most -% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam -% \tenbf}, for example. By redefining \tenbf, we obviate the need to -% redefine \bf itself. +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl + \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl + \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl + \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl + \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Set the fonts to use with the @small... environments. @@ -1449,7 +1667,7 @@ where each line of input produces a line % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 -% If we use \smallerfonts (8pt), then we can fit this many characters: +% If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. @@ -1457,14 +1675,13 @@ where each line of input produces a line % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % -% I wish we used A4 paper on this side of the Atlantic. -% +% I wish the USA used A4 paper. % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % -\textfonts +\textfonts \rm % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} @@ -1475,7 +1692,7 @@ where each line of input produces a line % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000} -\setfont\shortcontbf\bxshape{12}{1000} +\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000} \setfont\shortconttt\ttshape{12}{1000} @@ -1489,11 +1706,19 @@ where each line of input produces a line \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} + \let\i=\smartitalic +\let\slanted=\smartslanted \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic -\let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b @@ -1520,7 +1745,6 @@ where each line of input produces a line {\tt \rawbackslash \frenchspacing #1}% \null } -\let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} \setfont\keyrm\rmshape{8}{1000} \font\keysy=cmsy9 @@ -1561,7 +1785,7 @@ where each line of input produces a line \null } -% We *must* turn on hyphenation at `-' and `_' in \code. +% We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. @@ -1579,10 +1803,6 @@ where each line of input produces a line \catcode`\_=\active \let_\codeunder \codex } - % - % If we end up with any active - characters when handling the index, - % just treat them as a normal -. - \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} @@ -1606,8 +1826,7 @@ where each line of input produces a line % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). -\def\kbdinputstyle{\parsearg\kbdinputstylexxx} -\def\kbdinputstylexxx#1{% +\parseargdef\kbdinputstyle{% \def\arg{#1}% \ifx\arg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% @@ -1633,8 +1852,8 @@ where each line of input produces a line \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} -% For @url, @env, @command quotes seem unnecessary, so use \code. -\let\url=\code +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=\code \let\env=\code \let\command=\code @@ -1666,6 +1885,10 @@ where each line of input produces a line \endlink \endgroup} +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % @@ -1707,22 +1930,53 @@ where each line of input produces a line \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font -% @acronym downcases the argument and prints in smallcaps. -\def\acronym#1{{\smallcaps \lowercase{#1}}} +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\frenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} -% @pounds{} is a sterling sign. +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% \def\pounds{{\it\$}} -% @registeredsymbol - R in a circle. For now, only works in text size; -% we'd have to redo the font mechanism to change the \scriptstyle and -% \scriptscriptstyle font sizes to make it look right in headings. +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% - $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% }$% } +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + \message{page headings,} @@ -1741,87 +1995,103 @@ where each line of input produces a line \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue -\def\shorttitlepage{\parsearg\shorttitlepagezzz} -\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} -\def\titlepage{\begingroup \parindent=0pt \textfonts - \let\subtitlerm=\tenrm - \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% - % - \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines - \let\tt=\authortt}% - % - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - \def\titlezzz##1{\leftline{\titlefonts\rm ##1} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Now you can put text using @subtitle. - \def\subtitle{\parsearg\subtitlezzz}% - \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% - % - % @author should come last, but may come many times. - \def\author{\parsearg\authorzzz}% - \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi - {\authorfont \leftline{##1}}}% - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% \iffinishedtitlepage\else - \finishtitlepage + \finishtitlepage \fi - \oldpage \let\page = \oldpage - \hbox{}}% -% \def\page{\oldpage \hbox{}} + \page + \null + }% } \def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - % - % Need this before the \...aftertitlepage checks so that if they are - % in effect the toc pages will come out with page numbers. - \HEADINGSon - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi } \def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines + \let\tt=\authortt} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rm #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\authorfont \leftline{#1}}% + \fi } + %%% Set up page headings and footings. \let\thispage=\folio @@ -1831,7 +2101,7 @@ where each line of input produces a line \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages -% Now make Tex use those variables +% Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline @@ -1845,32 +2115,27 @@ where each line of input produces a line % @evenfooting @thisfile|| % @oddfooting ||@thisfile -\def\evenheading{\parsearg\evenheadingxxx} -\def\oddheading{\parsearg\oddheadingxxx} -\def\everyheading{\parsearg\everyheadingxxx} - -\def\evenfooting{\parsearg\evenfootingxxx} -\def\oddfooting{\parsearg\oddfootingxxx} -\def\everyfooting{\parsearg\everyfootingxxx} -{\catcode`\@=0 % - -\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} -\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} -\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% -\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} -\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} -\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume @@ -1879,9 +2144,8 @@ where each line of input produces a line \global\advance\vsize by -\baselineskip } -\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} -% -}% unbind the catcode of @. +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. @@ -1895,7 +2159,7 @@ where each line of input produces a line \def\headings #1 {\csname HEADINGS#1\endcsname} -\def\HEADINGSoff{ +\def\HEADINGSoff{% \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff @@ -1904,7 +2168,7 @@ where each line of input produces a line % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. -\def\HEADINGSdouble{ +\def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1916,7 +2180,7 @@ where each line of input produces a line % For single-sided printing, chapter title goes across top left of page, % page number on top right. -\def\HEADINGSsingle{ +\def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1963,12 +2227,11 @@ where each line of input produces a line % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} -\def\settitle{\parsearg\settitlezzz} -\def\settitlezzz #1{\gdef\thistitle{#1}} +\def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} -% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). +% Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in @@ -1980,7 +2243,7 @@ where each line of input produces a line % used internally for \itemindent minus \itemmargin \newdimen\itemmax -% Note @table, @vtable, and @vtable define @item, @itemx, etc., with +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). @@ -1992,22 +2255,10 @@ where each line of input produces a line \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} -\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} -\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} - -\def\internalBkitem{\smallbreak \parsearg\kitemzzz} -\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} - -\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% - \itemzzz {#1}} - -\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% - \itemzzz {#1}} - \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent - \setbox0=\hbox{\itemfont{#1}}% + \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % @@ -2031,17 +2282,13 @@ where each line of input produces a line % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % - % Stop a page break at the \parskip glue coming up. (Unfortunately - % we can't prevent a possible page break at the following - % \baselineskip glue.) However, if what follows is an environment - % such as @example, there will be no \parskip glue; then - % the negative vskip we just would cause the example and the item to - % crash together. So we use this bizarre value of 10001 as a signal - % to \aboveenvbreak to insert \parskip glue after all. - % (Possibly there are other commands that could be followed by - % @example which need the same treatment, but not section titles; or - % maybe section titles are the only special case and they should be - % penalty 10001...) + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse @@ -2061,81 +2308,72 @@ where each line of input produces a line \fi } -\def\item{\errmessage{@item while not in a table}} -\def\itemx{\errmessage{@itemx while not in a table}} -\def\kitem{\errmessage{@kitem while not in a table}} -\def\kitemx{\errmessage{@kitemx while not in a table}} -\def\xitem{\errmessage{@xitem while not in a table}} -\def\xitemx{\errmessage{@xitemx while not in a table}} - -% Contains a kludge to get @end[description] to work. -\def\description{\tablez{\dontindex}{1}{}{}{}{}} +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. -\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} -{\obeylines\obeyspaces% -\gdef\tablex #1^^M{% -\tabley\dontindex#1 \endtabley}} - -\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} -{\obeylines\obeyspaces% -\gdef\ftablex #1^^M{% -\tabley\fnitemindex#1 \endtabley -\def\Eftable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} -{\obeylines\obeyspaces% -\gdef\vtablex #1^^M{% -\tabley\vritemindex#1 \endtabley -\def\Evtable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\dontindex #1{} -\def\fnitemindex #1{\doind {fn}{\code{#1}}}% -\def\vritemindex #1{\doind {vr}{\code{#1}}}% - -{\obeyspaces % -\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% -\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} - -\def\tablez #1#2#3#4#5#6{% -\aboveenvbreak % -\begingroup % -\def\Edescription{\Etable}% Necessary kludge. -\let\itemindex=#1% -\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % -\ifnum 0#4>0 \tableindent=#4\mil \fi % -\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % -\def\itemfont{#2}% -\itemmax=\tableindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \tableindent % -\exdentamount=\tableindent -\parindent = 0pt -\parskip = \smallskipamount -\ifdim \parskip=0pt \parskip=2pt \fi% -\def\Etable{\endgraf\afterenvbreak\endgroup}% -\let\item = \internalBitem % -\let\itemx = \internalBitemx % -\let\kitem = \internalBkitem % -\let\kitemx = \internalBkitemx % -\let\xitem = \internalBxitem % -\let\xitemx = \internalBxitemx % +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley } +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno -\def\itemize{\parsearg\itemizezzz} +\envdef\itemize{\parsearg\doitemize} -\def\itemizezzz #1{% - \begingroup % ended by the @end itemize - \itemizey {#1}{\Eitemize} -} - -\def\itemizey#1#2{% +\def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin @@ -2144,13 +2382,33 @@ where each line of input produces a line \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi - \def#2{\endgraf\afterenvbreak\endgroup}% \def\itemcontents{#1}% % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi \let\item=\itemizeitem } +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % @@ -2160,11 +2418,8 @@ where each line of input produces a line % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % -\def\enumerate{\parsearg\enumeratezzz} -\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% - \begingroup % ended by the @end enumerate - % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi @@ -2235,13 +2490,13 @@ where each line of input produces a line }% } -% Call itemizey, adding a period to the first argument and supplying the +% Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 - \itemizey{#1.}\Eenumerate\flushcr + \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg @@ -2252,16 +2507,6 @@ where each line of input produces a line \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} -% Definition of @item while inside @itemize. - -\def\itemizeitem{% -\advance\itemno by 1 -{\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{In hmode at itemizeitem}\fi -{\parskip=0in \hskip 0pt -\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% -\vadjust{\penalty 1200}}% -\flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 @@ -2288,24 +2533,14 @@ where each line of input produces a line % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. -% -% For those who want to use more than one line's worth of words in -% the preamble, break the line within one argument and it -% will parse correctly, i.e., -% -% @multitable {Column 1 template} {Column 2 template} {Column 3 -% template} -% Not: -% @multitable {Column 1 template} {Column 2 template} -% {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. -% @item, @tab, @multitable or @end multitable do not need to be on their -% own lines, but it will not hurt if they are. +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. % Sample multitable: @@ -2349,13 +2584,12 @@ where each line of input produces a line \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent -% #1 is the part of the @columnfraction before the decimal point, which -% is presumably either 0 or the empty string (but we don't check, we -% just throw it away). #2 is the decimal part, which we use as the -% percent of \hsize for this column. -\def\pickupwholefraction#1.#2 {% +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% \global\advance\colcount by 1 - \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } @@ -2388,18 +2622,33 @@ where each line of input produces a line \go } +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. Note that \everycr resets \everytab. +\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + % @multitable ... @end multitable definitions: % -\def\multitable{\parsearg\dotable} -\def\dotable#1{\bgroup +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% \vskip\parskip - \let\item=\crcrwithfootnotes - % A \tab used to include \hskip1sp. But then the space in a template - % line is not enough. That is bad. So let's go back to just & until - % we encounter the problem it was intended to solve again. --karl, - % nathan@acm.org, 20apr99. - \let\tab=&% - \let\startfootins=\startsavedfootnote + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % \tolerance=9500 \hbadness=9500 \setmultitablespacing @@ -2407,85 +2656,93 @@ where each line of input produces a line \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 - \def\Emultitable{% - \global\setpercentfalse - \crcrwithfootnotes\crcr - \egroup\egroup + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% }% % + \parsearg\domultitable +} +\def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. - \everycr{\noalign{% - % - % \filbreak%% keeps underfull box messages off when table breaks over pages. - % Maybe so, but it also creates really weird page breaks when the table - % breaks over pages. Wouldn't \vfil be better? Wait until the problem - % manifests itself, so it can be fixed for real --karl. - \global\colcount=0\relax}}% - % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. - \halign\bgroup&\global\advance\colcount by 1\relax - \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing % - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % - % If the user has set preamble in terms of percent of \hsize we will - % use that dimension as the width of the column, and the \leftskip - % will keep entries from bumping into each other. Table will start at - % left margin and final column will justify at right margin. - % - % Make sure we don't inherit \rightskip from the outer environment. - \rightskip=0pt - \ifnum\colcount=1 - % The first column will be indented with the surrounding text. - \advance\hsize by\leftskip - \else - \ifsetpercent \else - % If user has not set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace. - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: - \leftskip=\multitablecolspace - \fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively marking - % characters. - \noindent\ignorespaces##\unskip\multistrut}\cr -} - -\def\setmultitablespacing{% test to see if user has set \multitablelinespace. -% If so, do nothing. If not, give it an appropriate dimension based on -% current baselineskip. + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 -%% strut to put in table in case some entry doesn't have descenders, -%% to keep lines equally spaced -\let\multistrut = \strut -\else -%% FIXME: what is \box0 supposed to be? -\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 -width0pt\relax} \fi +\fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. @@ -2500,163 +2757,33 @@ width0pt\relax} \fi %% than skip between lines in the table. \fi} -% In case a @footnote appears inside an alignment, save the footnote -% text to a box and make the \insert when a row of the table is -% finished. Otherwise, the insertion is lost, it never migrates to the -% main vertical list. --kasal, 22jan03. -% -\newbox\savedfootnotes -% -% \dotable \let's \startfootins to this, so that \dofootnote will call -% it instead of starting the insertion right away. -\def\startsavedfootnote{% - \global\setbox\savedfootnotes = \vbox\bgroup - \unvbox\savedfootnotes -} -\def\crcrwithfootnotes{% - \crcr - \ifvoid\savedfootnotes \else - \noalign{\insert\footins{\box\savedfootnotes}}% - \fi -} \message{conditionals,} -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% - \let\chapter=\relax - \let\unnumbered=\relax - \let\top=\relax - \let\unnumberedsec=\relax - \let\unnumberedsection=\relax - \let\unnumberedsubsec=\relax - \let\unnumberedsubsection=\relax - \let\unnumberedsubsubsec=\relax - \let\unnumberedsubsubsection=\relax - \let\section=\relax - \let\subsec=\relax - \let\subsubsec=\relax - \let\subsection=\relax - \let\subsubsection=\relax - \let\appendix=\relax - \let\appendixsec=\relax - \let\appendixsection=\relax - \let\appendixsubsec=\relax - \let\appendixsubsection=\relax - \let\appendixsubsubsec=\relax - \let\appendixsubsubsection=\relax - \let\contents=\relax - \let\smallbook=\relax - \let\titlepage=\relax -} - -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. -% -% We use \empty instead of \relax for the @def... commands, so that \end -% doesn't throw an error. For instance: -% @ignore -% @deffn ... -% @end deffn -% @end ignore -% -% The @end deffn is going to get expanded, because we're trying to allow -% nested conditionals. But we don't want to expand the actual @deffn, -% since it might be syntactically correct and intended to be ignored. -% Since \end checks for \relax, using \empty does not cause an error. -% -\def\ignoremorecommands{% - \let\defcodeindex = \relax - \let\defcv = \empty - \let\defcvx = \empty - \let\Edefcv = \empty - \let\deffn = \empty - \let\deffnx = \empty - \let\Edeffn = \empty - \let\defindex = \relax - \let\defivar = \empty - \let\defivarx = \empty - \let\Edefivar = \empty - \let\defmac = \empty - \let\defmacx = \empty - \let\Edefmac = \empty - \let\defmethod = \empty - \let\defmethodx = \empty - \let\Edefmethod = \empty - \let\defop = \empty - \let\defopx = \empty - \let\Edefop = \empty - \let\defopt = \empty - \let\defoptx = \empty - \let\Edefopt = \empty - \let\defspec = \empty - \let\defspecx = \empty - \let\Edefspec = \empty - \let\deftp = \empty - \let\deftpx = \empty - \let\Edeftp = \empty - \let\deftypefn = \empty - \let\deftypefnx = \empty - \let\Edeftypefn = \empty - \let\deftypefun = \empty - \let\deftypefunx = \empty - \let\Edeftypefun = \empty - \let\deftypeivar = \empty - \let\deftypeivarx = \empty - \let\Edeftypeivar = \empty - \let\deftypemethod = \empty - \let\deftypemethodx = \empty - \let\Edeftypemethod = \empty - \let\deftypeop = \empty - \let\deftypeopx = \empty - \let\Edeftypeop = \empty - \let\deftypevar = \empty - \let\deftypevarx = \empty - \let\Edeftypevar = \empty - \let\deftypevr = \empty - \let\deftypevrx = \empty - \let\Edeftypevr = \empty - \let\defun = \empty - \let\defunx = \empty - \let\Edefun = \empty - \let\defvar = \empty - \let\defvarx = \empty - \let\Edefvar = \empty - \let\defvr = \empty - \let\defvrx = \empty - \let\Edefvr = \empty - \let\clear = \relax - \let\down = \relax - \let\evenfooting = \relax - \let\evenheading = \relax - \let\everyfooting = \relax - \let\everyheading = \relax - \let\headings = \relax - \let\include = \relax - \let\item = \relax - \let\lowersections = \relax - \let\oddfooting = \relax - \let\oddheading = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\raisesections = \relax - \let\ref = \relax - \let\set = \relax - \let\setchapternewpage = \relax - \let\setchapterstyle = \relax - \let\settitle = \relax - \let\up = \relax - \let\verbatiminclude = \relax - \let\xref = \relax -} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} -\def\documentdescriptionword{documentdescription} \def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} \def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} @@ -2666,198 +2793,133 @@ width0pt\relax} \fi \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. -\let\dircategory = \comment - -% Ignore text until a line `@end #1'. +% Ignore text until a line `@end #1', keeping track of nested conditionals. % +% A count to remember the depth of nesting. +\newcount\doignorecount + \def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - % This @ is a catcode 12 token (that is the normal catcode of @ in - % this texinfo.tex file). We change the catcode of @ below to match. - \long\def\doignoretext##1@end #1{\enddoignore}% + % Scan in ``verbatim'' mode: + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode\spaceChar = 10 + \spaceisspace % - % Ignore braces, too, so mismatched braces don't cause trouble. - \catcode`\{ = 9 - \catcode`\} = 9 - % - % We must not have @c interpreted as a control sequence. - \catcode`\@ = 12 - % - \def\ignoreword{#1}% - \ifx\ignoreword\documentdescriptionword - % The c kludge breaks documentdescription, since - % `documentdescription' contains a `c'. Means not everything will - % be ignored inside @documentdescription, but oh well... - \else - % Make the letter c a comment character so that the rest of the line - % will be ignored. This way, the document can have (for example) - % @c @end ifinfo - % and the @end ifinfo will be properly ignored. - % (We've just changed @ to catcode 12.) - \catcode`\c = 14 - \fi - % - % And now expand the command defined above. - \doignoretext -} - -% What we do to finish off ignored text. -% -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{WARNING: for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{ (See ftp://ftp.gnu.org/non-gnu/TeX.README.)} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \global\warnedobstrue - \fi -} - -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax - -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the chance of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook. - % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because some sites - % might not have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. - % - \nullfont - \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont - \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont - \let\tensf=\nullfont - % Similarly for index fonts. - \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont - \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont - \let\smallsf=\nullfont - % Similarly for smallexample fonts. - \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont - \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont - \let\smallersf=\nullfont - % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 - % - % Don't bother to do space factor calculations. - \frenchspacing - % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. % - % Do not execute instructions in @tex. - \def\tex{\doignore{tex}}% - % Do not execute macro definitions. - % `c' is a comment character, so the word `macro' will get cut off. - \def\macro{\doignore{ma}}% + % Define a command to find the next `@end #1', which must be on a line + % by itself. + \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}% + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \obeylines % + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next } +% Finish off ignored text. +\def\enddoignore{\endgroup\ignorespaces} + + % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we -% didn't need it. Make sure the catcode of space is correct to avoid -% losing inside @example, for instance. +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. % -\def\set{\begingroup\catcode` =10 - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} +\parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi - \endgroup + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% } -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} % @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} { - \catcode`\_ = \active + \catcode`\- = \active \catcode`\_ = \active % - % We might end up with active _ or - characters in the argument if - % we're called from @code, as @code{@value{foo-bar_}}. So \let any - % such active characters to their normal equivalents. - \gdef\value{\begingroup + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other - \indexbreaks \let_\normalunderscore - \valuexxx} + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } } -\def\valuexxx#1{\expandablevalue{#1}\endgroup} % We have this subroutine so that we can handle at least some @value's -% properly in indexes (we \let\value to this in \indexdummies). Ones -% whose names contain - or _ still won't work, but we can't do anything -% about that. The command has to be fully expandable (if the variable -% is set), since the result winds up in the index file. This means that -% if the variable's value contains other Texinfo commands, it's almost -% certain it will fail (although perhaps we could fix that with -% sufficient work to do a one-level expansion on the result, instead of -% complete). +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax @@ -2871,55 +2933,36 @@ width0pt\relax} \fi % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % -\def\ifset{\parsearg\doifset} -\def\doifset#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \let\next=\ifsetfail - \else - \let\next=\ifsetsucceed - \fi - \next +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next } -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} +\def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % -\def\ifclear{\parsearg\doifclear} -\def\doifclear#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \let\next=\ifclearsucceed - \else - \let\next=\ifclearfail - \fi - \next -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we -% read the text following, through the first @end iftex (etc.). Make -% `@end iftex' (etc.) valid only after an @iftex. -% -\def\iftex{\conditionalsucceed{iftex}} -\def\ifnothtml{\conditionalsucceed{ifnothtml}} -\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} -\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} -\defineunmatchedend{iftex} -\defineunmatchedend{ifnothtml} -\defineunmatchedend{ifnotinfo} -\defineunmatchedend{ifnotplaintext} - -% True conditional. Since \set globally defines its variables, we can -% just start and end a group (to keep the @end definition undefined at -% the outer level). -% -\def\conditionalsucceed#1{\begingroup - \expandafter\def\csname E#1\endcsname{\endgroup}% -} +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment @@ -3044,6 +3087,7 @@ width0pt\relax} \fi \def\definedummyletter##1{% \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% }% + \let\definedummyaccent\definedummyletter % % Do the redefinitions. \commondummies @@ -3066,6 +3110,7 @@ width0pt\relax} \fi \def\definedummyletter##1{% \expandafter\def\csname ##1\endcsname{@##1}% }% + \let\definedummyaccent\definedummyletter % % Do the redefinitions. \commondummies @@ -3078,26 +3123,11 @@ width0pt\relax} \fi % \normalturnoffactive % - % Control letters and accents. + \commondummiesnofonts + % \definedummyletter{_}% - \definedummyletter{,}% - \definedummyletter{"}% - \definedummyletter{`}% - \definedummyletter{'}% - \definedummyletter{^}% - \definedummyletter{~}% - \definedummyletter{=}% - \definedummyword{u}% - \definedummyword{v}% - \definedummyword{H}% - \definedummyword{dotaccent}% - \definedummyword{ringaccent}% - \definedummyword{tieaccent}% - \definedummyword{ubaraccent}% - \definedummyword{udotaccent}% - \definedummyword{dotless}% % - % Other non-English letters. + % Non-English letters. \definedummyword{AA}% \definedummyword{AE}% \definedummyword{L}% @@ -3109,6 +3139,10 @@ width0pt\relax} \fi \definedummyword{oe}% \definedummyword{o}% \definedummyword{ss}% + \definedummyword{exclamdown}% + \definedummyword{questiondown}% + \definedummyword{ordf}% + \definedummyword{ordm}% % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword{bf}% @@ -3120,37 +3154,14 @@ width0pt\relax} \fi \definedummyword{tclose}% \definedummyword{tt}% % - % Texinfo font commands. - \definedummyword{b}% - \definedummyword{i}% - \definedummyword{r}% - \definedummyword{sc}% - \definedummyword{t}% - % + \definedummyword{LaTeX}% \definedummyword{TeX}% - \definedummyword{acronym}% - \definedummyword{cite}% - \definedummyword{code}% - \definedummyword{command}% - \definedummyword{dfn}% - \definedummyword{dots}% - \definedummyword{emph}% - \definedummyword{env}% - \definedummyword{file}% - \definedummyword{kbd}% - \definedummyword{key}% - \definedummyword{math}% - \definedummyword{option}% - \definedummyword{samp}% - \definedummyword{strong}% - \definedummyword{uref}% - \definedummyword{url}% - \definedummyword{var}% - \definedummyword{w}% % % Assorted special characters. \definedummyword{bullet}% + \definedummyword{comma}% \definedummyword{copyright}% + \definedummyword{registeredsymbol}% \definedummyword{dots}% \definedummyword{enddots}% \definedummyword{equiv}% @@ -3162,10 +3173,9 @@ width0pt\relax} \fi \definedummyword{print}% \definedummyword{result}% % - % Handle some cases of @value -- where the variable name does not - % contain - or _, and the value does not contain any + % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. - \let\value = \expandablevalue + \makevalueexpandable % % Normal spaces, not active ones. \unsepspaces @@ -3174,45 +3184,97 @@ width0pt\relax} \fi \turnoffmacros } -% If an index command is used in an @example environment, any spaces -% therein should become regular spaces in the raw index file, not the -% expansion of \tie (\leavevmode \penalty \@M \ ). -{\obeyspaces - \gdef\unsepspaces{\obeyspaces\let =\space}} - +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +% Better have this without active chars. +{ + \catcode`\~=\other + \gdef\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter{!}% + \definedummyaccent{"}% + \definedummyaccent{'}% + \definedummyletter{*}% + \definedummyaccent{,}% + \definedummyletter{.}% + \definedummyletter{/}% + \definedummyletter{:}% + \definedummyaccent{=}% + \definedummyletter{?}% + \definedummyaccent{^}% + \definedummyaccent{`}% + \definedummyaccent{~}% + \definedummyword{u}% + \definedummyword{v}% + \definedummyword{H}% + \definedummyword{dotaccent}% + \definedummyword{ringaccent}% + \definedummyword{tieaccent}% + \definedummyword{ubaraccent}% + \definedummyword{udotaccent}% + \definedummyword{dotless}% + % + % Texinfo font commands. + \definedummyword{b}% + \definedummyword{i}% + \definedummyword{r}% + \definedummyword{sc}% + \definedummyword{t}% + % + % Commands that take arguments. + \definedummyword{acronym}% + \definedummyword{cite}% + \definedummyword{code}% + \definedummyword{command}% + \definedummyword{dfn}% + \definedummyword{emph}% + \definedummyword{env}% + \definedummyword{file}% + \definedummyword{kbd}% + \definedummyword{key}% + \definedummyword{math}% + \definedummyword{option}% + \definedummyword{samp}% + \definedummyword{strong}% + \definedummyword{tie}% + \definedummyword{uref}% + \definedummyword{url}% + \definedummyword{var}% + \definedummyword{verb}% + \definedummyword{w}% + } +} % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % -\def\indexdummytex{TeX} -\def\indexdummydots{...} -% \def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{% + \expandafter\let\csname ##1\endcsname\asis + }% + % We can just ignore other control letters. + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{}% + }% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % \def\ { }% \def\@{@}% % how to handle braces? \def\_{\normalunderscore}% % - \let\,=\asis - \let\"=\asis - \let\`=\asis - \let\'=\asis - \let\^=\asis - \let\~=\asis - \let\==\asis - \let\u=\asis - \let\v=\asis - \let\H=\asis - \let\dotaccent=\asis - \let\ringaccent=\asis - \let\tieaccent=\asis - \let\ubaraccent=\asis - \let\udotaccent=\asis - \let\dotless=\asis - % - % Other non-English letters. + % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\L{L}% @@ -3226,130 +3288,169 @@ width0pt\relax} \fi \def\ss{ss}% \def\exclamdown{!}% \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% % - % Don't no-op \tt, since it isn't a user-level command - % and is used in the definitions of the active chars like <, >, |, etc. - % Likewise with the other plain tex font commands. - %\let\tt=\asis + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\expansion{==>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\result{=>}% % - % Texinfo font commands. - \let\b=\asis - \let\i=\asis - \let\r=\asis - \let\sc=\asis - \let\t=\asis - % - \let\TeX=\indexdummytex - \let\acronym=\asis - \let\cite=\asis - \let\code=\asis - \let\command=\asis - \let\dfn=\asis - \let\dots=\indexdummydots - \let\emph=\asis - \let\env=\asis - \let\file=\asis - \let\kbd=\asis - \let\key=\asis - \let\math=\asis - \let\option=\asis - \let\samp=\asis - \let\strong=\asis - \let\uref=\asis - \let\url=\asis - \let\var=\asis - \let\w=\asis + % Don't write macro names. + \emptyusermacros } \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? -% For \ifx comparisons. -\def\emptymacro{\empty} - % Most index entries go through here, but \dosubind is the general case. -% -\def\doind#1#2{\dosubind{#1}{#2}\empty} +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% \empty if called from \doind, as we usually are. The main exception -% is with defuns, which call us directly. +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). % \def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \ifvmode + \dosubindsanitize + \else + \dosubindwrite + \fi + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi - {% - \count255=\lastpenalty - {% - \indexdummies % Must do this here, since \bf, etc expand at this stage - \escapechar=`\\ - {% - \let\folio = 0% We will expand all macros now EXCEPT \folio. - \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. - % - % The main index entry text. - \toks0 = {#2}% - % - % If third arg is present, precede it with space in sort key. - \def\thirdarg{#3}% - \ifx\thirdarg\emptymacro \else - % If the third (subentry) arg is present, add it to the index - % line to write. - \toks0 = \expandafter{\the\toks0 \space #3}% - \fi - % - % Process the index entry with all font commands turned off, to - % get the string to sort by. - {\indexnofonts - \edef\temp{\the\toks0}% need full expansion - \xdef\indexsorttmp{\temp}% - }% - % - % Set up the complete index entry, with both the sort key and - % the original text, including any font commands. We write - % three arguments to \entry to the .?? file (four in the - % subentry case), texindex reduces to two when writing the .??s - % sorted result. - \edef\temp{% - \write\csname#1indfile\endcsname{% - \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% - }% - % - % If a skip is the last thing on the list now, preserve it - % by backing up by \lastskip, doing the \write, then inserting - % the skip again. Otherwise, the whatsit generated by the - % \write will make \lastskip zero. The result is that sequences - % like this: - % @end defun - % @tindex whatever - % @defun ... - % will have extra space inserted, because the \medbreak in the - % start of the @defun won't see the skip inserted by the @end of - % the previous defun. - % - % But don't do any of this if we're not in vertical mode. We - % don't want to do a \vskip and prematurely end a paragraph. - % - % Avoid page breaks due to these extra skips, too. - % - \iflinks - \ifvmode - \skip0 = \lastskip - \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi - \fi - % - \temp % do the write - % - \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi - \fi - }% - }% - \penalty\count255 + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% + \temp +} + +% Take care of unwanted page breaks: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write will make \lastskip zero. The result is that sequences +% like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +% ..., ready, GO: +% +\def\dosubindsanitize{% + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \skip0 = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \count255 = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\skip0 glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\skip0 + \fi + % + \dosubindwrite + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\count255>9999 \penalty\count255 \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\skip0 + \fi } % The index entry written in the file actually looks like @@ -3387,14 +3488,12 @@ width0pt\relax} \fi % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % -\def\printindex{\parsearg\doprintindex} -\def\doprintindex#1{\begingroup +\parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \everypar = {}% don't want the \kern\-parindent from indentation suppression. - \indexbreaks % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains @@ -3421,7 +3520,7 @@ width0pt\relax} \fi % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. - \def\indexbackslash{\rawbackslashxx}% + \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns @@ -3443,7 +3542,10 @@ width0pt\relax} \fi \removelastskip % % We like breaks before the index initials, so insert a bonus. - \penalty -300 + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -3453,80 +3555,100 @@ width0pt\relax} \fi % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% - \vskip .33\baselineskip plus .1\baselineskip - % % Do our best not to break after the initial. \nobreak + \vskip .33\baselineskip plus .1\baselineskip }} -% This typesets a paragraph consisting of #1, dot leaders, and then #2 -% flush to the right margin. It is used for index and table of contents -% entries. The paragraph is indented by \leftskip. -% -\def\entry#1#2{\begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent = 2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % A bit of stretch before each entry for the benefit of balancing columns. - \vskip 0pt plus1pt - % - % Start a ``paragraph'' for the index entry so the line breaking - % parameters we've set above will have an effect. - \noindent - % - % Insert the text of the index entry. TeX will do line-breaking on it. - #1% - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#2}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd\ \else% - % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. - % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ifpdf - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this frozes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#1}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd + \ % \else - \ #2% The page number ends the paragraph. + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi \fi - \fi% - \par -\endgroup} + \par + \endgroup +} % Like \dotfill except takes at least 1 em. \def\indexdotfill{\cleaders @@ -3695,6 +3817,12 @@ width0pt\relax} \fi \message{sectioning,} % Chapters, sections, etc. +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 @@ -3702,9 +3830,12 @@ width0pt\relax} \fi % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ +% % \def\appendixletter{\char\the\appendixno} -% We do the following for the sake of pdftex, which needs the actual +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. +% \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% @@ -3742,11 +3873,12 @@ width0pt\relax} \fi % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise. +% However, they are not reliable, because we don't use marks. \def\thischapter{} \def\thissection{} \newcount\absseclevel % used to calculate proper heading level -\newcount\secbase\secbase=0 % @raise/lowersections modify this count +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} @@ -3756,121 +3888,142 @@ width0pt\relax} \fi \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name -% Choose a numbered-heading macro -% #1 is heading level if unmodified by @raisesections or @lowersections -% #2 is text for heading -\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \chapterzzz{#2} -\or - \seczzz{#2} -\or - \numberedsubseczzz{#2} -\or - \numberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \chapterzzz{#2} +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 \else - \numberedsubsubseczzz{#2} + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi \fi -\fi -\suppressfirstparagraphindent -} - -% like \numhead, but chooses appendix heading levels -\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \appendixzzz{#2} -\or - \appendixsectionzzz{#2} -\or - \appendixsubseczzz{#2} -\or - \appendixsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \appendixzzz{#2} + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel = \absseclevel + \fi \else - \appendixsubsubseczzz{#2} + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel = 3 + \fi \fi -\fi -\suppressfirstparagraphindent -} - -% like \numhead, but chooses numberless heading levels -\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \unnumberedzzz{#2} -\or - \unnumberedseczzz{#2} -\or - \unnumberedsubseczzz{#2} -\or - \unnumberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \unnumberedzzz{#2} + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi \else - \unnumberedsubsubseczzz{#2} + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi \fi -\fi -\suppressfirstparagraphindent + \suppressfirstparagraphindent } -% @chapter, @appendix, @unnumbered. -\def\thischaptername{No Chapter Title} -\outer\def\chapter{\parsearg\chapteryyy} -\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{% - \secno=0 \subsecno=0 \subsubsecno=0 - \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% - \chapmacro {#1}{\the\chapno}% - \gdef\thissection{#1}% - \gdef\thischaptername{#1}% - % We don't substitute the actual chapter name into \thischapter - % because we don't want its macros evaluated now. - \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% - \writetocentry{chap}{#1}{{\the\chapno}} - \donoderef +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } -% we use \chapno to avoid indenting back -\def\appendixbox#1{% - \setbox0 = \hbox{\putwordAppendix{} \the\chapno}% - \hbox to \wd0{#1\hss}} - -\outer\def\appendix{\parsearg\appendixyyy} -\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{% - \secno=0 \subsecno=0 \subsubsecno=0 - \global\advance \appendixno by 1 - \message{\putwordAppendix\space \appendixletter}% - \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}% - \gdef\thissection{#1}% - \gdef\thischaptername{#1}% - \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% - \writetocentry{appendix}{#1}{{\appendixletter}} - \appendixnoderef +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } -% @centerchap is like @unnumbered, but the heading is centered. -\outer\def\centerchap{\parsearg\centerchapyyy} -\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} - -% @top is like @unnumbered. -\outer\def\top{\parsearg\unnumberedyyy} - -\outer\def\unnumbered{\parsearg\unnumberedyyy} -\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{% - \secno=0 \subsecno=0 \subsubsecno=0 +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX @@ -3883,134 +4036,98 @@ width0pt\relax} \fi % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) - \toks0 = {#1}\message{(\the\toks0)}% + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % - \unnumbchapmacro {#1}% - \gdef\thischapter{#1}\gdef\thissection{#1}% - \writetocentry{unnumbchap}{#1}{{\the\chapno}} - \unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } -% Sections. -\outer\def\numberedsec{\parsearg\secyyy} -\def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{% - \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % - \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% - \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}} - \donoderef - \nobreak +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax } -\outer\def\appendixsection{\parsearg\appendixsecyyy} -\outer\def\appendixsec{\parsearg\appendixsecyyy} -\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{% - \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % - \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% - \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}} - \appendixnoderef - \nobreak -} +% @top is like @unnumbered. +\let\top\unnumbered -\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} -\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{% - \plainsecheading {#1}\gdef\thissection{#1}% - \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}} - \unnumbnoderef - \nobreak +% Sections. +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. -\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} -\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{% - \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % - \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% - \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} - \donoderef - \nobreak -} - -\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} -\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{% - \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % - \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% - \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}} - \appendixnoderef - \nobreak -} - -\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} -\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{% - \plainsubsecheading {#1}\gdef\thissection{#1}% - \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} - \unnumbnoderef - \nobreak +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. -\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} -\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{% - \gdef\thissection{#1}\global\advance \subsubsecno by 1 % - \subsubsecheading {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} - \donoderef - \nobreak -} - -\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} -\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{% - \gdef\thissection{#1}\global\advance \subsubsecno by 1 % - \subsubsecheading {#1} - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% - \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}} - \appendixnoderef - \nobreak -} - -\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} -\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{% - \plainsubsubsecheading {#1}\gdef\thissection{#1}% - \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} - \unnumbnoderef - \nobreak +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } -% These are variants which are not "outer", so they can appear in @ifinfo. -% Actually, they should now be obsolete; ordinary section commands should work. -\def\infotop{\parsearg\unnumberedzzz} -\def\infounnumbered{\parsearg\unnumberedzzz} -\def\infounnumberedsec{\parsearg\unnumberedseczzz} -\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} -\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} - -\def\infoappendix{\parsearg\appendixzzz} -\def\infoappendixsec{\parsearg\appendixseczzz} -\def\infoappendixsubsec{\parsearg\appendixsubseczzz} -\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} - -\def\infochapter{\parsearg\chapterzzz} -\def\infosection{\parsearg\sectionzzz} -\def\infosubsection{\parsearg\subsectionzzz} -\def\infosubsubsection{\parsearg\subsubsectionzzz} - % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading @@ -4023,23 +4140,27 @@ width0pt\relax} \fi % if justification is not attempted. Hence \raggedright. -\def\majorheading{\parsearg\majorheadingzzz} -\def\majorheadingzzz #1{% +\def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% - {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} + \parsearg\chapheadingzzz +} -\def\chapheading{\parsearg\chapheadingzzz} -\def\chapheadingzzz #1{\chapbreak % +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} + \rm #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} % @heading, @subheading, @subsubheading. -\def\heading{\parsearg\plainsecheading} -\def\subheading{\parsearg\plainsubsecheading} -\def\subsubheading{\parsearg\plainsubsubsecheading} +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), @@ -4048,8 +4169,6 @@ width0pt\relax} \fi %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} - %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) @@ -4072,7 +4191,7 @@ width0pt\relax} \fi \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} -\def\CHAPPAGodd{ +\def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage @@ -4080,116 +4199,193 @@ width0pt\relax} \fi \CHAPPAGon -\def\CHAPFplain{ -\global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain -\global\let\centerchapmacro=\centerchfplain} - -% Plain chapter opening. -% #1 is the text, #2 the chapter number or empty if unnumbered. -\def\chfplain#1#2{% +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% \pchapsepmacro {% \chapfonts \rm - \def\chapnum{#2}% - \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% + % + % Have to define \thissection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\thissection{#1}% + \gdef\thischaptername{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \def\thischapter{#1}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \xdef\thischapter{}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + % We don't substitute the actual chapter name into \thischapter + % because we don't want its macros evaluated now. And we don't + % use \thissection because that changes with each section. + % + \xdef\thischapter{\putwordAppendix{} \appendixletter: + \noexpand\thischaptername}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \xdef\thischapter{\putwordChapter{} \the\chapno: + \noexpand\thischaptername}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 \centerparametersmaybe + \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } -% Plain opening for unnumbered. -\def\unnchfplain#1{\chfplain{#1}{}} - % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax -\def\centerchfplain#1{{% - \def\centerparametersmaybe{% - \advance\rightskip by 3\rightskip - \leftskip = \rightskip - \parfillskip = 0pt - }% - \chfplain{#1}{}% -}} +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} -\CHAPFplain % The default +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\nobreak } - \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } - \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} -\def\CHAPFopen{ -\global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen -\global\let\centerchapmacro=\centerchfopen} - -% Section titles. +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% \newskip\secheadingskip -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} -\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} -\def\plainsecheading#1{\sectionheading{sec}{}{#1}} +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. -\newskip \subsecheadingskip -\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} -\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} -\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. -\let\subsubsecheadingskip = \subsecheadingskip -\let\subsubsecheadingbreak = \subsecheadingbreak -\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} -\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} -% Print any size section title. +% Print any size, any type, section title. % -% #1 is the section type (sec/subsec/subsubsec), #2 is the section -% number (maybe empty), #3 the text. -\def\sectionheading#1#2#3{% - {% - \expandafter\advance\csname #1headingskip\endcsname by \parskip - \csname #1headingbreak\endcsname - }% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. - \csname #1fonts\endcsname \rm + \csname #2fonts\endcsname \rm + % + % Insert space above the heading. + \csname #2headingbreak\endcsname % - % Only insert the separating space if we have a section number. - \def\secnum{#2}% - \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % Only insert the space after the number if we have a section number. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\thissection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \thissection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\thissection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\thissection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chfplain. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chfplain. + \donoderef{#3}% % + % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 % zero if no section number - \unhbox0 #3}% + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% }% - % Add extra space after the heading -- either a line space or a - % paragraph space, whichever is more. (Some people like to set - % \parskip to large values for some reason.) Don't allow stretch, though. - \nobreak - \ifdim\parskip>\normalbaselineskip - \kern\parskip - \else - \kern\normalbaselineskip - \fi + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This is purely so the last item on the list is a known \penalty > + % 10000. This is so \startdefun can avoid allowing breakpoints after + % section headings. Otherwise, it would insert a valid breakpoint between: + % + % @section sec-whatever + % @deffn def-whatever + \penalty 10001 } @@ -4198,119 +4394,152 @@ width0pt\relax} \fi \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. -% Called from @chapter, etc. We supply {\folio} at the end of the -% argument, which will end up as the last argument to the \...entry macro. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. % -% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}} % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. % \newif\iftocfileopened +\def\omitkeyword{omit}% +% \def\writetocentry#1#2#3{% - \iftocfileopened\else - \immediate\openout\tocfile = \jobname.toc - \global\tocfileopenedtrue - \fi - % - \iflinks - \toks0 = {#2}% - \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}% - \temp + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + \toks0 = {#2}% + \toks2 = \expandafter{\lastnode}% + \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}% + {\the\toks2}{\noexpand\folio}}}% + \temp + \fi \fi % - % Tell \shipout to create a page destination if we're doing pdf, which - % will be the target of the links in the table of contents. We can't - % just do it on every page because the title pages are numbered 1 and - % 2 (the page numbers aren't printed), and so are the first two pages - % of the document. Thus, we'd have two destinations named `1', and - % two named `2'. - \ifpdf \pdfmakepagedesttrue \fi + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 -% Finish up the main text and prepare to read what we've written -% to \tocfile. +% Prepare to read what we've written to \tocfile. % \def\startcontents#1{% - % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund - \contentsalignmacro - \immediate\closeout\tocfile - % - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - \savepageno = \pageno - \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - % We can't do this, because then an actual ^ in a section - % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. - %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. - % - % Roman numerals for page numbers. - \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \def\thischapter{}% + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + % We can't do this, because then an actual ^ in a section + % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. + %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % Normal (long) toc. \def\contents{% - \startcontents{\putwordTOC}% - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \pdfmakeoutlines - \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno + \startcontents{\putwordTOC}% + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% - \startcontents{\putwordShortTOC}% - % - \let\chapentry = \shortchapentry - \let\appendixentry = \shortappendixentry - \let\unnumbchapentry = \shortunnumberedentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf - \let\sl=\shortcontsl \let\tt=\shortconttt - \rm - \hyphenpenalty = 10000 - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - \def\subsecentry ##1##2##3##4##5{} - \def\subsubsecentry ##1##2##3##4##5##6{} - \let\unnumbsecentry = \secentry - \let\unnumbsubsecentry = \subsecentry - \let\unnumbsubsubsecentry = \subsubsecentry - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno + \startcontents{\putwordShortTOC}% + % + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } \let\shortcontents = \summarycontents -\ifpdf - \pdfcatalog{/PageMode /UseOutlines}% -\fi +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. @@ -4318,58 +4547,46 @@ width0pt\relax} \fi % The arguments in between are the chapter number, section number, ... % Chapters, in the main contents. -\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. -\def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. -\def\appendixentry#1#2#3{% - \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}} -% -% Appendices, in the short toc. -\let\shortappendixentry = \shortchapentry - -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. -% We could simplify the code here by writing out an \appendixentry -% command in the toc file for appendices, instead of using \chapentry -% for both, but it doesn't seem worth it. +% Need the word Appendix, and a fixed-size box. % -\newdimen\shortappendixwidth +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} % -\def\shortchaplabel#1{% - % This space should be enough, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % But use \hss just in case. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in by \shortchapentry above.) - \dimen0 = 1em - \hbox to \dimen0{#1\hss}% -} +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. -\def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}} -\def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}} +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. -\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}} +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. -\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}} +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. -\def\subsubsecentry#1#2#3#4#5#6{% - \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}} +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. -\newdimen\tocindent \tocindent = 3pc +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. @@ -4400,17 +4617,8 @@ width0pt\relax} \fi \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} -% Final typesetting of a toc entry; we use the same \entry macro as for -% the index entries, but we want to suppress hyphenation here. (We -% can't do that in the \entry macro, since index entries might consist -% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -\def\tocentry#1#2{\begingroup - \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - % Do not use \turnoffactive in these arguments. Since the toc is - % typeset in cmr, characters such as _ would come out wrong; we - % have to do the usual translation tricks. - \entry{#1}{#2}% -\endgroup} +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} @@ -4420,8 +4628,8 @@ width0pt\relax} \fi \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} -\let\subsecentryfonts = \textfonts -\let\subsubsecentryfonts = \textfonts +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} \message{environments,} @@ -4448,10 +4656,10 @@ width0pt\relax} \fi % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} % -\global\setbox\errorbox=\hbox to \dimen0{\hfil +\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. - \vbox{ + \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. @@ -4465,14 +4673,13 @@ width0pt\relax} \fi % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. -\def\tex{\begingroup +\envdef\tex{% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other - \catcode `\==\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other @@ -4488,6 +4695,7 @@ width0pt\relax} \fi \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent + \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace @@ -4498,10 +4706,11 @@ width0pt\relax} \fi \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% -\let\Etex=\endgroup} +} +% There is no need to define \Etex. % Define @lisp ... @end lisp. -% @lisp does a \begingroup so it can rebind things, +% @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. @@ -4512,19 +4721,6 @@ width0pt\relax} \fi % have any width. \def\lisppar{\null\endgraf} -% Make each space character in the input produce a normal interword -% space in the output. Don't allow a line break at this space, as this -% is used only in environments like @example, where each line of input -% should produce a line of output anyway. -% -{\obeyspaces % -\gdef\sepspaces{\obeyspaces\let =\tie}} - -% Define \obeyedspace to be our active space, whatever it is. This is -% for use in \parsearg. -{\sepspaces% -\global\let\obeyedspace= } - % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt @@ -4534,7 +4730,8 @@ width0pt\relax} \fi % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% - % =10000 instead of <10000 because of a special case in \itemzzz, q.v. + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf @@ -4542,7 +4739,7 @@ width0pt\relax} \fi \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... - \ifnum\lastpenalty>10000 \else \penalty-50 \fi + \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi @@ -4574,52 +4771,52 @@ width0pt\relax} \fi % \newskip\lskip\newskip\rskip -\def\cartouche{% -\par % can't be in the midst of a paragraph. -\begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char, and rule thickness - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} \def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup -\endgroup -}} + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak - \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines @@ -4632,103 +4829,99 @@ width0pt\relax} \fi \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing - \let\exdent=\nofillexdent - \let\nonarrowing=\relax \fi + \let\exdent=\nofillexdent } -% Define the \E... control sequence only if we are inside the particular -% environment, so the error checking in \end will work. -% -% To end an @example-like environment, we first end the paragraph (via -% \afterenvbreak's vertical glue), and then the group. That way we keep -% the zero \parskip that the environments set -- \parskip glue will be -% inserted at the beginning of the next paragraph in the document, after -% the environment. +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp % -\def\nonfillfinish{\afterenvbreak\endgroup} +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \smallexamplefonts \rm + \fi +} -% @lisp: indented, narrowed, typewriter font. -\def\lisp{\begingroup - \nonfillstart - \let\Elisp = \nonfillfinish - \tt - \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. - \gobble % eat return +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } -% @example: Same as @lisp. -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. +% % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. -\def\smalllisp{\begingroup - \def\Esmalllisp{\nonfillfinish\endgroup}% - \def\Esmallexample{\nonfillfinish\endgroup}% - \smallexamplefonts - \lisp +% +\maketwodispenvs {lisp}{example}{% + \nonfillstart + \tt + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return } -\let\smallexample = \smalllisp - -% @display: same as @lisp except keep current font. +% @display/@smalldisplay: same as @lisp except keep current font. % -\def\display{\begingroup +\makedispenv {display}{% \nonfillstart - \let\Edisplay = \nonfillfinish \gobble } -% -% @smalldisplay: @display plus smaller fonts. -% -\def\smalldisplay{\begingroup - \def\Esmalldisplay{\nonfillfinish\endgroup}% - \smallexamplefonts \rm - \display -} -% @format: same as @display except don't narrow margins. +% @format/@smallformat: same as @display except don't narrow margins. % -\def\format{\begingroup - \let\nonarrowing = t +\makedispenv{format}{% + \let\nonarrowing = t% \nonfillstart - \let\Eformat = \nonfillfinish \gobble } -% -% @smallformat: @format plus smaller fonts. -% -\def\smallformat{\begingroup - \def\Esmallformat{\nonfillfinish\endgroup}% - \smallexamplefonts \rm - \format -} -% @flushleft (same as @format). -% -\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak % @flushright. % -\def\flushright{\begingroup - \let\nonarrowing = t +\envdef\flushright{% + \let\nonarrowing = t% \nonfillstart - \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } +\let\Eflushright = \afterenvbreak % @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. % -\def\quotation{% - \begingroup\inENV %This group ends at the end of the @quotation body +\envdef\quotation{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt - % We have retained a nonzero parskip for the environment, since we're - % doing normal filling. So to avoid extra space below the environment... - \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax @@ -4737,6 +4930,27 @@ width0pt\relax} \fi \exdentamount = \lispnarrowing \let\nonarrowing = \relax \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi } @@ -4758,7 +4972,7 @@ width0pt\relax} \fi % % [Knuth] p. 380 \def\uncatcodespecials{% - \def\do##1{\catcode`##1=12}\dospecials} + \def\do##1{\catcode`##1=\other}\dospecials} % % [Knuth] pp. 380,381,391 % Disable Spanish ligatures ?` and !` of \tt font @@ -4806,6 +5020,8 @@ width0pt\relax} \fi } \endgroup \def\setupverbatim{% + \nonfillstart + \advance\leftskip by -\defbodyindent % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% @@ -4827,7 +5043,7 @@ width0pt\relax} \fi % % [Knuth] p. 382; only eat outer {} \begingroup - \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12 + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % @@ -4844,13 +5060,6 @@ width0pt\relax} \fi % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] -%% Include LaTeX hack for completeness -- never know -%% \begingroup -%% \catcode`|=0 \catcode`[=1 -%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active -%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ -%% #1|endgroup|def|Everbatim[]|end[verbatim]] -%% |endgroup % \begingroup \catcode`\ =\active @@ -4858,54 +5067,32 @@ width0pt\relax} \fi % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. - \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}% + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. \endgroup % -\def\verbatim{% - \def\Everbatim{\nonfillfinish\endgroup}% - \begingroup - \nonfillstart - \advance\leftskip by -\defbodyindent - \begingroup\setupverbatim\doverbatim +\envdef\verbatim{% + \setupverbatim\doverbatim } +\let\Everbatim = \afterenvbreak + % @verbatiminclude FILE - insert text of file in verbatim environment. % -% Allow normal characters that we make active in the argument (a file name). -\def\verbatiminclude{% - \begingroup - \catcode`\\=\other - \catcode`~=\other - \catcode`^=\other - \catcode`_=\other - \catcode`|=\other - \catcode`<=\other - \catcode`>=\other - \catcode`+=\other - \parsearg\doverbatiminclude -} -\def\setupverbatiminclude{% - \begingroup - \nonfillstart - \advance\leftskip by -\defbodyindent - \begingroup\setupverbatim -} +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% - % Restore active chars for included file. - \endgroup - \begingroup - \let\value=\expandablevalue - \def\thisfile{#1}% - \expandafter\expandafter\setupverbatiminclude\input\thisfile - \endgroup - \nonfillfinish - \endgroup + {% + \makevalueexpandable + \setupverbatim + \input #1 + \afterenvbreak + }% } % @copying ... @end copying. -% Save the text away for @insertcopying later. Many commands won't be -% allowed in this context, but that's ok. +% Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the @@ -4914,670 +5101,392 @@ width0pt\relax} \fi % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % -\def\copying{\begingroup - % Define a command to swallow text until we reach `@end copying'. - % \ is the escape char in this texinfo.tex file, so it is the - % delimiter for the command; @ will be the escape char when we read - % it, but that doesn't matter. - \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}% - % - % We must preserve ^^M's in the input file; see \insertcopying below. - \catcode`\^^M = \active - \docopying -} - -% What we do to finish off the copying text. -% -\def\enddocopying{\endgroup\ignorespaces} - -% @insertcopying. Here we must play games with ^^M's. On the one hand, -% we need them to delimit commands such as `@end quotation', so they -% must be active. On the other hand, we certainly don't want every -% end-of-line to be a \par, as would happen with the normal active -% definition of ^^M. On the third hand, two ^^M's in a row should still -% generate a \par. -% -% Our approach is to make ^^M insert a space and a penalty1 normally; -% then it can also check if \lastpenalty=1. If it does, then manually -% do \par. -% -% This messes up the normal definitions of @c[omment], so we redefine -% it. Similarly for @ignore. (These commands are used in the gcc -% manual for man page generation.) -% -% Seems pretty fragile, most line-oriented commands will presumably -% fail, but for the limited use of getting the copying text (which -% should be quite simple) inserted, we can hope it's ok. -% -{\catcode`\^^M=\active % -\gdef\insertcopying{\begingroup % - \parindent = 0pt % looks wrong on title page - \def^^M{% - \ifnum \lastpenalty=1 % - \par % - \else % - \space \penalty 1 % - \fi % - }% - % - % Fix @c[omment] for catcode 13 ^^M's. - \def\c##1^^M{\ignorespaces}% - \let\comment = \c % - % - % Don't bother jumping through all the hoops that \doignore does, it - % would be very hard since the catcodes are already set. - \long\def\ignore##1\end ignore{\ignorespaces}% - % - \copyingtext % -\endgroup}% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup } \message{defuns,} % @defun etc. -% Allow user to change definition object font (\df) internally -\def\setdeffont#1 {\csname DEF#1\endcsname} - \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt -\newcount\parencount - -% We want ()&[] to print specially on the defun line. -% -\def\activeparens{% - \catcode`\(=\active \catcode`\)=\active - \catcode`\&=\active - \catcode`\[=\active \catcode`\]=\active -} - -% Make control sequences which act like normal parenthesis chars. -\let\lparen = ( \let\rparen = ) - -{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) - -% Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. -\global\let(=\lparen \global\let)=\rparen -\global\let[=\lbrack \global\let]=\rbrack - -\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } -\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} -% This is used to turn on special parens -% but make & act ordinary (given that it's active). -\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} - -% Definitions of (, ) and & used in args for functions. -% This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested - \global\advance\parencount by 1 -} -% -% This is the definition of ( when already inside a level of parens. -\gdef\opnested{\char`\(\global\advance\parencount by 1 } -% -\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. - % also in that case restore the outer-level definition of (. - \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi - \global\advance \parencount by -1 } -% If we encounter &foo, then turn on ()-hacking afterwards -\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } -% -\gdef\normalparens{\boldbrax\let&=\ampnr} -} % End of definition inside \activeparens -%% These parens (in \boldbrax) actually are a little bolder than the -%% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } -\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } -\let\ampnr = \& -\def\lbrb{{\bf\char`\[}} -\def\rbrb{{\bf\char`\]}} - -% Active &'s sneak into the index arguments, so make sure it's defined. -{ - \catcode`& = \active - \global\let& = \ampnr -} - -% \defname, which formats the name of the @def (not the args). -% #1 is the function name. -% #2 is the type of definition, such as "Function". -% -\def\defname#1#2{% - % How we'll output the type name. Putting it in brackets helps - % distinguish it from the body text that may end up on the next line - % just below it. - \ifempty{#2}% - \def\defnametype{}% +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak \else - \def\defnametype{[\rm #2]}% + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \defargscommonending, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + \ifnum\lastpenalty=10002 \penalty2000 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint \fi % - % Get the values of \leftskip and \rightskip as they were outside the @def... - \dimen2=\leftskip - \advance\dimen2 by -\defbodyindent - % - % Figure out values for the paragraph shape. - \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}% - \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line - \dimen1=\hsize \advance \dimen1 by -\defargsindent % size for continuations - \parshape 2 0in \dimen0 \defargsindent \dimen1 - % - % Output arg 2 ("Function" or some such) but stuck inside a box of - % width 0 so it does not interfere with linebreaking. - \noindent - % - {% Adjust \hsize to exclude the ambient margins, - % so that \rightline will obey them. - \advance \hsize by -\dimen2 - \dimen3 = 0pt % was -1.25pc - \rlap{\rightline{\defnametype\kern\dimen3}}% - }% - % - % Allow all lines to be underfull without complaint: - \tolerance=10000 \hbadness=10000 - \advance\leftskip by -\defbodyindent - \exdentamount=\defbodyindent - {\df #1}\enskip % output function name - % \defunargs will be called next to output the arguments, if any. -} - -% Common pieces to start any @def... -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence (which our caller defines). -% #3 is the control sequence to process the header, such as \defunheader. -% -\def\parsebodycommon#1#2#3{% - \begingroup\inENV - % If there are two @def commands in a row, we'll have a \nobreak, - % which is there to keep the function description together with its - % header. But if there's nothing but headers, we want to allow a - % break after all. Check for penalty 10002 (inserted by - % \defargscommonending) instead of 10000, since the sectioning - % commands insert a \penalty10000, and we don't want to allow a break - % between a section heading and a defun. - \ifnum\lastpenalty=10002 \penalty0 \fi - \medbreak - % - % Define the \E... end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } -% Common part of the \...x definitions. -% -\def\defxbodycommon{% - % As with \parsebodycommon above, allow line break if we have multiple - % x headers in a row. It's not a great place, though. - \ifnum\lastpenalty=10000 \penalty1000 \fi +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% % - \begingroup\obeylines -} - -% Process body of @defun, @deffn, @defmac, etc. -% -\def\defparsebody#1#2#3{% - \parsebodycommon{#1}{#2}{#3}% - \def#2{\defxbodycommon \activeparens \spacesplit#3}% - \catcode\equalChar=\active - \begingroup\obeylines\activeparens - \spacesplit#3% -} - -% #1, #2, #3 are the common arguments (see \parsebodycommon above). -% #4, delimited by the space, is the class name. -% -\def\defmethparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}% - \begingroup\obeylines\activeparens - % The \empty here prevents misinterpretation of a construct such as - % @deffn {whatever} {Enharmonic comma} - % See comments at \deftpparsebody, although in our case we don't have - % to remove the \empty afterwards, since it is empty. - \spacesplit{#3{#4}}\empty -} - -% Used for @deftypemethod and @deftypeivar. -% #1, #2, #3 are the common arguments (see \defparsebody). -% #4, delimited by a space, is the class name. -% #5 is the method's return type. -% -\def\deftypemethparsebody#1#2#3#4 #5 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}% - \begingroup\obeylines\activeparens - \spacesplit{#3{#4}{#5}}% + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% } +\def\gobbledefun#1\startdefun{} -% Used for @deftypeop. The change from \deftypemethparsebody is an -% extra argument at the beginning which is the `category', instead of it -% being the hardwired string `Method' or `Instance Variable'. We have -% to account for this both in the \...x definition and in parsing the -% input at hand. Thus also need a control sequence (passed as #5) for -% the \E... definition to assign the category name to. +% \printdefunline \deffnheader{text} % -\def\deftypeopparsebody#1#2#3#4#5 #6 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 ##3 {\def#4{##1}% - \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}% - \begingroup\obeylines\activeparens - \spacesplit{#3{#5}{#6}}% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty 10002 % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup } -% For @defop. -\def\defopparsebody #1#2#3#4#5 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 {\def#4{##1}% - \defxbodycommon \activeparens \spacesplit{#3{##2}}}% - \begingroup\obeylines\activeparens - \spacesplit{#3{#5}}% -} +\def\Edefun{\endgraf\medbreak} -% These parsing functions are similar to the preceding ones -% except that they do not make parens into active characters. -% These are used for "variables" since they have no arguments. +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remainnig is to define \deffnheader. % -\def\defvarparsebody #1#2#3{% - \parsebodycommon{#1}{#2}{#3}% - \def#2{\defxbodycommon \spacesplit#3}% - \catcode\equalChar=\active - \begingroup\obeylines - \spacesplit#3% -} - -% @defopvar. -\def\defopvarparsebody #1#2#3#4#5 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 ##2 {\def#4{##1}% - \defxbodycommon \spacesplit{#3{##2}}}% - \begingroup\obeylines - \spacesplit{#3{#5}}% -} - -\def\defvrparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% - \begingroup\obeylines - \spacesplit{#3{#4}}% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp } -% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the -% type is just `struct', because we lose the braces in `{struct -% termios}' when \spacesplit reads its undelimited argument. Sigh. -% \let\deftpparsebody=\defvrparsebody +% \domakedefun \deffn \deffnx \deffnheader % -% So, to get around this, we put \empty in with the type name. That -% way, TeX won't find exactly `{...}' as an undelimited argument, and -% won't strip off the braces. +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. % -\def\deftpparsebody #1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% - \begingroup\obeylines - \spacesplit{\parsetpheaderline{#3{#4}}}\empty +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% } -% Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does. -% -\def\removeemptybraces\empty#1\relax{#1} - -% After \spacesplit has done its work, this is called -- #1 is the final -% thing to call, #2 the type name (which starts with \empty), and #3 -% (which might be empty) the arguments. -% -\def\parsetpheaderline#1#2#3{% - #1{\removeemptybraces#2\relax}{#3}% -}% +%%% Untyped functions: -% Split up #2 (the rest of the input line) at the first space token. -% call #1 with two arguments: -% the first is all of #2 before the space token, -% the second is all of #2 after that space token. -% If #2 contains no space token, all of it is passed as the first arg -% and the second is passed as empty. -% -{\obeylines % - \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}% - \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{% - \ifx\relax #3% - #1{#2}{}% - \else % - #1{#2}{#3#4}% - \fi}% -} +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} -% Define @defun. +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} -% This is called to end the arguments processing for all the @def... commands. -% -\def\defargscommonending{% - \interlinepenalty = 10000 - \advance\rightskip by 0pt plus 1fil - \endgraf - \nobreak\vskip -\parskip - \penalty 10002 % signal to \parsebodycommon. -} +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } -% This expands the args and terminates the paragraph they comprise. +% \deffngeneral {subind}category name args % -\def\defunargs#1{\functionparens \sl -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Set the font temporarily and use \font in case \setfont made \tensl a macro. -{\tensl\hyphenchar\font=0}% -#1% -{\tensl\hyphenchar\font=45}% -\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% - \defargscommonending +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } -\def\deftypefunargs #1{% -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Use \boldbraxnoamp, not \functionparens, so that & is not special. -\boldbraxnoamp -\tclose{#1}% avoid \code because of side effects on active chars - \defargscommonending -} +%%% Typed functions: -% Do complete processing of one @defun or @defunx line already parsed. +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} -% @deffn Command forward-char nchars +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} -\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } -\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% -\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } -% @defun == @deffn Function - -\def\defun{\defparsebody\Edefun\defunx\defunheader} +%%% Typed variables: -\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDeffunc}% -\defunargs {#2}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody -} +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} -% @deftypefun int foobar (int @var{foo}, float @var{bar}) +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} -\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } -% #1 is the data type. #2 is the name and args. -\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} -% #1 is the data type, #2 the name, #3 the args. -\def\deftypefunheaderx #1#2 #3\relax{% -\doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% -\deftypefunargs {#3}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } -% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} +%%% Untyped variables: -% \defheaderxcond#1\relax$.$ -% puts #1 in @code, followed by a space, but does nothing if #1 is null. -\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } -% #1 is the classification. #2 is the data type. #3 is the name and args. -\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} -% #1 is the classification, #2 the data type, #3 the name, #4 the args. -\def\deftypefnheaderx #1#2#3 #4\relax{% -\doind {fn}{\code{#3}}% Make entry in function index -\begingroup -\normalparens % notably, turn off `&' magic, which prevents -% at least some C++ text from working -\defname {\defheaderxcond#2\relax$.$#3}{#1}% -\deftypefunargs {#4}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody -} - -% @defmac == @deffn Macro +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} -\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } -\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefmac}% -\defunargs {#2}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% } -% @defspec == @deffn Special Form - -\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} - -\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefspec}% -\defunargs {#2}\endgroup % -\catcode\equalChar=\other % Turn off change made in \defparsebody -} +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} -% @defop CATEGORY CLASS OPERATION ARG... +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. % -\def\defop #1 {\def\defoptype{#1}% -\defopparsebody\Edefop\defopx\defopheader\defoptype} +% We are followed by (but not passed) the arguments, if any. % -\def\defopheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry - \begingroup - \defname{#2}{\defoptype\ \putwordon\ #1}% - \defunargs{#3}% - \endgroup +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. } -% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. % -\def\deftypeop #1 {\def\deftypeopcategory{#1}% - \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader - \deftypeopcategory} -% -% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. -\def\deftypeopheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3} - {\deftypeopcategory\ \putwordon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \let\var=\ttslanted + #1% + \sl\hyphenchar\font=45 } -% @deftypemethod CLASS TYPE METHOD ARG... -% -\def\deftypemethod{% - \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} +% We want ()&[] to print specially on the defun line. % -% #1 is the class name, #2 the data type, #3 the method name, #4 the args. -\def\deftypemethodheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active } -% @deftypeivar CLASS TYPE VARNAME -% -\def\deftypeivar{% - \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} -% -% #1 is the class name, #2 the data type, #3 the variable name. -\def\deftypeivarheader#1#2#3{% - \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index - \begingroup - \defname{\defheaderxcond#2\relax$.$#3} - {\putwordInstanceVariableof\ \code{#1}}% - \defvarargs{#3}% - \endgroup -} +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) -% @defmethod == @defop Method -% -\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} -% -% #1 is the class name, #2 the method name, #3 the args. -\def\defmethodheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{#2}{\putwordMethodon\ \code{#1}}% - \defunargs{#3}% - \endgroup +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} } -% @defcv {Class Option} foo-class foo-flag +\newcount\parencount -\def\defcv #1 {\def\defcvtype{#1}% -\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} -\def\defcvarheader #1#2#3{% - \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry - \begingroup - \defname{#2}{\defcvtype\ \putwordof\ #1}% - \defvarargs{#3}% - \endgroup +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi } - -% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME -% -\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} -% -\def\defivarheader#1#2#3{% - \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index - \begingroup - \defname{#2}{\putwordInstanceVariableof\ #1}% - \defvarargs{#3}% - \endgroup +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi } +\def\bfafterword#1 {#1 \bf} -% @defvar -% First, define the processing that is wanted for arguments of @defvar. -% This is actually simple: just print them in roman. -% This must expand the args and terminate the paragraph they make up -\def\defvarargs #1{\normalparens #1% - \defargscommonending +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword } - -% @defvr Counter foo-count - -\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} - -\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% -\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} - -% @defvar == @defvr Variable - -\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} - -\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefvar}% -\defvarargs {#2}\endgroup % +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 } -% @defopt == @defvr {User Option} - -\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} - -\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefopt}% -\defvarargs {#2}\endgroup % +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 } -% @deftypevar int foobar - -\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - -% #1 is the data type. #2 is the name, perhaps followed by text that -% is actually part of the data type, which should not be put into the index. -\def\deftypevarheader #1#2{% -\dovarind#2 \relax% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% - \defargscommonending -\endgroup} -\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} - -% @deftypevr {Global Flag} int enable - -\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - -\def\deftypevrheader #1#2#3{\dovarind#3 \relax% -\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} - \defargscommonending -\endgroup} - -% Now define @deftp -% Args are printed in bold, a slight difference from @defvar. - -\def\deftpargs #1{\bf \defvarargs{#1}} - -% @deftp Class window height width ... - -\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} - -\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% -\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} - -% These definitions are used if you use @defunx (etc.) -% anywhere other than immediately after a @defun or @defunx. -% -\def\defcvx#1 {\errmessage{@defcvx in invalid context}} -\def\deffnx#1 {\errmessage{@deffnx in invalid context}} -\def\defivarx#1 {\errmessage{@defivarx in invalid context}} -\def\defmacx#1 {\errmessage{@defmacx in invalid context}} -\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\defopx#1 {\errmessage{@defopx in invalid context}} -\def\defspecx#1 {\errmessage{@defspecx in invalid context}} -\def\deftpx#1 {\errmessage{@deftpx in invalid context}} -\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} -\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} -\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} -\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} -\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} -\def\defunx#1 {\errmessage{@defunx in invalid context}} -\def\defvarx#1 {\errmessage{@defvarx in invalid context}} -\def\defvrx#1 {\errmessage{@defvrx in invalid context}} +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +\def\badparencount{% + \errmessage{Unbalanced parentheses in @def}% + \global\parencount=0 +} +\def\badbrackcount{% + \errmessage{Unbalanced square braces in @def}% + \global\brackcount=0 +} \message{macros,} % @macro. -% To do this right we need a feature of e-TeX, \scantokens, -% which we arrange to emulate with a temporary file in ordinary TeX. -\ifx\eTeXversion\undefined - \newwrite\macscribble - \def\scanmacro#1{% - \begingroup \newlinechar`\^^M - % Undo catcode changes of \startcontents and \doprintindex - \catcode`\@=0 \catcode`\\=\other \escapechar=`\@ - % Append \endinput to make sure that TeX does not see the ending newline. - \toks0={#1\endinput}% - \immediate\openout\macscribble=\jobname.tmp - \immediate\write\macscribble{\the\toks0}% - \immediate\closeout\macscribble - \let\xeatspaces\eatspaces - \input \jobname.tmp - \endgroup +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newline. + % + % I've verified that it is necessary both for e-TeX and for ordinary TeX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp } -\else -\def\scanmacro#1{% -\begingroup \newlinechar`\^^M -% Undo catcode changes of \startcontents and \doprintindex -\catcode`\@=0 \catcode`\\=\other \escapechar=`\@ -\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} -\fi \newcount\paramno % Count of parameters \newtoks\macname % Macro name @@ -5586,13 +5495,15 @@ width0pt\relax} \fi % \do\macro1\do\macro2... % Utility routines. -% Thisdoes \let #1 = #2, except with \csnames. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% \def\cslet#1#2{% -\expandafter\expandafter -\expandafter\let -\expandafter\expandafter -\csname#1\endcsname -\csname#2\endcsname} + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). @@ -5619,30 +5530,36 @@ width0pt\relax} \fi % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. -\def\macrobodyctxt{% - \catcode`\~=\other +\def\scanctxt{% + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other - \catcode`\<=\other - \catcode`\>=\other - \catcode`\+=\other + \catcode`\~=\other +} + +\def\scanargctxt{% + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% + \scanctxt \catcode`\{=\other \catcode`\}=\other - \catcode`\@=\other \catcode`\^^M=\other - \usembodybackslash} + \usembodybackslash +} \def\macroargctxt{% - \catcode`\~=\other - \catcode`\^=\other - \catcode`\_=\other - \catcode`\|=\other - \catcode`\<=\other - \catcode`\>=\other - \catcode`\+=\other - \catcode`\@=\other - \catcode`\\=\other} + \scanctxt + \catcode`\\=\other +} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N @@ -5683,8 +5600,7 @@ width0pt\relax} \fi \else \expandafter\parsemacbody \fi} -\def\unmacro{\parsearg\dounmacro} -\def\dounmacro#1{% +\parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% @@ -5825,25 +5741,41 @@ width0pt\relax} \fi \expandafter\parsearg \fi \next} -% We mant to disable all macros during \shipout so that they are not +% We want to disable all macros during \shipout so that they are not % expanded by \write. \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% \edef\next{\macrolist}\expandafter\endgroup\next} +% For \indexnofonts, we need to get rid of all macros, leaving only the +% arguments (if present). Of course this is not nearly correct, but it +% is the best we can do for now. makeinfo does not expand macros in the +% argument to @deffn, which ends up writing an index entry, and texindex +% isn't prepared for an index sort entry that starts with \. +% +% Since macro invocations are followed by braces, we can just redefine them +% to take a single TeX argument. The case of a macro invocation that +% goes to end-of-line is not handled. +% +\def\emptyusermacros{\begingroup + \def\do##1{\let\noexpand##1=\noexpand\asis}% + \edef\next{\macrolist}\expandafter\endgroup\next} + % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Just make them active and then expand them all to nothing. -\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} +\def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} -\def\aliasyyy #1=#2\relax{\ignoreactivespaces -\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% - \expandafter\noexpand\csname#2\endcsname}% -\expandafter\endgroup\next} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} \message{cross references,} -% @xref etc. \newwrite\auxfile @@ -5855,64 +5787,70 @@ width0pt\relax} \fi \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} -% @node's job is to define \lastnode. -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx #1,\finishnodeparse} -\def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}} +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + \let\nwnode=\node -\let\lastnode=\relax +\let\lastnode=\empty -% The sectioning commands (@chapter, etc.) call these. -\def\donoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Ysectionnumberandtype}% - \global\let\lastnode=\relax - \fi -} -\def\unnumbnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% - \global\let\lastnode=\relax - \fi -} -\def\appendixnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Yappendixletterandtype}% - \global\let\lastnode=\relax +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty \fi } - % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister -\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} -\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} -\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an -% anchor), namely NAME-title (the corresponding @chapter/etc. name), -% NAME-pg (the page number), and NAME-snt (section number and type). -% Called from \foonoderef. -% -% We have to set \indexdummies so commands such as @code in a section -% title aren't expanded. It would be nicer not to expand the titles in -% the first place, but there's so many layers that that is hard to do. -% -% Likewise, use \turnoffactive so that punctuation chars such as underscore -% and backslash work in node names. +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \thissection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. % -\def\setref#1#2{{% - \atdummies +\def\setref#1#2{% \pdfmkdest{#1}% - % - \turnoffactive - \dosetq{#1-title}{Ytitle}% - \dosetq{#1-pg}{Ypagenumber}% - \dosetq{#1-snt}{#2}% -}} + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \turnoffactive + \otherbackslash + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\thissection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \writexrdef{pg}{\folio}% will be written later, during \shipout + }% + \fi +} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed @@ -5925,38 +5863,33 @@ width0pt\relax} \fi \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% - \def\printednodename{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual}% - \setbox0=\hbox{\printednodename}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual\unskip}% + \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. - \def\printednodename{\refx{#1-title}{}}% + \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. + % Make link in pdf output. \ifpdf \leavevmode \getfilename{#4}% @@ -5966,64 +5899,86 @@ width0pt\relax} \fi goto file{\the\filename.pdf} name{#1}% \else \startlink attr{/Border [0 0 0]}% - goto name{#1}% + goto name{\pdfmkpgn{#1}}% \fi }% \linkcolor \fi % - \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% - \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\turnoffactive \otherbackslash - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - }% - % output the `[mynode]' via a macro. - \xrefprintnodename\printednodename + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \otherbackslash + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 = 0pt + \refx{#1-snt}% + \else + \printedrefname + \fi % - % But we always want a comma and a space: - ,\space + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. % - % output the `page 3'. - \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive \otherbackslash + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% + \fi \fi \endlink \endgroup} % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, -% since not square brackets don't work in some documents. Particularly +% since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} -% \dosetq is called from \setref to do the actual \write (\iflinks). -% -\def\dosetq#1#2{% - {\let\folio=0% - \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% - \iflinks \next \fi - }% -} - -% \internalsetq{foo}{page} expands into -% CHARACTERS @xrdef{foo}{...expansion of \page...} -\def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}} - -% Things to be expanded by \internalsetq. +% Things referred to by \setref. % -\def\Ypagenumber{\folio} -\def\Ytitle{\thissection} \def\Ynothing{} -\def\Ysectionnumberandtype{% +\def\Yomitfromtoc{} +\def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 @@ -6034,8 +5989,7 @@ width0pt\relax} \fi \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } - -\def\Yappendixletterandtype{% +\def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 @@ -6048,15 +6002,6 @@ width0pt\relax} \fi \fi\fi\fi } -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. -% -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Pre-3.0. -\else - \def\linenumber{\the\inputlineno:\space} -\fi - % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % @@ -6065,7 +6010,7 @@ width0pt\relax} \fi \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX - \csname X#1\endcsname + \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. @@ -6087,11 +6032,44 @@ width0pt\relax} \fi #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. -% -\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname} +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value. + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR#1\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}% + \fi +} % Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readauxfile + \global\havexrefstrue + \fi + \closein 1 +} + \def\readauxfile{\begingroup \catcode`\^^@=\other \catcode`\^^A=\other @@ -6150,7 +6128,16 @@ width0pt\relax} \fi \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % - % Make the characters 128-255 be printing characters + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. {% \count 1=128 \def\loop{% @@ -6160,31 +6147,17 @@ width0pt\relax} \fi }% }% % - % Turn off \ as an escape so we do not lose on - % entries which were dumped with control sequences in their names. - % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^ - % Reference to such entries still does not work the way one would wish, - % but at least they do not bomb out when the aux file is read in. - \catcode`\\=\other - % - % @ is our escape character in .aux files. + % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 % - \openin 1 \jobname.aux - \ifeof 1 \else - \closein 1 - \input \jobname.aux - \global\havexrefstrue - \global\warnedobstrue - \fi - % Open the new aux file. TeX will close it automatically at exit. - \openout\auxfile=\jobname.aux + \input \jobname.aux \endgroup} -% Footnotes. +\message{insertions,} +% including footnotes. \newcount \footnoteno @@ -6198,13 +6171,12 @@ width0pt\relax} \fi % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment -\let\ptexfootnote=\footnote - {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent + \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % @@ -6222,17 +6194,12 @@ width0pt\relax} \fi % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % -% Oh yes, they do; otherwise, @ifset and anything else that uses -% \parseargline fail inside footnotes because the tokens are fixed when +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % -% The start of the footnote looks usually like this: -\gdef\startfootins{\insert\footins\bgroup} -% -% ... but this macro is redefined inside @multitable. -% \gdef\dofootnote{% - \startfootins + \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. @@ -6268,40 +6235,66 @@ width0pt\relax} \fi } }%end \catcode `\@=11 -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). -% -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarily, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi } -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % -\def\finalout{\overfullrule=0pt} +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. @@ -6311,12 +6304,12 @@ width0pt\relax} \fi % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else - \closein 1 % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi +\closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf @@ -6372,6 +6365,269 @@ width0pt\relax} \fi \endgroup} +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \thissection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\thissection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies \turnoffactive \otherbackslash + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \thissection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + \message{localization,} % and i18n. @@ -6380,19 +6636,17 @@ width0pt\relax} \fi % properly. Single argument is the language abbreviation. % It would be nice if we could set up a hyphenation file here. % -\def\documentlanguage{\parsearg\dodocumentlanguage} -\def\dodocumentlanguage#1{% +\parseargdef\documentlanguage{% \tex % read txi-??.tex file in plain TeX. - % Read the file if it exists. - \openin 1 txi-#1.tex - \ifeof1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% - \let\temp = \relax - \else - \def\temp{\input txi-#1.tex }% - \fi - \temp + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 \endgroup } \newhelp\nolanghelp{The given language definition file cannot be found or @@ -6575,8 +6829,7 @@ should work if nowhere else does.} % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % -\def\pagesizes{\parsearg\pagesizesxxx} -\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 @@ -6623,8 +6876,8 @@ should work if nowhere else does.} \def\normalplus{+} \def\normaldollar{$}%$ font-lock fix -% This macro is used to make a character print one way in ttfont -% where it can probably just be output, and another way in other fonts, +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print @@ -6672,13 +6925,6 @@ should work if nowhere else does.} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix -% Set up an active definition for =, but don't enable it most of the time. -{\catcode`\==\active -\global\def={{\tt \char 61}}} - -\catcode`+=\active -\catcode`\_=\active - % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. @@ -6687,15 +6933,16 @@ should work if nowhere else does.} \catcode`\@=0 -% \rawbackslashxx outputs one backslash character in current font, +% \backslashcurfont outputs one backslash character in current font, % as in \char`\\. -\global\chardef\rawbackslashxx=`\\ +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work -% \rawbackslash defines an active \ to do \rawbackslashxx. +% \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. {\catcode`\\=\active - @gdef@rawbackslash{@let\=@rawbackslashxx} + @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} } @@ -6703,7 +6950,7 @@ should work if nowhere else does.} {\catcode`\\=\other @gdef@realbackslash{\}} % \normalbackslash outputs one backslash in fixed width font. -\def\normalbackslash{{\tt\rawbackslashxx}} +\def\normalbackslash{{\tt\backslashcurfont}} \catcode`\\=\active @@ -6720,6 +6967,7 @@ should work if nowhere else does.} @let>=@normalgreater @let+=@normalplus @let$=@normaldollar %$ font-lock fix + @unsepspaces } % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of @@ -6759,10 +7007,6 @@ should work if nowhere else does.} @catcode`@# = @other @catcode`@% = @other -@c Set initial fonts. -@textfonts -@rm - @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @@ -6771,3 +7015,9 @@ should work if nowhere else does.} @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff -urpP pinentry-0.7.1/doc/version.texi pinentry-0.7.2/doc/version.texi --- pinentry-0.7.1/doc/version.texi 2004-04-21 19:34:09.000000000 +0000 +++ pinentry-0.7.2/doc/version.texi 2005-01-27 08:06:25.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 22 December 2003 -@set UPDATED-MONTH December 2003 -@set EDITION 0.7.1 -@set VERSION 0.7.1 +@set UPDATED 27 January 2005 +@set UPDATED-MONTH January 2005 +@set EDITION 0.7.2 +@set VERSION 0.7.2 diff -urpP pinentry-0.7.1/gtk/Makefile.in pinentry-0.7.2/gtk/Makefile.in --- pinentry-0.7.1/gtk/Makefile.in 2004-04-21 19:34:02.000000000 +0000 +++ pinentry-0.7.2/gtk/Makefile.in 2005-01-27 08:11:58.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -33,6 +33,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +SOURCES = $(pinentry_gtk_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -40,7 +42,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -54,7 +55,48 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +bin_PROGRAMS = pinentry-gtk$(EXEEXT) +subdir = gtk +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_pinentry_gtk_OBJECTS = pinentry-gtk.$(OBJEXT) gtksecentry.$(OBJEXT) +pinentry_gtk_OBJECTS = $(am_pinentry_gtk_OBJECTS) +pinentry_gtk_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +@FALLBACK_CURSES_TRUE@am__DEPENDENCIES_2 = \ +@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry-curses.a \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) +pinentry_gtk_DEPENDENCIES = ../pinentry/libpinentry.a \ + ../assuan/libassuan.a ../secmem/libsecmem.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(pinentry_gtk_SOURCES) +DIST_SOURCES = $(pinentry_gtk_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -67,10 +109,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -93,9 +139,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,6 +162,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -125,6 +179,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -140,6 +196,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -148,6 +205,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -155,6 +213,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -175,6 +235,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -185,81 +246,63 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - EXTRA_DIST = Manifest - -bin_PROGRAMS = pinentry-gtk @FALLBACK_CURSES_FALSE@ncurses_include = - @FALLBACK_CURSES_TRUE@ncurses_include = $(NCURSES_INCLUDE) @FALLBACK_CURSES_FALSE@libcurses = @FALLBACK_CURSES_TRUE@libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) - AM_CPPFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(ncurses_include) \ -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a \ $(LIBCAP) $(GTK_LIBS) $(libcurses) - pinentry_gtk_SOURCES = pinentry-gtk.c \ gtksecentry.c gtksecentry.h -subdir = gtk -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = pinentry-gtk$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_pinentry_gtk_OBJECTS = pinentry-gtk.$(OBJEXT) gtksecentry.$(OBJEXT) -pinentry_gtk_OBJECTS = $(am_pinentry_gtk_OBJECTS) -pinentry_gtk_LDADD = $(LDADD) -@FALLBACK_CURSES_TRUE@pinentry_gtk_DEPENDENCIES = \ -@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry.a \ -@FALLBACK_CURSES_TRUE@ ../assuan/libassuan.a \ -@FALLBACK_CURSES_TRUE@ ../secmem/libsecmem.a \ -@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry-curses.a -@FALLBACK_CURSES_FALSE@pinentry_gtk_DEPENDENCIES = \ -@FALLBACK_CURSES_FALSE@ ../pinentry/libpinentry.a \ -@FALLBACK_CURSES_FALSE@ ../assuan/libassuan.a \ -@FALLBACK_CURSES_FALSE@ ../secmem/libsecmem.a -pinentry_gtk_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gtksecentry.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/pinentry-gtk.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(pinentry_gtk_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(pinentry_gtk_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gtk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gtk/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done @@ -267,8 +310,8 @@ uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @@ -278,7 +321,7 @@ pinentry-gtk$(EXEEXT): $(pinentry_gtk_OB $(LINK) $(pinentry_gtk_LDFLAGS) $(pinentry_gtk_OBJECTS) $(pinentry_gtk_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -287,36 +330,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-gtk.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -325,6 +352,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -336,10 +364,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -362,10 +391,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -379,7 +404,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -397,9 +422,10 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -419,7 +445,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -438,6 +464,8 @@ dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -473,11 +501,11 @@ uninstall-am: uninstall-binPROGRAMS unin .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am diff -urpP pinentry-0.7.1/gtk+-2/Makefile.am pinentry-0.7.2/gtk+-2/Makefile.am --- pinentry-0.7.1/gtk+-2/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/gtk+-2/Makefile.am 2005-01-27 08:10:22.000000000 +0000 @@ -0,0 +1,38 @@ +# Makefile.am - PIN entry GTK+ frontend. +# Copyright (C) 2002 g10 Code GmbH +# +# This file is part of PINENTRY. +# +# PINENTRY 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. +# +# PINENTRY 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 + +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = pinentry-gtk-2 + +if FALLBACK_CURSES +ncurses_include = $(NCURSES_INCLUDE) +libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) +else +ncurses_include = +libcurses = +endif + +AM_CPPFLAGS = $(GTK2CFLAGS) $(ncurses_include) \ + -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry +LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a \ + $(LIBCAP) $(GTK2LIBS) $(libcurses) + +pinentry_gtk_2_SOURCES = pinentry-gtk-2.c \ + gtksecentry.c gtksecentry.h diff -urpP pinentry-0.7.1/gtk+-2/Makefile.in pinentry-0.7.2/gtk+-2/Makefile.in --- pinentry-0.7.1/gtk+-2/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/gtk+-2/Makefile.in 2005-01-27 08:11:58.000000000 +0000 @@ -0,0 +1,515 @@ +# Makefile.in generated by automake 1.9.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - PIN entry GTK+ frontend. +# Copyright (C) 2002 g10 Code GmbH +# +# This file is part of PINENTRY. +# +# PINENTRY 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. +# +# PINENTRY 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 + +SOURCES = $(pinentry_gtk_2_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = pinentry-gtk-2$(EXEEXT) +subdir = gtk+-2 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_pinentry_gtk_2_OBJECTS = pinentry-gtk-2.$(OBJEXT) \ + gtksecentry.$(OBJEXT) +pinentry_gtk_2_OBJECTS = $(am_pinentry_gtk_2_OBJECTS) +pinentry_gtk_2_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +@FALLBACK_CURSES_TRUE@am__DEPENDENCIES_2 = \ +@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry-curses.a \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) +pinentry_gtk_2_DEPENDENCIES = ../pinentry/libpinentry.a \ + ../assuan/libassuan.a ../secmem/libsecmem.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(pinentry_gtk_2_SOURCES) +DIST_SOURCES = $(pinentry_gtk_2_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_LIBPINENTRY_CURSES_FALSE@ +BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ +BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ +BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ +BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ +BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ +BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FALLBACK_CURSES_FALSE = @FALLBACK_CURSES_FALSE@ +FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_TRUE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBCAP = @LIBCAP@ +LIBCURSES = @LIBCURSES@ +LIBICONV = @LIBICONV@ +LIBNCURSES = @LIBNCURSES@ +LIBOBJS = @LIBOBJS@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBTERMCAP = @LIBTERMCAP@ +LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MOC = @MOC@ +NCURSES_INCLUDE = @NCURSES_INCLUDE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ +QTE_NORTTI = @QTE_NORTTI@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_INCLUDES = @QT_INCLUDES@ +QT_LDFLAGS = @QT_LDFLAGS@ +QT_LIBS = @QT_LIBS@ +QT_MT_LDFLAGS = @QT_MT_LDFLAGS@ +QT_MT_LIBS = @QT_MT_LIBS@ +QT_RPATH = @QT_RPATH@ +RANLIB = @RANLIB@ +SETCAP = @SETCAP@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_THREADS = @USE_THREADS@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +qt_includes = @qt_includes@ +qt_libraries = @qt_libraries@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +x_libraries = @x_libraries@ +@FALLBACK_CURSES_FALSE@ncurses_include = +@FALLBACK_CURSES_TRUE@ncurses_include = $(NCURSES_INCLUDE) +@FALLBACK_CURSES_FALSE@libcurses = +@FALLBACK_CURSES_TRUE@libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) +AM_CPPFLAGS = $(GTK2CFLAGS) $(ncurses_include) \ + -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry + +LDADD = ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a \ + $(LIBCAP) $(GTK2LIBS) $(libcurses) + +pinentry_gtk_2_SOURCES = pinentry-gtk-2.c \ + gtksecentry.c gtksecentry.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gtk+-2/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu gtk+-2/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +pinentry-gtk-2$(EXEEXT): $(pinentry_gtk_2_OBJECTS) $(pinentry_gtk_2_DEPENDENCIES) + @rm -f pinentry-gtk-2$(EXEEXT) + $(LINK) $(pinentry_gtk_2_LDFLAGS) $(pinentry_gtk_2_OBJECTS) $(pinentry_gtk_2_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtksecentry.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry-gtk-2.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -urpP pinentry-0.7.1/gtk+-2/gtksecentry.c pinentry-0.7.2/gtk+-2/gtksecentry.c --- pinentry-0.7.1/gtk+-2/gtksecentry.c 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/gtk+-2/gtksecentry.c 2004-09-02 01:47:13.000000000 +0000 @@ -0,0 +1,3412 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * Copyright (C) 2004 Albrecht Dreß + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +/* + * Heavily stripped down for use in pinentry-gtk-2 by Albrecht Dreß + * Feb. 2004: + * + * The entry is now always invisible, uses secure memory methods to + * allocate the text memory, and all potentially dangerous methods + * (copy & paste, popup, etc.) have been removed. + */ + +#include +#include +#include +#include + +#include "gtksecentry.h" +#include "memory.h" + +#ifndef _ +# include +# define _(x) gettext(x) +#endif + +#define MIN_SECURE_ENTRY_WIDTH 150 +#define DRAW_TIMEOUT 20 +#define INNER_BORDER 2 + +/* Initial size of buffer, in bytes */ +#define MIN_SIZE 16 + +/* Maximum size of text buffer, in bytes */ +#define MAX_SIZE G_MAXUSHORT + +enum { + ACTIVATE, + MOVE_CURSOR, + INSERT_AT_CURSOR, + DELETE_FROM_CURSOR, + LAST_SIGNAL +}; + +enum { + PROP_0, + PROP_CURSOR_POSITION, + PROP_SELECTION_BOUND, + PROP_MAX_LENGTH, + PROP_HAS_FRAME, + PROP_INVISIBLE_CHAR, + PROP_ACTIVATES_DEFAULT, + PROP_WIDTH_CHARS, + PROP_SCROLL_OFFSET, + PROP_TEXT +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +/* GObject, GtkObject methods + */ +static void gtk_secure_entry_class_init(GtkSecureEntryClass * klass); +static void gtk_secure_entry_editable_init(GtkEditableClass * iface); +static void gtk_secure_entry_cell_editable_init(GtkCellEditableIface * + iface); +static void gtk_secure_entry_init(GtkSecureEntry * entry); +static void gtk_secure_entry_set_property(GObject * object, + guint prop_id, + const GValue * value, + GParamSpec * pspec); +static void gtk_secure_entry_get_property(GObject * object, + guint prop_id, + GValue * value, + GParamSpec * pspec); +static void gtk_secure_entry_finalize(GObject * object); + +/* GtkWidget methods + */ +static void gtk_secure_entry_realize(GtkWidget * widget); +static void gtk_secure_entry_unrealize(GtkWidget * widget); +static void gtk_secure_entry_size_request(GtkWidget * widget, + GtkRequisition * requisition); +static void gtk_secure_entry_size_allocate(GtkWidget * widget, + GtkAllocation * allocation); +static void gtk_secure_entry_draw_frame(GtkWidget * widget); +static gint gtk_secure_entry_expose(GtkWidget * widget, + GdkEventExpose * event); +static gint gtk_secure_entry_button_press(GtkWidget * widget, + GdkEventButton * event); +static gint gtk_secure_entry_button_release(GtkWidget * widget, + GdkEventButton * event); +static gint gtk_secure_entry_motion_notify(GtkWidget * widget, + GdkEventMotion * event); +static gint gtk_secure_entry_key_press(GtkWidget * widget, + GdkEventKey * event); +static gint gtk_secure_entry_key_release(GtkWidget * widget, + GdkEventKey * event); +static gint gtk_secure_entry_focus_in(GtkWidget * widget, + GdkEventFocus * event); +static gint gtk_secure_entry_focus_out(GtkWidget * widget, + GdkEventFocus * event); +static void gtk_secure_entry_grab_focus(GtkWidget * widget); +static void gtk_secure_entry_style_set(GtkWidget * widget, + GtkStyle * previous_style); +static void gtk_secure_entry_direction_changed(GtkWidget * widget, + GtkTextDirection + previous_dir); +static void gtk_secure_entry_state_changed(GtkWidget * widget, + GtkStateType previous_state); +static void gtk_secure_entry_screen_changed(GtkWidget * widget, + GdkScreen * old_screen); + +/* GtkEditable method implementations + */ +static void gtk_secure_entry_insert_text(GtkEditable * editable, + const gchar * new_text, + gint new_text_length, + gint * position); +static void gtk_secure_entry_delete_text(GtkEditable * editable, + gint start_pos, gint end_pos); +static void gtk_secure_entry_real_set_position(GtkEditable * editable, + gint position); +static gint gtk_secure_entry_get_position(GtkEditable * editable); +static void gtk_secure_entry_set_selection_bounds(GtkEditable * editable, + gint start, gint end); +static gboolean gtk_secure_entry_get_selection_bounds(GtkEditable * + editable, + gint * start, + gint * end); + +/* GtkCellEditable method implementations + */ +static void gtk_secure_entry_start_editing(GtkCellEditable * cell_editable, + GdkEvent * event); + +/* Default signal handlers + */ +static void gtk_secure_entry_real_insert_text(GtkEditable * editable, + const gchar * new_text, + gint new_text_length, + gint * position); +static void gtk_secure_entry_real_delete_text(GtkEditable * editable, + gint start_pos, + gint end_pos); +static void gtk_secure_entry_move_cursor(GtkSecureEntry * entry, + GtkMovementStep step, + gint count, + gboolean extend_selection); +static void gtk_secure_entry_insert_at_cursor(GtkSecureEntry * entry, + const gchar * str); +static void gtk_secure_entry_delete_from_cursor(GtkSecureEntry * entry, + GtkDeleteType type, + gint count); +static void gtk_secure_entry_real_activate(GtkSecureEntry * entry); + +static void gtk_secure_entry_keymap_direction_changed(GdkKeymap * keymap, + GtkSecureEntry * + entry); +/* IM Context Callbacks + */ +static void gtk_secure_entry_commit_cb(GtkIMContext * context, + const gchar * str, + GtkSecureEntry * entry); +static void gtk_secure_entry_preedit_changed_cb(GtkIMContext * context, + GtkSecureEntry * entry); +static gboolean gtk_secure_entry_retrieve_surrounding_cb(GtkIMContext * + context, + GtkSecureEntry * + entry); +static gboolean gtk_secure_entry_delete_surrounding_cb(GtkIMContext * + context, + gint offset, + gint n_chars, + GtkSecureEntry * + entry); + +/* Internal routines + */ +static void gtk_secure_entry_enter_text(GtkSecureEntry * entry, + const gchar * str); +static void gtk_secure_entry_set_positions(GtkSecureEntry * entry, + gint current_pos, + gint selection_bound); +static void gtk_secure_entry_draw_text(GtkSecureEntry * entry); +static void gtk_secure_entry_draw_cursor(GtkSecureEntry * entry); +static PangoLayout *gtk_secure_entry_ensure_layout(GtkSecureEntry * entry, + gboolean + include_preedit); +static void gtk_secure_entry_reset_layout(GtkSecureEntry * entry); +static void gtk_secure_entry_queue_draw(GtkSecureEntry * entry); +static void gtk_secure_entry_reset_im_context(GtkSecureEntry * entry); +static void gtk_secure_entry_recompute(GtkSecureEntry * entry); +static gint gtk_secure_entry_find_position(GtkSecureEntry * entry, gint x); +static void gtk_secure_entry_get_cursor_locations(GtkSecureEntry * entry, + gint * strong_x, + gint * weak_x); +static void gtk_secure_entry_adjust_scroll(GtkSecureEntry * entry); +static gint gtk_secure_entry_move_visually(GtkSecureEntry * editable, + gint start, gint count); +static gint gtk_secure_entry_move_logically(GtkSecureEntry * entry, + gint start, gint count); +static gboolean gtk_secure_entry_mnemonic_activate(GtkWidget * widget, + gboolean group_cycling); +static void gtk_secure_entry_state_changed(GtkWidget * widget, + GtkStateType previous_state); +static void gtk_secure_entry_check_cursor_blink(GtkSecureEntry * entry); +static void gtk_secure_entry_pend_cursor_blink(GtkSecureEntry * entry); +static void get_text_area_size(GtkSecureEntry * entry, + gint * x, + gint * y, gint * width, gint * height); +static void get_widget_window_size(GtkSecureEntry * entry, + gint * x, + gint * y, gint * width, gint * height); + + + +#define _gtk_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID +#define _gtk_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING +static void _gtk_marshal_VOID__ENUM_INT_BOOLEAN(GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * + param_values, + gpointer invocation_hint, + gpointer marshal_data); +static void _gtk_marshal_VOID__ENUM_INT(GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint, + gpointer marshal_data); + + +static GtkWidgetClass *parent_class = NULL; + +gboolean g_use_secure_mem = FALSE; + +# define g_sec_new(type, count) \ + ((type *) g_sec_malloc ((unsigned) sizeof (type) * (count))) + +#define WITH_SECURE_MEM(EXP) do { \ + gboolean tmp = g_use_secure_mem; \ + g_use_secure_mem = TRUE; \ + EXP; \ + g_use_secure_mem = tmp; \ + } while(0) + + +gpointer +g_malloc(gulong size) +{ + gpointer p; + + if (size == 0) + return NULL; + + if (g_use_secure_mem) + p = (gpointer) secmem_malloc(size); + else + p = (gpointer) malloc(size); + if (!p) + g_error("could not allocate %ld bytes", size); + + return p; +} + +gpointer +g_malloc0(gulong size) +{ + gpointer p; + + if (size == 0) + return NULL; + + if (g_use_secure_mem) { + p = (gpointer) secmem_malloc(size); + if (p) + memset(p, 0, size); + } else + p = (gpointer) calloc(size, 1); + if (!p) + g_error("could not allocate %ld bytes", size); + + return p; +} + +gpointer +g_realloc(gpointer mem, gulong size) +{ + gpointer p; + + if (size == 0) { + g_free(mem); + + return NULL; + } + + if (!mem) { + if (g_use_secure_mem) + p = (gpointer) secmem_malloc(size); + else + p = (gpointer) malloc(size); + } else { + if (g_use_secure_mem) { + g_assert(m_is_secure(mem)); + p = (gpointer) secmem_realloc(mem, size); + } else + p = (gpointer) realloc(mem, size); + } + + if (!p) + g_error("could not reallocate %lu bytes", (gulong) size); + + return p; +} + +void +g_free(gpointer mem) +{ + if (mem) { + if (m_is_secure(mem)) + secmem_free(mem); + else + free(mem); + } +} + +GType +gtk_secure_entry_get_type(void) +{ + static GType entry_type = 0; + + if (!entry_type) { + static const GTypeInfo entry_info = { + sizeof(GtkSecureEntryClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_secure_entry_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(GtkSecureEntry), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_secure_entry_init, + }; + + static const GInterfaceInfo editable_info = { + (GInterfaceInitFunc) gtk_secure_entry_editable_init, /* interface_init */ + NULL, /* interface_finalize */ + NULL /* interface_data */ + }; + + static const GInterfaceInfo cell_editable_info = { + (GInterfaceInitFunc) gtk_secure_entry_cell_editable_init, /* interface_init */ + NULL, /* interface_finalize */ + NULL /* interface_data */ + }; + + entry_type = + g_type_register_static(GTK_TYPE_WIDGET, "GtkSecureEntry", + &entry_info, 0); + + g_type_add_interface_static(entry_type, + GTK_TYPE_EDITABLE, &editable_info); + g_type_add_interface_static(entry_type, + GTK_TYPE_CELL_EDITABLE, + &cell_editable_info); + } + + return entry_type; +} + +static void +add_move_binding(GtkBindingSet * binding_set, + guint keyval, + guint modmask, GtkMovementStep step, gint count) +{ + g_return_if_fail((modmask & GDK_SHIFT_MASK) == 0); + + gtk_binding_entry_add_signal(binding_set, keyval, modmask, + "move_cursor", 3, + G_TYPE_ENUM, step, + G_TYPE_INT, count, G_TYPE_BOOLEAN, FALSE); + + /* Selection-extending version */ + gtk_binding_entry_add_signal(binding_set, keyval, + modmask | GDK_SHIFT_MASK, "move_cursor", + 3, G_TYPE_ENUM, step, G_TYPE_INT, count, + G_TYPE_BOOLEAN, TRUE); +} + +static void +gtk_secure_entry_class_init(GtkSecureEntryClass * class) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS(class); + GtkWidgetClass *widget_class; + GtkBindingSet *binding_set; + + widget_class = (GtkWidgetClass *) class; + parent_class = g_type_class_peek_parent(class); + + gobject_class->finalize = gtk_secure_entry_finalize; + gobject_class->set_property = gtk_secure_entry_set_property; + gobject_class->get_property = gtk_secure_entry_get_property; + + widget_class->realize = gtk_secure_entry_realize; + widget_class->unrealize = gtk_secure_entry_unrealize; + widget_class->size_request = gtk_secure_entry_size_request; + widget_class->size_allocate = gtk_secure_entry_size_allocate; + widget_class->expose_event = gtk_secure_entry_expose; + widget_class->button_press_event = gtk_secure_entry_button_press; + widget_class->button_release_event = gtk_secure_entry_button_release; + widget_class->motion_notify_event = gtk_secure_entry_motion_notify; + widget_class->key_press_event = gtk_secure_entry_key_press; + widget_class->key_release_event = gtk_secure_entry_key_release; + widget_class->focus_in_event = gtk_secure_entry_focus_in; + widget_class->focus_out_event = gtk_secure_entry_focus_out; + widget_class->grab_focus = gtk_secure_entry_grab_focus; + widget_class->style_set = gtk_secure_entry_style_set; + widget_class->direction_changed = gtk_secure_entry_direction_changed; + widget_class->state_changed = gtk_secure_entry_state_changed; + widget_class->screen_changed = gtk_secure_entry_screen_changed; + widget_class->mnemonic_activate = gtk_secure_entry_mnemonic_activate; + + class->move_cursor = gtk_secure_entry_move_cursor; + class->insert_at_cursor = gtk_secure_entry_insert_at_cursor; + class->delete_from_cursor = gtk_secure_entry_delete_from_cursor; + class->activate = gtk_secure_entry_real_activate; + + g_object_class_install_property(gobject_class, + PROP_CURSOR_POSITION, + g_param_spec_int("cursor_position", + _("Cursor Position"), + _ + ("The current position of the insertion cursor in chars"), + 0, MAX_SIZE, 0, + G_PARAM_READABLE)); + + g_object_class_install_property(gobject_class, + PROP_SELECTION_BOUND, + g_param_spec_int("selection_bound", + _("Selection Bound"), + _ + ("The position of the opposite end of the selection from the cursor in chars"), + 0, MAX_SIZE, 0, + G_PARAM_READABLE)); + + g_object_class_install_property(gobject_class, + PROP_MAX_LENGTH, + g_param_spec_int("max_length", + _("Maximum length"), + _ + ("Maximum number of characters for this entry. Zero if no maximum"), + 0, MAX_SIZE, 0, + G_PARAM_READABLE | + G_PARAM_WRITABLE)); + + g_object_class_install_property(gobject_class, + PROP_HAS_FRAME, + g_param_spec_boolean("has_frame", + _("Has Frame"), + _ + ("FALSE removes outside bevel from entry"), + TRUE, + G_PARAM_READABLE | + G_PARAM_WRITABLE)); + + g_object_class_install_property(gobject_class, + PROP_INVISIBLE_CHAR, + g_param_spec_unichar("invisible_char", + _ + ("Invisible character"), + _ + ("The character to use when masking entry contents (in \"password mode\")"), + '*', + G_PARAM_READABLE | + G_PARAM_WRITABLE)); + + g_object_class_install_property(gobject_class, + PROP_ACTIVATES_DEFAULT, + g_param_spec_boolean + ("activates_default", + _("Activates default"), + _ + ("Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed"), + FALSE, + G_PARAM_READABLE | G_PARAM_WRITABLE)); + g_object_class_install_property(gobject_class, PROP_WIDTH_CHARS, + g_param_spec_int("width_chars", + _("Width in chars"), + _ + ("Number of characters to leave space for in the entry"), + -1, G_MAXINT, -1, + G_PARAM_READABLE | + G_PARAM_WRITABLE)); + + g_object_class_install_property(gobject_class, + PROP_SCROLL_OFFSET, + g_param_spec_int("scroll_offset", + _("Scroll offset"), + _ + ("Number of pixels of the entry scrolled off the screen to the left"), + 0, G_MAXINT, 0, + G_PARAM_READABLE)); + + g_object_class_install_property(gobject_class, + PROP_TEXT, + g_param_spec_string("text", + _("Text"), + _ + ("The contents of the entry"), + "", + G_PARAM_READABLE | + G_PARAM_WRITABLE)); + + /* Action signals */ + + signals[ACTIVATE] = + g_signal_new("activate", + G_OBJECT_CLASS_TYPE(gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET(GtkSecureEntryClass, activate), + NULL, NULL, _gtk_marshal_VOID__VOID, G_TYPE_NONE, 0); + widget_class->activate_signal = signals[ACTIVATE]; + + signals[MOVE_CURSOR] = + g_signal_new("move_cursor", + G_OBJECT_CLASS_TYPE(gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET(GtkSecureEntryClass, move_cursor), + NULL, NULL, + _gtk_marshal_VOID__ENUM_INT_BOOLEAN, + G_TYPE_NONE, 3, + GTK_TYPE_MOVEMENT_STEP, G_TYPE_INT, G_TYPE_BOOLEAN); + + signals[INSERT_AT_CURSOR] = + g_signal_new("insert_at_cursor", + G_OBJECT_CLASS_TYPE(gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET(GtkSecureEntryClass, + insert_at_cursor), NULL, NULL, + _gtk_marshal_VOID__STRING, G_TYPE_NONE, 1, + G_TYPE_STRING); + + signals[DELETE_FROM_CURSOR] = + g_signal_new("delete_from_cursor", + G_OBJECT_CLASS_TYPE(gobject_class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET(GtkSecureEntryClass, + delete_from_cursor), NULL, NULL, + _gtk_marshal_VOID__ENUM_INT, G_TYPE_NONE, 2, + GTK_TYPE_DELETE_TYPE, G_TYPE_INT); + + /* + * Key bindings + */ + + binding_set = gtk_binding_set_by_class(class); + + /* Moving the insertion point */ + add_move_binding(binding_set, GDK_Right, 0, + GTK_MOVEMENT_VISUAL_POSITIONS, 1); + + add_move_binding(binding_set, GDK_Left, 0, + GTK_MOVEMENT_VISUAL_POSITIONS, -1); + + add_move_binding(binding_set, GDK_KP_Right, 0, + GTK_MOVEMENT_VISUAL_POSITIONS, 1); + + add_move_binding(binding_set, GDK_KP_Left, 0, + GTK_MOVEMENT_VISUAL_POSITIONS, -1); + + add_move_binding(binding_set, GDK_Right, GDK_CONTROL_MASK, + GTK_MOVEMENT_WORDS, 1); + + add_move_binding(binding_set, GDK_Left, GDK_CONTROL_MASK, + GTK_MOVEMENT_WORDS, -1); + + add_move_binding(binding_set, GDK_KP_Right, GDK_CONTROL_MASK, + GTK_MOVEMENT_WORDS, 1); + + add_move_binding(binding_set, GDK_KP_Left, GDK_CONTROL_MASK, + GTK_MOVEMENT_WORDS, -1); + + add_move_binding(binding_set, GDK_Home, 0, + GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); + + add_move_binding(binding_set, GDK_End, 0, + GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); + + add_move_binding(binding_set, GDK_KP_Home, 0, + GTK_MOVEMENT_DISPLAY_LINE_ENDS, -1); + + add_move_binding(binding_set, GDK_KP_End, 0, + GTK_MOVEMENT_DISPLAY_LINE_ENDS, 1); + + add_move_binding(binding_set, GDK_Home, GDK_CONTROL_MASK, + GTK_MOVEMENT_BUFFER_ENDS, -1); + + add_move_binding(binding_set, GDK_End, GDK_CONTROL_MASK, + GTK_MOVEMENT_BUFFER_ENDS, 1); + + add_move_binding(binding_set, GDK_KP_Home, GDK_CONTROL_MASK, + GTK_MOVEMENT_BUFFER_ENDS, -1); + + add_move_binding(binding_set, GDK_KP_End, GDK_CONTROL_MASK, + GTK_MOVEMENT_BUFFER_ENDS, 1); + + /* Select all + */ + gtk_binding_entry_add_signal(binding_set, GDK_a, GDK_CONTROL_MASK, + "move_cursor", 3, + GTK_TYPE_MOVEMENT_STEP, + GTK_MOVEMENT_BUFFER_ENDS, G_TYPE_INT, -1, + G_TYPE_BOOLEAN, FALSE); + gtk_binding_entry_add_signal(binding_set, GDK_a, GDK_CONTROL_MASK, + "move_cursor", 3, GTK_TYPE_MOVEMENT_STEP, + GTK_MOVEMENT_BUFFER_ENDS, G_TYPE_INT, 1, + G_TYPE_BOOLEAN, TRUE); + + + /* Activate + */ + gtk_binding_entry_add_signal(binding_set, GDK_Return, 0, + "activate", 0); + gtk_binding_entry_add_signal(binding_set, GDK_KP_Enter, 0, + "activate", 0); + + /* Deleting text */ + gtk_binding_entry_add_signal(binding_set, GDK_Delete, 0, + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, + G_TYPE_INT, 1); + + gtk_binding_entry_add_signal(binding_set, GDK_KP_Delete, 0, + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, + G_TYPE_INT, 1); + + gtk_binding_entry_add_signal(binding_set, GDK_BackSpace, 0, + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, + G_TYPE_INT, -1); + + /* Make this do the same as Backspace, to help with mis-typing */ + gtk_binding_entry_add_signal(binding_set, GDK_BackSpace, + GDK_SHIFT_MASK, "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_CHARS, G_TYPE_INT, + -1); + + gtk_binding_entry_add_signal(binding_set, GDK_Delete, GDK_CONTROL_MASK, + "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, + G_TYPE_INT, 1); + + gtk_binding_entry_add_signal(binding_set, GDK_KP_Delete, + GDK_CONTROL_MASK, "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, + G_TYPE_INT, 1); + + gtk_binding_entry_add_signal(binding_set, GDK_BackSpace, + GDK_CONTROL_MASK, "delete_from_cursor", 2, + G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, + G_TYPE_INT, -1); + + gtk_settings_install_property(g_param_spec_boolean + ("gtk-entry-select-on-focus", + _("Select on focus"), + _ + ("Whether to select the contents of an entry when it is focused"), + TRUE, G_PARAM_READWRITE)); +} + +static void +gtk_secure_entry_editable_init(GtkEditableClass * iface) +{ + iface->do_insert_text = gtk_secure_entry_insert_text; + iface->do_delete_text = gtk_secure_entry_delete_text; + iface->insert_text = gtk_secure_entry_real_insert_text; + iface->delete_text = gtk_secure_entry_real_delete_text; + iface->set_selection_bounds = gtk_secure_entry_set_selection_bounds; + iface->get_selection_bounds = gtk_secure_entry_get_selection_bounds; + iface->set_position = gtk_secure_entry_real_set_position; + iface->get_position = gtk_secure_entry_get_position; +} + +static void +gtk_secure_entry_cell_editable_init(GtkCellEditableIface * iface) +{ + iface->start_editing = gtk_secure_entry_start_editing; +} + +static void +gtk_secure_entry_set_property(GObject * object, + guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(object); + + switch (prop_id) { + case PROP_MAX_LENGTH: + gtk_secure_entry_set_max_length(entry, g_value_get_int(value)); + break; + + case PROP_HAS_FRAME: + gtk_secure_entry_set_has_frame(entry, g_value_get_boolean(value)); + break; + + case PROP_INVISIBLE_CHAR: + gtk_secure_entry_set_invisible_char(entry, + g_value_get_uint(value)); + break; + + case PROP_ACTIVATES_DEFAULT: + gtk_secure_entry_set_activates_default(entry, + g_value_get_boolean(value)); + break; + + case PROP_WIDTH_CHARS: + gtk_secure_entry_set_width_chars(entry, g_value_get_int(value)); + break; + + case PROP_TEXT: + gtk_secure_entry_set_text(entry, g_value_get_string(value)); + break; + + case PROP_SCROLL_OFFSET: + case PROP_CURSOR_POSITION: + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } +} + +static void +gtk_secure_entry_get_property(GObject * object, + guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(object); + + switch (prop_id) { + case PROP_CURSOR_POSITION: + g_value_set_int(value, entry->current_pos); + break; + case PROP_SELECTION_BOUND: + g_value_set_int(value, entry->selection_bound); + break; + case PROP_MAX_LENGTH: + g_value_set_int(value, entry->text_max_length); + break; + case PROP_HAS_FRAME: + g_value_set_boolean(value, entry->has_frame); + break; + case PROP_INVISIBLE_CHAR: + g_value_set_uint(value, entry->invisible_char); + break; + case PROP_ACTIVATES_DEFAULT: + g_value_set_boolean(value, entry->activates_default); + break; + case PROP_WIDTH_CHARS: + g_value_set_int(value, entry->width_chars); + break; + case PROP_SCROLL_OFFSET: + g_value_set_int(value, entry->scroll_offset); + break; + case PROP_TEXT: + g_value_set_string(value, gtk_secure_entry_get_text(entry)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + break; + } +} + +static void +gtk_secure_entry_init(GtkSecureEntry * entry) +{ + GTK_WIDGET_SET_FLAGS(entry, GTK_CAN_FOCUS); + + entry->text_size = MIN_SIZE; + WITH_SECURE_MEM(entry->text = g_malloc(entry->text_size)); + entry->text[0] = '\0'; + + entry->invisible_char = '*'; + entry->width_chars = -1; + entry->is_cell_renderer = FALSE; + entry->editing_canceled = FALSE; + entry->has_frame = TRUE; + + /* This object is completely private. No external entity can gain a reference + * to it; so we create it here and destroy it in finalize(). + */ + entry->im_context = gtk_im_multicontext_new(); + + g_signal_connect(entry->im_context, "commit", + G_CALLBACK(gtk_secure_entry_commit_cb), entry); + g_signal_connect(entry->im_context, "preedit_changed", + G_CALLBACK(gtk_secure_entry_preedit_changed_cb), + entry); + g_signal_connect(entry->im_context, "retrieve_surrounding", + G_CALLBACK(gtk_secure_entry_retrieve_surrounding_cb), + entry); + g_signal_connect(entry->im_context, "delete_surrounding", + G_CALLBACK(gtk_secure_entry_delete_surrounding_cb), + entry); +} + +static void +gtk_secure_entry_finalize(GObject * object) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(object); + + if (entry->cached_layout) + g_object_unref(entry->cached_layout); + + g_object_unref(entry->im_context); + + if (entry->blink_timeout) + g_source_remove(entry->blink_timeout); + + if (entry->recompute_idle) + g_source_remove(entry->recompute_idle); + + entry->text_size = 0; + + if (entry->text) + WITH_SECURE_MEM(g_free(entry->text)); + entry->text = NULL; + + G_OBJECT_CLASS(parent_class)->finalize(object); +} + +static void +gtk_secure_entry_realize(GtkWidget * widget) +{ + GtkSecureEntry *entry; + GtkEditable *editable; + GdkWindowAttr attributes; + gint attributes_mask; + + GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); + entry = GTK_SECURE_ENTRY(widget); + editable = GTK_EDITABLE(widget); + + attributes.window_type = GDK_WINDOW_CHILD; + + get_widget_window_size(entry, &attributes.x, &attributes.y, + &attributes.width, &attributes.height); + + attributes.wclass = GDK_INPUT_OUTPUT; + attributes.visual = gtk_widget_get_visual(widget); + attributes.colormap = gtk_widget_get_colormap(widget); + attributes.event_mask = gtk_widget_get_events(widget); + attributes.event_mask |= (GDK_EXPOSURE_MASK | + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | + GDK_BUTTON1_MOTION_MASK | + GDK_BUTTON3_MOTION_MASK | + GDK_POINTER_MOTION_HINT_MASK | + GDK_POINTER_MOTION_MASK | + GDK_ENTER_NOTIFY_MASK | + GDK_LEAVE_NOTIFY_MASK); + attributes_mask = + GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; + + widget->window = + gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, + attributes_mask); + gdk_window_set_user_data(widget->window, entry); + + get_text_area_size(entry, &attributes.x, &attributes.y, + &attributes.width, &attributes.height); + + attributes.cursor = + gdk_cursor_new_for_display(gtk_widget_get_display(widget), + GDK_XTERM); + attributes_mask |= GDK_WA_CURSOR; + + entry->text_area = + gdk_window_new(widget->window, &attributes, attributes_mask); + gdk_window_set_user_data(entry->text_area, entry); + + gdk_cursor_unref(attributes.cursor); + + widget->style = gtk_style_attach(widget->style, widget->window); + + gdk_window_set_background(widget->window, + &widget->style-> + base[GTK_WIDGET_STATE(widget)]); + gdk_window_set_background(entry->text_area, + &widget->style-> + base[GTK_WIDGET_STATE(widget)]); + + gdk_window_show(entry->text_area); + + gtk_im_context_set_client_window(entry->im_context, entry->text_area); + + gtk_secure_entry_adjust_scroll(entry); +} + +static void +gtk_secure_entry_unrealize(GtkWidget * widget) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + gtk_secure_entry_reset_layout(entry); + + gtk_im_context_set_client_window(entry->im_context, NULL); + + if (entry->text_area) { + gdk_window_set_user_data(entry->text_area, NULL); + gdk_window_destroy(entry->text_area); + entry->text_area = NULL; + } + + if (GTK_WIDGET_CLASS(parent_class)->unrealize) + (*GTK_WIDGET_CLASS(parent_class)->unrealize) (widget); +} + +static void +get_borders(GtkSecureEntry * entry, gint * xborder, gint * yborder) +{ + GtkWidget *widget = GTK_WIDGET(entry); + gint focus_width; + gboolean interior_focus; + + gtk_widget_style_get(widget, + "interior-focus", &interior_focus, + "focus-line-width", &focus_width, NULL); + + if (entry->has_frame) { + *xborder = widget->style->xthickness; + *yborder = widget->style->ythickness; + } else { + *xborder = 0; + *yborder = 0; + } + + if (!interior_focus) { + *xborder += focus_width; + *yborder += focus_width; + } +} + +static void +gtk_secure_entry_size_request(GtkWidget * widget, + GtkRequisition * requisition) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + PangoFontMetrics *metrics; + gint xborder, yborder; + PangoContext *context; + + context = gtk_widget_get_pango_context(widget); + metrics = pango_context_get_metrics(context, + widget->style->font_desc, + pango_context_get_language + (context)); + + entry->ascent = pango_font_metrics_get_ascent(metrics); + entry->descent = pango_font_metrics_get_descent(metrics); + + get_borders(entry, &xborder, &yborder); + + xborder += INNER_BORDER; + yborder += INNER_BORDER; + + if (entry->width_chars < 0) + requisition->width = MIN_SECURE_ENTRY_WIDTH + xborder * 2; + else { + gint char_width = + pango_font_metrics_get_approximate_char_width(metrics); + gint digit_width = + pango_font_metrics_get_approximate_digit_width(metrics); + gint char_pixels = + (MAX(char_width, digit_width) + PANGO_SCALE - 1) / PANGO_SCALE; + + requisition->width = + char_pixels * entry->width_chars + xborder * 2; + } + + requisition->height = + PANGO_PIXELS(entry->ascent + entry->descent) + yborder * 2; + + pango_font_metrics_unref(metrics); +} + +static void +get_text_area_size(GtkSecureEntry * entry, + gint * x, gint * y, gint * width, gint * height) +{ + gint xborder, yborder; + GtkRequisition requisition; + GtkWidget *widget = GTK_WIDGET(entry); + + gtk_widget_get_child_requisition(widget, &requisition); + + get_borders(entry, &xborder, &yborder); + + if (x) + *x = xborder; + + if (y) + *y = yborder; + + if (width) + *width = GTK_WIDGET(entry)->allocation.width - xborder * 2; + + if (height) + *height = requisition.height - yborder * 2; +} + +static void +get_widget_window_size(GtkSecureEntry * entry, + gint * x, gint * y, gint * width, gint * height) +{ + GtkRequisition requisition; + GtkWidget *widget = GTK_WIDGET(entry); + + gtk_widget_get_child_requisition(widget, &requisition); + + if (x) + *x = widget->allocation.x; + + if (y) { + if (entry->is_cell_renderer) + *y = widget->allocation.y; + else + *y = widget->allocation.y + (widget->allocation.height - + requisition.height) / 2; + } + + if (width) + *width = widget->allocation.width; + + if (height) { + if (entry->is_cell_renderer) + *height = widget->allocation.height; + else + *height = requisition.height; + } +} + +static void +gtk_secure_entry_size_allocate(GtkWidget * widget, + GtkAllocation * allocation) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + widget->allocation = *allocation; + + if (GTK_WIDGET_REALIZED(widget)) { + /* We call gtk_widget_get_child_requisition, since we want (for + * backwards compatibility reasons) the realization here to + * be affected by the usize of the entry, if set + */ + gint x, y, width, height; + + get_widget_window_size(entry, &x, &y, &width, &height); + + gdk_window_move_resize(widget->window, x, y, width, height); + + get_text_area_size(entry, &x, &y, &width, &height); + + gdk_window_move_resize(entry->text_area, x, y, width, height); + + gtk_secure_entry_recompute(entry); + } +} + +static void +gtk_secure_entry_draw_frame(GtkWidget * widget) +{ + gint x = 0, y = 0; + gint width, height; + gboolean interior_focus; + gint focus_width; + + gtk_widget_style_get(widget, + "interior-focus", &interior_focus, + "focus-line-width", &focus_width, NULL); + + gdk_drawable_get_size(widget->window, &width, &height); + + if (GTK_WIDGET_HAS_FOCUS(widget) && !interior_focus) { + x += focus_width; + y += focus_width; + width -= 2 * focus_width; + height -= 2 * focus_width; + } + + gtk_paint_shadow(widget->style, widget->window, + GTK_STATE_NORMAL, GTK_SHADOW_IN, + NULL, widget, "entry", x, y, width, height); + + if (GTK_WIDGET_HAS_FOCUS(widget) && !interior_focus) { + x -= focus_width; + y -= focus_width; + width += 2 * focus_width; + height += 2 * focus_width; + + gtk_paint_focus(widget->style, widget->window, + GTK_WIDGET_STATE(widget), NULL, widget, "entry", 0, + 0, width, height); + } +} + +static gint +gtk_secure_entry_expose(GtkWidget * widget, GdkEventExpose * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + if (widget->window == event->window) + gtk_secure_entry_draw_frame(widget); + else if (entry->text_area == event->window) { + gint area_width, area_height; + + get_text_area_size(entry, NULL, NULL, &area_width, &area_height); + + gtk_paint_flat_box(widget->style, entry->text_area, + GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE, + NULL, widget, "entry_bg", + 0, 0, area_width, area_height); + + if ((entry->invisible_char != 0) && + GTK_WIDGET_HAS_FOCUS(widget) && + entry->selection_bound == entry->current_pos + && entry->cursor_visible) + gtk_secure_entry_draw_cursor(GTK_SECURE_ENTRY(widget)); + + gtk_secure_entry_draw_text(GTK_SECURE_ENTRY(widget)); + } + + return FALSE; +} + +static gint +gtk_secure_entry_button_press(GtkWidget * widget, GdkEventButton * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + gint tmp_pos; + + if (event->window != entry->text_area || + (entry->button && event->button != entry->button)) + return FALSE; + + entry->button = event->button; + + if (!GTK_WIDGET_HAS_FOCUS(widget)) { + entry->in_click = TRUE; + gtk_widget_grab_focus(widget); + entry->in_click = FALSE; + } + + tmp_pos = + gtk_secure_entry_find_position(entry, + event->x + entry->scroll_offset); + + if (event->button == 1) { + switch (event->type) { + case GDK_BUTTON_PRESS: + gtk_secure_entry_set_positions(entry, tmp_pos, tmp_pos); + break; + + default: + break; + } + + return TRUE; + } + + return FALSE; +} + +static gint +gtk_secure_entry_button_release(GtkWidget * widget, GdkEventButton * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + if (event->window != entry->text_area + || entry->button != event->button) + return FALSE; + + entry->button = 0; + + return TRUE; +} + +static gint +gtk_secure_entry_motion_notify(GtkWidget * widget, GdkEventMotion * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + gint tmp_pos; + + if (entry->mouse_cursor_obscured) { + GdkCursor *cursor; + + cursor = + gdk_cursor_new_for_display(gtk_widget_get_display(widget), + GDK_XTERM); + gdk_window_set_cursor(entry->text_area, cursor); + gdk_cursor_unref(cursor); + entry->mouse_cursor_obscured = FALSE; + } + + if (event->window != entry->text_area || entry->button != 1) + return FALSE; + + if (event->is_hint || (entry->text_area != event->window)) + gdk_window_get_pointer(entry->text_area, NULL, NULL, NULL); + + { + gint height; + gdk_drawable_get_size(entry->text_area, NULL, &height); + + if (event->y < 0) + tmp_pos = 0; + else if (event->y >= height) + tmp_pos = entry->text_length; + else + tmp_pos = + gtk_secure_entry_find_position(entry, + event->x + + entry->scroll_offset); + + gtk_secure_entry_set_positions(entry, tmp_pos, -1); + } + + return TRUE; +} + +static void +set_invisible_cursor(GdkWindow * window) +{ + GdkBitmap *empty_bitmap; + GdkCursor *cursor; + GdkColor useless; + char invisible_cursor_bits[] = { 0x0 }; + + useless.red = useless.green = useless.blue = 0; + useless.pixel = 0; + + empty_bitmap = gdk_bitmap_create_from_data(window, + invisible_cursor_bits, 1, + 1); + + cursor = gdk_cursor_new_from_pixmap(empty_bitmap, + empty_bitmap, + &useless, &useless, 0, 0); + + gdk_window_set_cursor(window, cursor); + + gdk_cursor_unref(cursor); + + g_object_unref(empty_bitmap); +} + +static void +gtk_secure_entry_obscure_mouse_cursor(GtkSecureEntry * entry) +{ + if (entry->mouse_cursor_obscured) + return; + + set_invisible_cursor(entry->text_area); + + entry->mouse_cursor_obscured = TRUE; +} + +static gint +gtk_secure_entry_key_press(GtkWidget * widget, GdkEventKey * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + gtk_secure_entry_pend_cursor_blink(entry); + + if (gtk_im_context_filter_keypress(entry->im_context, event)) { + gtk_secure_entry_obscure_mouse_cursor(entry); + entry->need_im_reset = TRUE; + return TRUE; + } + + if (GTK_WIDGET_CLASS(parent_class)->key_press_event(widget, event)) + /* Activate key bindings + */ + return TRUE; + + return FALSE; +} + +static gint +gtk_secure_entry_key_release(GtkWidget * widget, GdkEventKey * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + if (gtk_im_context_filter_keypress(entry->im_context, event)) { + entry->need_im_reset = TRUE; + return TRUE; + } + + return GTK_WIDGET_CLASS(parent_class)->key_release_event(widget, + event); +} + +static gint +gtk_secure_entry_focus_in(GtkWidget * widget, GdkEventFocus * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + gtk_widget_queue_draw(widget); + + entry->need_im_reset = TRUE; + gtk_im_context_focus_in(entry->im_context); + + g_signal_connect(gdk_keymap_get_for_display + (gtk_widget_get_display(widget)), "direction_changed", + G_CALLBACK(gtk_secure_entry_keymap_direction_changed), + entry); + + gtk_secure_entry_check_cursor_blink(entry); + + return FALSE; +} + +static gint +gtk_secure_entry_focus_out(GtkWidget * widget, GdkEventFocus * event) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + gtk_widget_queue_draw(widget); + + entry->need_im_reset = TRUE; + gtk_im_context_focus_out(entry->im_context); + + gtk_secure_entry_check_cursor_blink(entry); + + g_signal_handlers_disconnect_by_func(gdk_keymap_get_for_display + (gtk_widget_get_display(widget)), + gtk_secure_entry_keymap_direction_changed, + entry); + + return FALSE; +} + +static void +gtk_secure_entry_grab_focus(GtkWidget * widget) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + gboolean select_on_focus; + + GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); + GTK_WIDGET_CLASS(parent_class)->grab_focus(widget); + + g_object_get(gtk_widget_get_settings(widget), + "gtk-entry-select-on-focus", &select_on_focus, NULL); + + if (select_on_focus && !entry->in_click) + gtk_editable_select_region(GTK_EDITABLE(widget), 0, -1); +} + +static void +gtk_secure_entry_direction_changed(GtkWidget * widget, + GtkTextDirection previous_dir) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + gtk_secure_entry_recompute(entry); + + GTK_WIDGET_CLASS(parent_class)->direction_changed(widget, + previous_dir); +} + +static void +gtk_secure_entry_state_changed(GtkWidget * widget, + GtkStateType previous_state) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + if (GTK_WIDGET_REALIZED(widget)) { + gdk_window_set_background(widget->window, + &widget->style-> + base[GTK_WIDGET_STATE(widget)]); + gdk_window_set_background(entry->text_area, + &widget->style-> + base[GTK_WIDGET_STATE(widget)]); + } + + if (!GTK_WIDGET_IS_SENSITIVE(widget)) { + /* Clear any selection */ + gtk_editable_select_region(GTK_EDITABLE(entry), entry->current_pos, + entry->current_pos); + } + + gtk_widget_queue_draw(widget); +} + +static void +gtk_secure_entry_screen_changed(GtkWidget * widget, GdkScreen * old_screen) +{ + gtk_secure_entry_recompute(GTK_SECURE_ENTRY(widget)); +} + +/* GtkEditable method implementations + */ +static void +gtk_secure_entry_insert_text(GtkEditable * editable, + const gchar * new_text, + gint new_text_length, gint * position) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(editable); + gchar *text; + + if (*position < 0 || *position > entry->text_length) + *position = entry->text_length; + + g_object_ref(editable); + + WITH_SECURE_MEM(text = g_new(gchar, new_text_length + 1)); + + text[new_text_length] = '\0'; + strncpy(text, new_text, new_text_length); + + g_signal_emit_by_name(editable, "insert_text", text, new_text_length, + position); + + WITH_SECURE_MEM(g_free(text)); + + g_object_unref(editable); +} + +static void +gtk_secure_entry_delete_text(GtkEditable * editable, + gint start_pos, gint end_pos) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(editable); + + if (end_pos < 0 || end_pos > entry->text_length) + end_pos = entry->text_length; + if (start_pos < 0) + start_pos = 0; + if (start_pos > end_pos) + start_pos = end_pos; + + g_object_ref(editable); + + g_signal_emit_by_name(editable, "delete_text", start_pos, end_pos); + + g_object_unref(editable); +} + +static void +gtk_secure_entry_set_position_internal(GtkSecureEntry * entry, + gint position, gboolean reset_im) +{ + if (position < 0 || position > entry->text_length) + position = entry->text_length; + + if (position != entry->current_pos || + position != entry->selection_bound) { + if (reset_im) + gtk_secure_entry_reset_im_context(entry); + gtk_secure_entry_set_positions(entry, position, position); + } +} + +static void +gtk_secure_entry_real_set_position(GtkEditable * editable, gint position) +{ + gtk_secure_entry_set_position_internal(GTK_SECURE_ENTRY(editable), + position, TRUE); +} + +static gint +gtk_secure_entry_get_position(GtkEditable * editable) +{ + return GTK_SECURE_ENTRY(editable)->current_pos; +} + +static void +gtk_secure_entry_set_selection_bounds(GtkEditable * editable, + gint start, gint end) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(editable); + + if (start < 0) + start = entry->text_length; + if (end < 0) + end = entry->text_length; + + gtk_secure_entry_reset_im_context(entry); + + gtk_secure_entry_set_positions(entry, + MIN(end, entry->text_length), + MIN(start, entry->text_length)); +} + +static gboolean +gtk_secure_entry_get_selection_bounds(GtkEditable * editable, + gint * start, gint * end) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(editable); + + *start = entry->selection_bound; + *end = entry->current_pos; + + return (entry->selection_bound != entry->current_pos); +} + +static void +gtk_secure_entry_style_set(GtkWidget * widget, GtkStyle * previous_style) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); + + gtk_secure_entry_recompute(entry); + + if (previous_style && GTK_WIDGET_REALIZED(widget)) { + gdk_window_set_background(widget->window, + &widget->style-> + base[GTK_WIDGET_STATE(widget)]); + gdk_window_set_background(entry->text_area, + &widget->style-> + base[GTK_WIDGET_STATE(widget)]); + } +} + +/* GtkCellEditable method implementations + */ +static void +gtk_cell_editable_secure_entry_activated(GtkSecureEntry * entry, gpointer data) +{ + gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(entry)); + gtk_cell_editable_remove_widget(GTK_CELL_EDITABLE(entry)); +} + +static gboolean +gtk_cell_editable_key_press_event(GtkSecureEntry * entry, + GdkEventKey * key_event, gpointer data) +{ + if (key_event->keyval == GDK_Escape) { + entry->editing_canceled = TRUE; + gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(entry)); + gtk_cell_editable_remove_widget(GTK_CELL_EDITABLE(entry)); + + return TRUE; + } + + /* override focus */ + if (key_event->keyval == GDK_Up || key_event->keyval == GDK_Down) { + gtk_cell_editable_editing_done(GTK_CELL_EDITABLE(entry)); + gtk_cell_editable_remove_widget(GTK_CELL_EDITABLE(entry)); + + return TRUE; + } + + return FALSE; +} + +static void +gtk_secure_entry_start_editing(GtkCellEditable * cell_editable, + GdkEvent * event) +{ + GTK_SECURE_ENTRY(cell_editable)->is_cell_renderer = TRUE; + + g_signal_connect(cell_editable, "activate", + G_CALLBACK(gtk_cell_editable_secure_entry_activated), NULL); + g_signal_connect(cell_editable, "key_press_event", + G_CALLBACK(gtk_cell_editable_key_press_event), NULL); +} + +/* Default signal handlers + */ +static void +gtk_secure_entry_real_insert_text(GtkEditable * editable, + const gchar * new_text, + gint new_text_length, gint * position) +{ + gint _index; + gint n_chars; + + GtkSecureEntry *entry = GTK_SECURE_ENTRY(editable); + + if (new_text_length < 0) + new_text_length = strlen(new_text); + + n_chars = g_utf8_strlen(new_text, new_text_length); + if (entry->text_max_length > 0 + && n_chars + entry->text_length > entry->text_max_length) { + gdk_display_beep(gtk_widget_get_display(GTK_WIDGET(entry))); + n_chars = entry->text_max_length - entry->text_length; + new_text_length = + g_utf8_offset_to_pointer(new_text, n_chars) - new_text; + } + + if (new_text_length + entry->n_bytes + 1 > entry->text_size) { + while (new_text_length + entry->n_bytes + 1 > entry->text_size) { + if (entry->text_size == 0) + entry->text_size = MIN_SIZE; + else { + if (2 * (guint) entry->text_size < MAX_SIZE && + 2 * (guint) entry->text_size > entry->text_size) + entry->text_size *= 2; + else { + entry->text_size = MAX_SIZE; + if (new_text_length > + (gint) entry->text_size - (gint) entry->n_bytes - + 1) { + new_text_length = + (gint) entry->text_size - + (gint) entry->n_bytes - 1; + new_text_length = + g_utf8_find_prev_char(new_text, + new_text + + new_text_length + 1) - + new_text; + n_chars = g_utf8_strlen(new_text, new_text_length); + } + break; + } + } + } + + WITH_SECURE_MEM(entry->text = + g_realloc(entry->text, entry->text_size)); + } + + _index = g_utf8_offset_to_pointer(entry->text, *position) - entry->text; + + g_memmove(entry->text + _index + new_text_length, entry->text + _index, + entry->n_bytes - _index); + memcpy(entry->text + _index, new_text, new_text_length); + + entry->n_bytes += new_text_length; + entry->text_length += n_chars; + + /* NUL terminate for safety and convenience */ + entry->text[entry->n_bytes] = '\0'; + + if (entry->current_pos > *position) + entry->current_pos += n_chars; + + if (entry->selection_bound > *position) + entry->selection_bound += n_chars; + + *position += n_chars; + + gtk_secure_entry_recompute(entry); + + g_signal_emit_by_name(editable, "changed"); + g_object_notify(G_OBJECT(editable), "text"); +} + +static void +gtk_secure_entry_real_delete_text(GtkEditable * editable, + gint start_pos, gint end_pos) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(editable); + + if (start_pos < 0) + start_pos = 0; + if (end_pos < 0 || end_pos > entry->text_length) + end_pos = entry->text_length; + + if (start_pos < end_pos) { + gint start_index = + g_utf8_offset_to_pointer(entry->text, start_pos) - entry->text; + gint end_index = + g_utf8_offset_to_pointer(entry->text, end_pos) - entry->text; + gint current_pos; + gint selection_bound; + + g_memmove(entry->text + start_index, entry->text + end_index, + entry->n_bytes + 1 - end_index); + entry->text_length -= (end_pos - start_pos); + entry->n_bytes -= (end_index - start_index); + + current_pos = entry->current_pos; + if (current_pos > start_pos) + current_pos -= MIN(current_pos, end_pos) - start_pos; + + selection_bound = entry->selection_bound; + if (selection_bound > start_pos) + selection_bound -= MIN(selection_bound, end_pos) - start_pos; + + gtk_secure_entry_set_positions(entry, current_pos, + selection_bound); + + gtk_secure_entry_recompute(entry); + + g_signal_emit_by_name(editable, "changed"); + g_object_notify(G_OBJECT(editable), "text"); + } +} + +/* Compute the X position for an offset that corresponds to the "more important + * cursor position for that offset. We use this when trying to guess to which + * end of the selection we should go to when the user hits the left or + * right arrow key. + */ +static gint +get_better_cursor_x(GtkSecureEntry * entry, gint offset) +{ + GdkKeymap *keymap = + gdk_keymap_get_for_display(gtk_widget_get_display + (GTK_WIDGET(entry))); + PangoDirection keymap_direction = gdk_keymap_get_direction(keymap); + gboolean split_cursor; + + PangoLayout *layout = gtk_secure_entry_ensure_layout(entry, TRUE); + const gchar *text = pango_layout_get_text(layout); + gint _index = g_utf8_offset_to_pointer(text, offset) - text; + + PangoRectangle strong_pos, weak_pos; + + g_object_get(gtk_widget_get_settings(GTK_WIDGET(entry)), + "gtk-split-cursor", &split_cursor, NULL); + + pango_layout_get_cursor_pos(layout, _index, &strong_pos, &weak_pos); + + if (split_cursor) + return strong_pos.x / PANGO_SCALE; + else + return (keymap_direction == + entry->resolved_dir) ? strong_pos.x / + PANGO_SCALE : weak_pos.x / PANGO_SCALE; +} + +static void +gtk_secure_entry_move_cursor(GtkSecureEntry * entry, + GtkMovementStep step, + gint count, gboolean extend_selection) +{ + gint new_pos = entry->current_pos; + + gtk_secure_entry_reset_im_context(entry); + + if (entry->current_pos != entry->selection_bound && !extend_selection) { + /* If we have a current selection and aren't extending it, move to the + * start/or end of the selection as appropriate + */ + switch (step) { + case GTK_MOVEMENT_VISUAL_POSITIONS: + { + gint current_x = + get_better_cursor_x(entry, entry->current_pos); + gint bound_x = + get_better_cursor_x(entry, entry->selection_bound); + + if (count < 0) + new_pos = + current_x < + bound_x ? entry->current_pos : entry-> + selection_bound; + else + new_pos = + current_x > + bound_x ? entry->current_pos : entry-> + selection_bound; + + break; + } + case GTK_MOVEMENT_LOGICAL_POSITIONS: + case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + case GTK_MOVEMENT_PARAGRAPH_ENDS: + case GTK_MOVEMENT_BUFFER_ENDS: + new_pos = count < 0 ? 0 : entry->text_length; + break; + case GTK_MOVEMENT_WORDS: + case GTK_MOVEMENT_DISPLAY_LINES: + case GTK_MOVEMENT_PARAGRAPHS: + case GTK_MOVEMENT_PAGES: + case GTK_MOVEMENT_HORIZONTAL_PAGES: + break; + } + } else { + switch (step) { + case GTK_MOVEMENT_LOGICAL_POSITIONS: + new_pos = + gtk_secure_entry_move_logically(entry, new_pos, count); + break; + case GTK_MOVEMENT_VISUAL_POSITIONS: + new_pos = + gtk_secure_entry_move_visually(entry, new_pos, count); + break; + case GTK_MOVEMENT_DISPLAY_LINE_ENDS: + case GTK_MOVEMENT_PARAGRAPH_ENDS: + case GTK_MOVEMENT_BUFFER_ENDS: + new_pos = count < 0 ? 0 : entry->text_length; + break; + case GTK_MOVEMENT_WORDS: + case GTK_MOVEMENT_DISPLAY_LINES: + case GTK_MOVEMENT_PARAGRAPHS: + case GTK_MOVEMENT_PAGES: + case GTK_MOVEMENT_HORIZONTAL_PAGES: + break; + } + } + + if (extend_selection) + gtk_editable_select_region(GTK_EDITABLE(entry), + entry->selection_bound, new_pos); + else + gtk_editable_set_position(GTK_EDITABLE(entry), new_pos); + + gtk_secure_entry_pend_cursor_blink(entry); +} + +static void +gtk_secure_entry_insert_at_cursor(GtkSecureEntry * entry, + const gchar * str) +{ + GtkEditable *editable = GTK_EDITABLE(entry); + gint pos = entry->current_pos; + + gtk_secure_entry_reset_im_context(entry); + + gtk_editable_insert_text(editable, str, -1, &pos); + gtk_editable_set_position(editable, pos); +} + +static void +gtk_secure_entry_delete_from_cursor(GtkSecureEntry * entry, + GtkDeleteType type, gint count) +{ + GtkEditable *editable = GTK_EDITABLE(entry); + gint start_pos = entry->current_pos; + gint end_pos = entry->current_pos; + + gtk_secure_entry_reset_im_context(entry); + + if (entry->selection_bound != entry->current_pos) { + gtk_editable_delete_selection(editable); + return; + } + + switch (type) { + case GTK_DELETE_CHARS: + end_pos = + gtk_secure_entry_move_logically(entry, entry->current_pos, + count); + gtk_editable_delete_text(editable, MIN(start_pos, end_pos), + MAX(start_pos, end_pos)); + break; + case GTK_DELETE_DISPLAY_LINE_ENDS: + case GTK_DELETE_PARAGRAPH_ENDS: + if (count < 0) + gtk_editable_delete_text(editable, 0, entry->current_pos); + else + gtk_editable_delete_text(editable, entry->current_pos, -1); + break; + case GTK_DELETE_DISPLAY_LINES: + case GTK_DELETE_PARAGRAPHS: + gtk_editable_delete_text(editable, 0, -1); + break; + default: + break; + } + + gtk_secure_entry_pend_cursor_blink(entry); +} + +static void +gtk_secure_entry_delete_cb(GtkSecureEntry * entry) +{ + GtkEditable *editable = GTK_EDITABLE(entry); + gint start, end; + + if (gtk_editable_get_selection_bounds(editable, &start, &end)) + gtk_editable_delete_text(editable, start, end); +} + +static void +gtk_secure_entry_toggle_overwrite(GtkSecureEntry * entry) +{ + entry->overwrite_mode = !entry->overwrite_mode; +} + +static void +gtk_secure_entry_real_activate(GtkSecureEntry * entry) +{ + GtkWindow *window; + GtkWidget *toplevel; + GtkWidget *widget; + + widget = GTK_WIDGET(entry); + + if (entry->activates_default) { + toplevel = gtk_widget_get_toplevel(widget); + if (GTK_IS_WINDOW(toplevel)) { + window = GTK_WINDOW(toplevel); + + if (window && + widget != window->default_widget && + !(widget == window->focus_widget && + (!window->default_widget + || !GTK_WIDGET_SENSITIVE(window->default_widget)))) + gtk_window_activate_default(window); + } + } +} + +static void +gtk_secure_entry_keymap_direction_changed(GdkKeymap * keymap, + GtkSecureEntry * entry) +{ + gtk_secure_entry_recompute(entry); +} + +/* IM Context Callbacks + */ + +static void +gtk_secure_entry_commit_cb(GtkIMContext * context, + const gchar * str, GtkSecureEntry * entry) +{ + gtk_secure_entry_enter_text(entry, str); +} + +static void +gtk_secure_entry_preedit_changed_cb(GtkIMContext * context, + GtkSecureEntry * entry) +{ + gchar *preedit_string; + gint cursor_pos; + + gtk_im_context_get_preedit_string(entry->im_context, + &preedit_string, NULL, &cursor_pos); + entry->preedit_length = strlen(preedit_string); + cursor_pos = CLAMP(cursor_pos, 0, g_utf8_strlen(preedit_string, -1)); + entry->preedit_cursor = cursor_pos; + g_free(preedit_string); + + gtk_secure_entry_recompute(entry); +} + +static gboolean +gtk_secure_entry_retrieve_surrounding_cb(GtkIMContext * context, + GtkSecureEntry * entry) +{ + gtk_im_context_set_surrounding(context, + entry->text, + entry->n_bytes, + g_utf8_offset_to_pointer(entry->text, + entry-> + current_pos) - + entry->text); + + return TRUE; +} + +static gboolean +gtk_secure_entry_delete_surrounding_cb(GtkIMContext * slave, + gint offset, + gint n_chars, + GtkSecureEntry * entry) +{ + gtk_editable_delete_text(GTK_EDITABLE(entry), + entry->current_pos + offset, + entry->current_pos + offset + n_chars); + + return TRUE; +} + +/* Internal functions + */ + +/* Used for im_commit_cb and inserting Unicode chars */ +static void +gtk_secure_entry_enter_text(GtkSecureEntry * entry, const gchar * str) +{ + GtkEditable *editable = GTK_EDITABLE(entry); + gint tmp_pos; + + if (gtk_editable_get_selection_bounds(editable, NULL, NULL)) + gtk_editable_delete_selection(editable); + else { + if (entry->overwrite_mode) + gtk_secure_entry_delete_from_cursor(entry, GTK_DELETE_CHARS, + 1); + } + + tmp_pos = entry->current_pos; + gtk_editable_insert_text(editable, str, strlen(str), &tmp_pos); + gtk_secure_entry_set_position_internal(entry, tmp_pos, FALSE); +} + +/* All changes to entry->current_pos and entry->selection_bound + * should go through this function. + */ +static void +gtk_secure_entry_set_positions(GtkSecureEntry * entry, + gint current_pos, gint selection_bound) +{ + gboolean changed = FALSE; + + g_object_freeze_notify(G_OBJECT(entry)); + + if (current_pos != -1 && entry->current_pos != current_pos) { + entry->current_pos = current_pos; + changed = TRUE; + + g_object_notify(G_OBJECT(entry), "cursor_position"); + } + + if (selection_bound != -1 && entry->selection_bound != selection_bound) { + entry->selection_bound = selection_bound; + changed = TRUE; + + g_object_notify(G_OBJECT(entry), "selection_bound"); + } + + g_object_thaw_notify(G_OBJECT(entry)); + + if (changed) + gtk_secure_entry_recompute(entry); +} + +static void +gtk_secure_entry_reset_layout(GtkSecureEntry * entry) +{ + if (entry->cached_layout) { + g_object_unref(entry->cached_layout); + entry->cached_layout = NULL; + } +} + +static void +update_im_cursor_location(GtkSecureEntry * entry) +{ + GdkRectangle area; + gint strong_x; + gint strong_xoffset; + gint area_width, area_height; + + gtk_secure_entry_get_cursor_locations(entry, &strong_x, NULL); + get_text_area_size(entry, NULL, NULL, &area_width, &area_height); + + strong_xoffset = strong_x - entry->scroll_offset; + if (strong_xoffset < 0) { + strong_xoffset = 0; + } else if (strong_xoffset > area_width) { + strong_xoffset = area_width; + } + area.x = strong_xoffset; + area.y = 0; + area.width = 0; + area.height = area_height; + + gtk_im_context_set_cursor_location(entry->im_context, &area); +} + +static gboolean +recompute_idle_func(gpointer data) +{ + GtkSecureEntry *entry; + + GDK_THREADS_ENTER(); + + entry = GTK_SECURE_ENTRY(data); + + entry->recompute_idle = 0; + + if (gtk_widget_has_screen(GTK_WIDGET(entry))) { + gtk_secure_entry_adjust_scroll(entry); + gtk_secure_entry_queue_draw(entry); + + update_im_cursor_location(entry); + } + + GDK_THREADS_LEAVE(); + + return FALSE; +} + +static void +gtk_secure_entry_recompute(GtkSecureEntry * entry) +{ + gtk_secure_entry_reset_layout(entry); + gtk_secure_entry_check_cursor_blink(entry); + + if (!entry->recompute_idle) { + entry->recompute_idle = g_idle_add_full(G_PRIORITY_HIGH_IDLE + 15, /* between resize and redraw */ + recompute_idle_func, entry, + NULL); + } +} + +static void +append_char(GString * str, gunichar ch, gint count) +{ + gint i; + gint char_len; + gchar buf[7]; + + char_len = g_unichar_to_utf8(ch, buf); + + i = 0; + while (i < count) { + g_string_append_len(str, buf, char_len); + ++i; + } +} + +static PangoLayout * +gtk_secure_entry_create_layout(GtkSecureEntry * entry, + gboolean include_preedit) +{ + GtkWidget *widget = GTK_WIDGET(entry); + PangoLayout *layout = gtk_widget_create_pango_layout(widget, NULL); + PangoAttrList *tmp_attrs = pango_attr_list_new(); + + gchar *preedit_string = NULL; + gint preedit_length = 0; + PangoAttrList *preedit_attrs = NULL; + + pango_layout_set_single_paragraph_mode(layout, TRUE); + + if (include_preedit) { + gtk_im_context_get_preedit_string(entry->im_context, + &preedit_string, &preedit_attrs, + NULL); + preedit_length = entry->preedit_length; + } + + if (preedit_length) { + GString *tmp_string = g_string_new(NULL); + + gint cursor_index = g_utf8_offset_to_pointer(entry->text, + entry->current_pos) - + entry->text; + + gint ch_len; + gint preedit_len_chars; + gunichar invisible_char; + + ch_len = g_utf8_strlen(entry->text, entry->n_bytes); + preedit_len_chars = g_utf8_strlen(preedit_string, -1); + ch_len += preedit_len_chars; + + if (entry->invisible_char != 0) + invisible_char = entry->invisible_char; + else + invisible_char = ' '; /* just pick a char */ + + append_char(tmp_string, invisible_char, ch_len); + + /* Fix cursor index to point to invisible char corresponding + * to the preedit, fix preedit_length to be the length of + * the invisible chars representing the preedit + */ + cursor_index = + g_utf8_offset_to_pointer(tmp_string->str, + entry->current_pos) - + tmp_string->str; + preedit_length = + preedit_len_chars * g_unichar_to_utf8(invisible_char, + NULL); + + pango_layout_set_text(layout, tmp_string->str, tmp_string->len); + + pango_attr_list_splice(tmp_attrs, preedit_attrs, + cursor_index, preedit_length); + + g_string_free(tmp_string, TRUE); + } else { + PangoDirection pango_dir; + + pango_dir = pango_find_base_dir(entry->text, entry->n_bytes); + if (pango_dir == PANGO_DIRECTION_NEUTRAL) { + if (GTK_WIDGET_HAS_FOCUS(widget)) { + GdkDisplay *display = gtk_widget_get_display(widget); + GdkKeymap *keymap = gdk_keymap_get_for_display(display); + pango_dir = gdk_keymap_get_direction(keymap); + } else { + if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_LTR) + pango_dir = PANGO_DIRECTION_LTR; + else + pango_dir = PANGO_DIRECTION_RTL; + } + } + + pango_context_set_base_dir(gtk_widget_get_pango_context(widget), + pango_dir); + + pango_layout_set_alignment(layout, pango_dir); + + entry->resolved_dir = pango_dir; + + { + GString *str = g_string_new(NULL); + gunichar invisible_char; + + if (entry->invisible_char != 0) + invisible_char = entry->invisible_char; + else + invisible_char = ' '; /* just pick a char */ + + append_char(str, invisible_char, entry->text_length); + pango_layout_set_text(layout, str->str, str->len); + g_string_free(str, TRUE); + } + } + + pango_layout_set_attributes(layout, tmp_attrs); + + if (preedit_string) + g_free(preedit_string); + if (preedit_attrs) + pango_attr_list_unref(preedit_attrs); + + pango_attr_list_unref(tmp_attrs); + + return layout; +} + +static PangoLayout * +gtk_secure_entry_ensure_layout(GtkSecureEntry * entry, + gboolean include_preedit) +{ + if (entry->preedit_length > 0 && + !include_preedit != !entry->cache_includes_preedit) + gtk_secure_entry_reset_layout(entry); + + if (!entry->cached_layout) { + entry->cached_layout = + gtk_secure_entry_create_layout(entry, include_preedit); + entry->cache_includes_preedit = include_preedit; + } + + return entry->cached_layout; +} + +static void +get_layout_position(GtkSecureEntry * entry, gint * x, gint * y) +{ + PangoLayout *layout; + PangoRectangle logical_rect; + gint area_width, area_height; + gint y_pos; + PangoLayoutLine *line; + + layout = gtk_secure_entry_ensure_layout(entry, TRUE); + + get_text_area_size(entry, NULL, NULL, &area_width, &area_height); + + area_height = PANGO_SCALE * (area_height - 2 * INNER_BORDER); + + line = pango_layout_get_lines(layout)->data; + pango_layout_line_get_extents(line, NULL, &logical_rect); + + /* Align primarily for locale's ascent/descent */ + y_pos = ((area_height - entry->ascent - entry->descent) / 2 + + entry->ascent + logical_rect.y); + + /* Now see if we need to adjust to fit in actual drawn string */ + if (logical_rect.height > area_height) + y_pos = (area_height - logical_rect.height) / 2; + else if (y_pos < 0) + y_pos = 0; + else if (y_pos + logical_rect.height > area_height) + y_pos = area_height - logical_rect.height; + + y_pos = INNER_BORDER + y_pos / PANGO_SCALE; + + if (x) + *x = INNER_BORDER - entry->scroll_offset; + + if (y) + *y = y_pos; +} + +static void +gtk_secure_entry_draw_text(GtkSecureEntry * entry) +{ + GtkWidget *widget; + PangoLayoutLine *line; + + if (entry->invisible_char == 0) + return; + + if (GTK_WIDGET_DRAWABLE(entry)) { + PangoLayout *layout = gtk_secure_entry_ensure_layout(entry, TRUE); + gint x, y; + gint start_pos, end_pos; + + widget = GTK_WIDGET(entry); + + get_layout_position(entry, &x, &y); + + gdk_draw_layout(entry->text_area, + widget->style->text_gc[widget->state], x, y, + layout); + + if (gtk_editable_get_selection_bounds + (GTK_EDITABLE(entry), &start_pos, &end_pos)) { + gint *ranges; + gint n_ranges, i; + PangoRectangle logical_rect; + const gchar *text = pango_layout_get_text(layout); + gint start_index = + g_utf8_offset_to_pointer(text, start_pos) - text; + gint end_index = + g_utf8_offset_to_pointer(text, end_pos) - text; + GdkRegion *clip_region = gdk_region_new(); + GdkGC *text_gc; + GdkGC *selection_gc; + + line = pango_layout_get_lines(layout)->data; + + pango_layout_line_get_x_ranges(line, start_index, end_index, + &ranges, &n_ranges); + + pango_layout_get_extents(layout, NULL, &logical_rect); + + if (GTK_WIDGET_HAS_FOCUS(entry)) { + selection_gc = widget->style->base_gc[GTK_STATE_SELECTED]; + text_gc = widget->style->text_gc[GTK_STATE_SELECTED]; + } else { + selection_gc = widget->style->base_gc[GTK_STATE_ACTIVE]; + text_gc = widget->style->text_gc[GTK_STATE_ACTIVE]; + } + + for (i = 0; i < n_ranges; i++) { + GdkRectangle rect; + + rect.x = + INNER_BORDER - entry->scroll_offset + + ranges[2 * i] / PANGO_SCALE; + rect.y = y; + rect.width = + (ranges[2 * i + 1] - ranges[2 * i]) / PANGO_SCALE; + rect.height = logical_rect.height / PANGO_SCALE; + + gdk_draw_rectangle(entry->text_area, selection_gc, TRUE, + rect.x, rect.y, rect.width, + rect.height); + + gdk_region_union_with_rect(clip_region, &rect); + } + + gdk_gc_set_clip_region(text_gc, clip_region); + gdk_draw_layout(entry->text_area, text_gc, x, y, layout); + gdk_gc_set_clip_region(text_gc, NULL); + + gdk_region_destroy(clip_region); + g_free(ranges); + } + } +} + +static void +draw_insertion_cursor(GtkSecureEntry * entry, + GdkRectangle * cursor_location, + gboolean is_primary, + PangoDirection direction, gboolean draw_arrow) +{ + GtkWidget *widget = GTK_WIDGET(entry); + GtkTextDirection text_dir; + + if (direction == PANGO_DIRECTION_LTR) + text_dir = GTK_TEXT_DIR_LTR; + else + text_dir = GTK_TEXT_DIR_RTL; + + gtk_draw_insertion_cursor(widget, entry->text_area, NULL, + cursor_location, + is_primary, text_dir, draw_arrow); +} + +static void +gtk_secure_entry_draw_cursor(GtkSecureEntry * entry) +{ + GdkKeymap *keymap = + gdk_keymap_get_for_display(gtk_widget_get_display + (GTK_WIDGET(entry))); + PangoDirection keymap_direction = gdk_keymap_get_direction(keymap); + + if (GTK_WIDGET_DRAWABLE(entry)) { + GtkWidget *widget = GTK_WIDGET(entry); + GdkRectangle cursor_location; + gboolean split_cursor; + + gint xoffset = INNER_BORDER - entry->scroll_offset; + gint strong_x, weak_x; + gint text_area_height; + PangoDirection dir1 = PANGO_DIRECTION_NEUTRAL; + PangoDirection dir2 = PANGO_DIRECTION_NEUTRAL; + gint x1 = 0; + gint x2 = 0; + + gdk_drawable_get_size(entry->text_area, NULL, &text_area_height); + + gtk_secure_entry_get_cursor_locations(entry, &strong_x, &weak_x); + + g_object_get(gtk_widget_get_settings(widget), + "gtk-split-cursor", &split_cursor, NULL); + + dir1 = entry->resolved_dir; + + if (split_cursor) { + x1 = strong_x; + + if (weak_x != strong_x) { + dir2 = + (entry->resolved_dir == + PANGO_DIRECTION_LTR) ? PANGO_DIRECTION_RTL : + PANGO_DIRECTION_LTR; + x2 = weak_x; + } + } else { + if (keymap_direction == entry->resolved_dir) + x1 = strong_x; + else + x1 = weak_x; + } + + cursor_location.x = xoffset + x1; + cursor_location.y = INNER_BORDER; + cursor_location.width = 0; + cursor_location.height = text_area_height - 2 * INNER_BORDER; + + draw_insertion_cursor(entry, + &cursor_location, TRUE, dir1, + dir2 != PANGO_DIRECTION_NEUTRAL); + + if (dir2 != PANGO_DIRECTION_NEUTRAL) { + cursor_location.x = xoffset + x2; + draw_insertion_cursor(entry, + &cursor_location, FALSE, dir2, TRUE); + } + } +} + +static void +gtk_secure_entry_queue_draw(GtkSecureEntry * entry) +{ + if (GTK_WIDGET_REALIZED(entry)) + gdk_window_invalidate_rect(entry->text_area, NULL, FALSE); +} + +static void +gtk_secure_entry_reset_im_context(GtkSecureEntry * entry) +{ + if (entry->need_im_reset) { + entry->need_im_reset = 0; + gtk_im_context_reset(entry->im_context); + } +} + +static gint +gtk_secure_entry_find_position(GtkSecureEntry * entry, gint x) +{ + PangoLayout *layout; + PangoLayoutLine *line; + gint _index; + gint pos; + gboolean trailing; + const gchar *text; + gint cursor_index; + + layout = gtk_secure_entry_ensure_layout(entry, TRUE); + text = pango_layout_get_text(layout); + cursor_index = + g_utf8_offset_to_pointer(text, entry->current_pos) - text; + + line = pango_layout_get_lines(layout)->data; + pango_layout_line_x_to_index(line, x * PANGO_SCALE, &_index, &trailing); + + if (_index >= cursor_index && entry->preedit_length) { + if (_index >= cursor_index + entry->preedit_length) + _index -= entry->preedit_length; + else { + _index = cursor_index; + trailing = 0; + } + } + + pos = g_utf8_pointer_to_offset(text, text + _index); + pos += trailing; + + return pos; +} + +static void +gtk_secure_entry_get_cursor_locations(GtkSecureEntry * entry, + gint * strong_x, gint * weak_x) +{ + if (!entry->invisible_char) { + if (strong_x) + *strong_x = 0; + + if (weak_x) + *weak_x = 0; + } else { + PangoLayout *layout = gtk_secure_entry_ensure_layout(entry, TRUE); + const gchar *text = pango_layout_get_text(layout); + PangoRectangle strong_pos, weak_pos; + gint _index; + + _index = + g_utf8_offset_to_pointer(text, + entry->current_pos + + entry->preedit_cursor) - text; + + pango_layout_get_cursor_pos(layout, _index, &strong_pos, &weak_pos); + + if (strong_x) + *strong_x = strong_pos.x / PANGO_SCALE; + + if (weak_x) + *weak_x = weak_pos.x / PANGO_SCALE; + } +} + +static void +gtk_secure_entry_adjust_scroll(GtkSecureEntry * entry) +{ + gint min_offset, max_offset; + gint text_area_width, text_width; + gint strong_x, weak_x; + gint strong_xoffset, weak_xoffset; + PangoLayout *layout; + PangoLayoutLine *line; + PangoRectangle logical_rect; + + if (!GTK_WIDGET_REALIZED(entry)) + return; + + gdk_drawable_get_size(entry->text_area, &text_area_width, NULL); + text_area_width -= 2 * INNER_BORDER; + + layout = gtk_secure_entry_ensure_layout(entry, TRUE); + line = pango_layout_get_lines(layout)->data; + + pango_layout_line_get_extents(line, NULL, &logical_rect); + + /* Display as much text as we can */ + + text_width = PANGO_PIXELS(logical_rect.width); + + if (text_width > text_area_width) { + min_offset = 0; + max_offset = text_width - text_area_width; + } else { + min_offset = 0; + max_offset = min_offset; + } + + entry->scroll_offset = + CLAMP(entry->scroll_offset, min_offset, max_offset); + + /* And make sure cursors are on screen. Note that the cursor is + * actually drawn one pixel into the INNER_BORDER space on + * the right, when the scroll is at the utmost right. This + * looks better to to me than confining the cursor inside the + * border entirely, though it means that the cursor gets one + * pixel closer to the the edge of the widget on the right than + * on the left. This might need changing if one changed + * INNER_BORDER from 2 to 1, as one would do on a + * small-screen-real-estate display. + * + * We always make sure that the strong cursor is on screen, and + * put the weak cursor on screen if possible. + */ + + gtk_secure_entry_get_cursor_locations(entry, &strong_x, &weak_x); + + strong_xoffset = strong_x - entry->scroll_offset; + + if (strong_xoffset < 0) { + entry->scroll_offset += strong_xoffset; + strong_xoffset = 0; + } else if (strong_xoffset > text_area_width) { + entry->scroll_offset += strong_xoffset - text_area_width; + strong_xoffset = text_area_width; + } + + weak_xoffset = weak_x - entry->scroll_offset; + + if (weak_xoffset < 0 + && strong_xoffset - weak_xoffset <= text_area_width) { + entry->scroll_offset += weak_xoffset; + } else if (weak_xoffset > text_area_width && + strong_xoffset - (weak_xoffset - text_area_width) >= 0) { + entry->scroll_offset += weak_xoffset - text_area_width; + } + + g_object_notify(G_OBJECT(entry), "scroll_offset"); +} + +static gint +gtk_secure_entry_move_visually(GtkSecureEntry * entry, + gint start, gint count) +{ + gint _index; + PangoLayout *layout = gtk_secure_entry_ensure_layout(entry, FALSE); + const gchar *text; + + text = pango_layout_get_text(layout); + + _index = g_utf8_offset_to_pointer(text, start) - text; + + while (count != 0) { + int new_index, new_trailing; + gboolean split_cursor; + gboolean strong; + + g_object_get(gtk_widget_get_settings(GTK_WIDGET(entry)), + "gtk-split-cursor", &split_cursor, NULL); + + if (split_cursor) + strong = TRUE; + else { + GdkKeymap *keymap = + gdk_keymap_get_for_display(gtk_widget_get_display + (GTK_WIDGET(entry))); + PangoDirection keymap_direction = + gdk_keymap_get_direction(keymap); + + strong = keymap_direction == entry->resolved_dir; + } + + if (count > 0) { + pango_layout_move_cursor_visually(layout, strong, _index, 0, 1, + &new_index, &new_trailing); + count--; + } else { + pango_layout_move_cursor_visually(layout, strong, _index, 0, -1, + &new_index, &new_trailing); + count++; + } + + if (new_index < 0 || new_index == G_MAXINT) + break; + + _index = new_index; + + while (new_trailing--) + _index = g_utf8_next_char(text + new_index) - text; + } + + return g_utf8_pointer_to_offset(text, text + _index); +} + +static gint +gtk_secure_entry_move_logically(GtkSecureEntry * entry, + gint start, gint count) +{ + gint new_pos = start; + + /* Prevent any leak of information */ + new_pos = CLAMP(start + count, 0, entry->text_length); + + return new_pos; +} + +/* Public API + */ + +GtkWidget * +gtk_secure_entry_new(void) +{ + return g_object_new(GTK_TYPE_SECURE_ENTRY, NULL); +} + +/** + * gtk_secure_entry_new_with_max_length: + * @max: the maximum length of the entry, or 0 for no maximum. + * (other than the maximum length of entries.) The value passed in will + * be clamped to the range 0-65536. + * + * Creates a new #GtkSecureEntry widget with the given maximum length. + * + * Note: the existence of this function is inconsistent + * with the rest of the GTK+ API. The normal setup would + * be to just require the user to make an extra call + * to gtk_secure_entry_set_max_length() instead. It is not + * expected that this function will be removed, but + * it would be better practice not to use it. + * + * Return value: a new #GtkSecureEntry. + **/ +GtkWidget * +gtk_secure_entry_new_with_max_length(gint max) +{ + GtkSecureEntry *entry; + + max = CLAMP(max, 0, MAX_SIZE); + + entry = g_object_new(GTK_TYPE_SECURE_ENTRY, NULL); + entry->text_max_length = max; + + return GTK_WIDGET(entry); +} + +void +gtk_secure_entry_set_text(GtkSecureEntry * entry, const gchar * text) +{ + gint tmp_pos; + + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + g_return_if_fail(text != NULL); + + /* Actually setting the text will affect the cursor and selection; + * if the contents don't actually change, this will look odd to the user. + */ + if (strcmp(entry->text, text) == 0) + return; + + gtk_editable_delete_text(GTK_EDITABLE(entry), 0, -1); + + tmp_pos = 0; + gtk_editable_insert_text(GTK_EDITABLE(entry), text, strlen(text), + &tmp_pos); +} + +void +gtk_secure_entry_append_text(GtkSecureEntry * entry, const gchar * text) +{ + gint tmp_pos; + + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + g_return_if_fail(text != NULL); + + tmp_pos = entry->text_length; + gtk_editable_insert_text(GTK_EDITABLE(entry), text, -1, &tmp_pos); +} + +void +gtk_secure_entry_prepend_text(GtkSecureEntry * entry, const gchar * text) +{ + gint tmp_pos; + + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + g_return_if_fail(text != NULL); + + tmp_pos = 0; + gtk_editable_insert_text(GTK_EDITABLE(entry), text, -1, &tmp_pos); +} + +void +gtk_secure_entry_set_position(GtkSecureEntry * entry, gint position) +{ + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + + gtk_editable_set_position(GTK_EDITABLE(entry), position); +} + +/** + * gtk_secure_entry_set_invisible_char: + * @entry: a #GtkSecureEntry + * @ch: a Unicode character + * + * Sets the character to use in place of the actual text when + * gtk_secure_entry_set_visibility() has been called to set text visibility + * to %FALSE. i.e. this is the character used in "password mode" to + * show the user how many characters have been typed. The default + * invisible char is an asterisk ('*'). If you set the invisible char + * to 0, then the user will get no feedback at all; there will be + * no text on the screen as they type. + * + **/ +void +gtk_secure_entry_set_invisible_char(GtkSecureEntry * entry, gunichar ch) +{ + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + + if (ch == entry->invisible_char) + return; + + entry->invisible_char = ch; + g_object_notify(G_OBJECT(entry), "invisible_char"); + gtk_secure_entry_recompute(entry); +} + +/** + * gtk_secure_entry_get_invisible_char: + * @entry: a #GtkSecureEntry + * + * Retrieves the character displayed in place of the real characters + * for entries with visisbility set to false. See gtk_secure_entry_set_invisible_char(). + * + * Return value: the current invisible char, or 0, if the entry does not + * show invisible text at all. + **/ +gunichar +gtk_secure_entry_get_invisible_char(GtkSecureEntry * entry) +{ + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), 0); + + return entry->invisible_char; +} + +/** + * gtk_secure_entry_get_text: + * @entry: a #GtkSecureEntry + * + * Retrieves the contents of the entry widget. + * See also gtk_editable_get_chars(). + * + * Return value: a pointer to the contents of the widget as a + * string. This string points to internally allocated + * storage in the widget and must not be freed, modified or + * stored. + **/ +G_CONST_RETURN gchar * +gtk_secure_entry_get_text(GtkSecureEntry * entry) +{ + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), NULL); + + return entry->text; +} + +void +gtk_secure_entry_select_region(GtkSecureEntry * entry, + gint start, gint end) +{ + gtk_editable_select_region(GTK_EDITABLE(entry), start, end); +} + +/** + * gtk_secure_entry_set_max_length: + * @entry: a #GtkSecureEntry. + * @max: the maximum length of the entry, or 0 for no maximum. + * (other than the maximum length of entries.) The value passed in will + * be clamped to the range 0-65536. + * + * Sets the maximum allowed length of the contents of the widget. If + * the current contents are longer than the given length, then they + * will be truncated to fit. + **/ +void +gtk_secure_entry_set_max_length(GtkSecureEntry * entry, gint max) +{ + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + + max = CLAMP(max, 0, MAX_SIZE); + + if (max > 0 && entry->text_length > max) + gtk_editable_delete_text(GTK_EDITABLE(entry), max, -1); + + entry->text_max_length = max; + g_object_notify(G_OBJECT(entry), "max_length"); +} + +/** + * gtk_secure_entry_get_max_length: + * @entry: a #GtkSecureEntry + * + * Retrieves the maximum allowed length of the text in + * @entry. See gtk_secure_entry_set_max_length(). + * + * Return value: the maximum allowed number of characters + * in #GtkSecureEntry, or 0 if there is no maximum. + **/ +gint +gtk_secure_entry_get_max_length(GtkSecureEntry * entry) +{ + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), 0); + + return entry->text_max_length; +} + +/** + * gtk_secure_entry_set_activates_default: + * @entry: a #GtkSecureEntry + * @setting: %TRUE to activate window's default widget on Enter keypress + * + * If @setting is %TRUE, pressing Enter in the @entry will activate the default + * widget for the window containing the entry. This usually means that + * the dialog box containing the entry will be closed, since the default + * widget is usually one of the dialog buttons. + * + * (For experts: if @setting is %TRUE, the entry calls + * gtk_window_activate_default() on the window containing the entry, in + * the default handler for the "activate" signal.) + * + **/ +void +gtk_secure_entry_set_activates_default(GtkSecureEntry * entry, + gboolean setting) +{ + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + setting = setting != FALSE; + + if (setting != entry->activates_default) { + entry->activates_default = setting; + g_object_notify(G_OBJECT(entry), "activates_default"); + } +} + +/** + * gtk_secure_entry_get_activates_default: + * @entry: a #GtkSecureEntry + * + * Retrieves the value set by gtk_secure_entry_set_activates_default(). + * + * Return value: %TRUE if the entry will activate the default widget + **/ +gboolean +gtk_secure_entry_get_activates_default(GtkSecureEntry * entry) +{ + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), FALSE); + + return entry->activates_default; +} + +/** + * gtk_secure_entry_set_width_chars: + * @entry: a #GtkSecureEntry + * @n_chars: width in chars + * + * Changes the size request of the entry to be about the right size + * for @n_chars characters. Note that it changes the size + * request, the size can still be affected by + * how you pack the widget into containers. If @n_chars is -1, the + * size reverts to the default entry size. + * + **/ +void +gtk_secure_entry_set_width_chars(GtkSecureEntry * entry, gint n_chars) +{ + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + + if (entry->width_chars != n_chars) { + entry->width_chars = n_chars; + g_object_notify(G_OBJECT(entry), "width_chars"); + gtk_widget_queue_resize(GTK_WIDGET(entry)); + } +} + +/** + * gtk_secure_entry_get_width_chars: + * @entry: a #GtkSecureEntry + * + * Gets the value set by gtk_secure_entry_set_width_chars(). + * + * Return value: number of chars to request space for, or negative if unset + **/ +gint +gtk_secure_entry_get_width_chars(GtkSecureEntry * entry) +{ + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), 0); + + return entry->width_chars; +} + +/** + * gtk_secure_entry_set_has_frame: + * @entry: a #GtkSecureEntry + * @setting: new value + * + * Sets whether the entry has a beveled frame around it. + **/ +void +gtk_secure_entry_set_has_frame(GtkSecureEntry * entry, gboolean setting) +{ + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + + setting = (setting != FALSE); + + if (entry->has_frame == setting) + return; + + gtk_widget_queue_resize(GTK_WIDGET(entry)); + entry->has_frame = setting; + g_object_notify(G_OBJECT(entry), "has_frame"); +} + +/** + * gtk_secure_entry_get_has_frame: + * @entry: a #GtkSecureEntry + * + * Gets the value set by gtk_secure_entry_set_has_frame(). + * + * Return value: whether the entry has a beveled frame + **/ +gboolean +gtk_secure_entry_get_has_frame(GtkSecureEntry * entry) +{ + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), FALSE); + + return entry->has_frame; +} + + +/** + * gtk_secure_entry_get_layout: + * @entry: a #GtkSecureEntry + * + * Gets the #PangoLayout used to display the entry. + * The layout is useful to e.g. convert text positions to + * pixel positions, in combination with gtk_secure_entry_get_layout_offsets(). + * The returned layout is owned by the entry so need not be + * freed by the caller. + * + * Keep in mind that the layout text may contain a preedit string, so + * gtk_secure_entry_layout_index_to_text_index() and + * gtk_secure_entry_text_index_to_layout_index() are needed to convert byte + * indices in the layout to byte indices in the entry contents. + * + * Return value: the #PangoLayout for this entry + **/ +PangoLayout * +gtk_secure_entry_get_layout(GtkSecureEntry * entry) +{ + PangoLayout *layout; + + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), NULL); + + layout = gtk_secure_entry_ensure_layout(entry, TRUE); + + return layout; +} + + +/** + * gtk_secure_entry_layout_index_to_text_index: + * @entry: a #GtkSecureEntry + * @layout_index: byte index into the entry layout text + * + * Converts from a position in the entry contents (returned + * by gtk_secure_entry_get_text()) to a position in the + * entry's #PangoLayout (returned by gtk_secure_entry_get_layout(), + * with text retrieved via pango_layout_get_text()). + * + * Return value: byte index into the entry contents + **/ +gint +gtk_secure_entry_layout_index_to_text_index(GtkSecureEntry * entry, + gint layout_index) +{ + PangoLayout *layout; + const gchar *text; + gint cursor_index; + + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), 0); + + layout = gtk_secure_entry_ensure_layout(entry, TRUE); + text = pango_layout_get_text(layout); + cursor_index = + g_utf8_offset_to_pointer(text, entry->current_pos) - text; + + if (layout_index >= cursor_index && entry->preedit_length) { + if (layout_index >= cursor_index + entry->preedit_length) + layout_index -= entry->preedit_length; + else + layout_index = cursor_index; + } + + return layout_index; +} + +/** + * gtk_secure_entry_text_index_to_layout_index: + * @entry: a #GtkSecureEntry + * @text_index: byte index into the entry contents + * + * Converts from a position in the entry's #PangoLayout(returned by + * gtk_secure_entry_get_layout()) to a position in the entry contents + * (returned by gtk_secure_entry_get_text()). + * + * Return value: byte index into the entry layout text + **/ +gint +gtk_secure_entry_text_index_to_layout_index(GtkSecureEntry * entry, + gint text_index) +{ + PangoLayout *layout; + const gchar *text; + gint cursor_index; + g_return_val_if_fail(GTK_IS_SECURE_ENTRY(entry), 0); + + layout = gtk_secure_entry_ensure_layout(entry, TRUE); + text = pango_layout_get_text(layout); + cursor_index = + g_utf8_offset_to_pointer(text, entry->current_pos) - text; + + if (text_index > cursor_index) + text_index += entry->preedit_length; + + return text_index; +} + +/** + * gtk_secure_entry_get_layout_offsets: + * @entry: a #GtkSecureEntry + * @x: location to store X offset of layout, or %NULL + * @y: location to store Y offset of layout, or %NULL + * + * + * Obtains the position of the #PangoLayout used to render text + * in the entry, in widget coordinates. Useful if you want to line + * up the text in an entry with some other text, e.g. when using the + * entry to implement editable cells in a sheet widget. + * + * Also useful to convert mouse events into coordinates inside the + * #PangoLayout, e.g. to take some action if some part of the entry text + * is clicked. + * + * Note that as the user scrolls around in the entry the offsets will + * change; you'll need to connect to the "notify::scroll_offset" + * signal to track this. Remember when using the #PangoLayout + * functions you need to convert to and from pixels using + * PANGO_PIXELS() or #PANGO_SCALE. + * + * Keep in mind that the layout text may contain a preedit string, so + * gtk_secure_entry_layout_index_to_text_index() and + * gtk_secure_entry_text_index_to_layout_index() are needed to convert byte + * indices in the layout to byte indices in the entry contents. + * + **/ +void +gtk_secure_entry_get_layout_offsets(GtkSecureEntry * entry, + gint * x, gint * y) +{ + gint text_area_x, text_area_y; + + g_return_if_fail(GTK_IS_SECURE_ENTRY(entry)); + + /* this gets coords relative to text area */ + get_layout_position(entry, x, y); + + /* convert to widget coords */ + get_text_area_size(entry, &text_area_x, &text_area_y, NULL, NULL); + + if (x) + *x += text_area_x; + + if (y) + *y += text_area_y; +} + + +/* Quick hack of a popup menu + */ +static void +activate_cb(GtkWidget * menuitem, GtkSecureEntry * entry) +{ + const gchar *signal = + g_object_get_data(G_OBJECT(menuitem), "gtk-signal"); + g_signal_emit_by_name(entry, signal); +} + + +static gboolean +gtk_secure_entry_mnemonic_activate(GtkWidget * widget, + gboolean group_cycling) +{ + gtk_widget_grab_focus(widget); + return TRUE; +} + + +static void +unichar_chosen_func(const char *text, gpointer data) +{ + GtkSecureEntry *entry = GTK_SECURE_ENTRY(data); + + gtk_secure_entry_enter_text(entry, text); +} + +/* We display the cursor when + * + * - the selection is empty, AND + * - the widget has focus + */ + +#define CURSOR_ON_MULTIPLIER 0.66 +#define CURSOR_OFF_MULTIPLIER 0.34 +#define CURSOR_PEND_MULTIPLIER 1.0 + +static gboolean +cursor_blinks(GtkSecureEntry * entry) +{ + GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(entry)); + gboolean blink; + + if (GTK_WIDGET_HAS_FOCUS(entry) && + entry->selection_bound == entry->current_pos) { + g_object_get(settings, "gtk-cursor-blink", &blink, NULL); + return blink; + } else + return FALSE; +} + +static gint +get_cursor_time(GtkSecureEntry * entry) +{ + GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(entry)); + gint time; + + g_object_get(settings, "gtk-cursor-blink-time", &time, NULL); + + return time; +} + +static void +show_cursor(GtkSecureEntry * entry) +{ + if (!entry->cursor_visible) { + entry->cursor_visible = TRUE; + + if (GTK_WIDGET_HAS_FOCUS(entry) + && entry->selection_bound == entry->current_pos) + gtk_widget_queue_draw(GTK_WIDGET(entry)); + } +} + +static void +hide_cursor(GtkSecureEntry * entry) +{ + if (entry->cursor_visible) { + entry->cursor_visible = FALSE; + + if (GTK_WIDGET_HAS_FOCUS(entry) + && entry->selection_bound == entry->current_pos) + gtk_widget_queue_draw(GTK_WIDGET(entry)); + } +} + +/* + * Blink! + */ +static gint +blink_cb(gpointer data) +{ + GtkSecureEntry *entry; + + GDK_THREADS_ENTER(); + + entry = GTK_SECURE_ENTRY(data); + + if (!GTK_WIDGET_HAS_FOCUS(entry)) { + g_warning + ("GtkSecureEntry - did not receive focus-out-event. If you\n" + "connect a handler to this signal, it must return\n" + "FALSE so the entry gets the event as well"); + } + + g_assert(GTK_WIDGET_HAS_FOCUS(entry)); + g_assert(entry->selection_bound == entry->current_pos); + + if (entry->cursor_visible) { + hide_cursor(entry); + entry->blink_timeout = + g_timeout_add(get_cursor_time(entry) * CURSOR_OFF_MULTIPLIER, + blink_cb, entry); + } else { + show_cursor(entry); + entry->blink_timeout = + g_timeout_add(get_cursor_time(entry) * CURSOR_ON_MULTIPLIER, + blink_cb, entry); + } + + GDK_THREADS_LEAVE(); + + /* Remove ourselves */ + return FALSE; +} + +static void +gtk_secure_entry_check_cursor_blink(GtkSecureEntry * entry) +{ + if (cursor_blinks(entry)) { + if (!entry->blink_timeout) { + entry->blink_timeout = + g_timeout_add(get_cursor_time(entry) * + CURSOR_ON_MULTIPLIER, blink_cb, entry); + show_cursor(entry); + } + } else { + if (entry->blink_timeout) { + g_source_remove(entry->blink_timeout); + entry->blink_timeout = 0; + } + + entry->cursor_visible = TRUE; + } + +} + +static void +gtk_secure_entry_pend_cursor_blink(GtkSecureEntry * entry) +{ + if (cursor_blinks(entry)) { + if (entry->blink_timeout != 0) + g_source_remove(entry->blink_timeout); + + entry->blink_timeout = + g_timeout_add(get_cursor_time(entry) * CURSOR_PEND_MULTIPLIER, + blink_cb, entry); + show_cursor(entry); + } +} + +static inline gboolean +keyval_is_cursor_move(guint keyval) +{ + if (keyval == GDK_Up || keyval == GDK_KP_Up) + return TRUE; + + if (keyval == GDK_Down || keyval == GDK_KP_Down) + return TRUE; + + if (keyval == GDK_Page_Up) + return TRUE; + + if (keyval == GDK_Page_Down) + return TRUE; + + return FALSE; +} + +/* stolen from gtkmarshalers.c */ + +#define g_marshal_value_peek_enum(v) (v)->data[0].v_int +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int + +/* VOID:ENUM,INT,BOOLEAN (gtkmarshalers.list:64) */ +static void +_gtk_marshal_VOID__ENUM_INT_BOOLEAN(GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__ENUM_INT_BOOLEAN) (gpointer data1, + gint arg_1, + gint arg_2, + gboolean arg_3, + gpointer data2); + register GMarshalFunc_VOID__ENUM_INT_BOOLEAN callback; + register GCClosure *cc = (GCClosure *) closure; + register gpointer data1, data2; + + g_return_if_fail(n_param_values == 4); + + if (G_CCLOSURE_SWAP_DATA(closure)) { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } else { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + callback = + (GMarshalFunc_VOID__ENUM_INT_BOOLEAN) (marshal_data ? marshal_data + : cc->callback); + + callback(data1, + g_marshal_value_peek_enum(param_values + 1), + g_marshal_value_peek_int(param_values + 2), + g_marshal_value_peek_boolean(param_values + 3), data2); +} + +static void +_gtk_marshal_VOID__ENUM_INT(GClosure * closure, + GValue * return_value, + guint n_param_values, + const GValue * param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__ENUM_INT) (gpointer data1, + gint arg_1, + gint arg_2, + gpointer data2); + register GMarshalFunc_VOID__ENUM_INT callback; + register GCClosure *cc = (GCClosure *) closure; + register gpointer data1, data2; + + g_return_if_fail(n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA(closure)) { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } else { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + callback = + (GMarshalFunc_VOID__ENUM_INT) (marshal_data ? marshal_data : cc-> + callback); + + callback(data1, + g_marshal_value_peek_enum(param_values + 1), + g_marshal_value_peek_int(param_values + 2), data2); +} diff -urpP pinentry-0.7.1/gtk+-2/gtksecentry.h pinentry-0.7.2/gtk+-2/gtksecentry.h --- pinentry-0.7.1/gtk+-2/gtksecentry.h 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/gtk+-2/gtksecentry.h 2004-09-02 01:47:13.000000000 +0000 @@ -0,0 +1,181 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * Copyright (C) 2004 Albrecht Dreß + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +/* + * Heavily stripped down for use in pinentry-gtk-2 by Albrecht Dreß + * Feb. 2004: + * + * The entry is now always invisible, uses secure memory methods to + * allocate the text memory, and all potentially dangerous methods + * (copy & paste, popup, etc.) have been removed. + */ + +#ifndef __GTK_SECURE_ENTRY_H__ +#define __GTK_SECURE_ENTRY_H__ + + +#include + +#ifdef __cplusplus +extern "C" { +#ifdef MAKE_EMACS_HAPPY +} +#endif /* MAKE_EMACS_HAPPY */ +#endif /* __cplusplus */ +#define GTK_TYPE_SECURE_ENTRY (gtk_secure_entry_get_type ()) +#define GTK_SECURE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SECURE_ENTRY, GtkSecureEntry)) +#define GTK_SECURE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SECURE_ENTRY, GtkSecureEntryClass)) +#define GTK_IS_SECURE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SECURE_ENTRY)) +#define GTK_IS_SECURE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SECURE_ENTRY)) +#define GTK_SECURE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SECURE_ENTRY, GtkSecureEntryClass)) +typedef struct _GtkSecureEntry GtkSecureEntry; +typedef struct _GtkSecureEntryClass GtkSecureEntryClass; + +struct _GtkSecureEntry { + GtkWidget widget; + + gchar *text; + + guint overwrite_mode:1; + + guint16 text_length; /* length in use, in chars */ + guint16 text_max_length; + + /*< private > */ + GdkWindow *text_area; + GtkIMContext *im_context; + + gint current_pos; + gint selection_bound; + + PangoLayout *cached_layout; + guint cache_includes_preedit:1; + + guint need_im_reset:1; + + guint has_frame:1; + + guint activates_default:1; + + guint cursor_visible:1; + + guint in_click:1; /* Flag so we don't select all when clicking in entry to focus in */ + + guint is_cell_renderer:1; + guint editing_canceled:1; /* Only used by GtkCellRendererText */ + + guint mouse_cursor_obscured:1; + + guint resolved_dir : 4; /* PangoDirection */ + + guint button; + guint blink_timeout; + guint recompute_idle; + gint scroll_offset; + gint ascent; /* font ascent, in pango units */ + gint descent; /* font descent, in pango units */ + + guint16 text_size; /* allocated size, in bytes */ + guint16 n_bytes; /* length in use, in bytes */ + + guint16 preedit_length; /* length of preedit string, in bytes */ + guint16 preedit_cursor; /* offset of cursor within preedit string, in chars */ + + gunichar invisible_char; + + gint width_chars; +}; + +struct _GtkSecureEntryClass { + GtkWidgetClass parent_class; + + /* Action signals + */ + void (*activate) (GtkSecureEntry * entry); + void (*move_cursor) (GtkSecureEntry * entry, + GtkMovementStep step, + gint count, gboolean extend_selection); + void (*insert_at_cursor) (GtkSecureEntry * entry, const gchar * str); + void (*delete_from_cursor) (GtkSecureEntry * entry, + GtkDeleteType type, gint count); + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); +}; + +GType +gtk_secure_entry_get_type(void) + G_GNUC_CONST; +GtkWidget * +gtk_secure_entry_new(void); +void +gtk_secure_entry_set_invisible_char(GtkSecureEntry * entry, gunichar ch); +gunichar +gtk_secure_entry_get_invisible_char(GtkSecureEntry * entry); +void +gtk_secure_entry_set_has_frame(GtkSecureEntry * entry, gboolean setting); +gboolean +gtk_secure_entry_get_has_frame(GtkSecureEntry * entry); +/* text is truncated if needed */ +void +gtk_secure_entry_set_max_length(GtkSecureEntry * entry, gint max); +gint +gtk_secure_entry_get_max_length(GtkSecureEntry * entry); +void +gtk_secure_entry_set_activates_default(GtkSecureEntry * entry, + gboolean setting); +gboolean +gtk_secure_entry_get_activates_default(GtkSecureEntry * entry); + +void +gtk_secure_entry_set_width_chars(GtkSecureEntry * entry, gint n_chars); +gint +gtk_secure_entry_get_width_chars(GtkSecureEntry * entry); + +/* Somewhat more convenient than the GtkEditable generic functions + */ +void +gtk_secure_entry_set_text(GtkSecureEntry * entry, const gchar * text); +/* returns a reference to the text */ +G_CONST_RETURN gchar * +gtk_secure_entry_get_text(GtkSecureEntry * entry); + +PangoLayout * +gtk_secure_entry_get_layout(GtkSecureEntry * entry); +void +gtk_secure_entry_get_layout_offsets(GtkSecureEntry * entry, + gint * x, gint * y); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __GTK_SECURE_ENTRY_H__ */ diff -urpP pinentry-0.7.1/gtk+-2/pinentry-gtk-2.c pinentry-0.7.2/gtk+-2/pinentry-gtk-2.c --- pinentry-0.7.1/gtk+-2/pinentry-gtk-2.c 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/gtk+-2/pinentry-gtk-2.c 2004-09-02 01:47:13.000000000 +0000 @@ -0,0 +1,411 @@ +/* pinentry-gtk-2.c + Copyright (C) 1999 Robert Bihlmeyer + Copyright (C) 2001, 2002 g10 Code GmbH + Copyright (C) 2004 by Albrecht Dreß + + pinentry-gtk-2 is a pinentry application for the Gtk+-2 widget set. + It tries to follow the Gnome Human Interface Guide as close as + possible. + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_GETOPT_H +#include +#else +#include "getopt.h" +#endif /* HAVE_GETOPT_H */ + +#include "gtksecentry.h" +#include "pinentry.h" + +#ifdef FALLBACK_CURSES +#include "pinentry-curses.h" +#endif + + +#define PGMNAME "pinentry-gtk2" + +#ifndef VERSION +# define VERSION +#endif + +static pinentry_t pinentry; +static int passphrase_ok; +static int confirm_yes; + +static GtkWidget *entry; +static GtkWidget *insure; +static GtkWidget *time_out; + +/* Gnome hig small and large space in pixels. */ +#define HIG_SMALL 6 +#define HIG_LARGE 12 + + +/* Constrain size of the window the window should not shrink beyond + the requisition, and should not grow vertically. */ +static void +constrain_size (GtkWidget *win, GtkRequisition *req, gpointer data) +{ + static gint width, height; + GdkGeometry geo; + + if (req->width == width && req->height == height) + return; + width = req->width; + height = req->height; + geo.min_width = width; + /* This limit is arbitrary, but INT_MAX breaks other things */ + geo.max_width = 10000; + geo.min_height = geo.max_height = height; + gtk_window_set_geometry_hints (GTK_WINDOW (win), NULL, &geo, + GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE); +} + + +/* Grab the keyboard for maximum security */ +static void +grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) +{ + if (!pinentry->grab) + return; + + if (gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event))) + g_error ("could not grab keyboard"); +} + +/* Remove grab. */ +static void +ungrab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data) +{ + gdk_keyboard_ungrab (gdk_event_get_time (event)); +} + + +static int +delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) +{ + gtk_main_quit (); + return TRUE; +} + + +static void +button_clicked (GtkWidget *widget, gpointer data) +{ + if (data) + { + const char *s; + + /* Okay button or enter used in text field. */ + + if (pinentry->enhanced) + printf ("Options: %s\nTimeout: %d\n\n", + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (insure)) + ? "insure" : "", + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (time_out))); + + s = gtk_secure_entry_get_text (GTK_SECURE_ENTRY (entry)); + if (!s) + s = ""; + passphrase_ok = 1; + pinentry_setbufferlen (pinentry, strlen (s) + 1); + if (pinentry->pin) + strcpy (pinentry->pin, s); + } + gtk_main_quit (); +} + + +static void +enter_callback (GtkWidget *widget, GtkWidget *anentry) +{ + button_clicked (widget, "ok"); +} + + +static void +confirm_button_clicked (GtkWidget *widget, gpointer data) +{ + if (data) + /* Okay button. */ + confirm_yes = 1; + + gtk_main_quit (); +} + + +static gchar * +pinentry_utf8_validate (gchar *text) +{ + gchar *result; + + if (!text) + return NULL; + + if (g_utf8_validate (text, -1, NULL)) + return g_strdup (text); + + result = g_locale_to_utf8 (text, -1, NULL, NULL, NULL); + if (!result) + { + gchar *p; + + result = p = g_strdup (text); + while (!g_utf8_validate (p, -1, (const gchar **) &p)) + *p = '?'; + } + return result; +} + + +static GtkWidget * +create_window (int confirm_mode) +{ + GtkWidget *w; + GtkWidget *win, *box, *ebox; + GtkWidget *wvbox, *chbox, *bbox; + GtkAccelGroup *acc; + gchar *msg; + + /* FIXME: check the grabbing code against the one we used with the + old gpg-agent */ + win = gtk_window_new (GTK_WINDOW_TOPLEVEL); + acc = gtk_accel_group_new (); + + g_signal_connect (G_OBJECT (win), "delete_event", + G_CALLBACK (delete_event), NULL); + +#if 0 + g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (gtk_main_quit), + NULL); +#endif + g_signal_connect (G_OBJECT (win), "size-request", + G_CALLBACK (constrain_size), NULL); + if (!confirm_mode) + { + g_signal_connect (G_OBJECT (win), + pinentry->grab ? "map-event" : "focus-in-event", + G_CALLBACK (grab_keyboard), NULL); + g_signal_connect (G_OBJECT (win), + pinentry->grab ? "unmap-event" : "focus-out-event", + G_CALLBACK (ungrab_keyboard), NULL); + } + gtk_window_add_accel_group (GTK_WINDOW (win), acc); + + wvbox = gtk_vbox_new (FALSE, HIG_LARGE * 2); + gtk_container_add (GTK_CONTAINER (win), wvbox); + gtk_container_set_border_width (GTK_CONTAINER (wvbox), HIG_LARGE); + + chbox = gtk_hbox_new (FALSE, HIG_LARGE); + gtk_box_pack_start (GTK_BOX (wvbox), chbox, FALSE, FALSE, 0); + + w = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, + GTK_ICON_SIZE_DIALOG); + gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.0); + gtk_box_pack_start (GTK_BOX (chbox), w, FALSE, FALSE, 0); + + box = gtk_vbox_new (FALSE, HIG_SMALL); + gtk_box_pack_start (GTK_BOX (chbox), box, TRUE, TRUE, 0); + + if (pinentry->description) + { + msg = pinentry_utf8_validate (pinentry->description); + w = gtk_label_new (msg); + g_free (msg); + gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5); + gtk_label_set_line_wrap (GTK_LABEL (w), TRUE); + gtk_box_pack_start (GTK_BOX (box), w, TRUE, FALSE, 0); + } + if (pinentry->error && !confirm_mode) + { + GdkColor color = { 0, 0xffff, 0, 0 }; + + msg = pinentry_utf8_validate (pinentry->error); + w = gtk_label_new (msg); + g_free (msg); + gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5); + gtk_label_set_line_wrap (GTK_LABEL (w), TRUE); + gtk_box_pack_start (GTK_BOX (box), w, TRUE, FALSE, 0); + gtk_widget_modify_fg (w, GTK_STATE_NORMAL, &color); + } + + ebox = gtk_hbox_new (FALSE, HIG_SMALL); + gtk_box_pack_start (GTK_BOX(box), ebox, FALSE, FALSE, 0); + + if (!confirm_mode) + { + if (pinentry->prompt) + { + msg = pinentry_utf8_validate (pinentry->prompt); + w = gtk_label_new (msg); + g_free (msg); + gtk_box_pack_start (GTK_BOX (ebox), w, FALSE, FALSE, 0); + } + entry = gtk_secure_entry_new (); + gtk_widget_set_size_request (entry, 200, -1); + g_signal_connect (G_OBJECT (entry), "activate", + G_CALLBACK (enter_callback), entry); + gtk_box_pack_start (GTK_BOX (ebox), entry, TRUE, TRUE, 0); + gtk_widget_grab_focus (entry); + gtk_widget_show (entry); + + if (pinentry->enhanced) + { + GtkWidget *sbox = gtk_hbox_new (FALSE, HIG_SMALL); + gtk_box_pack_start (GTK_BOX (box), sbox, FALSE, FALSE, 0); + + w = gtk_label_new ("Forget secret after"); + gtk_box_pack_start (GTK_BOX (sbox), w, FALSE, FALSE, 0); + gtk_widget_show (w); + + time_out = gtk_spin_button_new + (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, HUGE_VAL, 1, 60, 60)), + 2, 0); + gtk_box_pack_start (GTK_BOX (sbox), time_out, FALSE, FALSE, 0); + gtk_widget_show (time_out); + + w = gtk_label_new ("seconds"); + gtk_box_pack_start (GTK_BOX (sbox), w, FALSE, FALSE, 0); + gtk_widget_show (w); + gtk_widget_show (sbox); + + insure = gtk_check_button_new_with_label ("ask before giving out " + "secret"); + gtk_box_pack_start (GTK_BOX (box), insure, FALSE, FALSE, 0); + gtk_widget_show (insure); + } + } + + bbox = gtk_hbutton_box_new (); + gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END); + gtk_box_set_spacing (GTK_BOX (bbox), 6); + gtk_box_pack_start (GTK_BOX (wvbox), bbox, TRUE, FALSE, 0); + + if (pinentry->cancel) + { + msg = pinentry_utf8_validate (pinentry->cancel); + w = gtk_button_new_with_label (msg); + g_free (msg); + } + else + w = gtk_button_new_from_stock (GTK_STOCK_CANCEL); + gtk_container_add (GTK_CONTAINER (bbox), w); + g_signal_connect (G_OBJECT (w), "clicked", + G_CALLBACK (confirm_mode ? confirm_button_clicked + : button_clicked), NULL); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + + if (pinentry->ok) + { + msg = pinentry_utf8_validate (pinentry->ok); + w = gtk_button_new_with_label (msg); + g_free (msg); + } + else + w = gtk_button_new_from_stock (GTK_STOCK_OK); + gtk_container_add (GTK_CONTAINER(bbox), w); + if (!confirm_mode) + { + g_signal_connect (G_OBJECT (w), "clicked", + G_CALLBACK (button_clicked), "ok"); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + gtk_widget_grab_default (w); + g_signal_connect_object (G_OBJECT (entry), "focus_in_event", + G_CALLBACK (gtk_widget_grab_default), + G_OBJECT (w), 0); + } + else + { + g_signal_connect (G_OBJECT (w), "clicked", + G_CALLBACK(confirm_button_clicked), "ok"); + GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT); + } + + gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_CENTER); + + gtk_widget_show_all(win); + + return win; +} + + +static int +gtk_cmd_handler (pinentry_t pe) +{ + GtkWidget *w; + int want_pass = !!pe->pin; + + pinentry = pe; + confirm_yes = 0; + passphrase_ok = 0; + w = create_window (want_pass ? 0 : 1); + gtk_main (); + gtk_widget_destroy (w); + while (gtk_events_pending ()) + gtk_main_iteration (); + + pinentry = NULL; + if (want_pass) + { + if (passphrase_ok && pe->pin) + return strlen (pe->pin); + else + return -1; + } + else + return confirm_yes; +} + + +pinentry_cmd_handler_t pinentry_cmd_handler = gtk_cmd_handler; + + +int +main (int argc, char *argv[]) +{ + pinentry_init (PGMNAME); + +#ifdef FALLBACK_CURSES + if (pinentry_have_display (argc, argv)) + gtk_init (&argc, &argv); + else + pinentry_cmd_handler = curses_cmd_handler; +#else + gtk_init (&argc, &argv); +#endif + + /* Consumes all arguments. */ + if (pinentry_parse_opts (argc, argv)) + { + printf(PGMNAME " " VERSION "\n"); + exit(EXIT_SUCCESS); + } + + if (pinentry_loop ()) + return 1; + + return 0; +} diff -urpP pinentry-0.7.1/install-sh pinentry-0.7.2/install-sh --- pinentry-0.7.1/install-sh 2003-12-09 10:06:55.000000000 +0000 +++ pinentry-0.7.2/install-sh 2004-12-22 11:08:36.000000000 +0000 @@ -1,7 +1,8 @@ #!/bin/sh -# # install - install a program, script, or datafile -# + +scriptversion=2004-10-22.00 + # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. @@ -41,13 +42,11 @@ # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. - # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" - # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" @@ -59,236 +58,266 @@ stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -transformbasename="" -transform_arg="" -instcmd="$mvprog" chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" +chowncmd= +chgrpcmd= +stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "$0: no input file specified" >&2 - exit 1 -else - : -fi +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit 0;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "$0: $src does not exist" >&2 - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "$0: no destination specified" >&2 - exit 1 - else - : - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d "$dst" ] - then - dst=$dst/`basename "$src"` - else - : - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-$defaultIFS}" - -oIFS=$IFS -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS=$oIFS - -pathcomp='' + -t) dstarg=$2 + shift + shift + continue;; -while [ $# -ne 0 ] ; do - pathcomp=$pathcomp$1 + -T) no_target_directory=true shift + continue;; - if [ ! -d "$pathcomp" ] ; - then - $mkdirprog "$pathcomp" - else - : - fi + --version) echo "$0 $scriptversion"; exit 0;; - pathcomp=$pathcomp/ + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd "$dst" && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi -else - -# If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] - then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename "$dst"` - else - : - fi - -# Make a couple of temp file names in the proper directory. - - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - -# Trap to clean up temp files at exit. - - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 - -# Move or copy the file name to the temp name - - $doit $instcmd "$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 $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && - -# Now remove or move aside any old file at destination location. We try this -# two ways since rm can't unlink itself on some systems and the destination -# file might be busy for other reasons. In this case, the final cleanup -# might fail but the new file should still install successfully. - -{ - if [ -f "$dstdir/$dstfile" ] - then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || - $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || - { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi -} && - -# Now rename the file to the real destination. +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac -fi && + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit; } +done # The final little trick to "correctly" pass the exit status to the exit trap. - { - (exit 0); exit + (exit 0); exit } + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -urpP pinentry-0.7.1/m4/curses.m4 pinentry-0.7.2/m4/curses.m4 --- pinentry-0.7.1/m4/curses.m4 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/m4/curses.m4 2004-09-27 20:27:51.000000000 +0000 @@ -0,0 +1,126 @@ +dnl IU_LIB_NCURSES, IU_LIB_CURSES and IU_LIB_TERMCAP are: +dnl Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +dnl Written by Miles Bader +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +dnl + +dnl IU_LIB_NCURSES -- check for, and configure, ncurses +dnl +dnl If libncurses is found to exist on this system and the --disable-ncurses +dnl flag wasn't specified, defines LIBNCURSES with the appropriate linker +dnl specification, and possibly defines NCURSES_INCLUDE with the appropriate +dnl -I flag to get access to ncurses include files. +dnl +AC_DEFUN([IU_LIB_NCURSES], [ + AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't prefer -lncurses over -lcurses], + , enable_ncurses=yes) + if test "$enable_ncurses" = yes; then + AC_CHECK_LIB(ncurses, initscr, LIBNCURSES="-lncurses") + if test "$LIBNCURSES"; then + # Use ncurses header files instead of the ordinary ones, if possible; + # is there a better way of doing this, that avoids looking in specific + # directories? + AC_ARG_WITH(ncurses-include-dir, +[ --with-ncurses-include-dir=DIR + Set directory containing the include files for + use with -lncurses, when it isn't installed as + the default curses library. If DIR is "none", + then no special ncurses include files are used. + --without-ncurses-include-dir + Equivalent to --with-ncurses-include-dir=none])dnl + if test "${with_ncurses_include_dir+set}" = set; then + AC_MSG_CHECKING(for ncurses include dir) + case "$with_ncurses_include_dir" in + no|none) + inetutils_cv_includedir_ncurses=none;; + *) + inetutils_cv_includedir_ncurses="$with_ncurses_include_dir";; + esac + AC_MSG_RESULT($inetutils_cv_includedir_ncurses) + else + AC_CACHE_CHECK(for ncurses include dir, + inetutils_cv_includedir_ncurses, + for D in $includedir $prefix/include /local/include /usr/local/include /include /usr/include; do + if test -d $D/ncurses; then + inetutils_cv_includedir_ncurses="$D/ncurses" + break + fi + test "$inetutils_cv_includedir_ncurses" \ + || inetutils_cv_includedir_ncurses=none + done) + fi + if test "$inetutils_cv_includedir_ncurses" = none; then + NCURSES_INCLUDE="" + else + NCURSES_INCLUDE="-I$inetutils_cv_includedir_ncurses" + fi + fi + fi + AC_SUBST(NCURSES_INCLUDE) + AC_SUBST(LIBNCURSES)])dnl + +dnl IU_LIB_TERMCAP -- check for various termcap libraries +dnl +dnl Checks for various common libraries implementing the termcap interface, +dnl including ncurses (unless --disable ncurses is specified), curses (which +dnl does on some systems), termcap, and termlib. If termcap is found, then +dnl LIBTERMCAP is defined with the appropriate linker specification. +dnl +AC_DEFUN([IU_LIB_TERMCAP], [ + AC_REQUIRE([IU_LIB_NCURSES]) + if test "$LIBNCURSES"; then + LIBTERMCAP="$LIBNCURSES" + else + AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses) + if test "$ac_cv_lib_curses_tgetent" = no; then + AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap) + fi + if test "$ac_cv_lib_termcap_tgetent" = no; then + AC_CHECK_LIB(termlib, tgetent, LIBTERMCAP=-ltermlib) + fi + fi + AC_SUBST(LIBTERMCAP)])dnl + +dnl IU_LIB_CURSES -- checke for curses, and associated libraries +dnl +dnl Checks for varions libraries implementing the curses interface, and if +dnl found, defines LIBCURSES to be the appropriate linker specification, +dnl *including* any termcap libraries if needed (some versions of curses +dnl don't need termcap). +dnl +AC_DEFUN([IU_LIB_CURSES], [ + AC_REQUIRE([IU_LIB_TERMCAP]) + AC_REQUIRE([IU_LIB_NCURSES]) + if test "$LIBNCURSES"; then + LIBCURSES="$LIBNCURSES" # ncurses doesn't require termcap + else + _IU_SAVE_LIBS="$LIBS" + LIBS="$LIBTERMCAP" + AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses") + if test "$LIBCURSES" -a "$LIBTERMCAP" -a "$LIBCURSES" != "$LIBTERMCAP"; then + AC_CACHE_CHECK(whether curses needs $LIBTERMCAP, + inetutils_cv_curses_needs_termcap, + LIBS="$LIBCURSES" + AC_TRY_LINK([#include ], [initscr ();], + [inetutils_cv_curses_needs_termcap=no], + [inetutils_cv_curses_needs_termcap=yes])) + if test $inetutils_cv_curses_needs_termcap = yes; then + LIBCURSES="$LIBCURSES $LIBTERMCAP" + fi + fi + LIBS="$_IU_SAVE_LIBS" + fi + AC_SUBST(LIBCURSES)])dnl diff -urpP pinentry-0.7.1/m4/glib.m4 pinentry-0.7.2/m4/glib.m4 --- pinentry-0.7.1/m4/glib.m4 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/m4/glib.m4 2004-12-22 11:11:22.000000000 +0000 @@ -0,0 +1,196 @@ +# Configure paths for GLIB +# Owen Taylor 97-11-3 + +dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or +dnl gthread is specified in MODULES, pass to glib-config +dnl +AC_DEFUN([AM_PATH_GLIB], +[dnl +dnl Get the cflags and libraries from the glib-config script +dnl +AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], + glib_config_prefix="$withval", glib_config_prefix="") +AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], + glib_config_exec_prefix="$withval", glib_config_exec_prefix="") +AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], + , enable_glibtest=yes) + + if test x$glib_config_exec_prefix != x ; then + glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config + fi + fi + if test x$glib_config_prefix != x ; then + glib_config_args="$glib_config_args --prefix=$glib_config_prefix" + if test x${GLIB_CONFIG+set} != xset ; then + GLIB_CONFIG=$glib_config_prefix/bin/glib-config + fi + fi + + for module in . $4 + do + case "$module" in + gmodule) + glib_config_args="$glib_config_args gmodule" + ;; + gthread) + glib_config_args="$glib_config_args gthread" + ;; + esac + done + + AC_PATH_PROG(GLIB_CONFIG, glib-config, no) + min_glib_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) + no_glib="" + if test "$GLIB_CONFIG" = "no" ; then + no_glib=yes + else + GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` + GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` + glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_glibtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$GLIB_LIBS $LIBS" +dnl +dnl Now check if the installed GLIB is sufficiently new. (Also sanity +dnl checks the results of glib-config to some extent +dnl + rm -f conf.glibtest + AC_TRY_RUN([ +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.glibtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_glib_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_glib_version"); + exit(1); + } + + if ((glib_major_version != $glib_config_major_version) || + (glib_minor_version != $glib_config_minor_version) || + (glib_micro_version != $glib_config_micro_version)) + { + printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, + glib_major_version, glib_minor_version, glib_micro_version); + printf ("*** was found! If glib-config was correct, then it is best\n"); + printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); + printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } + else if ((glib_major_version != GLIB_MAJOR_VERSION) || + (glib_minor_version != GLIB_MINOR_VERSION) || + (glib_micro_version != GLIB_MICRO_VERSION)) + { + printf("*** GLIB header files (version %d.%d.%d) do not match\n", + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + glib_major_version, glib_minor_version, glib_micro_version); + } + else + { + if ((glib_major_version > major) || + ((glib_major_version == major) && (glib_minor_version > minor)) || + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", + glib_major_version, glib_minor_version, glib_micro_version); + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the glib-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); + printf("*** correct copy of glib-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_glib" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GLIB_CONFIG" = "no" ; then + echo "*** The glib-config script installed by GLIB could not be found" + echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GLIB_CONFIG environment variable to the" + echo "*** full path to glib-config." + else + if test -f conf.glibtest ; then + : + else + echo "*** Could not run GLIB test program, checking why..." + CFLAGS="$CFLAGS $GLIB_CFLAGS" + LIBS="$LIBS $GLIB_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GLIB or finding the wrong" + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GLIB was incorrectly installed" + echo "*** or that you have moved GLIB since it was installed. In the latter case, you" + echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GLIB_CFLAGS="" + GLIB_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + rm -f conf.glibtest +]) diff -urpP pinentry-0.7.1/m4/gtk.m4 pinentry-0.7.2/m4/gtk.m4 --- pinentry-0.7.1/m4/gtk.m4 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/m4/gtk.m4 2004-12-22 11:11:09.000000000 +0000 @@ -0,0 +1,194 @@ +# Configure paths for GTK+ +# Owen Taylor 97-11-3 + +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN([AM_PATH_GTK], +[dnl +dnl Get the cflags and libraries from the gtk-config script +dnl +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], + , enable_gtktest=yes) + + for module in . $4 + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" +dnl +dnl Now check if the installed GTK is sufficiently new. (Also sanity +dnl checks the results of gtk-config to some extent +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include +#include +#include + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) diff -urpP pinentry-0.7.1/m4/iconv.m4 pinentry-0.7.2/m4/iconv.m4 --- pinentry-0.7.1/m4/iconv.m4 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/m4/iconv.m4 2004-09-27 20:27:51.000000000 +0000 @@ -0,0 +1,103 @@ +# iconv.m4 serial AM4 (gettext-0.11.3) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include +#include ], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) +]) + +AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi +]) diff -urpP pinentry-0.7.1/m4/qt.m4 pinentry-0.7.2/m4/qt.m4 --- pinentry-0.7.1/m4/qt.m4 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/m4/qt.m4 2004-12-22 11:10:33.000000000 +0000 @@ -0,0 +1,706 @@ +## -*- autoconf -*- + + +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) +dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) +dnl (C) 2002 g10 Code GmbH +dnl Modified for PINENTRY by Marcus Brinkmann. +dnl +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +dnl Boston, MA 02111-1307, USA. + +dnl ------------------------------------------------------------------------ +dnl Find a file (or one of more files in a list of dirs) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([QT_FIND_FILE], +[ +$3=NO +for i in $2; +do + for j in $1; + do + echo "configure: __oline__: $i/$j" >&AS_MESSAGE_LOG_FD + if test -r "$i/$j"; then + echo "taking that" >&AS_MESSAGE_LOG_FD + $3=$i + break 2 + fi + done +done +]) + +dnl ------------------------------------------------------------------------ +dnl Find the meta object compiler in the PATH, +dnl in $QTDIR/bin, and some more usual places +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([QT_PATH_MOC], +[ + qt_bindirs="" + for dir in $qt_dirs; do + qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc" + done + qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin" + if test ! "$ac_qt_bindir" = "NO"; then + qt_bindirs="$ac_qt_bindir:$qt_bindirs" + fi + + AC_PATH_PROG(MOC, moc, no, [$qt_bindirs]) + if test "$MOC" = no; then + #AC_MSG_ERROR([No Qt meta object compiler (moc) found! + #Please check whether you installed Qt correctly. + #You need to have a running moc binary. + #configure tried to run $ac_cv_path_moc and the test didn't + #succeed. If configure shouldn't have tried this one, set + #the environment variable MOC to the right one before running + #configure. + #]) + have_moc="no" + else + have_moc="yes" + AC_SUBST(MOC) + fi +]) + + +dnl ------------------------------------------------------------------------ +dnl Find the header files and libraries for the X Window System. +dnl Extended the macro AC_PATH_XTRA. +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([QT_PATH_X], +[ +AC_ARG_ENABLE( + embedded, + [ --enable-embedded link to Qt-embedded, don't use X], + qt_use_emb=$enableval, + qt_use_emb=no +) + +AC_ARG_ENABLE( + palmtop, + [ --enable-palmtop link to Qt-embedded, don't use X, link to the Qt Palmtop Environment], + qt_use_emb_palm=$enableval, + qt_use_emb_palm=no +) + +if test "$qt_use_emb" = "no"; then + AC_PATH_X + AC_PATH_XTRA + if test "$no_x" = yes; then + AC_MSG_ERROR([Can't find X. Please check your installation and add the correct paths!]) + fi + QT_CXXFLAGS="$X_CFLAGS" + QT_LDFLAGS="$X_LIBS" + QT_LIBS="$X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS" + QTE_NORTTI="" +else + dnl We're using QT Embedded + QT_CXXFLAGS="-fno-rtti -DQWS" + QT_LDFLAGS="-DQWS" + QT_LIBS="" + QTE_NORTTI="-fno-rtti -DQWS" +fi +AC_SUBST(QT_CXXFLAGS) +AC_SUBST(QT_LDFLAGS) +AC_SUBST(QT_LIBS) +AC_SUBST(QTE_NORTTI) +]) + +AC_DEFUN([QT_PRINT_PROGRAM], +[ +AC_REQUIRE([QT_CHECK_VERSION]) +cat > conftest.$ac_ext < +#include +EOF +if test "$qt_ver" = "2"; then +cat >> conftest.$ac_ext < +#include +#include +EOF + +if test $qt_subver -gt 0; then +cat >> conftest.$ac_ext < +EOF +fi +fi + +if test "$qt_ver" = "3"; then +cat >> conftest.$ac_ext < +#include +#include +EOF +fi + +echo "#if ! ($qt_verstring)" >> conftest.$ac_ext +cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext < /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AS_MESSAGE_LOG_FD; fi + done +fi + +ac_qt_libraries="$qt_libdir" + +AC_LANG_PUSH(C++) + +ac_cxxflags_safe="$CXXFLAGS" +ac_ldflags_safe="$LDFLAGS" +ac_libs_safe="$LIBS" + +CXXFLAGS="$CXXFLAGS -I$qt_incdir $QT_CXXFLAGS" +LDFLAGS="$LDFLAGS -L$qt_libdir $QT_LDFLAGS" +LIBS="$LIBS $QT_LIBS" + +QT_PRINT_PROGRAM + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* +else + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD + ac_qt_libraries="NO" +fi +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +AC_LANG_POP(C++) +if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then + ac_cv_have_qt="have_qt=no" + ac_qt_notfound="" + missing_qt_mt="" + if test "$ac_qt_includes" = NO; then + if test "$ac_qt_libraries" = NO; then + ac_qt_notfound="(headers and libraries)"; + else + ac_qt_notfound="(headers)"; + fi + else + if test "x$qt_use_mt" = "xyes"; then + missing_qt_mt=" +Make sure that you have compiled Qt with thread support!" + ac_qt_notfound="(library $qtlib-mt)"; + else + ac_qt_notfound="(library $qtlib)"; + fi + fi + + #AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation! + #For more details about this problem, look at the end of config.log.$missing_qt_mt]) + have_qt="no" +else + have_qt="yes" +fi +]) + +eval "$ac_cv_have_qt" + +if test "$have_qt" != yes; then + AC_MSG_RESULT([$have_qt]); +else + ac_cv_have_qt="have_qt=yes \ + ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" + AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) + + qt_libraries="$ac_qt_libraries" + qt_includes="$ac_qt_includes" +fi + +AC_SUBST(qt_libraries) +AC_SUBST(qt_includes) + +if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then + QT_INCLUDES="" +else + QT_INCLUDES="-I$qt_includes" +fi + +if test "$qt_libraries" != "$x_libraries" && test -n "$qt_libraries"; then + QT_LDFLAGS="$QT_LDFLAGS -L$qt_libraries" +fi +test -z "$QT_MT_LDFLAGS" || QT_LDFLAGS="$QT_LDFLAGS $QT_MT_LDFLAGS" + +AC_SUBST(QT_INCLUDES) +QT_PATH_MOC + + +AC_SUBST(LIB_QPE) +]) + +AC_DEFUN([QT_PATH], +[ +QT_PATH_1_3 +QT_CHECK_RPATH +]) + + +AC_DEFUN([QT_CHECK_COMPILER_FLAG], +[ +AC_MSG_CHECKING(whether $CXX supports -$1) +kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` +AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, +[ + AC_LANG_PUSH(C++) + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -$1" + AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) + CXXFLAGS="$save_CXXFLAGS" + AC_LANG_POP(C++) +]) +if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + +dnl QT_REMOVE_FORBIDDEN removes forbidden arguments from variables +dnl use: QT_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) +dnl it's all white-space separated +AC_DEFUN([QT_REMOVE_FORBIDDEN], +[ __val=$$1 + __forbid=" $2 " + if test -n "$__val"; then + __new="" + ac_save_IFS=$IFS + IFS=" " + for i in $__val; do + case "$__forbid" in + *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; + *) # Careful to not add spaces, where there were none, because otherwise + # libtool gets confused, if we change e.g. CXX + if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; + esac + done + IFS=$ac_save_IFS + $1=$__new + fi +]) + +dnl QT_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given +AC_DEFUN([QT_VALIDIFY_CXXFLAGS], +[dnl +if test "x$qt_use_emb" != "xyes"; then + QT_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) + QT_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) +else + QT_REMOVE_FORBIDDEN(CXX, [-rpath]) + QT_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) +fi +]) + +AC_DEFUN([QT_CHECK_COMPILERS], +[ + AC_PROG_CXX + + QT_CHECK_COMPILER_FLAG(fexceptions,[QT_CXXFLAGS="$QT_CXXFLAGS -fexceptions"]) + + case "$host" in + *-*-irix*) test "$GXX" = yes && QT_CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $QT_CXXFLAGS" ;; + *-*-sysv4.2uw*) QT_CXXFLAGS="-D_UNIXWARE $QT_CXXFLAGS";; + *-*-sysv5uw7*) QT_CXXFLAGS="-D_UNIXWARE7 $QT_CXXFLAGS";; + *-*-solaris*) + if test "$GXX" = yes; then + libstdcpp=`$CXX -print-file-name=libstdc++.so` + if test ! -f $libstdcpp; then + AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with the Qt pinentry. Please recompile gcc with --enable-shared to receive a libstdc++.so]) + fi + fi + ;; + esac + + QT_VALIDIFY_CXXFLAGS + + AC_PROG_CXXCPP +]) + +AC_DEFUN([QT_CHECK_RPATH], +[ +AC_MSG_CHECKING(for rpath) +AC_ARG_ENABLE(rpath, + [ --disable-rpath do not use the rpath feature of ld], + USE_RPATH=$enableval, USE_RPATH=yes) + +if test -z "$QT_RPATH" && test "$USE_RPATH" = "yes"; then + + QT_RPATH="" + if test -n "$qt_libraries"; then + QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(qt_libraries)" + fi + dnl $x_libraries is set to /usr/lib in case + if test -n "$X_LIBS"; then + QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(x_libraries)" + fi +fi +AC_SUBST(x_libraries) +AC_SUBST(QT_RPATH) +AC_MSG_RESULT($USE_RPATH) +]) + + +AC_DEFUN([QT_CHECK_LIBPTHREAD], +[ +AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] ) +AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([QT_CHECK_PTHREAD_OPTION], +[ + AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.], + kde_use_kernthreads=$enableval, kde_use_kernthreads=no) + + if test "$kde_use_kernthreads" = "yes"; then + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_CFLAGS="$CXXFLAGS" + CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS" + CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS" + AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h) + CXXFLAGS="$ac_save_CXXFLAGS" + CFLAGS="$ac_save_CFLAGS" + if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then + kde_use_kernthreads=no + else + dnl Add proper -I and -l statements + AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD + if test "x$LIBPTHREAD" = "x"; then + kde_use_kernthreads=no + else + USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads" + fi + fi + else + USE_THREADS="" + if test -z "$LIBPTHREAD"; then + QT_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] ) + fi + fi + + case $host_os in + solaris*) + QT_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) + QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" + ;; + freebsd*) + QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" + ;; + aix*) + QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" + LIBPTHREAD="$LIBPTHREAD -lc_r" + ;; + linux*) QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT" + if test "$CXX" = "KCC"; then + QT_CXXFLAGS="$QT_CXXFLAGS --thread_safe" + fi + ;; + *) + ;; + esac + AC_SUBST(USE_THREADS) + AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([QT_CHECK_THREADING], +[ + AC_REQUIRE([QT_CHECK_LIBPTHREAD]) + AC_REQUIRE([QT_CHECK_PTHREAD_OPTION]) + dnl default is yes if libpthread is found and no if no libpthread is available + if test -z "$LIBPTHREAD"; then + if test -z "$USE_THREADS"; then + kde_check_threading_default=no + else + kde_check_threading_default=yes + fi + else + kde_check_threading_default=yes + fi + AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ], + qt_use_threading=$enableval, qt_use_threading=$kde_check_threading_default) + if test "x$qt_use_threading" = "xyes"; then + AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) + fi +]) diff -urpP pinentry-0.7.1/missing pinentry-0.7.2/missing --- pinentry-0.7.1/missing 2003-12-09 10:06:55.000000000 +0000 +++ pinentry-0.7.2/missing 2004-12-22 11:08:36.000000000 +0000 @@ -1,6 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. + +scriptversion=2004-09-07.08 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 +# Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -38,18 +42,24 @@ else configure_ac=configure.in fi +msg="missing on your system" + case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in -h|--h|--he|--hel|--help) echo "\ @@ -74,11 +84,15 @@ Supported PROGRAM values: 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]" + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing 0.4 - GNU automake" + echo "missing $scriptversion (GNU Automake)" + exit 0 ;; -*) @@ -87,14 +101,44 @@ Supported PROGRAM values: exit 1 ;; - aclocal*) +esac + +# 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). +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 "$1" in + aclocal*) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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." @@ -102,13 +146,8 @@ WARNING: \`$1' is missing on your system ;; autoconf) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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." @@ -116,13 +155,8 @@ WARNING: \`$1' is missing on your system ;; autoheader) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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." @@ -140,13 +174,8 @@ WARNING: \`$1' is missing on your system ;; automake*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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." @@ -156,16 +185,11 @@ WARNING: \`$1' is missing on your system ;; autom4te) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the +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 \`$1Help2man' as part of \`Autoconf' from any GNU + You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` @@ -185,7 +209,7 @@ WARNING: \`$1' is needed, and you do not bison|yacc) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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." @@ -215,7 +239,7 @@ WARNING: \`$1' is missing on your system lex|flex) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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." @@ -237,13 +261,8 @@ WARNING: \`$1' is missing on your system ;; help2man) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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." @@ -262,13 +281,8 @@ WARNING: \`$1' is missing on your system ;; makeinfo) - if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then - # We have makeinfo, but it failed. - exit 1 - fi - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +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, @@ -284,10 +298,6 @@ WARNING: \`$1' is missing on your system tar) shift - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error @@ -323,10 +333,10 @@ WARNING: I can't seem to be able to run *) echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the +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 prerequirements for installing + 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 @@ -334,3 +344,10 @@ WARNING: \`$1' is needed, and you do not esac exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -urpP pinentry-0.7.1/mkinstalldirs pinentry-0.7.2/mkinstalldirs --- pinentry-0.7.1/mkinstalldirs 2003-12-09 10:06:55.000000000 +0000 +++ pinentry-0.7.2/mkinstalldirs 2004-12-22 11:08:38.000000000 +0000 @@ -1,20 +1,32 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman + +scriptversion=2004-02-15.20 + +# Original author: Noah Friedman # Created: 1993-05-16 -# Public domain +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . errstatus=0 dirmode="" usage="\ -Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help - echo "$usage" 1>&2 + echo "$usage" exit 0 ;; -m) # -m PERM arg @@ -23,6 +35,10 @@ while test $# -gt 0 ; do dirmode=$1 shift ;; + --version) + echo "$0 $scriptversion" + exit 0 + ;; --) # stop option processing shift break @@ -50,17 +66,37 @@ case $# in 0) exit 0 ;; esac +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') - if mkdir -p -- . 2>/dev/null; then + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version fi ;; *) - if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done fi ;; esac @@ -84,17 +120,17 @@ do mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then - errstatus=$lasterr + errstatus=$lasterr else - if test ! -z "$dirmode"; then + if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi fi fi @@ -107,5 +143,8 @@ exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" # End: -# mkinstalldirs ends here diff -urpP pinentry-0.7.1/pinentry/Makefile.in pinentry-0.7.2/pinentry/Makefile.in --- pinentry-0.7.1/pinentry/Makefile.in 2004-04-21 19:33:55.000000000 +0000 +++ pinentry-0.7.2/pinentry/Makefile.in 2005-01-27 08:11:58.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -33,6 +33,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +SOURCES = $(libpinentry_curses_a_SOURCES) $(libpinentry_a_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -40,7 +42,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -54,7 +55,44 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +subdir = pinentry +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +libpinentry_curses_a_AR = $(AR) $(ARFLAGS) +libpinentry_curses_a_LIBADD = +am_libpinentry_curses_a_OBJECTS = pinentry-curses.$(OBJEXT) +libpinentry_curses_a_OBJECTS = $(am_libpinentry_curses_a_OBJECTS) +libpinentry_a_AR = $(AR) $(ARFLAGS) +libpinentry_a_LIBADD = +am_libpinentry_a_OBJECTS = pinentry.$(OBJEXT) +libpinentry_a_OBJECTS = $(am_libpinentry_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libpinentry_curses_a_SOURCES) $(libpinentry_a_SOURCES) +DIST_SOURCES = $(libpinentry_curses_a_SOURCES) \ + $(libpinentry_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -67,10 +105,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -93,9 +135,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,6 +158,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -125,6 +175,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -140,6 +192,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -148,6 +201,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -155,6 +209,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -175,6 +231,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -185,58 +242,46 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - EXTRA_DIST = Manifest @BUILD_LIBPINENTRY_CURSES_FALSE@pinentry_curses = - @BUILD_LIBPINENTRY_CURSES_TRUE@pinentry_curses = libpinentry-curses.a - noinst_LIBRARIES = libpinentry.a $(pinentry_curses) - AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem - libpinentry_a_SOURCES = pinentry.h pinentry.c libpinentry_curses_a_SOURCES = pinentry-curses.h pinentry-curses.c -subdir = pinentry -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - -libpinentry_curses_a_AR = $(AR) cru -libpinentry_curses_a_LIBADD = -am_libpinentry_curses_a_OBJECTS = pinentry-curses.$(OBJEXT) -libpinentry_curses_a_OBJECTS = $(am_libpinentry_curses_a_OBJECTS) -libpinentry_a_AR = $(AR) cru -libpinentry_a_LIBADD = -am_libpinentry_a_OBJECTS = pinentry.$(OBJEXT) -libpinentry_a_OBJECTS = $(am_libpinentry_a_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/pinentry-curses.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/pinentry.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libpinentry_curses_a_SOURCES) $(libpinentry_a_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libpinentry_curses_a_SOURCES) $(libpinentry_a_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pinentry/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu pinentry/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -AR = ar +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -250,7 +295,7 @@ libpinentry.a: $(libpinentry_a_OBJECTS) $(RANLIB) libpinentry.a mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -259,36 +304,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pinentry.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -297,6 +326,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -308,10 +338,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -334,10 +365,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -351,7 +378,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -369,7 +396,6 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) - installdirs: install: install-am install-exec: install-exec-am @@ -390,7 +416,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -409,6 +435,8 @@ dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -444,13 +472,14 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -urpP pinentry-0.7.1/pinentry/pinentry.c pinentry-0.7.2/pinentry/pinentry.c --- pinentry-0.7.1/pinentry/pinentry.c 2003-12-22 18:28:07.000000000 +0000 +++ pinentry-0.7.2/pinentry/pinentry.c 2004-12-22 11:37:50.000000000 +0000 @@ -28,10 +28,15 @@ #include #include #include -#include +#ifdef HAVE_LANGINFO_H #include +#endif #include +#if defined FALLBACK_CURSES || defined PINENTRY_CURSES || defined PINENTRY_GTK +#include +#endif + #include "assuan.h" #include "memory.h" #include "secmem-util.h" @@ -65,11 +70,13 @@ struct pinentry pinentry = }; + +#if defined FALLBACK_CURSES || defined PINENTRY_CURSES || defined PINENTRY_GTK char * pinentry_utf8_to_local (char *lc_ctype, char *text) { iconv_t cd; - char *input = text; + const char *input = text; size_t input_len = strlen (text) + 1; char *output; size_t output_len; @@ -132,7 +139,7 @@ pinentry_local_to_utf8 (char *lc_ctype, char *old_ctype; char *source_encoding; iconv_t cd; - char *input = text; + const char *input = text; size_t input_len = strlen (text) + 1; char *output; size_t output_len; @@ -192,6 +199,7 @@ pinentry_local_to_utf8 (char *lc_ctype, } return output_buf; } +#endif /* Try to make room for at least LEN bytes in the pinentry. Returns new buffer on success and 0 on failure or when the old buffer is @@ -260,7 +268,7 @@ pinentry_have_display (int argc, char ** static void usage (void) { - fprintf (stderr, "Usage: %s [OPTION]...\n" + fprintf (stdout, "Usage: %s [OPTION]...\n" "Ask securely for a secret and print it to stdout.\n" "\n" " --display DISPLAY Set the X display\n" @@ -670,8 +678,10 @@ pinentry_loop (void) ASSUAN_CONTEXT ctx; /* Extra check to make sure we have dropped privs. */ +#ifndef HAVE_DOSISH_SYSTEM if (getuid() != geteuid()) abort (); +#endif /* For now we use a simple pipe based server so that we can work from scripts. We will later add options to run as a daemon and diff -urpP pinentry-0.7.1/pinentry/pinentry.h pinentry-0.7.2/pinentry/pinentry.h --- pinentry-0.7.1/pinentry/pinentry.h 2003-12-22 15:34:46.000000000 +0000 +++ pinentry-0.7.2/pinentry/pinentry.h 2004-12-22 11:41:31.000000000 +0000 @@ -23,8 +23,12 @@ #ifdef __cplusplus extern "C" { +#if 0 +} +#endif #endif + struct pinentry { /* The description to display, or NULL. */ @@ -119,10 +123,23 @@ int pinentry_parse_opts (int argc, char /* The caller must define this variable to process assuan commands. */ extern pinentry_cmd_handler_t pinentry_cmd_handler; + + + + +#ifdef HAVE_W32_SYSTEM +/* Windows declares sleep as obsolete, but provides a definition for + _sleep but non for the still existing sleep. */ +#define sleep(a) _sleep ((a)) +#endif /*HAVE_W32_SYSTEM*/ + + + +#if 0 +{ +#endif #ifdef __cplusplus } #endif #endif /* PINENTRY_H */ - - diff -urpP pinentry-0.7.1/qt/Makefile.am pinentry-0.7.2/qt/Makefile.am --- pinentry-0.7.1/qt/Makefile.am 2004-04-20 05:04:46.000000000 +0000 +++ pinentry-0.7.2/qt/Makefile.am 2004-09-21 18:58:02.000000000 +0000 @@ -24,7 +24,7 @@ EXTRA_DIST = Manifest README.SecQ bin_PROGRAMS = pinentry-qt if FALLBACK_CURSES -ncurses_include = -I$(top_srcdir)/pinentry $(NCURSES_INCLUDE) +ncurses_include = $(NCURSES_INCLUDE) libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) else ncurses_include = @@ -32,12 +32,13 @@ libcurses = endif -AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem $(QT_INCLUDES) $(ncurses_include) +AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem $(QT_INCLUDES) $(ncurses_include) \ + -I$(top_srcdir)/pinentry AM_CXXFLAGS = $(QT_CXXFLAGS) pinentry_qt_LDADD = $(QT_LIBS) $(libcurses) ../pinentry/libpinentry.a \ $(top_builddir)/assuan/libassuan.a \ $(top_builddir)/secmem/libsecmem.a $(LIBCAP) -pinentry_qt_LDFLAGS = $(QT_LDFLAGS) +pinentry_qt_LDFLAGS = $(QT_LDFLAGS) $(QT_RPATH) pinentry_qt_SOURCES = secqstring.h secqstring.cpp \ secqinternal_p.h secqinternal.cpp \ diff -urpP pinentry-0.7.1/qt/Makefile.in pinentry-0.7.2/qt/Makefile.in --- pinentry-0.7.1/qt/Makefile.in 2004-04-21 19:34:05.000000000 +0000 +++ pinentry-0.7.2/qt/Makefile.in 2005-01-27 08:11:58.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -33,6 +33,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +SOURCES = $(pinentry_qt_SOURCES) $(nodist_pinentry_qt_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -40,7 +42,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -54,7 +55,55 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +bin_PROGRAMS = pinentry-qt$(EXEEXT) +subdir = qt +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_pinentry_qt_OBJECTS = secqstring.$(OBJEXT) secqinternal.$(OBJEXT) \ + secqlineedit.$(OBJEXT) pinentrydialog.$(OBJEXT) main.$(OBJEXT) +nodist_pinentry_qt_OBJECTS = secqlineedit.moc.$(OBJEXT) \ + pinentrydialog.moc.$(OBJEXT) +pinentry_qt_OBJECTS = $(am_pinentry_qt_OBJECTS) \ + $(nodist_pinentry_qt_OBJECTS) +am__DEPENDENCIES_1 = +@FALLBACK_CURSES_TRUE@am__DEPENDENCIES_2 = \ +@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry-curses.a \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) \ +@FALLBACK_CURSES_TRUE@ $(am__DEPENDENCIES_1) +pinentry_qt_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + ../pinentry/libpinentry.a $(top_builddir)/assuan/libassuan.a \ + $(top_builddir)/secmem/libsecmem.a $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(pinentry_qt_SOURCES) $(nodist_pinentry_qt_SOURCES) +DIST_SOURCES = $(pinentry_qt_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -67,10 +116,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -93,9 +146,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,6 +169,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -125,6 +186,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -140,6 +203,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -148,6 +212,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -155,6 +220,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -175,6 +242,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -185,24 +253,20 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - EXTRA_DIST = Manifest README.SecQ - -bin_PROGRAMS = pinentry-qt @FALLBACK_CURSES_FALSE@ncurses_include = - -@FALLBACK_CURSES_TRUE@ncurses_include = -I$(top_srcdir)/pinentry $(NCURSES_INCLUDE) +@FALLBACK_CURSES_TRUE@ncurses_include = $(NCURSES_INCLUDE) @FALLBACK_CURSES_FALSE@libcurses = @FALLBACK_CURSES_TRUE@libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) +AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem $(QT_INCLUDES) $(ncurses_include) \ + -I$(top_srcdir)/pinentry -AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem $(QT_INCLUDES) $(ncurses_include) AM_CXXFLAGS = $(QT_CXXFLAGS) pinentry_qt_LDADD = $(QT_LIBS) $(libcurses) ../pinentry/libpinentry.a \ $(top_builddir)/assuan/libassuan.a \ $(top_builddir)/secmem/libsecmem.a $(LIBCAP) -pinentry_qt_LDFLAGS = $(QT_LDFLAGS) - +pinentry_qt_LDFLAGS = $(QT_LDFLAGS) $(QT_RPATH) pinentry_qt_SOURCES = secqstring.h secqstring.cpp \ secqinternal_p.h secqinternal.cpp \ secqlineedit.h secqlineedit.cpp \ @@ -212,75 +276,50 @@ pinentry_qt_SOURCES = secqstring.h secqs nodist_pinentry_qt_SOURCES = secqlineedit.moc.cpp \ pinentrydialog.moc.cpp - DISTCLEANFILES = $(nodist_pinentry_qt_SOURCES) -subdir = qt -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = pinentry-qt$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_pinentry_qt_OBJECTS = secqstring.$(OBJEXT) secqinternal.$(OBJEXT) \ - secqlineedit.$(OBJEXT) pinentrydialog.$(OBJEXT) main.$(OBJEXT) -nodist_pinentry_qt_OBJECTS = secqlineedit.moc.$(OBJEXT) \ - pinentrydialog.moc.$(OBJEXT) -pinentry_qt_OBJECTS = $(am_pinentry_qt_OBJECTS) \ - $(nodist_pinentry_qt_OBJECTS) -@FALLBACK_CURSES_TRUE@pinentry_qt_DEPENDENCIES = \ -@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry-curses.a \ -@FALLBACK_CURSES_TRUE@ ../pinentry/libpinentry.a \ -@FALLBACK_CURSES_TRUE@ $(top_builddir)/assuan/libassuan.a \ -@FALLBACK_CURSES_TRUE@ $(top_builddir)/secmem/libsecmem.a -@FALLBACK_CURSES_FALSE@pinentry_qt_DEPENDENCIES = \ -@FALLBACK_CURSES_FALSE@ ../pinentry/libpinentry.a \ -@FALLBACK_CURSES_FALSE@ $(top_builddir)/assuan/libassuan.a \ -@FALLBACK_CURSES_FALSE@ $(top_builddir)/secmem/libsecmem.a - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/main.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/pinentrydialog.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/pinentrydialog.moc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/secqinternal.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/secqlineedit.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/secqlineedit.moc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/secqstring.Po -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(pinentry_qt_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(pinentry_qt_SOURCES) $(nodist_pinentry_qt_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu qt/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu qt/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done @@ -288,8 +327,8 @@ uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @@ -299,7 +338,7 @@ pinentry-qt$(EXEEXT): $(pinentry_qt_OBJE $(CXXLINK) $(pinentry_qt_LDFLAGS) $(pinentry_qt_OBJECTS) $(pinentry_qt_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -313,36 +352,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secqstring.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -351,6 +374,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -362,10 +386,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -388,10 +413,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -405,7 +426,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -423,9 +444,10 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) - installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -445,7 +467,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @@ -465,6 +487,8 @@ dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -500,11 +524,11 @@ uninstall-am: uninstall-binPROGRAMS unin .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-binPROGRAMS install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am diff -urpP pinentry-0.7.1/secmem/Makefile.in pinentry-0.7.2/secmem/Makefile.in --- pinentry-0.7.1/secmem/Makefile.in 2004-04-21 19:33:53.000000000 +0000 +++ pinentry-0.7.2/secmem/Makefile.in 2005-01-27 08:11:59.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. +# Makefile.in generated by automake 1.9.4 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -33,6 +33,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +SOURCES = $(libsecmem_a_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -40,7 +42,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -54,7 +55,39 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ +subdir = secmem +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +libsecmem_a_AR = $(AR) $(ARFLAGS) +libsecmem_a_LIBADD = +am_libsecmem_a_OBJECTS = secmem.$(OBJEXT) util.$(OBJEXT) +libsecmem_a_OBJECTS = $(am_libsecmem_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libsecmem_a_SOURCES) +DIST_SOURCES = $(libsecmem_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ @@ -67,10 +100,14 @@ BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_ BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -93,9 +130,15 @@ FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,6 +153,8 @@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ LIBTERMCAP = @LIBTERMCAP@ LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ @@ -125,6 +170,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ QTE_NORTTI = @QTE_NORTTI@ QT_CXXFLAGS = @QT_CXXFLAGS@ QT_INCLUDES = @QT_INCLUDES@ @@ -140,6 +187,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_THREADS = @USE_THREADS@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ @@ -148,6 +196,7 @@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -155,6 +204,8 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TR am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -175,6 +226,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -185,11 +237,8 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ x_libraries = @x_libraries@ - EXTRA_DIST = Manifest - noinst_LIBRARIES = libsecmem.a - libsecmem_a_SOURCES = \ memory.h \ secmem-util.h \ @@ -197,41 +246,39 @@ libsecmem_a_SOURCES = \ secmem.c \ util.c -subdir = secmem -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - -libsecmem_a_AR = $(AR) cru -libsecmem_a_LIBADD = -am_libsecmem_a_OBJECTS = secmem.$(OBJEXT) util.$(OBJEXT) -libsecmem_a_OBJECTS = $(am_libsecmem_a_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/secmem.Po ./$(DEPDIR)/util.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libsecmem_a_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libsecmem_a_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu secmem/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu secmem/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -AR = ar +.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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -241,7 +288,7 @@ libsecmem.a: $(libsecmem_a_OBJECTS) $(li $(RANLIB) libsecmem.a mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -250,36 +297,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -288,6 +319,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -299,10 +331,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -325,10 +358,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -342,7 +371,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -360,7 +389,6 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) - installdirs: install: install-am install-exec: install-exec-am @@ -381,7 +409,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -400,6 +428,8 @@ dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -435,13 +465,14 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -urpP pinentry-0.7.1/secmem/util.c pinentry-0.7.2/secmem/util.c --- pinentry-0.7.1/secmem/util.c 2003-12-22 10:33:18.000000000 +0000 +++ pinentry-0.7.2/secmem/util.c 2004-12-22 11:38:10.000000000 +0000 @@ -41,8 +41,10 @@ __result; })) #endif +#ifndef HAVE_DOSISH_SYSTEM static int uid_set = 0; static uid_t real_uid, file_uid; +#endif /*!HAVE_DOSISH_SYSTEM*/ /* write DATA of size BYTES to FD, until all is written or an error occurs */ ssize_t xwrite(int fd, const void *data, size_t bytes) @@ -78,12 +80,14 @@ int debugmsg(const char *fmt, ...) #endif /* initialize uid variables */ +#ifndef HAVE_DOSISH_SYSTEM static void init_uids(void) { real_uid = getuid(); file_uid = geteuid(); uid_set = 1; } +#endif #if 0 /* Not used. */ @@ -121,6 +125,7 @@ void raise_privs() /* drop all additional privileges */ void drop_privs() { +#ifndef HAVE_DOSISH_SYSTEM if (!uid_set) init_uids(); if (real_uid != file_uid) { @@ -130,4 +135,5 @@ void drop_privs() } file_uid = real_uid; } +#endif } diff -urpP pinentry-0.7.1/w32/Makefile.am pinentry-0.7.2/w32/Makefile.am --- pinentry-0.7.1/w32/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/w32/Makefile.am 2004-12-22 14:26:59.000000000 +0000 @@ -0,0 +1,40 @@ +# Makefile.am - PIN entry W32 +# Copyright (C) 2004 g10 Code GmbH +# +# This file is part of PINENTRY. +# +# PINENTRY 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. +# +# PINENTRY 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 + +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = Manifest + +bin_PROGRAMS = pinentry-w32 + +AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem \ + -I$(top_srcdir)/pinentry + + + +pinentry_w32_SOURCES = main.c pinentry-w32.rc resource.h + +pinentry_w32_LDFLAGS = -mwindows -mconsole +pinentry_w32_LDADD = pinentry-w32.o \ + ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a + + +pinentry-w32.o: pinentry-w32.rc resource.h + $(WINDRES) -v -o $@ $< + diff -urpP pinentry-0.7.1/w32/Makefile.in pinentry-0.7.2/w32/Makefile.in --- pinentry-0.7.1/w32/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/w32/Makefile.in 2005-01-27 08:11:59.000000000 +0000 @@ -0,0 +1,504 @@ +# Makefile.in generated by automake 1.9.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - PIN entry W32 +# Copyright (C) 2004 g10 Code GmbH +# +# This file is part of PINENTRY. +# +# PINENTRY 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. +# +# PINENTRY 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 + +SOURCES = $(pinentry_w32_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = pinentry-w32$(EXEEXT) +subdir = w32 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/curses.m4 \ + $(top_srcdir)/m4/glib.m4 $(top_srcdir)/m4/gtk.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/qt.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_pinentry_w32_OBJECTS = main.$(OBJEXT) +pinentry_w32_OBJECTS = $(am_pinentry_w32_OBJECTS) +pinentry_w32_DEPENDENCIES = pinentry-w32.o ../pinentry/libpinentry.a \ + ../assuan/libassuan.a ../secmem/libsecmem.a +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(pinentry_w32_SOURCES) +DIST_SOURCES = $(pinentry_w32_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_LIBPINENTRY_CURSES_FALSE = @BUILD_LIBPINENTRY_CURSES_FALSE@ +BUILD_LIBPINENTRY_CURSES_TRUE = @BUILD_LIBPINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_CURSES_FALSE = @BUILD_PINENTRY_CURSES_FALSE@ +BUILD_PINENTRY_CURSES_TRUE = @BUILD_PINENTRY_CURSES_TRUE@ +BUILD_PINENTRY_GTK_2_FALSE = @BUILD_PINENTRY_GTK_2_FALSE@ +BUILD_PINENTRY_GTK_2_TRUE = @BUILD_PINENTRY_GTK_2_TRUE@ +BUILD_PINENTRY_GTK_FALSE = @BUILD_PINENTRY_GTK_FALSE@ +BUILD_PINENTRY_GTK_TRUE = @BUILD_PINENTRY_GTK_TRUE@ +BUILD_PINENTRY_QT_FALSE = @BUILD_PINENTRY_QT_FALSE@ +BUILD_PINENTRY_QT_TRUE = @BUILD_PINENTRY_QT_TRUE@ +BUILD_PINENTRY_W32_FALSE = @BUILD_PINENTRY_W32_FALSE@ +BUILD_PINENTRY_W32_TRUE = @BUILD_PINENTRY_W32_TRUE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FALLBACK_CURSES_FALSE = @FALLBACK_CURSES_FALSE@ +FALLBACK_CURSES_TRUE = @FALLBACK_CURSES_TRUE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_CONFIG = @GLIB_CONFIG@ +GLIB_LIBS = @GLIB_LIBS@ +GTK2CFLAGS = @GTK2CFLAGS@ +GTK2LIBS = @GTK2LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +HAVE_DOSISH_SYSTEM_FALSE = @HAVE_DOSISH_SYSTEM_FALSE@ +HAVE_DOSISH_SYSTEM_TRUE = @HAVE_DOSISH_SYSTEM_TRUE@ +HAVE_W32_SYSTEM_FALSE = @HAVE_W32_SYSTEM_FALSE@ +HAVE_W32_SYSTEM_TRUE = @HAVE_W32_SYSTEM_TRUE@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBCAP = @LIBCAP@ +LIBCURSES = @LIBCURSES@ +LIBICONV = @LIBICONV@ +LIBNCURSES = @LIBNCURSES@ +LIBOBJS = @LIBOBJS@ +LIBPTHREAD = @LIBPTHREAD@ +LIBS = @LIBS@ +LIBTERMCAP = @LIBTERMCAP@ +LIB_QPE = @LIB_QPE@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MOC = @MOC@ +NCURSES_INCLUDE = @NCURSES_INCLUDE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PINENTRY_DEFAULT = @PINENTRY_DEFAULT@ +PKGCONFIG = @PKGCONFIG@ +QTE_NORTTI = @QTE_NORTTI@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_INCLUDES = @QT_INCLUDES@ +QT_LDFLAGS = @QT_LDFLAGS@ +QT_LIBS = @QT_LIBS@ +QT_MT_LDFLAGS = @QT_MT_LDFLAGS@ +QT_MT_LIBS = @QT_MT_LIBS@ +QT_RPATH = @QT_RPATH@ +RANLIB = @RANLIB@ +SETCAP = @SETCAP@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_THREADS = @USE_THREADS@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_ct_WINDRES = @ac_ct_WINDRES@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +qt_includes = @qt_includes@ +qt_libraries = @qt_libraries@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +x_libraries = @x_libraries@ +EXTRA_DIST = Manifest +AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem \ + -I$(top_srcdir)/pinentry + +pinentry_w32_SOURCES = main.c pinentry-w32.rc resource.h +pinentry_w32_LDFLAGS = -mwindows -mconsole +pinentry_w32_LDADD = pinentry-w32.o \ + ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu w32/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu w32/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +pinentry-w32$(EXEEXT): $(pinentry_w32_OBJECTS) $(pinentry_w32_DEPENDENCIES) + @rm -f pinentry-w32$(EXEEXT) + $(LINK) $(pinentry_w32_LDFLAGS) $(pinentry_w32_OBJECTS) $(pinentry_w32_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-info-am + + +pinentry-w32.o: pinentry-w32.rc resource.h + $(WINDRES) -v -o $@ $< +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -urpP pinentry-0.7.1/w32/Manifest pinentry-0.7.2/w32/Manifest --- pinentry-0.7.1/w32/Manifest 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/w32/Manifest 2004-12-22 13:05:41.000000000 +0000 @@ -0,0 +1,2 @@ +Makefile.am +$names$ diff -urpP pinentry-0.7.1/w32/main.c pinentry-0.7.2/w32/main.c --- pinentry-0.7.1/w32/main.c 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/w32/main.c 2004-12-23 18:06:51.000000000 +0000 @@ -0,0 +1,170 @@ +/* main.c - Secure W32 dialog for PIN entry. + Copyright (C) 2004 g10 Code GmbH + + 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 */ + +#include +#include +#include +#include + +#include "pinentry.h" +#include "memory.h" + +#include "resource.h" + + +#define PGMNAME "pinentry-w32" + + +static int w32_cmd_handler (pinentry_t pe); +static void ok_button_clicked (HWND dlg, pinentry_t pe); + + +/* We use gloabl variables for the state, becuase there should never + ever be a second instance. */ +static HWND dialog_handle; +static int passphrase_ok = 0; + + +/* Connect this module to the pinnetry framework. */ +pinentry_cmd_handler_t pinentry_cmd_handler = w32_cmd_handler; + + + +/* Dialog processing loop. */ +static BOOL CALLBACK +dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) +{ + static pinentry_t pe; + + switch (msg) + { + case WM_INITDIALOG: + pe = (pinentry_t)lparam; + if (!pe) + abort (); + SetDlgItemText (dlg, IDC_PINENT_PROMPT, pe->prompt); + SetDlgItemText (dlg, IDC_PINENT_DESC, pe->description); + SetDlgItemText (dlg, IDC_PINENT_TEXT, ""); + if (pe->ok) + SetDlgItemText (dlg, IDOK, pe->ok); + if (pe->cancel) + SetDlgItemText (dlg, IDCANCEL, pe->cancel); + if (pe->error) + SetDlgItemText (dlg, IDC_PINENT_ERR, pe->error); + dialog_handle = dlg; + SetForegroundWindow (dlg); + break; + + case WM_COMMAND: + switch (LOWORD (wparam)) + { + case IDOK: + ok_button_clicked (dlg, pe); + EndDialog (dlg, TRUE); + break; + + case IDCANCEL: + pe->result = -1; + EndDialog (dlg, FALSE); + break; + } + break; + } + return FALSE; +} + + +/* The okay button has been clicked or the enter enter key in the text + field. */ +static void +ok_button_clicked (HWND dlg, pinentry_t pe) +{ + char *s_utf8; + char *s_buffer; + size_t s_buffer_size = 256; + + pe->locale_err = 1; + s_buffer = secmem_malloc (s_buffer_size + 1); + if (!s_buffer) + return; + + pe->result = GetDlgItemText (dlg, IDC_PINENT_TEXT, s_buffer, s_buffer_size); +/* s_utf8 = pinentry_local_to_utf8 (pe->lc_ctype, s_buffer, 1); */ +/* secmem_free (s_buffer); */ + s_utf8 = s_buffer; /* FIXME */ + if (s_utf8) + { + passphrase_ok = 1; + pinentry_setbufferlen (pe, strlen (s_utf8) + 1); + if (pe->pin) + strcpy (pe->pin, s_utf8); +/* secmem_free (s_utf8); */ + pe->locale_err = 0; + pe->result = strlen (pe->pin); + } +} + + +static int +w32_cmd_handler (pinentry_t pe) +{ + int want_pass = !!pe->pin; + + passphrase_ok = 0; + + if (want_pass) + { + DialogBoxParam (NULL, (LPCTSTR) IDD_PINENT, + GetDesktopWindow (), dlg_proc, (LPARAM)pe); + ShowWindow (dialog_handle, SW_SHOWNORMAL); + return pe->result; + } + else /* Confirmation mode. */ + { + int ret; + + if (pe->error) + ret = MessageBox (NULL, pe->error, "Error", MB_YESNO | MB_ICONERROR); + else + ret = MessageBox (NULL, pe->description?pe->description:"", + "Information", MB_YESNO | MB_ICONINFORMATION); + if (ret == IDYES) + return 1; + else + return 0; + } +} + + +int +main (int argc, char **argv) +{ + pinentry_init (PGMNAME); + + /* Consumes all arguments. */ + if (pinentry_parse_opts (argc, argv)) + { + printf ("pinentry-w32 (pinentry) " VERSION "\n"); + exit (EXIT_SUCCESS); + } + + if (pinentry_loop ()) + return 1; + + return 0; +} diff -urpP pinentry-0.7.1/w32/pinentry-w32.rc pinentry-0.7.2/w32/pinentry-w32.rc --- pinentry-0.7.1/w32/pinentry-w32.rc 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/w32/pinentry-w32.rc 2004-12-23 17:26:56.000000000 +0000 @@ -0,0 +1,41 @@ +/* dialog.rc - Resource definitions + Copyright (C) 2004 g10 Code GmbH + + 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 */ + + +#include +#include "resource.h" + +/* + * Main dialog + */ + +IDD_PINENT DIALOG DISCARDABLE 0, 0, 186, 125 +STYLE DS_MODALFRAME | DS_SYSMODAL | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Pinentry W32" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "", IDC_PINENT_DESC, 6, 6, 152, 40 + EDITTEXT IDC_PINENT_TEXT, 71, 56, 107, 12, ES_PASSWORD | ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", IDOK, 77, 100, 50, 14 + PUSHBUTTON "&Cancel", IDCANCEL, 132, 100, 50, 14 + LTEXT "", IDC_PINENT_PROMPT, 6, 56, 64, 12 + LTEXT "", IDC_PINENT_ERR, 6, 82, 170, 9 +END + + + diff -urpP pinentry-0.7.1/w32/resource.h pinentry-0.7.2/w32/resource.h --- pinentry-0.7.1/w32/resource.h 1970-01-01 00:00:00.000000000 +0000 +++ pinentry-0.7.2/w32/resource.h 2004-12-22 13:05:41.000000000 +0000 @@ -0,0 +1,17 @@ +/* resource.h + * Copyright 2004 g10 Code GmbH + * + * This file is free software; as a special exception the author gives + * unlimited permission to copy and/or distribute it, with or without + * modifications, as long as this notice is preserved. + * + * This file 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. + */ + +#define IDD_PINENT 101 +#define IDC_PINENT_TEXT 292 +#define IDC_PINENT_DESC 1000 +#define IDC_PINENT_ERR 1001 +#define IDC_PINENT_PROMPT 1002 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFB+KT6aLeriVdUjc0RAgkTAJ9GRWv5QRwqMFVTHA4/CUJJvPBUBACdGqNL bfC4/Y8wUjzmNoQfDFXtUYc= =FO5/ -----END PGP SIGNATURE-----