summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Winkelmann <jw@smts.ch>2005-11-09 21:43:05 +0000
committerJohannes Winkelmann <jw@smts.ch>2005-11-09 21:43:05 +0000
commitd8c1e157ab01cb214872b5e4606d92dfd8495650 (patch)
tree806e18cc4cc272e39508d28f8c3839fccfcc7749
downloadprt-get-d8c1e157ab01cb214872b5e4606d92dfd8495650.tar.gz
prt-get-d8c1e157ab01cb214872b5e4606d92dfd8495650.tar.xz
introduce svn-typical layout
git-svn-id: https://crux.nu/svn/tools/prt-get/trunk@9 0b5ae1c7-2405-0410-a7fc-ba219f786e1e
-rw-r--r--AUTHORS1
-rw-r--r--CREDITS18
-rw-r--r--ChangeLog373
-rw-r--r--FAQ8
-rw-r--r--INSTALL6
-rw-r--r--LICENSE279
-rw-r--r--Makefile.am7
-rw-r--r--Makefile.in580
-rw-r--r--README39
-rw-r--r--TODO123
-rw-r--r--aclocal.m4862
-rw-r--r--config.h.in87
-rwxr-xr-xconfigure5917
-rw-r--r--configure.in42
-rwxr-xr-xdepcomp423
-rw-r--r--doc/Makefile.am10
-rw-r--r--doc/Makefile.in386
-rw-r--r--doc/coding4
-rw-r--r--doc/prt-cache.856
-rw-r--r--doc/prt-get.8538
-rw-r--r--doc/prt-get.conf.5157
-rwxr-xr-xinstall-sh276
-rw-r--r--misc/Makefile.am16
-rw-r--r--misc/Makefile.in323
-rw-r--r--misc/prt-get.aliases6
-rw-r--r--misc/prt-get.conf42
-rw-r--r--misc/prt-get.deplist28
-rw-r--r--misc/prt-get_complete98
-rwxr-xr-xmissing336
-rwxr-xr-xmkinstalldirs111
-rw-r--r--src/Makefile.am29
-rw-r--r--src/Makefile.in452
-rw-r--r--src/argparser.cpp445
-rw-r--r--src/argparser.h133
-rw-r--r--src/configuration.cpp225
-rw-r--r--src/configuration.h83
-rw-r--r--src/datafileparser.cpp50
-rw-r--r--src/datafileparser.h29
-rw-r--r--src/depresolver.cpp102
-rw-r--r--src/depresolver.h43
-rw-r--r--src/file.cpp92
-rw-r--r--src/file.h30
-rw-r--r--src/installtransaction.cpp539
-rw-r--r--src/installtransaction.h142
-rw-r--r--src/locker.cpp110
-rw-r--r--src/locker.h51
-rw-r--r--src/lockfile.cpp150
-rw-r--r--src/lockfile.h45
-rw-r--r--src/main.cpp170
-rw-r--r--src/package.cpp333
-rw-r--r--src/package.h104
-rw-r--r--src/pg_regex.cpp52
-rw-r--r--src/pg_regex.h39
-rw-r--r--src/pkgdb.cpp238
-rw-r--r--src/pkgdb.h60
-rw-r--r--src/process.cpp229
-rw-r--r--src/process.h46
-rw-r--r--src/prtget.cpp1939
-rw-r--r--src/prtget.h148
-rw-r--r--src/repository.cpp447
-rw-r--r--src/repository.h81
-rw-r--r--src/signaldispatcher.cpp54
-rw-r--r--src/signaldispatcher.h58
-rw-r--r--src/stringhelper.cpp148
-rw-r--r--src/stringhelper.h80
-rw-r--r--src/versioncomparator.cpp250
-rw-r--r--src/versioncomparator.h28
67 files changed, 18406 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..eb8da36
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Johannes Winkelmann, jw@tks6.net
diff --git a/CREDITS b/CREDITS
new file mode 100644
index 0000000..5e376e7
--- /dev/null
+++ b/CREDITS
@@ -0,0 +1,18 @@
+Thanks go to the following persons for valuable feedback/bug reports:
+ * Olle Gustafsson
+ * Daniel Mueller
+ * Juergen Daubert
+ * Mike Toggweiler
+ * Robert McMeekin
+ * Michael Ablassmeier
+ * Roger Kislig
+ * Sven Dahl
+ * Matt Housh
+ * Christoph Winkelmann
+ * Han Boetes
+
+The following persons have contributed patches to prt-get's source code:
+ * Logan Ingalls
+
+Not to forget debian for the inspiration for a *-get tool and the those
+on the crux mailing list writing about their ideas and needs.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..ba99203
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,373 @@
+* 0.5.11 29.05.2005 Johannes Winkelmann
+- add --path to 'ls'
+- initial regex support
+- replace `uname -r` and `date +...` in version strings
+- add 'useregex' config key and --regex command line argument
+- Add --full to fsearch
+- use regex in fsearch if requested
+- add leading slash to fsearch result
+- support both `` and $()
+- support date patterns like '+%Y'
+- add aliases and deplist to dist-tarball
+- support multiple shell patterns in version
+
+* 0.5.10 21.04.2005 Johannes Winkelmann
+- fix bugs #3735, #3836
+- implement --ignore=<port1>,<port2> feature
+- fix --path for list, search
+- add --path for depends
+- enable logfile and depfile in default prt-get.conf
+
+
+* 0.5.9 06.12.2005 Johannes Winkelmann
+- add alias support
+- use absolut pathes for commands (pkgmk et al)
+- add -v switch to 'info' to show the readme
+- fix 'keephigher' in default prt-get.conf
+- add deptree to 'help'
+- remove some debug test
+- prettify error message when packages are not found
+- change 'bash' to 'sh' in process.cpp
+- use 'Pkgfile' as default file for cat and edit if no second argument given
+
+* 0.5.8 31.10.2004 Johannes Winkelmann
+- re-enable version parseing; use --prefer-higher to make prt-get use
+ it
+- implement shortcuts to frequentily used pkgmk/pkgadd options
+- make -f do 'pkgadd -f'
+- add new versioncomparator class
+- implement 'alpha' < 'beta' < 'gamma' < 'delta'
+
+* 0.5.7 16.07.2004 Johannes Winkelmann
+- add the --install-root argument to allow installation to a different root
+- add the --rargs switch to pass options to pkgmk in "prt-get remove"
+- add 'removecommand' configuration key
+- add 'runscriptcommand' configuration key
+- improve config parsing: options can now be in front of command
+
+* 0.5.6 06.01.2004 Johannes Winkelmann
+- add four new command line arguments:
+ --no-std-config Don't parse default configuration file
+ --config-prepend=<string> Prepend <string> to configuration
+ --config-append=<string> Append <string> to configuration
+ --config-set=<string> Set configuration data, overriding config file
+- add new command: dumpconfig
+- respect 'cachefile' setting in configuration (did anyone ever use this??)
+- add 'runscripts' configuration variable to (equivalent to --install-scripts)
+- dump readme and runscripts configuration in dumpConfig()
+- add 'makecommand' and 'addcommand' to config file to make prt-get use
+ another command than pkgmk and pkgadd
+
+* 0.5.5p1 23.03.2004 Johannes Winkelmann
+- Let Pkgfile's dependencies take precedence over deplist
+
+* 0.5.5 05.03.2004 Johannes Winkelmann
+- Add new configuration option: depfile
+- add way to use external dependency file
+- Add some missing headers for compilation with gcc 2.95
+- update bash completion for isinst
+- add deptree command (--all for all deps)
+
+* 0.5.4p2 17.11.2003 Johannes Winkelmann
+- fix bug in "at least X arguments" after getting several complaints
+
+* 0.5.4p1 30.10.2003 Johannes Winkelmann
+- fix message when called without argument
+- Fix duplicate prtdir ignoring error (when using filters)
+
+* 0.5.4 04.10.2003 Johannes Winkelmann
+- introduce symbolic return values
+- code: introduce generic argument number checks
+- (re)introduce depinst command
+- fix problem with prt-get fsearch: symlink'ed files are found as well
+- print output while logging (Patch from Logan)
+- redirect output of InstallTransaction::installPackage to log file
+- add %v (version) and %r (release) patterns to the log file name
+- fix typo in man page: %d in printf used for desc and deps
+- check for pre-install and post-install
+ - store in cache (-> cache version update)
+ - show in prt-get info
+ - enable in prt-get printf, using %E (prE) and %O (pOst)
+
+* 0.5.3p2 29.09.2003 Johannes Winkelmann
+- Fix little bug in prt-get printf: don't print out empty lines (even if
+ there's a newline char)
+
+* 0.5.3p1 25.09.2003 Johannes Winkelmann
+- Adapt new patch naming
+- Be more clever when calling prt-get diff with a filter
+
+* 0.5.3 01.09.2003 Johannes Winkelmann
+- Add 'remove' feature
+- implement pre/post install execution
+- prt-get diff doesn't display locked; use --all if you want them
+- Fix bug in repository initialization when pkgdirs were specified twice
+
+* 0.5.2 not used ;-)
+
+* 0.5.1a 08.08.2003 Johannes Winkelmann
+- Fix for gcc 3.3
+
+* 0.5.1 09.07.2003 Johannes Winkelmann
+- use PKGMK_PACKAGE_DIR
+
+* 0.5.0 22.06.2003 Johannes Winkelmann
+- update to fit new CLC project
+(pre3)
+- made bash completion work with ls, cat and edit
+(pre2)
+- sort ls output
+(pre1)
+- introduced new commands: ls, cat, edit
+- fixed an empty error message in argparser
+
+* 0.4.4c 08.05.2003 Johannes Winkelmann
+- Fixed an ugly bug: no error messages shown when logging enabled
+
+
+* 0.4.4b 08.05.2003 Johannes Winkelmann
+- Change mode of created directories from 0711 to 0755
+
+* 0.4.4a 05.05.2003 Johannes Winkelmann
+- Change $PKGDEST to $PACKAGE_DIR
+
+* 0.4.4 01.05.2003 Johannes Winkelmann
+- add support for PKGDEST
+- add lock/unlock and listlocked commands
+- better parsing of arguments
+- small update of the argument parser
+
+* Reimported after disk crash; 07.04.2003
+
+* 0.4.3 18.02.2003 Johannes Winkelmann
+- fixed bug in dependent: it split the list wrongly
+- new command: fsearch: search for file names in ports tree
+- speed fix in Package: don't load() in name() and path()
+- cosmetical changes to the help screen
+
+* 0.4.2a 06.02.2003 Johannes Winkelmann
+- fixed bug in dependent: it looked just for a substring, so pkgconfig whould
+ also be a match for 'dependent gconf', as it contains gconf...
+
+* 0.4.2 06.02.2003 Johannes Winkelmann
+- Fixed a segfault when no pkg database file available
+
+* 0.4.1 20.01.2003 Johannes Winkelmann
+- added small speed fix to printDiff
+- added missing include in configuration.cpp
+- enable clc ports by default
+- added misc dir to DIST
+
+* 0.4.0pre2 14.01.2003 Johannes Winkelmann
+- fixed segfault when no m_currentTransaction
+
+* 0.4.0pre2 13.01.2003 Johannes Winkelmann
+- fixed --listall -> --all switch on help page
+- completed SignalDispatcher
+- made PrtGet a SubClass of SignalHandler
+- feedback on Ctrl-C
+- fixed performance problems by not copying lists
+
+* 0.4.0pre1 13.01.2003 Johannes Winkelmann
+- update man page
+
+
+* 0.4.0alpha4 13.01.2003 Johannes Winkelmann
+- removed find command
+- list can have a wildcard filter
+- renamed --listall switch to --all for dependent
+- implemented wildcards for listinst
+
+* 0.4.0alpha3 13.01.2003 Johannes Winkelmann
+- added --listall switch for dependent; don't show only installed ports
+- corrected help once more
+- added LockFile class
+- added check for Pkgfile in Port directory
+- added expandWildcard*() methods
+- enabled wildcards for diff
+- implemented 'current' command
+
+* 0.4.0alpha2 05.01.2003 Johannes Winkelmann
+- added --filter="..." option used in printf
+- added sysup command (refactoring required)
+- updated help output
+- added signal dispatcher
+- new cache file format (newline separated)
+- cache file versioning
+- support for maintainer and packager in info and printf
+- support for hasReadme in printf
+- fixed bug in Pkgfile parser (whitespaces before version, name and rev)
+- better format for prt-get help
+
+* 0.4.0alpha1 04.01.2003 Johannes Winkelmann
+- added find command (searching using wildcards),
+- Repository::getMatchingPackages() (wildcard match)
+- added data object for package
+
+
+* 0.3.5c 28.12.2002 Johannes Winkelmann
+- fixed bug: pkgadd was called even if pkgmk failed... there since 0.3.4
+
+* 0.3.5b 28.12.2002 Johannes Winkelmann
+- fixed bug in writeCache()
+
+* 0.3.5a 23.12.2002 Johannes Winkelmann
+- dependent -> help page
+
+
+* 0.3.5 04.12.2002 Johannes Winkelmann
+- added readme command
+- info shows whether there is a README file
+- added readme info to cache file (-> new format)
+- added (README) to install/update output
+- fixed a memory leak
+- introduced configuration object
+- exchanged result printing order ("Packages already installed" before
+ "Packages installed now"
+- added dependent command: show which packages depend on argument
+- corrected ugly copy and paste errors in "<command> takes only one arg..."
+- added misc/prt-edit (not installed)
+- new manual format, not included anymore
+
+
+* 0.3.4c 02.12.2002 Johannes Winkelmann
+- corrected typo in manual
+- added logging options to default prt-get.conf
+- added --sort option for printf
+
+* 0.3.4b 02.12.2002 Johannes Winkelmann
+- printf replaces \t and \n
+- small change in StringHelper::replaceAll()
+- listinst -vv prints description
+- listinst documentation update
+- --log doc update
+- cleanups (using StringHelper::replaceAll())
+- add bash completion file
+
+* 0.3.4a 30.11.2002 Johannes Winkelmann
+- small change in printf (%i expands to "diff")
+
+* 0.3.4 10.11.2002 Johannes Winkelmann
+- implemented new printf function
+- corrected usage output (removed "," characters)
+- added StringHelper::replaceAll(..)
+- log feature
+- added %p in logfile
+
+* 0.3.3 27.08.2002 Johannes Winkelmann
+- implemented a returnValue() method in PrtGet
+- prt-get isinst no longer returns "... is not installed" to be more
+ consistent with "pkginfo -i|grep ...", but returns 1 when a package is not
+ installed (1 = general error).
+- allow dependencies to be commented out when starting with #. THINK ABOUT
+ THIS SOME MORE
+
+* 0.3.2 15.07.2002 Johannes Winkelmann
+- changed example prt-get.conf again
+- added another example to the manual
+- added doxygen api documentation
+- various code cleanups
+- output fix for prt-get diff (title not printed if no difference)
+- added tests for process and stringhelper class
+- added _very_ simple version checking in prt-get diff
+- return values on errors (=1)
+- no output for prt-get isinst if package not installed (to be consistent with
+ pkginfo)
+- gcc 3.2 fixes
+
+
+* 0.3.1a 15.07.2002 Johannes Winkelmann
+- changed example prt-get.conf to meet the new format...
+
+* 0.3.1 13.07.2002 Johannes Winkelmann
+- Fixed some conditions where Valgrind reported errors
+
+* 0.3.1pre2 10.07.2002 Johannes Winkelmann
+- Fixed another bug in the process execution
+- proper implementation of process execution :-)
+- improved StringHelper::split()
+
+* 0.3.1pre1 08.07.2002 Johannes Winkelmann
+- listinst
+- new config file format (can use alternate location for cache)
+- removed depinst skeletion
+
+* 0.3.0 05.07.2002 Johannes Winkelmann
+- added cache feature
+- moved string functions to stringhelper
+- Makefile.am includes code to create a symlink from prt-get to prt-cache
+- If prt-get is called as prt-cache, it uses the caching all the time
+- added man page for prt-cache
+- added package filter functionality in prt-get-conf
+- added man page for prt-get.conf
+- comments are removed in prt-get.conf
+- added check whether cache is outdated (config file changed after cache
+ generated)
+- added check for 'prt-get diff <packagelist>' that the packages listed
+ are really installed
+- added path command
+- print errors to stderr
+- always exit( -1 ) on error
+
+* 0.3.0pre2 03.07.2002 Johannes Winkelmann
+- Fixed bug when release or version had a comment on the same line
+
+* 0.3.0pre1 02.07.2002 Johannes Winkelman
+- Changed format of TODO, so others can understand it as well :-)
+- added version command
+
+* 0.2.9 01.07.2002 Johannes Winkelmann
+- If files are rejected during update, prt-get no longer says "update failed"
+- implemented dsearch feature (to search descriptions)
+- Fixed a bug in prt-get depends (empty listing instead of warning when
+ invalid package given)
+
+* 0.2.8 30.06.2002 Johannes Winkelmann
+- moved to autoconf/automake
+
+* 0.2.7 28.06.2002 Johannes Winkelmann
+- added a man page
+- adjusted message of install/update
+decided to go up to .7, as I made some errors in the release of .6
+
+
+* 0.2.6 28.06.2002 Johannes Winkelmann
+- added --test switch: doing no installation, just prints out the result
+- added quickdiff feature, printing out a list of installed packages to be
+ updated: use it for prt-get update `prt-get quickdiff`
+
+
+* 0.2.5 28.06.2002 Johannes Winkelmann
+- removed depinst feature (maybe reimplemented soon)
+- it is now possible to pass a list of arguments to
+ prt-get install
+ prt-get depends/quickdep
+- implemented -v and -vv in prt-get list
+- implemented -v for prt-get search (show description as well)
+- lazy initialization of repository -> speed improvement
+- removed --args switch, added --margs and --aargs switches for pkgmk and
+ pkgadd respectively
+
+* 0.2.4 24.06.2002 Johannes Winkelmann
+- fixed segfault when having cyclic dependecies
+
+* 0.2.3 24.06.2002 Johannes Winkelmann
+- added --config=<conffile> option
+- added prt-get update feature
+- added prt-get quickdep feature
+- added prt-get diff feature
+
+* 0.2.2 24.06.2002 Johannes Winkelmann
+- Fixed segfault in depends
+
+* 0.2.1 23.06.2002 Johannes Winkelmann
+- added config file /etc/prt-get.conf
+
+* 0.2 22.06.2002 Johannes Winkelmann
+- C++ port
+
+* 0.1.1 22.06.2002 Johannes Winkelmann
+- moved install to InstallTransaction
+
+* 0.1 21.06.2002 Johannes Winkelmann
+- First release
diff --git a/FAQ b/FAQ
new file mode 100644
index 0000000..d4438e8
--- /dev/null
+++ b/FAQ
@@ -0,0 +1,8 @@
+Q: Why are there no wildcards for install/update/grpinst
+A: Because you don't want it (dependencies)
+
+Q: Why is there no prt-get depinst?
+A:
+
+Q: Why is there no GUI or shared lib for/of prt-get?
+A:
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..81b43f2
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,6 @@
+Installing prt-get
+------------------
+Installing prt-get is just a matter of
+./configure
+make
+make install
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..2432538
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,279 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..9cdc976
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = foreign
+
+
+MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in
+SUBDIRS = src doc misc
+
+EXTRA_DIST = CREDITS FAQ LICENSE
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..f3ae827
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,580 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/configure AUTHORS ChangeLog INSTALL TODO depcomp \
+ install-sh missing mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+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 = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+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@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_STRIP = @ac_ct_STRIP@
+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_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = foreign
+MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in
+SUBDIRS = src doc misc
+EXTRA_DIST = CREDITS FAQ LICENSE
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+ check-am clean clean-generic clean-recursive ctags \
+ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
+ dist-tarZ dist-zip distcheck distclean distclean-generic \
+ distclean-hdr distclean-recursive distclean-tags \
+ distcleancheck distdir distuninstallcheck dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-info-am
+
+# 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 --git a/README b/README
new file mode 100644
index 0000000..c43a40c
--- /dev/null
+++ b/README
@@ -0,0 +1,39 @@
+PRT-GET OVERVIEW:
+(Johannes Winkelmann, jw@tks6.net)
+
+
+Description:
+------------
+prt-get is a utility which is meant to be used with the pkgutils and
+ports from crux (http://crux.nu). It offers some simplification over
+pure pkgmk, but might hide some interesting details about the install
+process.
+
+Installing:
+-----------
+Just install the crux port from
+- http://www.hta-bi.bfh.ch/~winkj/files/crux/prt-get.prt.gz
+
+prt-get has to know where to look for ports. You can specify those in
+/etc/prt-get.conf, one directory per line. Note that the order
+matters, when the same port is in multiple direcories
+(e.g. /usr/ports/contrib/mutt and /usr/ports/local/mutt), the one
+found _first_ will be used.
+
+Feel free to contact me in case of problems (jw@tks6.net)
+
+
+more information
+----------------
+See the man pages for prt-get(8), prt-get.conf(5) and prt-cache for more
+information. There is also a user manual in the doc directory (as a
+tex file). This document should also be available as PDF from
+http://www.hta-bi.bfh.ch/~winkj/files/crux/manual.pdf
+
+"it must be user error" (thinkgeek)
+-----------------------------------
+
+port directories may only contain ports, or else prt-get can fail (which
+means that nothing is installed, your system takes no harm). The reason
+for this is because the additional checking slows down the application
+too much
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..ba2921d
--- /dev/null
+++ b/TODO
@@ -0,0 +1,123 @@
+
+- add support to "prefer higher" for certain packages ?
+
+
+
+
+next release:
+- configuration override/extend
+ [20:01] <cptn> --config-add="prtdir /tmp" even
+ [20:01] <cptn> --config-set="logfile /tmp/%n.log"
+ [20:14] <cptn> prt-get --config-set="prtdir /tmp" \
+ --config-add="prtdir /usr"
+ [20:14] <cptn> the 'set' would delete the config file's prtdir settings
+
+Don't bail out if no prt-get.conf is found if the user specified
+--config-* options
+
+enum KindOfConfig {ADD, SET}
+argparser: user addConfig(string, KindOfConfig);
+config: go through additional configuration options; add and/or replace
+
+
+
+1.0.0
+
+- sysup
+ - allow injecting of new (uninstalled) dependencies
+ - allow to prohibit recompilation of packages when a dependency failed
+ to be updated in this sysup run
+
+- better reports (installed/failed/not even tried to install)
+[ ] message log for prt-get messages ?
+[ ] timestamps for the log file
+[ ] --quiet mode; suppress output of pkgmk and pkgadd
+[ ] prt-get diff stats: "100 Packages with differences"
+
+---------------------------
+
+later
+
+- parallel download (mt)
+- download only
+- group support
+- Actions/Commands
+ - Help per command
+- Dynamic command binding
+- Make InstallTransaction a real install transaction:
+ - rollback pre-install if package building failed
+ - needs heavy refactoring to be easier to understand/maintain
+- Test mode: global (is duplicated right now)
+- remove should be in a transaction as well
+ - remove transaction
+ - install transaction
+ - etc.
+ - Transaction handler
+- better examples for man page
+- reorder message to avoid losing the important bits when installing
+ _lots_ of packages; maybe also think about forgeting not so
+ important things like packages installed before etc
+
+[ ] prt-get rm and cd
+[ ] cache file class, help class
+[ ] interrupt handler (ctrl-c) kill pkgmk/pkgadd, delete lock files, say
+ "prt-get: action cancelled"; warn when cancel during download ->
+ STATE variable, separate download and build.
+[ ] lock files for log, cache (lock file class)
+[ ] move command name out of execTransaction (would be wrong for e.g.
+ sysup)
+
+
+SHORT TERM
+------------
+
+* Answer FAQs
+
+* create a fileExists(), createDir() etc helper class
+
+* questions
+ - should the install/update result include the version/release?
+
+* cosmetic
+ - move all output messages to prtget.cpp (away from main.cpp)
+ - remove "using namespace std" from header file
+
+* test
+ - add asserts
+
+* functional
+ - check exit messages (strings). always add 'prt-get'
+
+* refactor
+ - check operations in prtget.cpp for common code
+ - make InstallTransaction more modular (download/build/install)
+
+LONG TERM
+------------------------------
+* remove quickdiff
+* move find command into list --filter="..." ???
+
+* symbolic exit codes
+
+* new commands:
+
+* questions:
+ - should there be a install/update mixed to mode, to install and update,
+ which ever method is needed?
+ - namespace prtget ?
+ - remove the path:package1, package2 filter functionality from the
+ config file again. This could be done by creating another ports
+ directories an creation symlinks there to. Could improve performance
+ - might people like ansi colors?
+
+* new features
+ - list shadow packages (dup) for arguments
+
+* - rebuild all ports using dependency information
+
+
+LONG LONG TERM
+--------------
+- parallel download for installing/updating multiple packages (at least
+ download of 2nd package while building first)
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..74de4a1
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,862 @@
+# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.9.5])])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.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])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+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)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# 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
+])
+
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _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. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# 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)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/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
+
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..29c6a0b
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,87 @@
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <fnmatch.h> header file. */
+#undef HAVE_FNMATCH_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <regex.h> header file. */
+#undef HAVE_REGEX_H
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <\> header file. */
+#undef HAVE__
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
diff --git a/configure b/configure
new file mode 100755
index 0000000..8ffd003
--- /dev/null
+++ b/configure
@@ -0,0 +1,5917 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="src/prtget.cpp"
+ac_default_prefix=/usr
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+
+Some influential environment variables:
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CC C compiler command
+ CFLAGS C compiler flags
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=prt-get
+ VERSION=0.5.11
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+
+test x$prefix = "xNONE" && prefix="$ac_default_prefix"
+
+# Checks for programs.
+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
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+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_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+ CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5
+echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C++ compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5
+echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CXX" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+
+
+# Checks for libraries.
+
+# Checks for header files.
+
+
+
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+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 opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ 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_search_opendir="none required"
+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 "$ac_cv_search_opendir" = no; then
+ for ac_lib in dir; do
+ LIBS="-l$ac_lib $ac_func_search_save_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 opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ 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_search_opendir="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+
+fi
+
+else
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+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 opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ 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_search_opendir="none required"
+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 "$ac_cv_search_opendir" = no; then
+ for ac_lib in x; do
+ LIBS="-l$ac_lib $ac_func_search_save_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 opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ 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_search_opendir="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+
+fi
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_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 <string.h>
+
+_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 <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in unistd.h stdio.h sys/types.h sys/stat.h fnmatch.h \
+ dirent.h fcntl.h signal.h regex.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+CFLAGS="$CFLAGS $X_CFLAGS"
+CXXFLAGS="$CXXFLAGS $X_CFLAGS"
+LIBS="$LIBS $X_LIBS"
+LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
+
+# Checks for typedefs, structures, and compiler characteristics.
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+
+# I hate you autotools
+sysconfdir="/etc"
+localstatedir="/var"
+
+# Checks for library functions.
+ ac_config_headers="$ac_config_headers config.h"
+
+ ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile misc/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__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
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "misc/Makefile" ) CONFIG_FILES="$CONFIG_FILES misc/Makefile" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..1c561b5
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,42 @@
+# Process this file with autoconf to produce a configure script.
+AC_INIT
+AC_CONFIG_SRCDIR([src/prtget.cpp])
+AM_INIT_AUTOMAKE(prt-get,0.5.11)
+
+
+dnl Determine default prefix
+test x$prefix = "xNONE" && prefix="$ac_default_prefix"
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_INSTALL
+
+AC_PREFIX_DEFAULT(/usr)
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_DIRENT
+AC_CHECK_HEADERS(unistd.h stdio.h sys/types.h sys/stat.h fnmatch.h \
+ dirent.h fcntl.h signal.h regex.h)
+
+CFLAGS="$CFLAGS $X_CFLAGS"
+CXXFLAGS="$CXXFLAGS $X_CFLAGS"
+LIBS="$LIBS $X_LIBS"
+LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+
+# I hate you autotools
+sysconfdir="/etc"
+localstatedir="/var"
+
+# Checks for library functions.
+AM_CONFIG_HEADER(config.h)
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ doc/Makefile
+ misc/Makefile])
+AC_OUTPUT
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..807b991
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,423 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+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
+
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. 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/'`
+ tmpdepfile="$stripped.u"
+ outname="$stripped.o"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ tmpdepfile1="$dir.libs/$base.lo.d"
+ tmpdepfile2="$dir.libs/$base.d"
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1="$dir$base.o.d"
+ tmpdepfile2="$dir$base.d"
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ 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"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'. We will use -o /dev/null later,
+ # however we can't do the remplacement now because
+ # `-o $object' might simply not be used
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ -*)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..14e4127
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,10 @@
+
+man_MANS = prt-get.8 prt-cache.8 prt-get.conf.5
+
+clean-local:
+ rm -rf *.log *.aux *.toc *.dvi *.idx *.pdf api
+
+apidoc:
+ doxygen
+
+EXTRA_DIST = $(man_MANS) coding
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..57df315
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,386 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = doc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+man5dir = $(mandir)/man5
+am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"
+man8dir = $(mandir)/man8
+NROFF = nroff
+MANS = $(man_MANS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+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@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_STRIP = @ac_ct_STRIP@
+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_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+man_MANS = prt-get.8 prt-cache.8 prt-get.conf.5
+EXTRA_DIST = $(man_MANS) coding
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-man5: $(man5_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)"
+ @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.5*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 5*) ;; \
+ *) ext='5' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \
+ done
+uninstall-man5:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.5*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 5*) ;; \
+ *) ext='5' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \
+ done
+install-man8: $(man8_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)"
+ @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.8*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 8*) ;; \
+ *) ext='8' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
+ done
+uninstall-man8:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.8*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 8*) ;; \
+ *) ext='8' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+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 $(MANS)
+installdirs:
+ for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; 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-generic clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man: install-man5 install-man8
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-man
+
+uninstall-man: uninstall-man5 uninstall-man8
+
+.PHONY: all all-am check check-am clean clean-generic clean-local \
+ 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-man5 install-man8 install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
+ uninstall-man uninstall-man5 uninstall-man8
+
+
+clean-local:
+ rm -rf *.log *.aux *.toc *.dvi *.idx *.pdf api
+
+apidoc:
+ doxygen
+# 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 --git a/doc/coding b/doc/coding
new file mode 100644
index 0000000..e7f4e5e
--- /dev/null
+++ b/doc/coding
@@ -0,0 +1,4 @@
+Documentation:
+- /*! */-style
+- types in .h
+- methods in .cpp
diff --git a/doc/prt-cache.8 b/doc/prt-cache.8
new file mode 100644
index 0000000..9144119
--- /dev/null
+++ b/doc/prt-cache.8
@@ -0,0 +1,56 @@
+.\" man page for prt-cache
+.\" Johannes Winkelmann, jw@tks6.net
+
+.PU
+.TH prt-cache 8
+.SH "NAME"
+.LP
+prt\-cache \- call prt\-get using a cache file as a data source
+.SH "SYNOPSIS"
+.B prt\-cache command [options] <arguments>
+.br
+.SH "DESCRIPTION"
+prt\-cache is a synonym for
+.B prt\-get --cache.
+It's perfectly the same as calling prt\-get --cache, just shorter. See
+.B man prt-get(8)
+for details on how to use prt-get
+
+.PP
+Even though there are almost restrictions on using prt-cache over prt-get,
+it's mostly recommended for the following commands:
+.B search, dsearch, list, info, depends, quickdep, diff, quickdiff
+and
+.B info.
+It won't work for the
+.B dup
+command.
+
+.PP
+Using
+.B prt-cache isinst
+is not recommended (really not!)
+
+.PP
+Note that if the cache is not up to date (and there's a newer port in the
+ports tree),
+.B prt-cache install
+and
+.B prt-cache update
+will use the version from the ports tree anyway, so there's no real
+risk.
+
+.PP
+If you're using prt-cache, make sure to regenerate the cache by calling
+.B prt-get cache
+each time you make changes to the ports tree!
+
+.PP
+To create a cache, just invoke
+.B prt-get cache.
+Make sure you have the right permissions to do this
+
+.SH "AUTHORS"
+Johannes Winkelmann <jw@tks6.net>
+.SH "SEE ALSO"
+prt-get(8), pkgmk(8) pkgadd(8), ports(8)
diff --git a/doc/prt-get.8 b/doc/prt-get.8
new file mode 100644
index 0000000..0a51dc5
--- /dev/null
+++ b/doc/prt-get.8
@@ -0,0 +1,538 @@
+.\" man page for prt-get
+.\" Johannes Winkelmann, jw@tks6.net
+.\"
+.\" my first man page, so forgive me for the errors :-)
+.\"
+.\" .PU
+.TH "prt-get" "8" "" "" ""
+.SH "NAME"
+.LP
+prt\-get \- an advanced package management tool to be used with
+pkgutils from CRUX (see http://www.crux.nu)
+.SH "SYNOPSIS"
+.B prt\-get command [options] <arguments>
+.br
+.SH "DESCRIPTION"
+prt\-get is a package management tool which provides additional
+functionality to crux' package management system. It works with the
+local ports tree and is therefore fully compatible with ports(8) and
+pkgmk(8)/pkgadd(8). It offers the following features:
+
+.PP
+.TP
+\ \ \ \(bu
+abstract ports installation/update from file system
+
+.TP
+\ \ \ \(bu
+install/update a list of packages with one command
+
+.TP
+\ \ \ \(bu
+list dependencies for a list of packages
+
+.TP
+\ \ \ \(bu
+show information about ports
+
+.TP
+\ \ \ \(bu
+search within the ports
+
+.PP
+
+What prt\-get basically does is installing and upgrading packages, using
+pkgmk and pkgadd. Additionally, you don't have be in the port's
+directory to call prt\-get. prt\-get will search for the respective port
+itself in a list of directories specified in /etc/prt\-get.conf. This
+allows you to just install or update a package, without caring where
+it actually is located on your file system.
+
+.PP
+
+prt\-get also offers some features like searching ports by name,
+showing information about ports (without installing them of course)
+and can list the dependencies listed in the Pkgfile, and provide a
+complete dependency list for a port. Note that dependencies are no
+requirement for crux packages and therefore not always accurate. There's
+a possiblity to use an external dependency map to get dependency
+listings for ports which don't provide them in their Pkgfile.
+
+.PP
+
+prt\-get has a test mode so you can see what effect an install/update
+operation would have. Use the \-\-test switch for this (see also:
+OPTIONS)
+
+.SH "RETURN VALUE"
+prt\-get returns 0 on success and a non-zero value otherwise (exact
+value -> meaning mapping to be determined...)
+
+.SH "COMMANDS"
+prt\-get uses so called commands, which always have to be the first
+non-option argument passed. This is very similar to
+.B cvs(1).
+[command] can be one of the following:
+
+
+.TP
+.B install [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
+install all packages in the listed order. Note that you can do this
+from any directory
+
+.TP
+.B depinst [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
+install all packages in the listed order including their dependencies.
+Note that outdated packages won't be updated.
+
+.TP
+.B grpinst [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
+install all packages in the listed order, but stop if installation of
+one package fails. This can be used to install packages where package2
+depends on package1
+
+.TP
+.B update [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
+update all packages listed in this order
+
+.TP
+.B remove <package1> [<package2> ...]
+remove packages listed in this order
+
+.TP
+.B sysup [\-\-nodeps]
+Update all installed packages which are outdated. Sorts by dependencies
+if specified. If you don't want prt-get to resolve the dependencies, use
+the --nodeps switch. Also see the
+.B lock
+and
+.B unlock
+commands to keep the currently installed versions, even if there are
+changes in the ports tree. If you want to update only diffs which have
+a lower version installed than the one in the ports tree, use the
+--prefer-higher option.
+
+.TP
+.B lock <package1> [<package2>...]
+Do not update these packages in a
+.B sysup
+operation
+
+.TP
+.B unlock <package1> [<package2>...]
+Remove lock from these packages
+
+.TP
+.B listlocked [-v|-vv]
+List names of packages which are locked. As always,
+.B -v
+will additionally show the version, and
+.B -vv
+also includes the description from the Pkgfile. Note that the
+.B -vv
+switch will slow down the operation remarkably.
+
+.TP
+.B diff [--all] [<package1> <package2> ...]
+show differences between installed packages and ports in the ports
+tree. If arguments are given, shows only differences for these
+packages, otherwise all differences are shown. It's also possible to use
+shell like
+.B wildcards
+for the diff command. Make sure you escape where needed. Locked
+packages are only displayed if you use the --all switch. If you want
+to see only diffs which have a lower version installed than the one in
+the ports tree, use the --prefer-higher option.
+
+.TP
+.B quickdiff
+prints a simple list of packages which have a different version in the
+ports tree than what is installed. This is meant as an input for
+.B prt\-get update,
+so you can update all ports on your system with one simple command. If you want
+to see only diffs which have a lower version installed than the one in
+the ports tree, use the --prefer-higher option.
+
+.TP
+.B search [\-v|\-vv] [--path] [--regex]<expr>
+Search the ports tree for
+.B expr
+in their name
+
+.TP
+.B dsearch [\-v|\-vv] [--path] [--regex]<expr>
+Search the ports tree for
+.B expr
+in both name and description. The search in the description is not case
+sensitive. Note that this requires prt\-get to read every Pkgfile, which
+makes it rather slow; if you like this, consider using the cache
+functionality, so you only have to spend this time once after updating
+the ports tree has been updated.
+
+.TP
+.B fsearch [--full] [--regex] <pattern>
+Search the ports tree for
+.B pattern
+as file name in their footprint. When called without '--full', strips
+the directories from the file names before matching; this behaviour
+will change in prt-get 0.6, where full path search will be
+default. Pattern can be a shell-like wildcard pattern (e.g prt-get
+fsearch "*.h") or regexps.
+
+
+.TP
+.B info <port>
+Print available info for a port
+
+.TP
+.B path <port>
+Print the path of a port
+
+.TP
+.B readme <port>
+Print the port's README file if it exists
+
+.TP
+.B depends <package1> [<package2> ...]
+print a recursive list of dependencies to install the packages passed
+as argument. It shows a list with ports which are found, plus a list
+of ports which are missing
+
+.TP
+.B quickdep <package1> [<package2> ...]
+print a simple list of recursive dependencies for all the ports passed
+as argument in a simple format to be used by
+.B prt\-get install
+to make an install including dependencies
+.B Does not display dependencies which are not in the ports tree
+
+.TP
+.B dependent <package>
+print a list of package which depend on
+.B package.
+Only list direct dependencies. Usually shows dependent packages which
+are installed. To see all dependencies, add the --all switch
+
+.TP
+.B deptree <package>
+print a tree of the dependencies of the package
+.B package.
+Subtrees already shown are marked with '-->' to save some space, in
+order to show them all, add the --all switch
+
+.TP
+.B dup
+List ports which can be found in multiple directories configured in
+.B /etc/prt.get.conf
+
+
+.TP
+.B list [\-v|\-vv] [filter] [--path] [--regex]
+List ports available in the ports tree. It's basically the same as
+.B ports \-l
+but looks in all directories specified in
+.B /etc/prt\-get.conf.
+It's also possible to use
+shell like
+.B wildcards
+for the list command. Make sure you escape where needed
+
+.TP
+.B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>]
+Print formated port list format string can contain variables, which
+are replaced like this:
+.TP
+\ \ \ \(bu
+%n \-> name
+
+.TP
+\ \ \ \(bu
+%p \-> path
+
+.TP
+\ \ \ \(bu
+%v \-> version
+
+.TP
+\ \ \ \(bu
+%r \-> release
+
+.TP
+\ \ \ \(bu
+%d \-> description
+
+.TP
+\ \ \ \(bu
+%e \-> dependencies
+
+.TP
+\ \ \ \(bu
+%u \-> URL
+
+.TP
+\ \ \ \(bu
+%P -> Packager
+
+.TP
+\ \ \ \(bu
+%M -> Maintainer
+
+.TP
+\ \ \ \(bu
+%R -> Readme ("yes"/"no")
+
+.TP
+\ \ \ \(bu
+%E -> pre-install script ("yes"/"no")
+
+.TP
+\ \ \ \(bu
+%O -> post-install script ("yes"/"no")
+
+.TP
+\ \ \ \(bu
+%l -> is locked ("yes"/"no")
+
+.TP
+\ \ \ \(bu
+%i \-> "no" if not installed, "yes" if it's installed and
+up to date and "diff" if it's installed and a new version is in the
+ports tree.
+
+Use "\\n" and "\\t" to format your output (no additional format specified
+suported). The optional format string2 can contain the same variables
+as format string1 and is used to sort the output. You can specify a
+.B wildcard filter
+to filter by package name.
+
+
+.TP
+.B listinst [\-v|\-vv] [filter] [--regex]
+List installed ports. It's basically the same as
+.B pkginfo \-i,
+but omits version when called without verbose (\-v, \-vv) switch. Plus
+it is notably faster in my tests. \-v adds version information, \-vv
+adds version and description.
+.B Warning:
+\-vv will slow down the process because it requires prt\-get to scan
+both the ports database and the ports tree.
+It's also possible to use shell like
+.B wildcards
+for the listinst command. Make sure you escape where needed
+
+
+
+.TP
+.B isinst <package>
+Check whether a package is installed. The same as
+.B pkginfo \-i|grep ^package
+.TP
+
+.TP
+.B current <package>
+Prints out the version of the currently installed package
+
+
+.TP
+.B ls [--path] <package>
+Prints out a listing of the port's directory
+
+.TP
+.B cat <package> [<file>]
+Prints out the file to stdout. If <file> is not specified, 'Pkgfile' is used
+
+.TP
+.B edit <package> <file>
+Edit the file using the editor specified in the $EDITOR environment variable.
+If <file> is not specified, 'Pkgfile' is used
+
+
+.TP
+.B help
+Shows a help screen
+
+.TP
+.B dumpconfig
+Dump the configuration to the current terminal
+
+.TP
+.B version
+Shows the current version of prt\-get
+
+.TP
+.B cache
+create a cache file from the ports tree to be used by prt\-get using the
+\-\-cache option. Remember to run prt\-get cache each time you update the
+ports tree
+
+.SH "OPTIONS"
+
+.TP
+.B -f, -i
+Force install; Implies 'pkgadd -f'; same as --aargs=-f
+
+.TP
+.B -fr
+Force rebuild, Implies 'pkgmk -f'; same as --margs=-f
+
+.TP
+.B -um
+Update md5sum, implies 'pkgmk -um'; same as --margs=-um
+
+.TP
+.B -im
+Ignore md5sum, implies 'pkgmk -im'; same as --margs=-im
+
+.TP
+.B -uf
+Update footprint, implies 'pkgmk -uf'; same as --margs=-uf
+
+.TP
+.B -if
+Ignore footprint, implies 'pkgmk -if'; same as --margs=-if
+
+.TP
+.B -ns
+No stripping, implies 'pkgmk -ns'; same as --margs=-ns
+
+.TP
+.B -kw
+Keep working directory, implies 'pkgmk -kw'; same as --margs=-kw
+
+.TP
+.B --ignore=<package1,package2,...>
+Don't install those packages, even if they're listed as dependency
+
+
+.TP
+.B \-\-cache
+Use cache file for this command
+
+.TP
+.B \-\-test
+Dry run, don't actually install anything, mostly interesting for
+.B prt\-get install, prt\-get grpinst, prt\-get update, prt\-get sysup
+
+.TP
+.B \-\-pre-install
+Execute pre-install script if it's there
+
+.TP
+.B \-\-post-install
+Execute post-install script if it's there
+
+.TP
+.B \-\-install-scripts
+Execute pre-install and post-install script if they're there
+
+.TP
+.B \-\-no-std-config
+Don't parse the default configuration file
+
+.TP
+.B \-\-config-prepend=<string>
+Prepend <string> to configuration
+
+.TP
+.B \-\-config-append=<string>
+Append <string> to configuration
+
+.TP
+.B \-\-config-set=<string>
+Set <string> in configuration, overriding configuration file
+
+
+.TP
+.B \-v, \-vv
+verbose and more verbose, relevant for
+.B prt\-get search, prt\-get list
+verbose shows version of a port, more verbose shows version and
+description (if available)
+
+.B \-\-path
+Show path info; used in 'search', 'dsearch', 'list' and 'depends'
+
+.B \-\-regex
+Interpret filter and search pattern as regular expression
+
+.TP
+.B \-\-margs="...", e.g. \-\-margs="\-im"
+arguments to be passed to pkgmk, relevant for
+.B prt\-get install, prt\-get grpinst, prt\-get update
+note that \-d is already passed to pkgmk anyway
+
+.TP
+.B \-\-aargs="...", e.g. \-\-aargs="\-f"
+arguments to be passed to pkgadd, relevant for
+.B prt\-get install, prt\-get grpinst, prt\-get update
+
+.TP
+.B \-\-rargs="..."
+arguments to be passed to pkgrm; currently not used, implemented for
+future uses and consistency reasons
+
+.TP
+.B \-\-prefer-higher, -ph
+Make prt-get parse the version strings and prefer the higher version,
+even if the one found in the ports tree is lower. Will influence diff,
+quickdiff and sysup.
+
+.TP
+.B \-\-strict-diff, -sd
+Override the 'preferhigher' configuration option
+
+
+.TP
+.B \-\-config=<file>
+Use alternative configuration file to read ports directories from
+
+.TP
+.B \-\-install-root=<dir>
+Use <dir> as root directory for your installation; allows to install to
+a different directory than '/'. In daily usage, this option is not
+required; helpful if you're developing an independent installation.
+
+.TP
+.B \-\-log
+Write build output to log file
+
+.SH "CONFIGURATION"
+.TP
+See man prt\-get.conf(5)
+
+.SH "EXAMPLES"
+.TP
+.B prt\-get install irssi
+download, build and install irssi, with one simple command
+
+.TP
+.B prt\-get install indent mplayer
+install indent and mplayer
+
+.TP
+.B prt\-get update openssh
+update your current version of openssh :\-)
+
+.TP
+.B prt\-get info kdelibs
+show info about kdelibs
+
+.TP
+.B prt\-get search icq
+Search all ports containing 'icq' in their name
+
+.TP
+.B prt\-get grpinst \-\-test `prt\-get quickdep kdenetwork`
+Show what would happen if you installed all packages needed for
+kdenetwork (test mode). Remove \-\-test to install kdenetwork and all
+it's dependencies. Remember that grpinst stops installing when one
+installing of one package fails
+
+.TP
+.B prt\-get update `prt\-get quickdiff`
+Update all packages where a different version is in the ports tree
+
+.SH "AUTHORS"
+Johannes Winkelmann <jw@tks6.net>
+.SH "SEE ALSO"
+prt\-get.conf(5), prt\-cache(8), pkgmk(8) pkgadd(8), ports(8)
diff --git a/doc/prt-get.conf.5 b/doc/prt-get.conf.5
new file mode 100644
index 0000000..8166784
--- /dev/null
+++ b/doc/prt-get.conf.5
@@ -0,0 +1,157 @@
+.\" man page for prt-get.conf
+.\" Johannes Winkelmann, jw@tks6.net
+
+
+.PU
+.TH prt-get.conf 5
+.SH "NAME"
+.LP
+prt-get.conf - Configuration file for prt-get
+
+.SH "DESCRIPTION"
+This file, by default
+.IR /etc/prt-get.conf ,
+is read by prt-get and prt-cache (see prt-get(8) and prt-cache(8))
+.LP
+It might look like this:
+.IP
+.nf
+###
+# prt-get.conf
+
+# root directories
+prtdir /usr/ports/base
+prtdir /usr/ports/opt
+prtdir /usr/ports/contrib
+
+prtdir /usr/ports/unofficial
+
+# use mutt and yafc from local build directory
+prtdir /home/jw/build:mutt, yafc
+
+# change default location of cache file
+cachefile /tmp/port-cache
+
+# write a log file
+writelog enabled
+logmode append
+logfile /tmp/log/%n.log
+
+# show compact readme information
+readme compact
+
+# execute pre- and post-installs scripts (default no)
+runscripts yes
+
+# don't prefer higher versions (default no)
+preferhigher yes
+
+# use regexps for searching (default no)
+useregex yes
+.fi
+
+.LP
+There are a few values to be configured: the location where to look
+for the ports, the location of the cache file, some log options and
+how to notify the user about README files.
+
+If you don't specify the
+cache file, the default location is
+.B /var/lib/pkg/prt-get.conf
+
+.LP
+Every line can contain one configuration option. The format of the lines
+is
+.B <key> <value>.
+The valid keys are
+.B prtdir
+and
+.B cachefile.
+The value for
+.B prtdir
+is a directory, the value for
+.B cachefile
+is a file to be used as cache
+
+.nf
+<portname1>:<dependency1> <dependency2>
+<portname2>:<dependency1>
+
+.B runscripts
+if set to yes, execute pre- and post-install scripts
+
+.B preferhigher
+if set to yes, prt-get will parse version strings and prefer the
+higher one, even if the one found in the ports tree is lower. Will
+influence diff, quickdiff and sysup
+
+.B useregex
+if set to yes, prt-get will interpret search and filter patterns in
+list, listinst, printf, search, dsearch and fsearch as regular
+expressions. This will be the default in prt-get 0.6.
+
+.LP
+.B makecommand
+.B addcommand
+.B removecommand
+.B runscriptcommand
+can be used to use an alternate command instead of 'pkgmk' for the
+makecommand,'pkgadd' for the addcommand, 'pkgrm' for the
+removecommand and 'sh' for the command which is used to run the pre- and
+post-install scripts. These are expert options which shouldn't be used
+in general; when used the wrong way, they can completely break prt-get's
+original functionality.
+
+
+
+.LP
+The log options are
+.B writelog
+which can be set to 'enabled' or 'disabled'
+.B logmode
+which can be set to 'append' or 'overwrite'
+.B logfile
+which represent the file path. All occurances of %n in logfile are
+replaced with the port name and all occurances of %p are
+replaced with the port's path, e.g. for port gcc in base, %p would be
+.B /usr/base
+and %n
+.B gcc.
+This allows you to have separate log files per port.
+
+.LP
+If the readme option is set to something different than 'disabled',
+prt-get will notify the user if she/he installs a port with a README
+file. The option to configure this is called
+.B readme
+which can be set to 'verbose' (print separate information about README
+files), 'compact' (integrate in result output) or 'disabled' (no information about README files). See
+.B prt-get(8)
+and especially the readme command how to read those README files using
+prt-get
+
+.LP
+The order of the prtdir options is important, as if a port is in multiple
+directories, prt-get will use the one found first (directories listed
+first have precedence)
+
+.LP
+If you want to restrict the ports used from one prtdir, you can
+append a comma separated list of ports to be used after the path,
+using a colon (':') character to separate the two components
+.B path:package1, package2,...
+Note that this slows down prt-get a lot if you list a lot of packages.
+If you become aware of speed problems due to this, create a separate
+ports directory instead and use symlinks for the ports you want to use
+
+.LP
+You can write comments after a '#' character. If you have '#'
+characters in you pathes, there's no way to escape them (as there is no
+way to escape ':' characters). Complain to the author if this is a
+problem :-)
+
+
+.SH "AUTHORS"
+Johannes Winkelmann <jw@tks6.net>
+.SH "SEE ALSO"
+prt-get(8), pkgmk(8) pkgadd(8), ports(8)
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..36f96f3
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,276 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+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
+
+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=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp=$pathcomp$1
+ shift
+
+ if [ ! -d "$pathcomp" ] ;
+ then
+ $mkdirprog "$pathcomp"
+ else
+ :
+ fi
+
+ pathcomp=$pathcomp/
+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.
+
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+
+{
+ (exit 0); exit
+}
diff --git a/misc/Makefile.am b/misc/Makefile.am
new file mode 100644
index 0000000..220bafe
--- /dev/null
+++ b/misc/Makefile.am
@@ -0,0 +1,16 @@
+EXTRA_DIST = prt-get_complete prt-get.aliases prt-get.deplist prt-get.conf
+
+sysconf_DATA = prt-get.conf
+
+install-data-local:
+ $(INSTALL) -D -m 644 $(srcdir)/prt-get.deplist \
+ $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.deplist
+ $(INSTALL) -D -m 644 $(srcdir)/prt-get.aliases \
+ $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.aliases
+# $(INSTALL) -D -m 644 $(srcdir)/prt-get.conf \
+# $(DESTDIR)$(sysconfdir)/prt-get.conf
+
+uninstall-local:
+ rm $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.deplist
+ rm $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.aliases
+# rm $(DESTDIR)$(sysconfigdir)/etc/prt-get.conf
diff --git a/misc/Makefile.in b/misc/Makefile.in
new file mode 100644
index 0000000..0d18825
--- /dev/null
+++ b/misc/Makefile.in
@@ -0,0 +1,323 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = misc
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(sysconfdir)"
+sysconfDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(sysconf_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+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@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_STRIP = @ac_ct_STRIP@
+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_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+EXTRA_DIST = prt-get_complete prt-get.aliases prt-get.deplist prt-get.conf
+sysconf_DATA = prt-get.conf
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu misc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu misc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+install-sysconfDATA: $(sysconf_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)"
+ @list='$(sysconf_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \
+ $(sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \
+ done
+
+uninstall-sysconfDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sysconf_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+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 $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(sysconfdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+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-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-exec-am: install-sysconfDATA
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-local uninstall-sysconfDATA
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-local install-exec install-exec-am install-info \
+ install-info-am install-man install-strip install-sysconfDATA \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
+ uninstall-local uninstall-sysconfDATA
+
+
+install-data-local:
+ $(INSTALL) -D -m 644 $(srcdir)/prt-get.deplist \
+ $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.deplist
+ $(INSTALL) -D -m 644 $(srcdir)/prt-get.aliases \
+ $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.aliases
+# $(INSTALL) -D -m 644 $(srcdir)/prt-get.conf \
+# $(DESTDIR)$(sysconfdir)/prt-get.conf
+
+uninstall-local:
+ rm $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.deplist
+ rm $(DESTDIR)$(localstatedir)/lib/pkg/prt-get.aliases
+# rm $(DESTDIR)$(sysconfigdir)/etc/prt-get.conf
+# 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 --git a/misc/prt-get.aliases b/misc/prt-get.aliases
new file mode 100644
index 0000000..3e1be34
--- /dev/null
+++ b/misc/prt-get.aliases
@@ -0,0 +1,6 @@
+j2sdk: j2re
+lesstif: openmotif
+postfix: sendmail
+exim: sendmail
+qmail: sendmail
+masqmail: sendmail
diff --git a/misc/prt-get.conf b/misc/prt-get.conf
new file mode 100644
index 0000000..b4ea28f
--- /dev/null
+++ b/misc/prt-get.conf
@@ -0,0 +1,42 @@
+###
+### prt-get conf
+###
+
+prtdir /usr/ports/base
+prtdir /usr/ports/opt
+
+### clc ports
+prtdir /usr/ports/contrib
+
+### use mypackage form local directory
+# prtdir /home/packages/build:mypackage
+
+### use alternate cache file (default: /var/lib/pkg/prt-get.cache
+# cachefile /mnt/nfs/cache
+
+### log options:
+# writelog enabled # (enabled|disabled)
+# logmode overwrite # (append|overwrite)
+logfile /var/log/pkgbuild/%n.log
+ # path, %p=path to port dir, %n=port name
+ # %v=version, %r=release
+
+### print README information:
+# readme verbose # (verbose|compact|disabled)
+
+### run pre- and post-installs scripts; yes is equivalent to the
+### --install-scripts option
+# runscripts no # (no|yes)
+
+### alternative commands
+# makecommand pkgmk
+# addcommand pkgadd
+# removecommand pkgrm
+# runscriptcommand sh
+
+
+### prefer higher versions in sysup / diff
+# preferhigher no # (yes|no)
+
+### use regexp search
+# useregex no # (yes|no)
diff --git a/misc/prt-get.deplist b/misc/prt-get.deplist
new file mode 100644
index 0000000..51145cb
--- /dev/null
+++ b/misc/prt-get.deplist
@@ -0,0 +1,28 @@
+# dependencies for opt ports, 16 May 2004, Jürgen Daubert
+
+atk : glib
+audiofile : pkgconfig
+cvs : openssl
+emacs : x11 libtiff
+esound : audiofile
+fetchmail : openssl
+firefox : gtk libidl
+fontconfig : freetype expat pkgconfig
+glib : gettext pkgconfig
+gtk : atk pango libtiff
+libidl : glib
+libogg : pkgconfig
+libpng : pkgconfig
+libtiff : libjpeg
+libvorbis : libogg
+openssh : openssl
+pango : glib x11
+pine : openssl
+ppp : openssl
+webfs : openssl
+windowmaker : x11 libtiff libungif
+xchat : gtk openssl
+x11 : fontconfig libpng
+zip : unzip
+
+# End of file
diff --git a/misc/prt-get_complete b/misc/prt-get_complete
new file mode 100644
index 0000000..c1be89a
--- /dev/null
+++ b/misc/prt-get_complete
@@ -0,0 +1,98 @@
+# prt-get(8), prt-cache(8) completion by Johannes Winkelmann, jw@tks6.net
+# problems: options ending on = should not add a space afterwards
+#
+# 07.07.2002: use prt-get listinst (from 0.3.1pre1) instead of pkginfo
+# 06.07.2002: first version
+
+_prt-get()
+{
+ local cur prev
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ if [ $COMP_CWORD -eq 1 ]; then
+ COMPREPLY=( $( compgen -W ' \
+ install depinst update grpinst help \
+ version readme list info path \
+ search dsearch fsearch printf cache \
+ dependent sysup current lock unlock \
+ listlocked diff quickdiff depends quickdep \
+ dup isinst cat ls edit deptree \
+ remove listinst' $cur ))
+ fi
+
+
+ if [ $COMP_CWORD '>' 1 ]; then
+ if [[ "$cur" != -* ]]; then
+ case ${COMP_WORDS[1]} in
+ "install" | "depinst" | "grpinst" | "path" | "dependent" | \
+ "depends" | "quickdep" | "info" | "readme" | \
+ "ls" | "isinst" | "deptree" )
+ if [ -f /var/lib/pkg/prt-get.cache ]; then
+ plist=`prt-cache list`
+ if [ ! "$plist" == "" ]; then
+ COMPREPLY=( $( compgen -W '$plist' $cur ) )
+ fi
+ fi
+ ;;
+ "cat" | "edit" )
+ if [ $COMP_CWORD '>' 2 ]; then
+ plist=`prt-get ls ${COMP_WORDS[2]}`
+ COMPREPLY=( $( compgen -W '$plist' $cur ) )
+ else
+ if [ -f /var/lib/pkg/prt-get.cache ]; then
+ plist=`prt-cache list`
+ if [ ! "$plist" == "" ]; then
+ COMPREPLY=( $( compgen -W '$plist' $cur ) )
+ fi
+ fi
+ fi
+ ;;
+ "current"|"lock"|"remove")
+ plist=`prt-get listinst`
+ COMPREPLY=( $( compgen -W '$plist' $cur ) )
+ ;;
+ "update")
+ plist=`prt-get quickdiff`
+ COMPREPLY=( $( compgen -W '$plist' $cur ) )
+ ;;
+ "unlock")
+ plist=`prt-get listlocked`
+ COMPREPLY=( $( compgen -W '$plist' $cur ) )
+ ;;
+ esac
+ else
+ case ${COMP_WORDS[1]} in
+ "install" | "update" | "groupinst")
+ COMPREPLY=( $( compgen -W '--config= --cache \
+ --pre-install \
+ --post-install \
+ --install-scripts \
+ --log --test \
+ --config \
+ --config-append= \
+ --config-prepend= \
+ --config-set= \
+ --aargs= --margs= \
+ --rargs= \
+ --install-root=' \
+ -- $cur ) )
+ ;;
+ "list" | "search" | "dsearch" )
+ COMPREPLY=( $( compgen -W '-v -vv --cache \
+ --config=' -- $cur ) )
+ ;;
+ *)
+ COMPREPLY=( $( compgen -W '--cache --log --test --config=' \
+ -- $cur ) )
+ ;;
+ esac
+ fi
+ fi
+
+ return 0
+}
+complete -F _prt-get -o default prt-get
+complete -F _prt-get -o default prt-cache
diff --git a/missing b/missing
new file mode 100755
index 0000000..6a37006
--- /dev/null
+++ b/missing
@@ -0,0 +1,336 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing 0.4 - GNU automake"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. 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
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. 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
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..d2d5f21
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,111 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage" 1>&2
+ exit 0
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+case $dirmode in
+ '')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ fi
+ ;;
+esac
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
+# mkinstalldirs ends here
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..4bb3e1f
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,29 @@
+# Makefile.am for prt-get by Johannes Winkelmann
+
+install-exec-local: install-binPROGRAMS
+ (cd $(DESTDIR)$(bindir); ln -sf prt-get prt-cache)
+
+bin_PROGRAMS=prt-get
+
+prt_get_SOURCES= argparser.cpp argparser.h\
+ depresolver.cpp depresolver.h \
+ installtransaction.cpp installtransaction.h \
+ main.cpp \
+ package.cpp package.h \
+ pkgdb.cpp pkgdb.h \
+ prtget.cpp prtget.h \
+ repository.cpp repository.h \
+ stringhelper.cpp stringhelper.h \
+ process.cpp process.h \
+ configuration.cpp configuration.h \
+ signaldispatcher.cpp signaldispatcher.h \
+ lockfile.cpp lockfile.h \
+ file.cpp file.h \
+ locker.cpp locker.h \
+ versioncomparator.cpp versioncomparator.h \
+ datafileparser.cpp datafileparser.h \
+ pg_regex.cpp pg_regex.h
+
+
+AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLOCALSTATEDIR=\"$(localstatedir)\"
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..b032884
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,452 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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 for prt-get by Johannes Winkelmann
+
+SOURCES = $(prt_get_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+bin_PROGRAMS = prt-get$(EXEEXT)
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(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_prt_get_OBJECTS = argparser.$(OBJEXT) depresolver.$(OBJEXT) \
+ installtransaction.$(OBJEXT) main.$(OBJEXT) package.$(OBJEXT) \
+ pkgdb.$(OBJEXT) prtget.$(OBJEXT) repository.$(OBJEXT) \
+ stringhelper.$(OBJEXT) process.$(OBJEXT) \
+ configuration.$(OBJEXT) signaldispatcher.$(OBJEXT) \
+ lockfile.$(OBJEXT) file.$(OBJEXT) locker.$(OBJEXT) \
+ versioncomparator.$(OBJEXT) datafileparser.$(OBJEXT) \
+ pg_regex.$(OBJEXT)
+prt_get_OBJECTS = $(am_prt_get_OBJECTS)
+prt_get_LDADD = $(LDADD)
+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 = $(prt_get_SOURCES)
+DIST_SOURCES = $(prt_get_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+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@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_STRIP = @ac_ct_STRIP@
+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_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+prt_get_SOURCES = argparser.cpp argparser.h\
+ depresolver.cpp depresolver.h \
+ installtransaction.cpp installtransaction.h \
+ main.cpp \
+ package.cpp package.h \
+ pkgdb.cpp pkgdb.h \
+ prtget.cpp prtget.h \
+ repository.cpp repository.h \
+ stringhelper.cpp stringhelper.h \
+ process.cpp process.h \
+ configuration.cpp configuration.h \
+ signaldispatcher.cpp signaldispatcher.h \
+ lockfile.cpp lockfile.h \
+ file.cpp file.h \
+ locker.cpp locker.h \
+ versioncomparator.cpp versioncomparator.h \
+ datafileparser.cpp datafileparser.h \
+ pg_regex.cpp pg_regex.h
+
+AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLOCALSTATEDIR=\"$(localstatedir)\"
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+prt-get$(EXEEXT): $(prt_get_OBJECTS) $(prt_get_DEPENDENCIES)
+ @rm -f prt-get$(EXEEXT)
+ $(CXXLINK) $(prt_get_LDFLAGS) $(prt_get_OBJECTS) $(prt_get_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argparser.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/configuration.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datafileparser.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/depresolver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/installtransaction.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locker.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lockfile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/package.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pg_regex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkgdb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prtget.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repository.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signaldispatcher.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringhelper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versioncomparator.Po@am__quote@
+
+.cpp.o:
+@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@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@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@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(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-exec-local
+
+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-exec-local 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
+
+
+install-exec-local: install-binPROGRAMS
+ (cd $(DESTDIR)$(bindir); ln -sf prt-get prt-cache)
+# 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 --git a/src/argparser.cpp b/src/argparser.cpp
new file mode 100644
index 0000000..c39e626
--- /dev/null
+++ b/src/argparser.cpp
@@ -0,0 +1,445 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: argparser.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+#include "argparser.h"
+
+/*!
+ Construct a ArgParser object
+ \param argc argument count
+ \param argv argument vector
+*/
+ArgParser::ArgParser( int argc, char** argv )
+ : m_isCommandGiven( false ),
+ m_isForced( false ),
+ m_isTest( false ),
+ m_isAlternateConfigGiven( false ),
+ m_useCache( false ),
+ m_calledAsPrtCache( false ),
+ m_alternateConfigFile( "" ),
+ m_pkgmkArgs( "" ),
+ m_pkgaddArgs( "" ),
+ m_pkgrmArgs( "" ),
+ m_installRoot( "" ),
+ m_ignore( "" ),
+ m_argc( argc ),
+ m_argv( argv ),
+ m_verbose( 0 ),
+ m_writeLog( false ),
+ m_hasFilter( false ),
+ m_noStdConfig( false ),
+ m_nodeps( false ),
+ m_all( false ),
+ m_printPath( false ),
+ m_execPreInstall( false ),
+ m_execPostInstall( false ),
+ m_preferHigher( false ),
+ m_strictDiff( false ),
+ m_useRegex(false),
+ m_fullPath(false)
+{
+}
+
+
+/*!
+ \return true if an alternate configuration file is given
+*/
+bool ArgParser::isAlternateConfigGiven() const
+{
+ return m_isAlternateConfigGiven;
+}
+
+
+/*!
+ \return true if a command is given
+*/
+bool ArgParser::isCommandGiven() const
+{
+ return m_isCommandGiven;
+}
+
+
+/*!
+ \return a list of arguments not processed by ArgParser
+*/
+const list<char*>& ArgParser::otherArgs() const
+{
+ return m_otherArgs;
+}
+
+
+/*!
+ \return what command was given
+*/
+ArgParser::Type ArgParser::commandType() const
+{
+ return m_commandType;
+}
+
+
+/*!
+ \return addtional arguments to pkgmk
+*/
+const string& ArgParser::pkgmkArgs() const
+{
+ return m_pkgmkArgs;
+}
+
+
+/*!
+ \return addtional arguments to pkgadd
+*/
+const string& ArgParser::pkgaddArgs() const
+{
+ return m_pkgaddArgs;
+}
+
+
+/*!
+ \return the name of the alternative configuration file
+*/
+const string& ArgParser::alternateConfigFile() const
+{
+ return m_alternateConfigFile;
+}
+
+
+/*!
+ parse the arguments
+ \return true on success
+*/
+bool ArgParser::parse()
+{
+ const int commandCount = 34;
+ string commands[commandCount] = { "list", "search", "dsearch",
+ "info",
+ "depends", "install", "depinst",
+ "help", "isinst", "dup", "update",
+ "quickdep", "diff", "quickdiff",
+ "grpinst", "version", "cache",
+ "path", "listinst", "printf", "readme",
+ "dependent", "sysup", "current",
+ "fsearch", "lock", "unlock",
+ "listlocked", "cat", "ls", "edit",
+ "remove", "deptree", "dumpconfig" };
+
+ Type commandID[commandCount] = { LIST, SEARCH, DSEARCH, INFO,
+ DEPENDS, INSTALL, DEPINST,
+ HELP, ISINST, DUP, UPDATE,
+ QUICKDEP, DIFF, QUICKDIFF,
+ GRPINST, SHOW_VERSION, CREATE_CACHE,
+ PATH, LISTINST, PRINTF, README,
+ DEPENDENT, SYSUP, CURRENT,
+ FSEARCH, LOCK, UNLOCK, LISTLOCKED,
+ CAT, LS, EDIT, REMOVE, DEPTREE,
+ DUMPCONFIG };
+ if ( m_argc < 2 ) {
+ return false;
+ }
+
+ // if called from a symlink ending on prt-cache, use cached
+ // access
+ string app = m_argv[0];
+ string::size_type pos = app.rfind( "/" );
+ if ( pos != string::npos ) {
+ app = app.substr( pos );
+ }
+ if ( app.find( "prt-cache" ) != string::npos ) {
+ m_useCache = true;
+ m_calledAsPrtCache = true;
+ }
+
+ for ( int i = 1; i < m_argc; ++i ) {
+ if ( m_argv[i][0] == '-' ) {
+ string s = m_argv[i];
+ if ( s == "-v" ) {
+ m_verbose += 1;
+ } else if ( s == "-vv" ) {
+ m_verbose += 2;
+ } else if ( s == "--force" ) {
+ m_isForced = true;
+ } else if ( s == "--test" ) {
+ m_isTest = true;
+ } else if ( s == "--cache" ) {
+ m_useCache = true;
+ } else if ( s == "--nodeps" ) {
+ m_nodeps = true;
+ } else if ( s == "--all" ) {
+ m_all = true;
+ } else if ( s == "--path" ) {
+ m_printPath = true;
+ } else if ( s == "--log" ) {
+ m_writeLog = true;
+ } else if ( s == "--pre-install" ) {
+ m_execPreInstall = true;
+ } else if ( s == "--post-install" ) {
+ m_execPostInstall = true;
+ } else if ( s == "--install-scripts" ) {
+ m_execPreInstall = true;
+ m_execPostInstall = true;
+ } else if ( s == "--no-std-config" ) {
+ m_noStdConfig = true;
+ } else if ( s == "--prefer-higher" || s == "-ph" ) {
+ m_preferHigher = true;
+ } else if ( s == "--strict-diff" || s == "-sd" ) {
+ m_strictDiff = true;
+ } else if ( s == "--regex" ) {
+ m_useRegex = true;
+ } else if ( s == "--full" ) {
+ m_fullPath = true;
+
+ } else if ( s == "-f" ) {
+ m_pkgaddArgs += " " + s;
+ } else if ( s == "-fr" ) {
+ m_pkgmkArgs += " -f";
+ } else if ( s == "-if" ) {
+ m_pkgmkArgs += " " + s;
+ } else if ( s == "-uf" ) {
+ m_pkgmkArgs += " " + s;
+ } else if ( s == "-im" ) {
+ m_pkgmkArgs += " " + s;
+ } else if ( s == "-um" ) {
+ m_pkgmkArgs += " " + s;
+ } else if ( s == "-kw" ) {
+ m_pkgmkArgs += " " + s;
+ } else if ( s == "-ns" ) {
+ m_pkgmkArgs += " " + s;
+ } else if ( s == "-fi" ) {
+ m_pkgaddArgs += " -f";
+ }
+
+ // substrings
+ else if ( s.substr( 0, 8 ) == "--margs=" ) {
+ m_pkgmkArgs += " " + s.substr( 8 );
+ } else if ( s.substr( 0, 8 ) == "--aargs=" ) {
+ m_pkgaddArgs += " " + s.substr( 8 );
+ } else if ( s.substr( 0, 8 ) == "--rargs=" ) {
+ m_pkgrmArgs = s.substr( 8 );
+ } else if ( s.substr( 0, 7 ) == "--sort=" ) {
+ m_sortArgs = s.substr( 7 );
+ } else if ( s.substr( 0, 9 ) == "--filter=" ) {
+ m_filter = s.substr( 9 );
+ m_hasFilter = true;
+ } else if ( s.substr( 0, 9 ) == "--config=" ) {
+ m_alternateConfigFile = s.substr( 9 );
+ m_isAlternateConfigGiven = true;
+ } else if ( s.substr( 0, 16 ) == "--config-append=" ) {
+ m_configData.push_back(make_pair(m_argv[i]+16,
+ CONFIG_APPEND ) );
+ } else if ( s.substr( 0, 17 ) == "--config-prepend=" ) {
+ m_configData.push_back(make_pair(m_argv[i]+17,
+ CONFIG_PREPEND ) );
+ } else if ( s.substr( 0, 13 ) == "--config-set=" ) {
+ m_configData.push_back(make_pair(m_argv[i]+13, CONFIG_SET ) );
+ } else if ( s.substr( 0, 15 ) == "--install-root=" ) {
+ m_installRoot = s.substr(15);
+ } else if ( s.substr( 0, 9 ) == "--ignore=" ) {
+ m_ignore = s.substr(9);
+ } else {
+ m_unknownOption = s;
+ return false;
+ }
+ } else {
+ if (!m_isCommandGiven) {
+ string s = m_argv[i];
+ m_commandName = s;
+ for ( int i = 0; i < commandCount; ++i ) {
+ if ( s == commands[i] ) {
+ m_isCommandGiven = true;
+ m_commandType = commandID[i];
+ break;
+ }
+ }
+ // first argument must be command
+ if ( !m_isCommandGiven ) {
+ return false;
+ }
+ } else {
+ m_otherArgs.push_back( m_argv[i] );
+ }
+ }
+ }
+
+
+
+ return m_isCommandGiven;
+}
+
+
+/*!
+ \return true whether --force has been specified
+*/
+bool ArgParser::isForced() const
+{
+ return m_isForced;
+}
+
+
+/*!
+ \return true whether --test has been specified
+*/
+bool ArgParser::isTest() const
+{
+ return m_isTest;
+}
+
+
+/*!
+ \return the level of verbose: -v -> 1, -vv -> 2
+*/
+int ArgParser::verbose() const
+{
+ return m_verbose;
+}
+
+
+/*!
+ \return whether --cache has been specified
+*/
+bool ArgParser::useCache() const
+{
+ return m_useCache;
+}
+
+
+/*!
+ \return whether prt-get was called as 'prt-cache' or not
+*/
+bool ArgParser::wasCalledAsPrtCached() const
+{
+ return m_calledAsPrtCache;
+}
+
+/*!
+ \return whether prt-get should write to a log file or not
+*/
+bool ArgParser::writeLog() const
+{
+ return m_writeLog;
+}
+
+/*!
+ \return the --sort="..." string
+*/
+const string& ArgParser::sortArgs() const
+{
+ return m_sortArgs;
+}
+
+/*!
+ \return whether there was a --filter argument
+*/
+bool ArgParser::hasFilter() const
+{
+ return m_hasFilter;
+}
+
+
+/*!
+ \return whether there was a --no-std-config argument
+ */
+bool ArgParser::noStdConfig() const
+{
+ return m_noStdConfig;
+}
+
+
+/*!
+ \return the --filter="..." string
+*/
+const string& ArgParser::filter() const
+{
+ return m_filter;
+}
+
+/*!
+ \return whether there was a --nodeps argument
+*/
+bool ArgParser::nodeps() const
+{
+ return m_nodeps;
+}
+
+/*!
+ \return whether there was a --all argument
+*/
+bool ArgParser::all() const
+{
+ return m_all;
+}
+
+bool ArgParser::printPath() const
+{
+ return m_printPath;
+}
+
+const string& ArgParser::commandName() const
+{
+ return m_commandName;
+}
+
+const string& ArgParser::unknownOption() const
+{
+ return m_unknownOption;
+}
+
+bool ArgParser::execPreInstall() const
+{
+ return m_execPreInstall;
+}
+
+bool ArgParser::execPostInstall() const
+{
+ return m_execPostInstall;
+}
+
+const list< pair<char*, ArgParser::ConfigArgType> >
+ArgParser::configData() const
+{
+ return m_configData;
+}
+
+const string& ArgParser::installRoot() const
+{
+ return m_installRoot;
+}
+
+const string& ArgParser::pkgrmArgs() const
+{
+ return m_pkgrmArgs;
+}
+
+bool ArgParser::preferHigher() const
+{
+ return m_preferHigher;
+}
+
+bool ArgParser::strictDiff() const
+{
+ return m_strictDiff;
+}
+
+bool ArgParser::useRegex() const
+{
+ return m_useRegex;
+}
+
+bool ArgParser::fullPath() const
+{
+ return m_fullPath;
+}
+
+
+const string& ArgParser::ignore() const
+{
+ return m_ignore;
+}
diff --git a/src/argparser.h b/src/argparser.h
new file mode 100644
index 0000000..1859c35
--- /dev/null
+++ b/src/argparser.h
@@ -0,0 +1,133 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: argparser.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _ARGPARSER_H_
+#define _ARGPARSER_H_
+
+#include <list>
+#include <string>
+using namespace std;
+
+/*!
+ \class ArgParser
+ \brief Argument Parser
+
+ This is the argument parser for prt-get.
+*/
+class ArgParser
+{
+public:
+ ArgParser( int argc, char** argv );
+
+ bool parse();
+
+ /*! Command type */
+ enum Type { HELP, LIST, SEARCH, DSEARCH, INSTALL, DEPINST,
+ INFO, DEPENDS, ISINST, DUP, UPDATE,
+ QUICKDEP, DIFF, GRPINST, GRPUPDATE,
+ QUICKDIFF, SHOW_VERSION, CREATE_CACHE, PATH,
+ LISTINST, PRINTF, README, DEPENDENT, SYSUP,
+ CURRENT, FSEARCH, LOCK, UNLOCK, LISTLOCKED,
+ CAT, LS, EDIT, REMOVE,
+ DEPTREE, DUMPCONFIG };
+
+ bool isCommandGiven() const;
+ bool isForced() const;
+ bool isTest() const;
+ bool isAlternateConfigGiven() const;
+ bool useCache() const;
+ bool wasCalledAsPrtCached() const;
+ bool writeLog() const;
+ bool hasFilter() const;
+ bool noStdConfig() const;
+ bool nodeps() const;
+ bool all() const;
+ bool printPath() const;
+ bool execPreInstall() const;
+ bool execPostInstall() const;
+ bool preferHigher() const;
+ bool strictDiff() const;
+ bool useRegex() const;
+ bool fullPath() const;
+
+ const string& alternateConfigFile() const;
+ const string& pkgmkArgs() const;
+ const string& pkgaddArgs() const;
+ const string& pkgrmArgs() const;
+ const string& sortArgs() const;
+ const string& filter() const;
+ const string& installRoot() const;
+ const string& ignore() const;
+
+
+ Type commandType() const;
+
+ const string& commandName() const;
+ const string& unknownOption() const;
+
+ const list<char*>& otherArgs() const;
+
+ int verbose() const;
+
+ enum ConfigArgType { CONFIG_SET, CONFIG_APPEND, CONFIG_PREPEND };
+
+ const list< pair<char*, ConfigArgType> > configData() const;
+
+
+private:
+
+ bool m_isCommandGiven;
+ bool m_isForced;
+ bool m_isTest;
+ bool m_isAlternateConfigGiven;
+ bool m_useCache;
+ bool m_calledAsPrtCache;
+ bool m_hasFilter;
+ bool m_noStdConfig;
+
+ bool m_writeLog;
+
+ bool m_nodeps;
+
+ bool m_all;
+ bool m_printPath;
+
+ bool m_execPreInstall;
+ bool m_execPostInstall;
+ bool m_preferHigher;
+ bool m_strictDiff;
+ bool m_useRegex;
+ bool m_fullPath;
+
+ string m_alternateConfigFile;
+ string m_pkgmkArgs;
+ string m_pkgaddArgs;
+ string m_pkgrmArgs;
+ string m_sortArgs;
+ string m_filter;
+ string m_commandName;
+ string m_unknownOption;
+ string m_installRoot;
+ string m_ignore;
+
+ Type m_commandType;
+
+ int m_argc;
+ char** m_argv;
+
+ int m_verbose;
+
+ list<char*> m_otherArgs;
+
+ list< pair<char*, ConfigArgType> > m_configData;
+};
+
+#endif /* _ARGPARSER_H_ */
diff --git a/src/configuration.cpp b/src/configuration.cpp
new file mode 100644
index 0000000..5cacc7f
--- /dev/null
+++ b/src/configuration.cpp
@@ -0,0 +1,225 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: configuration.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <iostream>
+#include <cstdio>
+#include <dirent.h>
+
+#include "configuration.h"
+#include "stringhelper.h"
+#include "argparser.h"
+
+using namespace std;
+using namespace StringHelper;
+
+Configuration::Configuration( const std::string& configFile,
+ const ArgParser* parser )
+ : m_configFile( configFile ),
+ m_parser( parser ),
+ m_writeLog( false ),
+ m_appendLog( false ),
+ m_logFilePattern( "" ),
+ m_cacheFile( "" ),
+ m_readmeMode( VERBOSE_README ),
+ m_runScripts( false ),
+ m_preferHigher( false ),
+ m_useRegex( false ),
+ m_makeCommand( "" ), m_addCommand( "" ),
+ m_removeCommand( "" ), m_runscriptCommand( "" )
+{
+
+}
+
+
+bool Configuration::parse()
+{
+ FILE* fp = fopen( m_configFile.c_str(), "r" );
+ if ( !fp ) {
+ return false;
+ }
+
+ const int length = BUFSIZ;
+ char input[length];
+ string s;
+ while ( fgets( input, length, fp ) ) {
+ s = input;
+ s = getValueBefore( s, '#' );
+ s = stripWhiteSpace( s );
+ parseLine(s);
+ }
+
+ fclose( fp );
+
+ // command line arguments override config:
+ if ( m_parser->writeLog() ) {
+ m_writeLog = true;
+ }
+
+ return true;
+}
+
+bool Configuration::writeLog() const
+{
+ return m_writeLog;
+}
+
+bool Configuration::appendLog() const
+{
+ return m_appendLog;
+}
+
+string Configuration::logFilePattern() const
+{
+ return m_logFilePattern;
+}
+
+
+const list< pair<string, string> >& Configuration::rootList() const
+{
+ return m_rootList;
+}
+
+Configuration::ReadmeMode Configuration::readmeMode() const
+{
+ return m_readmeMode;
+}
+
+std::string Configuration::cacheFile() const
+{
+ return m_cacheFile;
+}
+
+
+void Configuration::addConfig(const string& line,
+ bool configSet,
+ bool configPrepend)
+{
+ if (configSet && startwith_nocase( line, "prtdir" )) {
+ m_rootList.clear();
+ }
+ parseLine(line, configPrepend);
+}
+
+/*!
+ parse a line and set the configuration data accordingly; if \a
+ prepend is set, prepend the data for configuration options which are lists
+ */
+void Configuration::parseLine(const string& line, bool prepend)
+{
+ string s = line;
+ if ( s.empty() ) {
+ return;
+ }
+
+ if ( startwith_nocase( s, "prtdir" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 6, "" ) );
+ string path = stripWhiteSpace( getValueBefore( s, ':' ) );
+ string packages = getValue( s, ':' );
+ DIR* dir = opendir( path.c_str() );
+ if ( dir ) {
+ closedir( dir );
+
+ if (prepend) {
+ m_rootList.push_front( make_pair( path, packages ) );
+ } else {
+ m_rootList.push_back( make_pair( path, packages ) );
+ }
+ } else {
+ cerr << "[Config error: can't access " << path
+ << "]" << endl;
+ }
+ } else if ( startwith_nocase( s, "cachefile" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 9, "" ) );
+ m_cacheFile = s;
+ } else if ( startwith_nocase( s, "writelog" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 8, "" ) );
+ if ( s == "enabled" ) {
+ // it's already set to false, so we can just enable it.
+ // like this, the command line switch works as well
+ m_writeLog = true;
+ }
+ } else if ( startwith_nocase( s, "logfile" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 7, "" ) );
+ m_logFilePattern = s;
+ } else if ( startwith_nocase( s, "logmode" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 7, "" ) );
+ if ( s == "append" ) {
+ m_appendLog = true;
+ }
+ } else if ( startwith_nocase( s, "readme" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 6, "" ) );
+ if ( s == "compact" ) {
+ m_readmeMode = COMPACT_README;
+ } else if ( s == "disabled" ) {
+ m_readmeMode = NO_README;
+ }
+ } else if ( startwith_nocase( s, "runscripts" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 10, "" ) );
+ if ( s == "yes" ) {
+ m_runScripts = true;
+ }
+ } else if ( startwith_nocase( s, "preferhigher" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 12, "" ) );
+ if ( s == "yes" ) {
+ m_preferHigher = true;
+ }
+ } else if ( startwith_nocase( s, "useregex" ) ) {
+ s = stripWhiteSpace( s.replace( 0, 8, "" ) );
+ if ( s == "yes" ) {
+ m_useRegex = true;
+ }
+ } else if ( startwith_nocase( s, "makecommand" ) ) {
+ m_makeCommand = stripWhiteSpace( s.replace( 0, 11, "" ) );
+ } else if ( startwith_nocase( s, "addcommand" ) ) {
+ m_addCommand = stripWhiteSpace( s.replace( 0, 10, "" ) );
+ } else if ( startwith_nocase( s, "removecommand" ) ) {
+ m_removeCommand = stripWhiteSpace( s.replace( 0, 13, "" ) );
+ } else if ( startwith_nocase( s, "runscriptcommand" ) ) {
+ m_runscriptCommand = stripWhiteSpace( s.replace( 0, 16, "" ) );
+ }
+}
+
+bool Configuration::runScripts() const
+{
+ return m_runScripts;
+}
+
+std::string Configuration::makeCommand() const
+{
+ return m_makeCommand;
+}
+
+std::string Configuration::addCommand() const
+{
+ return m_addCommand;
+}
+
+std::string Configuration::removeCommand() const
+{
+ return m_removeCommand;
+}
+
+std::string Configuration::runscriptCommand() const
+{
+ return m_runscriptCommand;
+}
+
+bool Configuration::preferHigher() const
+{
+ return m_preferHigher;
+}
+
+bool Configuration::useRegex() const
+{
+ return m_useRegex;
+}
+
+
diff --git a/src/configuration.h b/src/configuration.h
new file mode 100644
index 0000000..c1b0b69
--- /dev/null
+++ b/src/configuration.h
@@ -0,0 +1,83 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: configuration.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _CONFIGURATION_H_
+#define _CONFIGURATION_H_
+
+#include <string>
+#include <list>
+#include <utility>
+
+class ArgParser;
+
+/*!
+ Configuration file class
+*/
+class Configuration
+{
+public:
+ Configuration( const std::string& configFile, const ArgParser* parser );
+ bool parse();
+
+ bool writeLog() const;
+ bool appendLog() const;
+ std::string logFilePattern() const;
+
+ const std::list< std::pair<std::string, std::string> >& rootList() const;
+
+
+ enum ReadmeMode { VERBOSE_README, COMPACT_README, NO_README };
+ ReadmeMode readmeMode() const;
+
+ std::string cacheFile() const;
+
+ bool runScripts() const;
+ bool preferHigher() const;
+ bool useRegex() const;
+
+ void addConfig(const std::string& line,
+ bool configSet,
+ bool configPrepend);
+
+ std::string makeCommand() const;
+ std::string addCommand() const;
+ std::string removeCommand() const;
+ std::string runscriptCommand() const;
+
+private:
+ std::string m_configFile;
+ const ArgParser* m_parser;
+
+ // config data
+ std::string m_cacheFile;
+
+ std::list< std::pair<std::string, std::string> > m_rootList;
+
+ std::string m_logFilePattern;
+ bool m_writeLog;
+ bool m_appendLog;
+
+ ReadmeMode m_readmeMode;
+
+ bool m_runScripts;
+ bool m_preferHigher;
+ bool m_useRegex;
+
+ std::string m_makeCommand;
+ std::string m_addCommand;
+ std::string m_removeCommand;
+ std::string m_runscriptCommand;
+
+
+ void parseLine(const std::string& line, bool prepend=false);
+};
+
+#endif /* _CONFIGURATION_H_ */
diff --git a/src/datafileparser.cpp b/src/datafileparser.cpp
new file mode 100644
index 0000000..4291f26
--- /dev/null
+++ b/src/datafileparser.cpp
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: datafileparser.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <cstdio>
+
+#include "datafileparser.h"
+#include "stringhelper.h"
+
+using namespace std;
+using namespace StringHelper;
+
+bool DataFileParser::parse(const string& fileName,
+ map<string, string>& target)
+{
+ FILE* fd = fopen(fileName.c_str(), "r");
+ char buffer[512];
+ string input;
+
+ if (!fd) {
+ return false;
+ }
+
+ while (fgets(buffer, 512, fd)) {
+ input = buffer;
+ input = stripWhiteSpace(input);
+
+ if (input.length() > 0 && input[0] != '#') {
+ string::size_type pos = input.find(":");
+ if (pos != string::npos) {
+ string name = stripWhiteSpace(input.substr(0, pos));
+ string deps = stripWhiteSpace(input.substr(pos+1));
+ deps = StringHelper::replaceAll(deps, " ", " ");
+ deps = StringHelper::replaceAll(deps, " ", ",");
+ deps = StringHelper::replaceAll(deps, ",,", ",");
+
+ target[name] = deps;
+ }
+ }
+ }
+ fclose(fd);
+ return true;
+}
diff --git a/src/datafileparser.h b/src/datafileparser.h
new file mode 100644
index 0000000..bc1ca9a
--- /dev/null
+++ b/src/datafileparser.h
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: datafileparser.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2004 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _DATAFILEPARSER_H_
+#define _DATAFILEPARSER_H_
+
+#include <map>
+#include <string>
+
+/**
+ * Parser for files of the format
+ * key : value1,value2
+ */
+class DataFileParser
+{
+public:
+ static bool parse(const std::string& fileName,
+ std::map<std::string, std::string>& target);
+};
+
+#endif /* _DATAFILEPARSER_H_ */
diff --git a/src/depresolver.cpp b/src/depresolver.cpp
new file mode 100644
index 0000000..ca5d609
--- /dev/null
+++ b/src/depresolver.cpp
@@ -0,0 +1,102 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: depresolver.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <map>
+#include <cassert>
+using namespace std;
+
+#include "depresolver.h"
+
+
+
+/*!
+ add a dependency
+ \param first the package with dependency
+ \param second the pacakge which \a first depends on
+*/
+void DepResolver::addDependency( int first, int second )
+{
+ m_dependencies.push_back( Pair( first, second ) );
+}
+
+
+/*!
+ resolve the dependencies
+ \param result a list which will be filled with resulting indexes in
+ the correct order
+ \return true on success, false otherwise (cyclic dependencies)
+*/
+bool DepResolver::resolve( list<int>& result )
+{
+ return topSort( result );
+}
+
+
+/*!
+ sort the dependencies
+*/
+bool DepResolver::topSort( list<int>& result )
+{
+ map<int, int > numPreds; // elt -> number of predecessors
+ map<int, list<int> > successors; // elt -> number of successors
+
+ list<Pair>::iterator it = m_dependencies.begin();
+ for ( ; it != m_dependencies.end(); ++it ) {
+
+ // make sure every elt is a key in numpreds
+ if ( numPreds.find( it->first ) == numPreds.end() ) {
+ numPreds[it->first] = 0;
+ }
+ if ( numPreds.find( it->second ) == numPreds.end() ) {
+ numPreds[it->second] = 0;
+ }
+
+ // if they're the same, there's no real dependence
+ if ( it->first == it->second ) {
+ continue;
+ }
+
+ // since first < second, second gains a pred
+ numPreds[it->second] = numPreds[it->second] + 1;
+
+ // ... and first gains a succ
+ successors[it->first].push_back( it->second );
+ }
+
+ // suck up everything without a predecessor
+ result.clear();
+ map<int, int>::iterator mit = numPreds.begin();
+ for ( ; mit != numPreds.end(); ++mit ) {
+ if ( mit->second == 0 ) {
+ result.push_back( mit->first );
+ }
+ }
+
+ // for everything in answer, knock down the pred count on
+ // its successors; note that answer grows *in* the loop
+ list<int>::iterator lit = result.begin();
+ for ( ; lit != result.end(); ++lit ) {
+ assert( numPreds[*lit] == 0 );
+ numPreds.erase( *lit );
+ if ( successors.find( *lit ) != successors.end() ) {
+ list<int>::iterator succIt = successors[*lit].begin();
+ for ( ; succIt != successors[*lit].end(); ++succIt ) {
+ numPreds[*succIt] = numPreds[*succIt] - 1;
+ if ( numPreds[*succIt] == 0 ) {
+ result.push_back( *succIt );
+ }
+ }
+ successors.erase( *lit );
+ }
+ }
+
+ return numPreds.size() == 0;
+}
diff --git a/src/depresolver.h b/src/depresolver.h
new file mode 100644
index 0000000..7bbd89a
--- /dev/null
+++ b/src/depresolver.h
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: depresolver.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _DEPRESOLVER_H_
+#define _DEPRESOLVER_H_
+
+#include <list>
+using namespace std;
+
+/*!
+ \class DepResolver
+ \brief a dependency resolver
+
+ A dependency resolver
+*/
+class DepResolver
+{
+public:
+ void addDependency( int, int );
+ bool resolve( list<int>& result );
+
+private:
+ /*! simple int pair, so we don't have to use std::pair */
+ struct Pair {
+ Pair( int f, int s ) : first( f ), second( s ) {}
+ int first;
+ int second;
+ };
+
+ bool topSort( list<int>& result );
+
+ list<Pair> m_dependencies;
+};
+
+#endif /* _DEPRESOLVER_H_ */
diff --git a/src/file.cpp b/src/file.cpp
new file mode 100644
index 0000000..605dd15
--- /dev/null
+++ b/src/file.cpp
@@ -0,0 +1,92 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: file.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <cstdio>
+#include <fnmatch.h>
+#include <libgen.h>
+
+using namespace std;
+
+#include "stringhelper.h"
+#include "pg_regex.h"
+
+namespace File
+{
+
+bool fileExists( const string& fileName )
+{
+ struct stat result;
+ return stat( fileName.c_str(), &result ) == 0;
+
+}
+
+bool grep( const string& fileName,
+ const string& pattern,
+ list<string>& result,
+ bool fullPath,
+ bool useRegex)
+{
+ FILE* fp;
+ fp = fopen( fileName.c_str(), "r" );
+ if ( !fp ) {
+ return false;
+ }
+ const int length = BUFSIZ;
+ char input[length];
+ char* p;
+ char* end;
+ string line;
+ string entry;
+
+ RegEx re(pattern);
+
+ while ( fgets( input, length, fp ) ) {
+ p = strtok( input, "\t" );
+ p = strtok( NULL, "\t" );
+ p = strtok( NULL, "\t" );
+
+ if ( p ) {
+ // prepend slash to string
+ p--;
+ p[0] = '/';
+
+ entry = p;
+ end = strstr(p, "->");
+ if (end) {
+ *end = '\0';
+ }
+ p[strlen(p)-1] = '\0'; // strip newline
+
+ char* name = p;
+ if (!fullPath) {
+ name = basename(p);
+ }
+
+ if (useRegex) {
+ if (re.match(name)) {
+ result.push_back(StringHelper::stripWhiteSpace(entry));
+ }
+ } else {
+ if ( fnmatch(pattern.c_str(), name, FNM_CASEFOLD) == 0 ) {
+ result.push_back( StringHelper::stripWhiteSpace(entry) );
+ }
+ }
+ }
+ }
+
+ fclose( fp );
+ return true;
+}
+
+}
diff --git a/src/file.h b/src/file.h
new file mode 100644
index 0000000..4e7e768
--- /dev/null
+++ b/src/file.h
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: file.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _FILE_H_
+#define _FILE_H_
+
+#include <list>
+#include <string>
+
+namespace File
+{
+
+bool fileExists( const std::string& fileName );
+bool grep( const std::string& fileName,
+ const std::string& pattern,
+ std::list<string>& result,
+ bool fullPath,
+ bool useRegex);
+
+}
+
+#endif /* _FILE_H_ */
diff --git a/src/installtransaction.cpp b/src/installtransaction.cpp
new file mode 100644
index 0000000..aa423c1
--- /dev/null
+++ b/src/installtransaction.cpp
@@ -0,0 +1,539 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: installtransaction.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <unistd.h>
+#include <cstdio>
+#include <iostream>
+#include <algorithm>
+#include <list>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+using namespace std;
+
+
+#include "installtransaction.h"
+#include "repository.h"
+#include "pkgdb.h"
+#include "stringhelper.h"
+#include "argparser.h"
+#include "process.h"
+#include "configuration.h"
+
+#ifdef USE_LOCKING
+#include "lockfile.h"
+#endif
+
+using namespace StringHelper;
+
+
+const string InstallTransaction::PKGMK_DEFAULT_COMMAND = "/usr/bin/pkgmk";
+const string InstallTransaction::PKGADD_DEFAULT_COMMAND = "/usr/bin/pkgadd";
+const string InstallTransaction::PKGRM_DEFAULT_COMMAND = "/usr/bin/pkgrm";
+
+
+
+/*!
+ Create a nice InstallTransaction
+ \param names a list of port names to be installed
+ \param repo the repository to look for packages
+ \param pkgDB the pkgDB with already installed packages
+*/
+InstallTransaction::InstallTransaction( const list<char*>& names,
+ const Repository* repo,
+ PkgDB* pkgDB,
+ const Configuration* config )
+ : m_repo( repo ),
+ m_pkgDB( pkgDB ),
+ m_depCalced( false ),
+ m_config( config )
+{
+ list<char*>::const_iterator it = names.begin();
+ for ( ; it != names.end(); ++it ) {
+ m_packages.push_back( make_pair( *it, m_repo->getPackage( *it ) ) );
+ }
+
+}
+
+/*!
+ Create a nice InstallTransaction
+ \param names a list of port names to be installed
+ \param repo the repository to look for packages
+ \param pkgDB the pkgDB with already installed packages
+*/
+InstallTransaction::InstallTransaction( const list<string>& names,
+ const Repository* repo,
+ PkgDB* pkgDB,
+ const Configuration* config )
+ : m_repo( repo ),
+ m_pkgDB( pkgDB ),
+ m_depCalced( false ),
+ m_config( config )
+{
+ list<string>::const_iterator it = names.begin();
+ for ( ; it != names.end(); ++it ) {
+ m_packages.push_back( make_pair( *it, m_repo->getPackage( *it ) ) );
+ }
+
+}
+
+/*!
+ \return packages where building/installation failed
+*/
+const list< pair<string, InstallTransaction::InstallInfo> >&
+InstallTransaction::installError() const
+{
+ return m_installErrors;
+}
+
+/*!
+ install (commit) a transaction
+ \param parser the argument parser
+ \param update whether this is an update operation
+ \param group whether this is a group transaction (stops transaction on error)
+ \return returns an InstallResult telling whether installation worked
+*/
+InstallTransaction::InstallResult
+InstallTransaction::install( const ArgParser* parser,
+ bool update, bool group )
+{
+ if ( m_packages.empty() ) {
+ return NO_PACKAGE_GIVEN;
+ }
+
+ list<string> ignoredPackages;
+ StringHelper::split(parser->ignore(), ',', ignoredPackages);
+
+ list< pair<string, const Package*> >::iterator it = m_packages.begin();
+ for ( ; it != m_packages.end(); ++it ) {
+ const Package* package = it->second;
+
+ if (find(ignoredPackages.begin(),
+ ignoredPackages.end(),
+ it->first) != ignoredPackages.end() ) {
+ m_ignoredPackages.push_back(it->first);
+ continue;
+ }
+
+ if ( package == NULL ) {
+ m_missingPackages.push_back( make_pair( it->first, string("") ) );
+ if ( group ) {
+ return PACKAGE_NOT_FOUND;
+ }
+ continue;
+ }
+
+ // consider aliases here, but don't show them specifically
+ if ( !update && m_pkgDB->isInstalled( package->name(), true ) ) {
+ // ignore
+ m_alreadyInstalledPackages.push_back( package->name() );
+ continue;
+ }
+
+ InstallTransaction::InstallResult result;
+ InstallInfo info( package->hasReadme() );
+ if ( parser->isTest() ||
+ (result = installPackage( package, parser, update, info )) == SUCCESS) {
+
+ m_installedPackages.push_back( make_pair( package->name(), info));
+ } else {
+
+ // log failures are critical
+ if ( result == LOG_DIR_FAILURE ||
+ result == LOG_FILE_FAILURE ||
+ result == NO_LOG_FILE ||
+ result == CANT_LOCK_LOG_FILE ||
+
+ // or pkgdest
+ result == PKGDEST_ERROR ) {
+ return result;
+ }
+
+ m_installErrors.push_back( make_pair(package->name(), info) );
+ if ( group ) {
+ return PKGMK_FAILURE;
+ }
+ }
+ }
+
+ return SUCCESS;
+}
+
+
+/*!
+ Install a single package
+ \param package the package to be installed
+ \param parser the argument parser to be used
+ \param update whether this is an update transaction
+ \param info store pre and post install information
+*/
+InstallTransaction::InstallResult
+InstallTransaction::installPackage( const Package* package,
+ const ArgParser* parser,
+ bool update,
+ InstallTransaction::InstallInfo& info )
+ const
+{
+
+ InstallTransaction::InstallResult result = SUCCESS;
+#ifdef USE_LOCKING
+ LockFile lockFile;
+#endif
+
+ int fdlog = -1;
+ if ( m_config->writeLog() ) {
+ string logFile = m_config->logFilePattern();
+ if ( logFile == "" ) {
+ return NO_LOG_FILE;
+ }
+
+ StringHelper::replaceAll( logFile, "%n", package->name() );
+ StringHelper::replaceAll( logFile, "%p", package->path() );
+ StringHelper::replaceAll( logFile, "%v", package->version() );
+ StringHelper::replaceAll( logFile, "%r", package->release() );
+
+#ifdef USE_LOCKING
+ lockFile.setFile( logFile );
+ if ( !lockFile.lockWrite() ) {
+ cout << "here" << logFile << endl;
+ return CANT_LOCK_LOG_FILE;
+ }
+#endif
+
+ size_t pos = logFile.find_last_of( "/" );
+ if ( pos != string::npos ) {
+ if ( !Repository::createOutputDir( logFile.substr( 0, pos ) ) ) {
+ return LOG_DIR_FAILURE;
+ }
+ }
+
+ if ( !m_config->appendLog() ) {
+ unlink( logFile.c_str() );
+ }
+
+ fdlog = open( logFile.c_str(),
+ O_APPEND | O_WRONLY | O_CREAT, 0666 );
+
+ if ( fdlog == -1 ) {
+ return LOG_FILE_FAILURE;
+ }
+ }
+
+ string pkgdir = package->path() + "/" + package->name();
+ chdir( pkgdir.c_str() );
+
+ string runscriptCommand = "sh";
+ if (m_config->runscriptCommand() != "") {
+ runscriptCommand = m_config->runscriptCommand();
+ }
+
+ // -- pre-install
+ struct stat statData;
+ if ((parser->execPreInstall() || m_config->runScripts()) &&
+ stat((pkgdir + "/" + "pre-install").c_str(), &statData) == 0) {
+ Process preProc( runscriptCommand,
+ pkgdir + "/" + "pre-install",
+ fdlog );
+ if (preProc.executeShell()) {
+ info.preState = FAILED;
+ } else {
+ info.preState = EXEC_SUCCESS;
+ }
+ }
+
+ // -- build
+ string cmd = PKGMK_DEFAULT_COMMAND;
+ if (m_config->makeCommand() != "") {
+ cmd = m_config->makeCommand();
+ }
+
+ string args = "-d " + parser->pkgmkArgs();
+ Process makeProc( cmd, args, fdlog );
+ if ( makeProc.executeShell() ) {
+ result = PKGMK_FAILURE;
+ } else {
+ // -- update
+ string pkgdest = getPkgDest();
+ if ( pkgdest != "" ) {
+ // TODO: don't manipulate pkgdir
+ pkgdir = pkgdest;
+ string message = "Using PKGMK_PACKAGE_DIR: " + pkgdir;
+ cout << message << endl;
+ if ( m_config->writeLog() ) {
+ write( fdlog, message.c_str(), message.length() );
+ write( fdlog, "\n", 1 );
+ }
+ }
+
+ // the following chdir is a noop if usePkgDest() returns false
+ if ( chdir( pkgdir.c_str() ) != 0 ) {
+ result = PKGDEST_ERROR;
+ } else {
+ cmd = PKGADD_DEFAULT_COMMAND;
+ if (m_config->addCommand() != "") {
+ cmd = m_config->addCommand();
+ }
+
+ args = "";
+ if (parser->installRoot() != "") {
+ args = "-r " + parser->installRoot() + " ";
+ }
+
+
+ if ( update ) {
+ args += "-u ";
+ }
+ if ( !parser->pkgaddArgs().empty() ) {
+ args += parser->pkgaddArgs() + " ";
+ }
+ args +=
+ package->name() + "#" +
+ package->version() + "-" +
+ package->release() + ".pkg.tar.gz";
+
+ string commandName = "prt-get";
+ if ( parser->wasCalledAsPrtCached() ) {
+ commandName = "prt-cache";
+ }
+
+ string message = commandName + ": " + cmd + " " + args;
+ cout << message << endl;
+ if ( m_config->writeLog() ) {
+ write( fdlog, message.c_str(), message.length() );
+ write( fdlog, "\n", 1 );
+ }
+
+ Process installProc( cmd, args, fdlog );
+ if ( installProc.executeShell() ) {
+ result = PKGADD_FAILURE;
+ } else {
+ // exec post install
+ if ((parser->execPostInstall() || m_config->runScripts() ) &&
+ stat((package->path() + "/" + package->name() +
+ "/" + "post-install").c_str(), &statData)
+ == 0) {
+ // Work around the pkgdir variable change
+ Process postProc( runscriptCommand,
+ package->path() + "/" + package->name()+
+ "/" + "post-install",
+ fdlog );
+ if (postProc.executeShell()) {
+ info.postState = FAILED;
+ } else {
+ info.postState = EXEC_SUCCESS;
+ }
+ }
+ }
+ }
+ }
+
+ if ( m_config->writeLog() ) {
+
+#ifdef USE_LOCKING
+ lockFile.unlock();
+#endif
+
+ // Close logfile
+ close ( fdlog );
+ }
+ return result;
+}
+
+/*!
+ Calculate dependencies for this transaction
+ \return true on success
+*/
+bool InstallTransaction::calculateDependencies()
+{
+ if ( m_depCalced ) {
+ return true;
+ }
+ m_depCalced = true;
+ if ( m_packages.empty() ) {
+ return false;
+ }
+
+ list< pair<string, const Package*> >::const_iterator it =
+ m_packages.begin();
+ for ( ; it != m_packages.end(); ++it ) {
+ const Package* package = it->second;
+ if ( package ) {
+ checkDependecies( package );
+ }
+ }
+ list<int> indexList;
+ if ( ! m_resolver.resolve( indexList ) ) {
+ m_depCalced = false;
+ return false;
+ }
+
+ list<int>::iterator lit = indexList.begin();
+ for ( ; lit != indexList.end(); ++lit ) {
+ m_depNameList.push_back( m_depList[*lit] );
+ }
+
+ return true;
+}
+
+/*!
+ recursive method to calculate dependencies
+ \param package package for which we want to calculate dependencies
+ \param depends index if the package \a package depends on (-1 for none)
+*/
+void InstallTransaction::checkDependecies( const Package* package,
+ int depends )
+{
+ int index = -1;
+ bool newPackage = true;
+ for ( unsigned int i = 0; i < m_depList.size(); ++i ){
+ if ( m_depList[i] == package->name() ) {
+ index = i;
+ newPackage = false;
+ break;
+ }
+ }
+
+
+ if ( index == -1 ) {
+ index = m_depList.size();
+ m_depList.push_back( package->name() );
+ }
+
+ if ( depends != -1 ) {
+ m_resolver.addDependency( index, depends );
+ } else {
+ // this just adds index to the dependency resolver
+ m_resolver.addDependency( index, index );
+ }
+
+ if ( newPackage ) {
+ if ( !package->dependencies().empty() ) {
+ list<string> deps;
+ split( package->dependencies(), ',', deps );
+ list<string>::iterator it = deps.begin();
+ for ( ; it != deps.end(); ++it ) {
+ string dep = *it;
+ if ( !dep.empty() ) {
+ string::size_type pos = dep.find_last_of( '/' );
+ if ( pos != string::npos && (pos+1) < dep.length() ) {
+ dep = dep.substr( pos + 1 );
+ }
+ const Package* p = m_repo->getPackage( dep );
+ if ( p ) {
+ checkDependecies( p, index );
+ } else {
+ m_missingPackages.
+ push_back( make_pair( dep, package->name() ) );
+ }
+ }
+ }
+ }
+ }
+}
+
+
+/*!
+ This method returns a list of packages which should be installed to
+ meet the requirements for the packages to be installed. Includes
+ the packages to be installed. The packages are in the correct order,
+ packages to be installed first come first :-)
+
+ \return a list of packages required for the transaction
+*/
+const list<string>& InstallTransaction::dependencies() const
+{
+ return m_depNameList;
+}
+
+
+/*!
+ This method returns a list of packages which could not be installed
+ because they could not be found in the ports tree. The return value is
+ a pair, \a pair.first is package name and \a pair.second is the package
+ requiring \a pair.first.
+
+ \return packages missing in the ports tree
+*/
+const list< pair<string, string> >& InstallTransaction::missing() const
+{
+ return m_missingPackages;
+}
+
+
+/*!
+ \return packages which were requested to be installed but are already
+ installed
+*/
+const list<string>& InstallTransaction::alreadyInstalledPackages() const
+{
+ return m_alreadyInstalledPackages;
+}
+
+
+/*!
+ \return the packages which were installed in this transaction
+*/
+const list< pair<string, InstallTransaction::InstallInfo> >&
+InstallTransaction::installedPackages() const
+{
+ return m_installedPackages;
+}
+
+
+/*!
+ calculate dependendencies for this package
+*/
+InstallTransaction::InstallResult
+InstallTransaction::calcDependencies( )
+{
+ if ( m_packages.empty() ) {
+ return NO_PACKAGE_GIVEN;
+ }
+
+ bool validPackages = false;
+ list< pair<string, const Package*> >::iterator it = m_packages.begin();
+ for ( ; it != m_packages.end(); ++it ) {
+ if ( it->second ) {
+ validPackages = true;
+ } else {
+ // Note: moved here from calculateDependencies
+ m_missingPackages.push_back( make_pair( it->first, string("") ) );
+ }
+ }
+ if ( !validPackages ) {
+ return PACKAGE_NOT_FOUND;
+ }
+
+ if ( !calculateDependencies() ) {
+ return CYCLIC_DEPEND;
+ }
+ return SUCCESS;
+}
+
+string InstallTransaction::getPkgDest()
+{
+ string pkgdest = "";
+ FILE* p = popen( ". /etc/pkgmk.conf && echo $PKGMK_PACKAGE_DIR", "r" );
+ if ( p ) {
+ char line[256];
+ fgets( line, 256, p );
+ pkgdest = line;
+ pkgdest = StringHelper::stripWhiteSpace( pkgdest );
+ pclose( p );
+ }
+ return pkgdest;
+}
+
+const list<string>& InstallTransaction::ignoredPackages() const
+{
+ return m_ignoredPackages;
+}
diff --git a/src/installtransaction.h b/src/installtransaction.h
new file mode 100644
index 0000000..bd154ea
--- /dev/null
+++ b/src/installtransaction.h
@@ -0,0 +1,142 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: installtransaction.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _INSTALLTRANSACTION_H_
+#define _INSTALLTRANSACTION_H_
+
+#include <string>
+#include <list>
+#include <map>
+#include <vector>
+#include <utility>
+using namespace std;
+
+#include "depresolver.h"
+
+class Repository;
+class PkgDB;
+class Package;
+class ArgParser;
+class Configuration;
+/*!
+ \class InstallTransaction
+ \brief Transaction for installing/updating a list of packages
+*/
+class InstallTransaction
+{
+public:
+ InstallTransaction( const list<char*>& names,
+ const Repository* repo,
+ PkgDB* pkgDB,
+ const Configuration* config );
+ InstallTransaction( const list<string>& names,
+ const Repository* repo,
+ PkgDB* pkgDB,
+ const Configuration* config );
+
+ static const std::string PKGMK_DEFAULT_COMMAND;
+ static const std::string PKGADD_DEFAULT_COMMAND;
+ static const std::string PKGRM_DEFAULT_COMMAND;
+
+
+ /*! Result of an installation */
+ enum InstallResult {
+ SUCCESS, /*!< yeah, success */
+ NO_PACKAGE_GIVEN, /*!< no package give to install */
+ PACKAGE_NOT_FOUND, /*!< package not found */
+ PKGMK_EXEC_ERROR, /*!< can't execute pkgmk */
+ PKGMK_FAILURE, /*!< error while pkgmk */
+ PKGADD_EXEC_ERROR, /*!< can't execute pkgadd */
+ PKGDEST_ERROR, /*!< can't change to PKGDEST */
+ PKGADD_FAILURE, /*!< error while pkgadd */
+ CYCLIC_DEPEND, /*!< cyclic dependencies found */
+ LOG_DIR_FAILURE, /*!< couldn't create log directory */
+ LOG_FILE_FAILURE, /*!< couldn't create log file */
+ NO_LOG_FILE, /*!< no log file specified */
+ CANT_LOCK_LOG_FILE /*!< can't create lock for log file */
+ };
+
+ enum State {
+ EXEC_SUCCESS,
+ FAILED,
+ NONEXISTENT
+ };
+ struct InstallInfo {
+ InstallInfo(bool hasReadme_) {
+ hasReadme = hasReadme_;
+ preState = NONEXISTENT;
+ postState = NONEXISTENT;
+ }
+ State preState;
+ State postState;
+ bool hasReadme;
+ };
+
+ InstallResult install( const ArgParser* parser,
+ bool update,
+ bool group );
+ InstallResult calcDependencies();
+
+ const list< pair<string, InstallInfo> >& installedPackages() const;
+ const list<string>& alreadyInstalledPackages() const;
+ const list<string>& ignoredPackages() const;
+
+
+ const list<string>& dependencies() const;
+ const list< pair<string,string> >& missing() const;
+ const list< pair<string, InstallInfo> >& installError() const;
+
+private:
+ bool calculateDependencies();
+ void checkDependecies( const Package* package, int depends=-1 );
+
+ InstallResult installPackage( const Package* package,
+ const ArgParser* parser,
+ bool update,
+ InstallInfo& info ) const;
+
+ static string getPkgDest();
+
+ PkgDB* m_pkgDB;
+ DepResolver m_resolver;
+ const Repository* m_repo;
+
+ // packages to be installed
+ list< pair<string, const Package*> > m_packages;
+
+ // boolean used to implement lazy initialization
+ bool m_depCalced;
+
+ // packages< pair<name, hasReadme> > installed by this transaction
+ list< pair<string, InstallInfo> > m_installedPackages;
+
+ // packages which were requested to be installed which where already
+ list<string> m_alreadyInstalledPackages;
+
+ // packages which are required by the transaction, but ignored by
+ // the user
+ list<string> m_ignoredPackages;
+
+ list<string> m_depNameList;
+ vector<string> m_depList;
+
+ // packages requested to be installed not found in the ports tree
+ list< pair<string, string> > m_missingPackages;
+
+ // packages where build/installed failed
+ list< pair<string, InstallInfo> > m_installErrors;
+
+ /// prt-get itself
+ const Configuration* m_config;
+
+};
+
+#endif /* _INSTALLTRANSACTION_H_ */
diff --git a/src/locker.cpp b/src/locker.cpp
new file mode 100644
index 0000000..59faecc
--- /dev/null
+++ b/src/locker.cpp
@@ -0,0 +1,110 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: locker.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <cstdio>
+#include <cstring>
+#include <algorithm>
+
+#include "locker.h"
+#include "repository.h"
+
+const string Locker::LOCKER_FILE_PATH = "/var/lib/pkg/";
+const string Locker::LOCKER_FILE = "prt-get.locker";
+
+Locker::Locker()
+ : m_openFailed( false )
+{
+ string fName = LOCKER_FILE_PATH + LOCKER_FILE;
+ FILE* fp = fopen( fName.c_str(), "r" );
+ if ( fp ) {
+ char input[512];
+ while ( fgets( input, 512, fp ) ) {
+ if ( input[strlen( input )-1] == '\n' ) {
+ input[strlen( input )-1] = '\0';
+ }
+ if ( strlen( input ) > 0 ) {
+ m_packages.push_back( input );
+ }
+ }
+
+ fclose( fp );
+ } else {
+ m_openFailed = true;
+ }
+}
+
+bool Locker::store()
+{
+ if ( !Repository::createOutputDir(LOCKER_FILE_PATH) ) {
+ return false;
+ }
+
+ string fName = LOCKER_FILE_PATH + LOCKER_FILE;
+ FILE* fp = fopen( fName.c_str(), "w" );
+ if ( fp ) {
+ vector<string>::iterator it = m_packages.begin();
+ for ( ; it != m_packages.end(); ++it ) {
+ fprintf( fp, "%s\n", it->c_str() );
+ }
+ fclose( fp );
+ return true;
+ }
+
+ return false;
+}
+
+/*!
+ \return true locking worked, false if already locked
+*/
+bool Locker::lock( const string& package )
+{
+ if ( isLocked( package ) ) {
+ // already locked
+ return false;
+ }
+ m_packages.push_back( package );
+ return true;
+}
+
+/*!
+ \return true if it could be unlocked, false if it wasn't locked
+*/
+bool Locker::unlock( const string& package )
+{
+ vector<string>::iterator it = find( m_packages.begin(), m_packages.end(),
+ package );
+ if ( it != m_packages.end() ) {
+ m_packages.erase( it );
+ return true;
+ }
+
+ return false;
+}
+
+bool Locker::isLocked( const string& package ) const
+{
+ if ( find( m_packages.begin(), m_packages.end(), package ) !=
+ m_packages.end() ) {
+ return true;
+ }
+
+ return false;
+}
+
+const vector<string>& Locker::lockedPackages() const
+{
+ return m_packages;
+}
+
+bool Locker::openFailed() const
+{
+ return m_openFailed;
+}
diff --git a/src/locker.h b/src/locker.h
new file mode 100644
index 0000000..44968cc
--- /dev/null
+++ b/src/locker.h
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: locker.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _LOCKER_H_
+#define _LOCKER_H_
+
+#include <string>
+#include <vector>
+
+using namespace std;
+
+/**
+ * prt-get can place packages in the locker, which are then not updated
+ * anymore.
+ * Locked packages are:
+ * - marked in prt-get diff
+ * - not shown in prt-get quickdiff
+ * - not updated in prt-get sysup
+ */
+class Locker
+{
+public:
+ Locker();
+
+ bool store();
+
+ bool lock( const string& package );
+ bool unlock( const string& package );
+ bool isLocked( const string& package ) const;
+
+ const vector<string>& lockedPackages() const;
+
+ bool openFailed() const;
+private:
+
+ vector<string> m_packages;
+ static const string LOCKER_FILE;
+ static const string LOCKER_FILE_PATH;
+
+ bool m_openFailed;
+};
+
+#endif /* _LOCKER_H_ */
diff --git a/src/lockfile.cpp b/src/lockfile.cpp
new file mode 100644
index 0000000..340691b
--- /dev/null
+++ b/src/lockfile.cpp
@@ -0,0 +1,150 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: lockfile.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <cstdio>
+
+#include "lockfile.h"
+
+using namespace std;
+
+string LockFile::LOCK_SUFFIX = ".lock";
+string LockFile::WRITE_LOCK_STRING = "write_lock";
+string LockFile::READ_LOCK_STRING = "read_lock";
+string LockFile::READ_WRITE_LOCK_STRING = "read_write_lock";
+
+
+/*!
+ \brief a file locking class
+ */
+LockFile::LockFile()
+ : m_readLock( false ),
+ m_writeLock( false )
+{
+}
+
+
+bool LockFile::lockRead()
+{
+ if ( m_readLock ) {
+ // we already lock it, so it's a good lock
+ return true;
+ }
+
+ if ( m_writeLock ) {
+ // can't lock for read and write separatedly
+ return false;
+ }
+
+ struct stat buf;
+ if ( stat( m_fileName.c_str(), &buf) == 0 ) {
+ FILE* fp = fopen( m_fileName.c_str(), "w" );
+ if ( fp ) {
+ // file did not exist, could be created
+ m_writeLock = true;
+ fprintf( fp, "%s", READ_LOCK_STRING.c_str() );
+ fclose( fp );
+ return true;
+ }
+ } else {
+ // file exists, but it could be a read lock
+
+ // TODO: allow locking, increment lock count
+ }
+
+ // couldn't lock
+ return false;
+}
+
+
+/*!
+ lock the file
+ \return true if we have a lock
+ */
+bool LockFile::lockWrite()
+{
+ if ( m_writeLock ) {
+ // we already lock it, so it's a good lock
+ return true;
+ }
+
+ if ( m_readLock ) {
+ // can't lock for read and write separatedly
+ return false;
+ }
+
+ struct stat buf;
+ if ( stat( m_fileName.c_str(), &buf) == -1 ) {
+ // file can not be stat'ed
+ FILE* fp = fopen( m_fileName.c_str(), "w" );
+ if ( fp ) {
+ // file did not exist, could be created
+ m_writeLock = true;
+ fprintf( fp, "%s", WRITE_LOCK_STRING.c_str() );
+ fclose( fp );
+ return true;
+ }
+ }
+
+ // couldn't lock
+ return false;
+}
+
+bool LockFile::lockReadWrite()
+{
+ if ( m_readWriteLock ) {
+ // we already lock it, so it's a good lock
+ return true;
+ }
+
+ if ( m_writeLock || m_readLock ) {
+ // can't lock for read and write separatedly
+ return false;
+ }
+
+ struct stat buf;
+ if ( stat( m_fileName.c_str(), &buf) == 0 ) {
+ FILE* fp = fopen( m_fileName.c_str(), "w" );
+ if ( fp ) {
+ // file did not exist, could be created
+ m_writeLock = true;
+ fprintf( fp, "%s", READ_WRITE_LOCK_STRING.c_str() );
+ fclose( fp );
+ return true;
+ }
+ }
+
+ // couldn't lock
+ return false;
+
+}
+
+bool LockFile::unlock()
+{
+ if ( m_readLock || m_writeLock || m_readWriteLock ) {
+ // TODO: check whether lock count is 0
+ if ( unlink( m_fileName.c_str() ) == 0 ) {
+ m_readLock = m_writeLock = m_readWriteLock = false;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+void LockFile::setFile( const string& fileName )
+{
+ m_fileName = fileName + LOCK_SUFFIX;
+}
diff --git a/src/lockfile.h b/src/lockfile.h
new file mode 100644
index 0000000..fb1415f
--- /dev/null
+++ b/src/lockfile.h
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: lockfile.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _LOCKFILE_H_
+#define _LOCKFILE_H_
+
+#include <string>
+
+class LockFile
+{
+public:
+ LockFile();
+
+ bool lockRead();
+ bool lockWrite();
+ bool lockReadWrite();
+
+ bool unlock();
+
+ void setFile( const std::string& fileName );
+
+private:
+ std::string m_fileName;
+
+ bool m_readLock;
+ bool m_writeLock;
+ bool m_readWriteLock;
+
+ static std::string LOCK_SUFFIX;
+
+ static std::string WRITE_LOCK_STRING;
+ static std::string READ_LOCK_STRING;
+ static std::string READ_WRITE_LOCK_STRING;
+
+};
+
+#endif /* _LOCKFILE_H_ */
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..1af02ed
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,170 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: main.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <signal.h>
+#include <iostream>
+using namespace std;
+
+#include "argparser.h"
+#include "prtget.h"
+#include "signaldispatcher.h"
+
+int main( int argc, char** argv )
+{
+ ArgParser argParser( argc, argv );
+ if ( !argParser.parse() ) {
+ if (argParser.unknownOption().size() > 0){
+ cerr << "prt-get: Unknown option: " << argParser.unknownOption()
+ << endl;
+ } else if ( !argParser.isCommandGiven() ) {
+ if (argParser.commandName() != "") {
+ cerr << "prt-get: Unknown command '"
+ << argParser.commandName() << "'. "
+ << "try prt-get help for more information" << endl;
+ } else {
+ cerr << "prt-get: no command given. "
+ << "try prt-get help for more information" << endl;
+ }
+ }
+
+ exit( -1 );
+ }
+ if ( argParser.verbose() > 2 ) {
+ cerr << "prt-get: can't specify both -v and -vv. " << endl;
+ exit( -1 );
+ }
+
+ PrtGet prtGet( &argParser );
+
+ signal( SIGHUP, SignalDispatcher::dispatch );
+ signal( SIGINT, SignalDispatcher::dispatch );
+ signal( SIGQUIT, SignalDispatcher::dispatch );
+ signal( SIGILL, SignalDispatcher::dispatch );
+
+ SignalDispatcher::instance()->registerHandler( &prtGet, SIGINT );
+ SignalDispatcher::instance()->registerHandler( &prtGet, SIGHUP );
+ SignalDispatcher::instance()->registerHandler( &prtGet, SIGQUIT );
+ SignalDispatcher::instance()->registerHandler( &prtGet, SIGILL );
+
+
+ ArgParser::Type command = argParser.commandType();
+ switch ( command )
+ {
+ case ArgParser::HELP:
+ prtGet.printUsage();
+ break;
+ case ArgParser::SHOW_VERSION:
+ prtGet.printVersion();
+ break;
+ case ArgParser::LIST:
+ prtGet.listPackages();
+ break;
+ case ArgParser::DUP:
+ prtGet.listShadowed();
+ break;
+ case ArgParser::SEARCH:
+ prtGet.searchPackages();
+ break;
+ case ArgParser::DSEARCH:
+ prtGet.searchPackages( true );
+ break;
+ case ArgParser::INFO:
+ prtGet.printInfo();
+ break;
+ case ArgParser::ISINST:
+ prtGet.isInstalled();
+ break;
+ case ArgParser::INSTALL:
+ prtGet.install();
+ break;
+ case ArgParser::DEPINST:
+ prtGet.install(false, true, true);
+ break;
+ case ArgParser::GRPINST:
+ prtGet.install( false, true );
+ break;
+ case ArgParser::DEPENDS:
+ prtGet.printDepends();
+ break;
+ case ArgParser::QUICKDEP:
+ prtGet.printDepends( true );
+ break;
+ case ArgParser::UPDATE:
+ prtGet.install( true );
+ break;
+ case ArgParser::DIFF:
+ prtGet.printDiff();
+ break;
+ case ArgParser::QUICKDIFF:
+ prtGet.printQuickDiff();
+ break;
+ case ArgParser::CREATE_CACHE:
+ prtGet.createCache();
+ break;
+ case ArgParser::PATH:
+ prtGet.printPath();
+ break;
+ case ArgParser::LISTINST:
+ prtGet.listInstalled();
+ break;
+ case ArgParser::PRINTF:
+ prtGet.printf();
+ break;
+ case ArgParser::README:
+ prtGet.readme();
+ break;
+ case ArgParser::DEPENDENT:
+ prtGet.printDependendent();
+ break;
+ case ArgParser::SYSUP:
+ prtGet.sysup();
+ break;
+ case ArgParser::CURRENT:
+ prtGet.current();
+ break;
+ case ArgParser::FSEARCH:
+ prtGet.fsearch();
+ break;
+ case ArgParser::LOCK:
+ prtGet.setLock( true );
+ break;
+ case ArgParser::UNLOCK:
+ prtGet.setLock( false );
+ break;
+ case ArgParser::LISTLOCKED:
+ prtGet.listLocked();
+ break;
+ case ArgParser::CAT:
+ prtGet.cat();
+ break;
+ case ArgParser::LS:
+ prtGet.ls();
+ break;
+ case ArgParser::EDIT:
+ prtGet.edit();
+ break;
+ case ArgParser::REMOVE:
+ prtGet.remove();
+ break;
+ case ArgParser::DEPTREE:
+ prtGet.printDependTree();
+ break;
+ case ArgParser::DUMPCONFIG:
+ prtGet.dumpConfig();
+ break;
+ default:
+ cerr << "unknown command" << endl;
+ break;
+ }
+
+
+ return prtGet.returnValue();
+}
diff --git a/src/package.cpp b/src/package.cpp
new file mode 100644
index 0000000..454ff6e
--- /dev/null
+++ b/src/package.cpp
@@ -0,0 +1,333 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: package.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <cstdio>
+#include <sys/stat.h>
+#include <sys/utsname.h>
+using namespace std;
+
+#include "package.h"
+#include "stringhelper.h"
+using namespace StringHelper;
+
+
+
+/*!
+ Create a package, which is not yet fully initialized, This is interesting
+ in combination with the lazy initialization
+*/
+Package::Package( const string& name,
+ const string& path )
+ : m_loaded( false )
+{
+ m_data = new PackageData( name, path );
+}
+
+/*!
+ Create a fully initialized package. Most interesting when created from a
+ cache file
+*/
+Package::Package( const string& name,
+ const string& path,
+ const string& version,
+ const string& release,
+ const string& description,
+ const string& dependencies,
+ const string& url,
+ const string& packager,
+ const string& maintainer,
+ const string& hasReadme,
+ const string& hasPreInstall,
+ const string& hasPostInstall)
+ : m_loaded( true )
+{
+ m_data = new PackageData( name, path, version, release,
+ description, dependencies, url,
+ packager, maintainer, hasReadme,
+ hasPreInstall, hasPostInstall );
+
+}
+
+Package::~Package()
+{
+ delete m_data;
+}
+
+/*! \return the name of this package */
+const string& Package::name() const
+{
+ return m_data->name;
+}
+
+/*! \return the path to this package */
+const string& Package::path() const
+{
+ return m_data->path;
+}
+
+/*! \return the version of this package */
+const string& Package::version() const
+{
+ load();
+ return m_data->version;
+}
+
+/*! \return the release number of this package */
+const string& Package::release() const
+{
+ load();
+ return m_data->release;
+}
+
+/*! \return the description field of this package */
+const string& Package::description() const
+{
+ load();
+ return m_data->description;
+}
+
+/*! \return the dependency line of this package */
+const string& Package::dependencies() const
+{
+ load();
+ return m_data->depends;
+}
+
+/*! \return the url of this package */
+const string& Package::url() const
+{
+ load();
+ return m_data->url;
+}
+
+/*! \return the packager of this package */
+const string& Package::packager() const
+{
+ load();
+ return m_data->packager;
+}
+/*! \return the maintainer of this package */
+const string& Package::maintainer() const
+{
+ load();
+ return m_data->maintainer;
+}
+
+/*! \return whether or not this package has a readme file */
+const bool Package::hasReadme() const
+{
+ load();
+ return m_data->hasReadme;
+}
+
+const bool Package::hasPreInstall() const
+{
+ return m_data->hasPreInstall;
+}
+
+const bool Package::hasPostInstall() const
+{
+ return m_data->hasPostInstall;
+}
+
+/*!
+ load from Pkgfile
+*/
+void Package::load() const
+{
+ if ( m_loaded ) {
+ return;
+ }
+ m_loaded = true;
+
+ string fileName = m_data->path + "/" + m_data->name + "/Pkgfile";
+
+ // c IO is about four times faster then fstream :-(
+ FILE* fp = fopen( fileName.c_str(), "r" );
+ if ( fp == NULL ) {
+ return;
+ }
+
+
+ const int length = BUFSIZ;
+ char input[length];
+ string line;
+
+ time_t timeNow;
+ time(&timeNow);
+
+ struct utsname unameBuf;
+ if (uname(&unameBuf) != 0) {
+ unameBuf.release[0] = '\0';
+ }
+
+
+
+ while ( fgets( input, length, fp ) ) {
+
+ line = stripWhiteSpace( input );
+
+ if ( line.substr( 0, 8 ) == "version=" ) {
+ m_data->version = getValueBefore( getValue( line, '=' ), '#' );
+ m_data->version = stripWhiteSpace( m_data->version );
+
+ expandShellCommands(m_data->version, timeNow, unameBuf);
+ } else if ( line.substr( 0, 8 ) == "release=" ) {
+ m_data->release = getValueBefore( getValue( line, '=' ), '#' );
+ m_data->release = stripWhiteSpace( m_data->release );
+ } else if ( line[0] == '#' ) {
+ while ( !line.empty() &&
+ ( line[0] == '#' || line[0] == ' ' || line[0] == '\t' ) ) {
+ line = line.substr( 1 );
+ }
+ string::size_type pos = line.find( ':' );
+ if ( pos != string::npos ) {
+ if ( startwith_nocase( line, "desc" ) ) {
+ m_data->description =
+ stripWhiteSpace( getValue( line, ':' ) );
+
+ } else if ( startwith_nocase( line, "pack" ) ) {
+ m_data->packager =
+ stripWhiteSpace( getValue( line, ':' ) );
+ } else if ( startwith_nocase( line, "maint" ) ) {
+ m_data->maintainer =
+ stripWhiteSpace( getValue( line, ':' ) );
+ } else if ( startwith_nocase( line, "url" ) ) {
+ m_data->url = stripWhiteSpace( getValue( line, ':' ) );
+ } else if ( startwith_nocase( line, "dep" ) ) {
+ string depends = stripWhiteSpace( getValue( line, ':' ) );
+
+ StringHelper::replaceAll( depends, " ", "," );
+ StringHelper::replaceAll( depends, ",,", "," );
+
+ // TODO: decide which one to use
+#if 0
+ // remove commented out packages
+ list<string> deps = StringHelper::split( depends, ',' );
+ list<string>::iterator it = deps.begin();
+ for ( ; it != deps.end(); ++it ) {
+ if ( (*it)[0] == '#' ) {
+ cerr << "Commented dep: " << *it << endl;
+ } else {
+ if ( it != deps.begin() ) {
+ m_data->depends += ",";
+ }
+ m_data->depends += *it;
+ }
+ }
+#else
+ m_data->depends = depends;
+#endif
+
+ }
+ }
+ }
+ }
+ fclose( fp );
+
+
+ string file = m_data->path + "/" + m_data->name + "/README";
+ struct stat buf;
+ if ( stat( file.c_str(), &buf ) != -1) {
+ m_data->hasReadme = true;
+ }
+ file = m_data->path + "/" + m_data->name + "/pre-install";
+ if ( stat( file.c_str(), &buf ) != -1) {
+ m_data->hasPreInstall = true;
+ }
+ file = m_data->path + "/" + m_data->name + "/post-install";
+ if ( stat( file.c_str(), &buf ) != -1) {
+ m_data->hasPostInstall = true;
+ }
+
+}
+
+void Package::setDependencies( const std::string& dependencies )
+{
+ m_data->depends = dependencies;
+}
+
+
+
+PackageData::PackageData( const string& name_,
+ const string& path_,
+ const string& version_,
+ const string& release_,
+ const string& description_,
+ const string& dependencies_,
+ const string& url_,
+ const string& packager_,
+ const string& maintainer_,
+ const string& hasReadme_,
+ const string& hasPreInstall_,
+ const string& hasPostInstall_ )
+ : name( name_ ),
+ path( path_ ),
+ version( version_ ),
+ release( release_ ),
+ description( description_ ),
+ depends( dependencies_ ),
+ url( url_ ),
+ packager( packager_ ),
+ maintainer( maintainer_ )
+
+{
+ hasReadme = ( stripWhiteSpace( hasReadme_ ) == "yes" );
+ hasPreInstall = ( stripWhiteSpace( hasPreInstall_ ) == "yes" );
+ hasPostInstall = ( stripWhiteSpace( hasPostInstall_ ) == "yes" );
+}
+
+
+void Package::expandShellCommands(std::string& input,
+ const time_t& timeNow,
+ const struct utsname unameBuf)
+{
+ // TODO: consider dropping either of the tagsets, depending on feedback
+
+ static const int TAG_COUNT = 2;
+ string startTag[TAG_COUNT] = { "`", "$(" };
+ string endTag[TAG_COUNT] = { "`", ")" };
+
+ for (int i = 0; i < TAG_COUNT; ++i) {
+ string::size_type pos;
+ while ((pos = input.find(startTag[i])) != string::npos) {
+
+ if (unameBuf.release) {
+ input = replaceAll(input,
+ startTag[i] + "uname -r" + endTag[i],
+ unameBuf.release);
+ }
+
+ pos = input.find(startTag[i] + "date");
+ if (pos != string::npos) {
+ // NOTE: currently only works for one date pattern
+ string::size_type startpos, endpos;
+ endpos = input.find(endTag[i], pos+1);
+ startpos = input.find('+', pos+1);
+
+ string format = input.substr(startpos+1, endpos-startpos-1);
+
+ // support date '+...' and date "+..."
+ int len = format.length();
+ if (format[len-1] == '\'' || format[len-1] == '"') {
+ format = format.substr(0, len-1);
+ }
+ char timeBuf[32];
+ strftime(timeBuf, 32, format.c_str(), localtime(&timeNow));
+
+ input = input.substr(0, pos) + timeBuf +
+ input.substr(endpos+1);
+ }
+ }
+ }
+}
diff --git a/src/package.h b/src/package.h
new file mode 100644
index 0000000..7af66dc
--- /dev/null
+++ b/src/package.h
@@ -0,0 +1,104 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: package.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _PACKAGE_H_
+#define _PACKAGE_H_
+
+#include <string>
+
+struct PackageData;
+
+/*!
+ \class Package
+ \brief representation of a package
+
+ Representation of a package from the crux ports tree
+*/
+class Package
+{
+public:
+ Package( const std::string& name,
+ const std::string& path );
+
+ Package( const std::string& name,
+ const std::string& path,
+ const std::string& version,
+ const std::string& release,
+ const std::string& description,
+ const std::string& dependencies,
+ const std::string& url,
+ const std::string& packager,
+ const std::string& maintainer,
+ const std::string& hasReadme,
+ const std::string& hasPreInstall,
+ const std::string& hasPostInstall );
+
+ ~Package();
+
+ const std::string& name() const;
+ const std::string& path() const;
+ const std::string& version() const;
+ const std::string& release() const;
+ const std::string& description() const;
+ const std::string& dependencies() const;
+ const std::string& url() const;
+ const std::string& packager() const;
+ const std::string& maintainer() const;
+ const bool hasReadme() const;
+ const bool hasPreInstall() const;
+ const bool hasPostInstall() const;
+
+ void setDependencies( const std::string& dependencies );
+
+
+private:
+ void load() const;
+
+ static void expandShellCommands(std::string& input,
+ const time_t& timeNow,
+ const struct utsname unameBuf);
+
+ mutable PackageData* m_data;
+ mutable bool m_loaded;
+
+ };
+
+struct PackageData
+{
+ PackageData( const std::string& name_,
+ const std::string& path_,
+ const std::string& version_="",
+ const std::string& release_="",
+ const std::string& description_="",
+ const std::string& dependencies_="",
+ const std::string& url_="",
+ const std::string& packager="",
+ const std::string& maintainer="",
+ const std::string& hasReadme_="",
+ const std::string& hasPreInstall_="",
+ const std::string& hasPostInstall_="");
+
+ std::string name;
+ std::string path;
+ std::string version;
+ std::string release;
+ std::string description;
+ std::string depends;
+ std::string url;
+ std::string packager;
+ std::string maintainer;
+
+ bool hasReadme;
+ bool hasPreInstall;
+ bool hasPostInstall;
+};
+
+#endif /* _PACKAGE_H_ */
diff --git a/src/pg_regex.cpp b/src/pg_regex.cpp
new file mode 100644
index 0000000..0051beb
--- /dev/null
+++ b/src/pg_regex.cpp
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: pg_regex.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2005 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+
+#include <string>
+using namespace std;
+
+#include "pg_regex.h"
+
+
+RegEx::RegEx(const string& pattern, bool caseSensitive)
+{
+ int additionalFlags = 0;
+ if (!caseSensitive) {
+ additionalFlags |= REG_ICASE;
+ }
+
+ m_validPattern =
+ regcomp(&m_pattern,
+ pattern.c_str(),
+ REG_EXTENDED|REG_NOSUB|additionalFlags) == 0;
+}
+
+RegEx::~RegEx()
+{
+ regfree(&m_pattern);
+}
+
+bool RegEx::match(const string& input)
+{
+ if (!m_validPattern) {
+ return false;
+ }
+ bool success = (regexec(&m_pattern, input.c_str(), 0, 0, 0) == 0);
+ return success;
+}
+
+bool RegEx::match(const string& pattern,
+ const string& input,
+ bool caseSensitive)
+{
+ RegEx re(pattern, caseSensitive);
+ return re.match(input);
+}
diff --git a/src/pg_regex.h b/src/pg_regex.h
new file mode 100644
index 0000000..8d8209b
--- /dev/null
+++ b/src/pg_regex.h
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: regex.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2005 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+
+#ifndef _REGEX_H_
+#define _REGEX_H_
+
+#include <sys/types.h>
+#include <regex.h>
+#include <string>
+
+
+class RegEx
+{
+public:
+ RegEx(const std::string& pattern, bool caseSensitive=false);
+ ~RegEx();
+
+ bool match(const std::string& input);
+
+ static bool match(const std::string& pattern,
+ const std::string& input,
+ bool caseSensitive=false);
+
+private:
+ regex_t m_pattern;
+ bool m_validPattern;
+};
+
+
+#endif /* _REGEX_H_ */
diff --git a/src/pkgdb.cpp b/src/pkgdb.cpp
new file mode 100644
index 0000000..f264300
--- /dev/null
+++ b/src/pkgdb.cpp
@@ -0,0 +1,238 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: pkgdb.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <algorithm>
+#include <fstream>
+#include <map>
+#include <iostream>
+using namespace std;
+
+#include <cstring>
+#include <cstdio>
+
+#include <fnmatch.h>
+
+#include "pkgdb.h"
+#include "datafileparser.h"
+#include "stringhelper.h"
+#include "pg_regex.h"
+
+
+const string PkgDB::PKGDB = "/var/lib/pkg/db";
+const string PkgDB::ALIAS_STORE = LOCALSTATEDIR"/lib/pkg/prt-get.aliases";
+
+/*!
+ Create a PkgDB object
+*/
+PkgDB::PkgDB( const string& installRoot )
+ : m_isLoaded( false ),
+ m_installRoot( installRoot )
+{
+}
+
+/*!
+ Check whether a package is installed
+
+ \param name the name of the package to check
+ \param isAlias whether a package is installed as alias
+ \param aliasOriginalName the original name of an aliased package
+
+ \return whether package \a name is installed
+*/
+bool PkgDB::isInstalled( const string& name,
+ bool useAlias,
+ bool* isAlias,
+ string* aliasOrignalName ) const
+{
+ if ( !load() ) {
+ return false;
+ }
+
+ bool installed = m_packages.find( name ) != m_packages.end();
+ if (!installed && useAlias) {
+ string provider;
+ installed = aliasExistsFor(name, provider);
+
+ if (isAlias) {
+ *isAlias = installed;
+
+ if (installed && aliasOrignalName) {
+ *aliasOrignalName = provider;
+ }
+ }
+ }
+
+ return installed;
+}
+
+
+bool PkgDB::aliasExistsFor(const string& name, string& providerName) const
+{
+ // when used the first time, split alias names
+ if (m_splitAliases.size() < m_aliases.size()) {
+ map<string, string>::iterator it = m_aliases.begin();
+ for (; it != m_aliases.end(); ++it) {
+ StringHelper::split(it->second, ',',
+ m_splitAliases[it->first]);
+ }
+ }
+
+ map<string, vector<string> >::iterator it = m_splitAliases.begin();
+ for (; it != m_splitAliases.end(); ++it) {
+ if (find(it->second.begin(), it->second.end(), name) !=
+ it->second.end()) {
+ providerName = it->first;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/*!
+ load the package db
+*/
+bool PkgDB::load() const
+{
+ if ( m_isLoaded ) {
+ return true;
+ }
+
+#if 0
+ // check this one out to see a really slow IO library :-(
+
+
+ ifstream db( PKGDB );
+ string line;
+ bool emptyLine = true;
+ while ( db.good() ) {
+ getline( db, line );
+ if ( emptyLine ) {
+ if ( !line.empty() ) {
+ m_packages.push_back( line );
+ }
+ emptyLine = false;
+ }
+ if ( line == "" ) {
+ emptyLine = true;
+ }
+ }
+ db.close();
+#endif
+
+ std::map<std::string, std::string> aliases;
+ DataFileParser::parse(ALIAS_STORE, aliases);
+
+ const int length = 256;
+ char line[length];
+ bool emptyLine = true;
+ bool nameRead = false;
+ string name;
+
+ string pkgdb = "";
+ if (m_installRoot != "") {
+ pkgdb = m_installRoot;
+ }
+ pkgdb += PKGDB;
+
+ FILE* fp = fopen( pkgdb.c_str(), "r" );
+ if ( fp ) {
+ while ( fgets( line, length, fp ) ) {
+ if ( emptyLine ) {
+ line[strlen(line)-1] = '\0';
+ name = line;
+ emptyLine = false;
+ nameRead = true;
+ } else if ( nameRead ) {
+ line[strlen(line)-1] = '\0';
+ m_packages[ name ] = line;
+ nameRead = false;
+ if (aliases.find(name) != aliases.end()) {
+ m_aliases[name] = aliases[name];
+ }
+ }
+ if ( line[0] == '\n' ) {
+ emptyLine = true;
+ }
+
+ }
+ } else {
+ return false;
+ }
+
+ m_isLoaded = true;
+
+ fclose( fp );
+
+ return true;
+}
+
+/*!
+ return a map of installed packages, where the key is the package name and
+ the value is the version/release string
+ \return a map of installed packages (key=name, value=version/release)
+*/
+const map<string, string>& PkgDB::installedPackages()
+{
+ load();
+ return m_packages;
+}
+
+/*!
+ \return a package's version and release or an empty string if not found
+*/
+string PkgDB::getPackageVersion( const string& name ) const
+{
+ if ( !load() ) {
+ return "";
+ }
+
+ map<string, string>::const_iterator it = m_packages.find( name );
+ if ( it == m_packages.end() ) {
+ return "";
+ }
+
+ return it->second;
+}
+
+/*!
+ Search packages for a match of \a pattern in name. The name can
+ contain shell wildcards.
+
+ \param pattern the pattern to be found
+ \return a list of matching packages
+*/
+void PkgDB::getMatchingPackages( const string& pattern,
+ map<string,string>& target,
+ bool useRegex ) const
+{
+ if ( !load() ) {
+ return;
+ }
+
+ RegEx re(pattern);
+ map<string, string>::const_iterator it = m_packages.begin();
+ if (useRegex) {
+ for ( ; it != m_packages.end(); ++it ) {
+ if (re.match(it->first)) {
+ target[it->first] = it->second;
+ }
+ }
+ } else {
+ for ( ; it != m_packages.end(); ++it ) {
+ // I assume fnmatch will be quite fast for "match all" (*), so
+ // I didn't add a boolean to check for this explicitely
+ if ( fnmatch( pattern.c_str(), it->first.c_str(), 0 ) == 0 ) {
+ target[it->first] = it->second;
+ }
+ }
+ }
+}
diff --git a/src/pkgdb.h b/src/pkgdb.h
new file mode 100644
index 0000000..930b8e1
--- /dev/null
+++ b/src/pkgdb.h
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: pkgdb.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _PKGDB_H_
+#define _PKGDB_H_
+
+#include <map>
+#include <utility>
+#include <vector>
+#include <string>
+
+
+/*!
+ \class PkgDB
+ \brief database of installed packages
+
+ A representation of crux' package database of installed packages
+*/
+class PkgDB
+{
+public:
+ PkgDB( const std::string& installRoot = "" );
+ bool isInstalled( const std::string& name,
+ bool useAlias = false,
+ bool* isAlias = 0,
+ string* aliasOrignalName = 0 ) const;
+
+
+ std::string getPackageVersion( const std::string& name ) const;
+ const std::map<std::string, std::string>& installedPackages();
+ void getMatchingPackages( const std::string& pattern,
+ map<std::string,std::string>& target,
+ bool useRegex ) const;
+
+ static const std::string ALIAS_STORE;
+
+private:
+ bool load() const;
+
+ bool aliasExistsFor(const string& name, string& provider) const;
+
+ mutable bool m_isLoaded;
+ mutable std::map<std::string, std::string> m_packages;
+ mutable std::map<std::string, std::string> m_aliases;
+ mutable std::map<std::string, std::vector<std::string> > m_splitAliases;
+
+ std::string m_installRoot;
+
+ static const std::string PKGDB;
+};
+
+#endif /* _PKGDB_H_ */
diff --git a/src/process.cpp b/src/process.cpp
new file mode 100644
index 0000000..47c09c3
--- /dev/null
+++ b/src/process.cpp
@@ -0,0 +1,229 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: process.cpp
+// AUTHORS: Johannes Winkelmann, jw@tks6.net
+// Output redirection by Logan Ingalls, log@plutor.org
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <list>
+using namespace std;
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+
+#include <cassert>
+#include <cstddef>
+#include <cstdlib>
+#include <cstdio>
+
+#include "process.h"
+
+#include "stringhelper.h"
+using namespace StringHelper;
+
+
+/*!
+ create a process
+ \param app the application to execute
+ \param arguments the arguments to be passed to \a app
+ \param fdlog file descriptor to a log file
+*/
+Process::Process( const string& app, const string& arguments, int fdlog )
+ : m_app( app ), m_arguments( arguments ), m_fdlog( fdlog )
+{
+}
+
+/*!
+ execute the process
+ \return the exit status of the application
+*/
+int Process::execute()
+{
+ list<string> args;
+ split( m_arguments, ' ', args, 0, false );
+
+ const int argc = 1 + args.size() + 1; // app, args, NULL
+
+ char** argv = new char*[argc];
+ list<string>::iterator it = args.begin();
+
+ int i = 0;
+ argv[i] = const_cast<char*>( m_app.c_str() );
+ for ( ; it != args.end(); ++it ) {
+ ++i;
+ argv[i] = const_cast<char*>( it->c_str() );
+ }
+
+ ++i;
+ assert( i+1 == argc );
+ argv[i] = NULL;
+ int status = 0;
+
+ if ( m_fdlog > 0 ) {
+ status = execLog(argc, argv);
+ } else {
+ status = exec(argc, argv);
+ }
+ delete [] argv;
+
+ return status;
+}
+
+
+int Process::execLog(const int argc, char** argv)
+{
+ int status = 0;
+ int fdpipe[2];
+ pipe( fdpipe );
+
+ pid_t pid = fork();
+ if ( pid == 0 ) {
+ // child process
+ close( fdpipe[0] );
+ dup2( fdpipe[1], 1 );
+ dup2( fdpipe[1], 2 );
+
+ execv( m_app.c_str(), argv );
+ _exit( EXIT_FAILURE );
+ } else if ( pid < 0 ) {
+ // fork failed
+ status = -1;
+ } else {
+ // parent process
+ close( fdpipe[1] );
+
+ char readbuf[1024];
+ int bytes, wpval;
+
+ while ( (wpval = waitpid ( pid, &status, WNOHANG )) == 0 ) {
+ while ( (bytes=read(fdpipe[0], readbuf, sizeof(readbuf)-1)) > 0 ) {
+ readbuf[bytes] = 0;
+ printf("%s", readbuf);
+ fflush(stdout);
+ fflush(stderr);
+ write( m_fdlog, readbuf, bytes );
+ }
+ }
+
+ if ( wpval != pid ) {
+ status = -1;
+ }
+ }
+
+ return status;
+}
+
+
+int Process::exec(const int argc, char** argv)
+{
+ int status = 0;
+ pid_t pid = fork();
+ if ( pid == 0 ) {
+ // child process
+ execv( m_app.c_str(), argv );
+ _exit( EXIT_FAILURE );
+ } else if ( pid < 0 ) {
+ // fork failed
+ status = -1;
+ } else {
+ // parent process
+ if ( waitpid ( pid, &status, 0 ) != pid ) {
+ status = -1;
+ }
+ }
+ return status;
+}
+
+/*!
+ execute the process using the shell
+ \return the exit status of the application
+
+ \todo make shell exchangable
+*/
+int Process::executeShell()
+{
+ // TODO: make shell exchangable
+ static const char SHELL[] = "/bin/sh";
+ int status = 0;
+ if ( m_fdlog > 0 ) {
+ status = execShellLog(SHELL);
+ } else {
+ status = execShell(SHELL);
+ }
+
+ return status;
+}
+
+
+int Process::execShellLog(const char* SHELL)
+{
+ int status = 0;
+
+ int fdpipe[2];
+ pipe( fdpipe );
+
+ pid_t pid = fork();
+ if ( pid == 0 ) {
+ // child process
+ close( fdpipe[0] );
+ dup2( fdpipe[1], 1 );
+ dup2( fdpipe[1], 2 );
+
+ execl( SHELL, SHELL, "-c", (m_app + " " + m_arguments).c_str(), NULL );
+ _exit( EXIT_FAILURE );
+ } else if ( pid < 0 ) {
+ // fork failed
+ status = -1;
+ } else {
+ // parent process
+ close( fdpipe[1] );
+
+ char readbuf[1024];
+ int bytes, wpval;
+
+ while ( (wpval = waitpid ( pid, &status, WNOHANG )) == 0 ) {
+ while ( (bytes=read(fdpipe[0], readbuf, sizeof(readbuf)-1)) > 0 ) {
+ readbuf[bytes] = 0;
+ printf("%s", readbuf);
+ fflush(stdout);
+ fflush(stderr);
+ write( m_fdlog, readbuf, bytes );
+ }
+ }
+
+ if ( wpval != pid ) {
+ status = -1;
+ }
+ }
+
+ return status;
+}
+
+int Process::execShell(const char* SHELL)
+{
+ int status = 0;
+
+ pid_t pid = fork();
+ if ( pid == 0 ) {
+ execl( SHELL, SHELL, "-c", (m_app + " " + m_arguments).c_str(), NULL );
+ _exit( EXIT_FAILURE );
+ } else if ( pid < 0 ) {
+ // fork failed
+ status = -1;
+ } else {
+ // parent process
+ if ( waitpid ( pid, &status, 0 ) != pid ) {
+ status = -1;
+ }
+ }
+
+ return status;
+}
diff --git a/src/process.h b/src/process.h
new file mode 100644
index 0000000..416e65a
--- /dev/null
+++ b/src/process.h
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: process.h
+// AUTHORS: Johannes Winkelmann, jw@tks6.net
+// Output redirection by Logan Ingalls, log@plutor.org
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _PROCESS_H_
+#define _PROCESS_H_
+
+#include <string>
+using namespace std;
+
+/*!
+ \class Process
+ \brief Process execution class
+
+ A class to execute processes
+
+*/
+class Process
+{
+public:
+ Process( const string& app, const string& arguments, int fdlog=0 );
+ int execute();
+ int executeShell();
+
+private:
+
+ int exec(const int argc, char** argv);
+ int execLog(const int argc, char** argv);
+
+ int execShell(const char* shell);
+ int execShellLog(const char* shell);
+
+ string m_app;
+ string m_arguments;
+ int m_fdlog;
+};
+
+#endif /* _PROCESS_H_ */
diff --git a/src/prtget.cpp b/src/prtget.cpp
new file mode 100644
index 0000000..a3bbe1a
--- /dev/null
+++ b/src/prtget.cpp
@@ -0,0 +1,1939 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: prtget.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iostream>
+#include <algorithm>
+#include <set>
+#include <iomanip>
+#include <cstdio>
+#include <cassert>
+using namespace std;
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <unistd.h>
+
+#include "prtget.h"
+#include "repository.h"
+#include "argparser.h"
+#include "installtransaction.h"
+#include "configuration.h"
+
+#include "stringhelper.h"
+#include "versioncomparator.h"
+#include "file.h"
+#include "process.h"
+#include "datafileparser.h"
+using namespace StringHelper;
+
+
+const string PrtGet::CONF_FILE = SYSCONFDIR"/prt-get.conf";
+const string PrtGet::DEFAULT_CACHE_FILE = LOCALSTATEDIR"/lib/pkg/prt-get.cache";
+
+/*!
+ Create a PrtGet object
+ \param parser the argument parser to be used
+*/
+PrtGet::PrtGet( const ArgParser* parser )
+ : m_repo( 0 ),
+ m_config( 0 ),
+ m_parser( parser ),
+ m_cacheFile( DEFAULT_CACHE_FILE ),
+ m_returnValue( PG_OK ),
+ m_currentTransaction( 0 )
+{
+ if ( m_parser->wasCalledAsPrtCached() ) {
+ m_appName = "prt-cache";
+ } else {
+ m_appName = "prt-get";
+ }
+
+
+ m_pkgDB = new PkgDB(m_parser->installRoot());
+ readConfig();
+
+ m_useRegex = m_config->useRegex() || m_parser->useRegex();
+}
+
+/*! destruct PrtGet object */
+PrtGet::~PrtGet()
+{
+ if ( m_config ) {
+ delete m_config;
+ }
+ if ( m_repo ) {
+ delete m_repo;
+ }
+
+ delete m_pkgDB;
+}
+
+
+/*! print version and exit */
+void PrtGet::printVersion()
+{
+ cout << m_appName << " " << VERSION
+ << " by Johannes Winkelmann, jw@tks6.net" << endl;
+}
+
+/*! print version, usage and exit */
+void PrtGet::printUsage()
+{
+ printVersion();
+ cout << "Usage: " << m_appName << " <command> [options]" << endl;
+
+ cout << "where commands are:" << endl;
+
+ cout << "\nINFORMATION" << endl;
+ cout << " help show this help" << endl;
+ cout << " version show the current version" << endl;
+ cout << " list [<filter>] show a list of available ports"
+ << endl;
+ cout << " printf <format> print formatted list of available"
+ << " ports"
+ << endl;
+ cout << " listinst [<filter>] show a list of installed ports"
+ << endl;
+ cout << " info <port> show info about a port" << endl;
+ cout << " path <port> show path of a port" << endl;
+ cout << " readme <port> show a port's readme file "
+ << "(if it exists)" << endl;
+ cout << " dup Find duplicate ports" << endl;
+ cout << " isinst <port1 port2...> print whether ports are installed"
+ << endl;
+ cout << " current <port> print installed version of port"
+ << endl;
+
+ cout << "\nDIFFERENCES / CHECK FOR UPDATES" << endl;
+ cout << " diff <port1 port2...> list outdated packages (or check "
+ << "args for change)" << endl;
+ cout << " quickdiff same as diff but simple format"
+ << endl;
+ cout << " where opt can be:" << endl;
+ cout << " --all display locked ports too"
+ << endl;
+ cout << " --prefer-higher prefer higher installed "
+ << "versions over lower ports"
+ << endl;
+ cout << " --strict-diff override prefer higher "
+ << "configuration setting"
+ << endl;
+
+ cout << "\nDEPENDENCIES" << endl;
+ cout << " depends <port1 port2...> show dependencies for these ports"
+ << endl;
+ cout << " quickdep <port1 port2...> same as 'depends' but simple format"
+ << endl;
+ cout << " deptree <port> show dependencies tree for <port>"
+ << endl;
+ cout << " dependent [opt] <port> show installed packages which "
+ << "depend on 'port'"
+ << endl;
+ cout << " where opt can be:" << endl;
+ cout << " --all list all dependent packages, not "
+ << "only installed" << endl;
+
+ cout << "\nSEARCHING" << endl;
+ cout << " search <expr> show port names containing 'expr'" << endl;
+ cout << " dsearch <expr> show ports containing 'expr' in the "
+ << "name or description" << endl;
+ cout << " fsearch <pattern> show file names in footprints matching "
+ << "'pattern'" << endl;
+
+ cout << "\nINSTALL, UPDATE and REMOVAL" << endl;
+ cout << " install [opt] <port1 port2...> install ports" << endl;
+ cout << " update [opt] <port1 port2...> update ports" << endl;
+ cout << " grpinst [opt] <port1 port2...> install ports, stop on error"
+ << endl;
+ cout << " remove [opt] <port1 port2...> remove ports"
+ << endl;
+ cout << " where opt can be:" << endl;
+ cout << " -f, -fi force installation" << endl;
+ cout << " -fr force rebuild" << endl;
+ cout << " -uf update footprint" << endl;
+ cout << " -if ignore footprint" << endl;
+ cout << " -um update md5sum" << endl;
+ cout << " -im ignore md5sum" << endl;
+ cout << " --margs=<string> pass 'string' to pkgmk"
+ << endl;
+ cout << " --aargs=<string> pass 'string' to pkgadd"
+ << endl;
+ cout << " --rargs=<string> pass 'string' to pkgrm"
+ << endl;
+ cout << " --test test mode" << endl;
+ cout << " --log write log file"<< endl;
+ cout << " --ignore=<package1,package2,...>" << endl
+ << " Don't install/update those packages"<< endl;
+ cout << " --pre-install execute pre-install script"
+ << endl;
+ cout << " --post-install execute post-install script"
+ << endl;
+ cout << " --install-scripts execute "
+ << "pre-install and post-install script"
+ << endl;
+
+ cout << "\nSYSTEM UPDATE " << endl;
+ cout << " sysup [opt] update all outdated ports"
+ << endl;
+ cout << " where opt can be:" << endl;
+ cout << " --nodeps don't sort by dependencies"
+ << endl;
+ cout << " --test test mode" << endl;
+ cout << " --log write log file"<< endl;
+ cout << " --prefer-higher prefer higher installed "
+ << "versions over lower ones in ports tree"
+ << endl;
+ cout << " --strict-diff override prefer higher "
+ << "configuration setting"
+ << endl;
+
+ cout << " lock <port1 port2...> lock current version "
+ << "of packages"
+ << endl;
+ cout << " unlock <port1 port2...> unlock packages"
+ << endl;
+ cout << " listlocked list locked packages"
+ << endl;
+
+ cout << "\nFILE OPERATIONS " << endl;
+
+ cout << " ls <port> print a listing of the port's"
+ << " directory" << endl;
+ cout << " cat <port> <file> print out 'port/file'"
+ << endl;
+ cout << " edit <port> <file> edit 'port/file'" << endl;
+
+ cout << "\nGENERAL OPTIONS" << endl;
+ cout << " -v Show version in listing"
+ << endl;
+ cout << " -vv Show version and decription " << "in listing\n" << endl;
+ cout << " --path Print path to port if appropriate (search, list, depends)\n" << endl;
+ cout << " --cache Use a cache file" << endl;
+ cout << " --config=<file> Use alternative "
+ << "configuration file" << endl;
+ cout << " --install-root=.. Use alternative "
+ << "install root directory" << endl;
+
+
+
+
+ cout << " --no-std-config Don't parse "
+ << "default configuration file" << endl;
+ cout << " --config-prepend=.. Prepend '..' to"
+ << " configuration" << endl;
+ cout << " --config-append=.. Append '..' "
+ << "to configuration" << endl;
+ cout << " --config-set=.. Set configuration "
+ << "data '..',\n"
+ << " overriding config file"
+ << endl;
+
+}
+
+
+/*! print list of duplicate packages in the repository */
+void PrtGet::listShadowed()
+{
+ if ( m_parser->useCache() ) {
+ cout << m_appName << ": command 'dup' can't work on a cache" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ initRepo( true );
+ cout << "Hidden packages:" << endl;
+ map<string, pair<string, string> >::const_iterator it =
+ m_repo->shadowedPackages().begin();
+ for ( ; it != m_repo->shadowedPackages().end(); ++it ) {
+ string name = it->first;
+ cout << "* " << name << endl;
+ cout << " " << it->second.second << " preceeds over" << endl;
+ cout << " " << it->second.first << endl;
+ }
+}
+
+/*!
+ find ports matching a pattern in repository
+
+ \sa Repository::getMatchingPackages()
+*/
+void PrtGet::listPackages()
+{
+ string arg = "*";
+ assertMaxArgCount(1);
+
+ if ( m_parser->otherArgs().size() == 1 ) {
+ arg = *(m_parser->otherArgs().begin());
+ }
+
+ initRepo();
+ list<Package*> packages;
+ m_repo->getMatchingPackages( arg, packages );
+ if ( packages.size() ) {
+ list<Package*>::iterator it = packages.begin();
+ for ( ; it != packages.end(); ++it ) {
+ if ( m_parser->printPath() ) {
+ cout << (*it)->path() << "/";
+ }
+ cout << (*it)->name();
+ if ( m_parser->verbose() > 0 ) {
+ cout << " " << (*it)->version() << "-" << (*it)->release();
+ }
+ if ( m_parser->verbose() > 1 && !(*it)->description().empty() ) {
+ cout << ": " << (*it)->description();
+ }
+
+ cout << endl;
+ }
+ } else {
+ cout << "No matching packages found" << endl;
+ }
+}
+
+/*!
+ search repository for a certain pattern (which is read by the argument
+ parser.
+
+ \sa Repository::searchMatchingPackages()
+*/
+void PrtGet::searchPackages( bool searchDesc )
+{
+ assertExactArgCount(1);
+
+ initRepo();
+ string arg = *(m_parser->otherArgs().begin());
+ list<Package*> packages;
+ m_repo->searchMatchingPackages( arg, packages, searchDesc );
+ if ( packages.size() ) {
+ list<Package*>::iterator it = packages.begin();
+ for ( ; it != packages.end(); ++it ) {
+ if ( m_parser->printPath()) {
+ cout << (*it)->path() << "/";
+ }
+ cout << (*it)->name();
+
+ if ( m_parser->verbose() > 0 ) {
+ cout << " " << (*it)->version() << "-" << (*it)->release();
+ }
+ if ( m_parser->verbose() > 1 && !(*it)->description().empty() ) {
+ cout << ": " << (*it)->description();
+ }
+
+
+ cout << endl;
+ }
+ } else {
+ m_returnValue = PG_GENERAL_ERROR;
+ cout << "No matching packages found" << endl;
+ }
+}
+
+/*! print info for a package */
+void PrtGet::printInfo()
+{
+ assertExactArgCount(1);
+
+ initRepo();
+ string arg = *(m_parser->otherArgs().begin());
+ const Package* p = m_repo->getPackage( arg );
+ if ( p ) {
+ cout << "Name: " << p->name() << "\n"
+ << "Path: " << p->path() << "\n"
+ << "Version: " << p->version() << "\n"
+ << "Release: " << p->release() << endl;
+
+ if ( !p->description().empty() ) {
+ cout << "Description: " << p->description() << endl;
+ }
+ if ( !p->url().empty() ) {
+ cout << "URL: " << p->url() << endl;
+ }
+ if ( !p->packager().empty() ) {
+ cout << "Packager: " << p->packager() << endl;
+ }
+ if ( !p->maintainer().empty() ) {
+ cout << "Maintainer: " << p->maintainer() << endl;
+ }
+
+ if ( !p->dependencies().empty() ) {
+ cout << "Dependencies: " << p->dependencies() << endl;
+ }
+
+ // TODO: don't hardcode file names
+ string filesString = "";
+ if ( p->hasReadme() ) {
+ filesString += "README ";
+ }
+ if ( p->hasPreInstall() ) {
+ filesString += "pre-install ";
+ }
+ if ( p->hasPostInstall() ) {
+ filesString += "post-install ";
+ }
+
+ if ( filesString.length() > 0 ) {
+ filesString = StringHelper::stripWhiteSpace( filesString );
+ StringHelper::replaceAll( filesString, " ", "," );
+ cout << "Files: " << filesString << endl;
+ }
+
+ if ( m_parser->verbose() > 0 && p->hasReadme()) {
+ cout << "\n-- README ------" << endl;
+ readme();
+ }
+
+ } else {
+ cerr << "Package '" << arg << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+}
+
+
+/*!
+ initialize repository
+ \sa Repository::initFromCache()
+ \sa Repository::initFromFS()
+ */
+void PrtGet::initRepo( bool listDuplicate )
+{
+ if ( !m_repo ) {
+ m_repo = new Repository(m_useRegex);
+
+ if ( m_parser->useCache() ) {
+ if (m_config->cacheFile() != "") {
+ m_cacheFile = m_config->cacheFile();
+ }
+
+ Repository::CacheReadResult result =
+ m_repo->initFromCache( m_cacheFile );
+ if ( result == Repository::ACCESS_ERR ) {
+ cerr << "Can't open cache file: " << m_cacheFile << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ } else if ( result == Repository::FORMAT_ERR ) {
+ cerr << "warning: your cache file "
+ << m_cacheFile << " was made with an "
+ << "older version "
+ << "of prt-get."
+ << "\nPlease regenerate it using"
+ << "\n prt-get cache" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ struct stat cacheStat;
+ struct stat confStat;
+ stat( m_cacheFile.c_str(), &cacheStat );
+ stat( CONF_FILE.c_str(), &confStat );
+ if ( confStat.st_ctime > cacheStat.st_ctime ) {
+ cerr << "Error: "
+ << "Configuration changed after generating cache"
+ << endl;
+ cerr << "regenerate cache using 'prt-get cache'" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ if ( !m_parser->wasCalledAsPrtCached() ) {
+ cout << m_appName << ": using cache" << endl;
+ }
+
+ } else {
+ m_repo->initFromFS( m_config->rootList(), listDuplicate );
+ }
+ }
+}
+
+/*! print whether a package is installed or not */
+void PrtGet::isInstalled()
+{
+ assertMinArgCount(1);
+
+ const list<char*>& l = m_parser->otherArgs();
+ list<char*>::const_iterator it = l.begin();
+ for ( ; it != l.end(); ++it ) {
+ bool isAlias = false;
+ string aliasName;
+
+ if ( m_pkgDB->isInstalled( *it, true, &isAlias, &aliasName ) ) {
+ if (isAlias) {
+ cout << *it << " is provided by package "
+ << aliasName
+ << endl;
+ } else {
+ cout << "package " << *it << " is installed" << endl;
+ }
+ } else {
+ cout << "package " << *it << " is not installed" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ }
+ }
+}
+
+
+/*! list installed packages */
+void PrtGet::listInstalled()
+{
+ assertMaxArgCount(1);
+
+ string arg = "*";
+ if ( m_parser->otherArgs().size() == 1 ) {
+ arg = *(m_parser->otherArgs().begin());
+ }
+
+ map<string, string> l;
+ m_pkgDB->getMatchingPackages( arg, l, m_useRegex );
+ map<string, string>::iterator it = l.begin();
+
+ if ( l.empty() && m_parser->otherArgs().size() > 0 ) {
+ cerr << m_appName << ": No matching packages found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ if ( m_parser->verbose() > 1 ) {
+ // warning: will slow down the process...
+ initRepo();
+ }
+
+ for ( ; it != l.end(); ++it ) {
+ cout << it->first.c_str();
+ if ( m_parser->verbose() > 0 ) {
+ cout << " " << it->second.c_str();
+ }
+ if ( m_parser->verbose() > 1 ) {
+ const Package* p = m_repo->getPackage( it->first );
+ if ( p ) {
+ cout << " " << p->description();
+ }
+ }
+
+ cout << endl;
+ }
+}
+
+/*!
+ install package
+ \param update whether this is an update operation
+ \param group whether it's a group install (stop on error)
+
+*/
+void PrtGet::install( bool update, bool group, bool dependencies )
+{
+ assertMinArgCount(1);
+
+ // this can be done without initRepo()
+ const list<char*>& args = m_parser->otherArgs();
+ list<char*>::const_iterator it = args.begin();
+
+ if ( args.size() == 1 ) {
+ for ( ; it != args.end(); ++it ) {
+ string s = *it;
+ if ( !update && m_pkgDB->isInstalled( s ) ) {
+ cout << "package " << s << " is installed" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ } else if ( update && !m_pkgDB->isInstalled( s ) ) {
+ // can't upgrade
+ cout << "package " << s << " is not installed" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+ }
+ }
+
+ initRepo();
+
+ if (dependencies) {
+ // calc dependencies
+ InstallTransaction depTransaction( m_parser->otherArgs(),
+ m_repo, m_pkgDB, m_config );
+ InstallTransaction::InstallResult result =
+ depTransaction.calcDependencies();
+
+ // TODO: code duplication with printDepends!
+ if ( result == InstallTransaction::CYCLIC_DEPEND ) {
+ cerr << "prt-get: cyclic dependencies found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ } else if ( result == InstallTransaction::PACKAGE_NOT_FOUND ) {
+ warnPackageNotFound(depTransaction);
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+ const list<string>& depRef = depTransaction.dependencies();
+ list<string>::const_iterator it = depRef.begin();
+
+ list<string> deps;
+ for (; it != depRef.end(); ++it) {
+ if (!m_pkgDB->isInstalled(*it)) {
+ deps.push_back(*it);
+ }
+ }
+
+ InstallTransaction transaction( deps, m_repo, m_pkgDB, m_config );
+ executeTransaction( transaction, update, group );
+ } else {
+ InstallTransaction transaction( m_parser->otherArgs(),
+ m_repo, m_pkgDB, m_config );
+ executeTransaction( transaction, update, group );
+ }
+}
+
+void PrtGet::executeTransaction( InstallTransaction& transaction,
+ bool update, bool group )
+{
+ m_currentTransaction = &transaction;
+
+ string command[] = { "install", "installed" };
+ if ( update ) {
+ command[0] = "update";
+ command[1] = "updated";
+ }
+
+ if ( m_parser->isTest() ) {
+ cout << "*** " << m_appName << ": test mode" << endl;
+ }
+
+ InstallTransaction::InstallResult result =
+ transaction.install( m_parser, update, group );
+ bool failed = false;
+ // TODO: use switch
+ if ( result == InstallTransaction::PACKAGE_NOT_FOUND ) {
+ cout << m_appName << ": package(s) not found" << endl;
+ } else if ( result == InstallTransaction::PKGMK_EXEC_ERROR ) {
+ cout << m_appName << " couldn't excecute pkgmk "
+ << "(or alternative command). "
+ << "Make sure it's installed properly" << endl;
+ } else if ( result == InstallTransaction::PKGMK_FAILURE ) {
+ cout << m_appName << ": error while " << command[0] << endl;
+ } else if ( result == InstallTransaction::NO_PACKAGE_GIVEN ) {
+ cout << m_appName << ": no package specified for "
+ << command[0] << endl;
+ } else if ( result == InstallTransaction::PKGADD_EXEC_ERROR ) {
+ cout << m_appName << " couldn't excecute pkgadd. "
+ << "Make sure it's installed properly" << endl;
+ } else if ( result == InstallTransaction::PKGDEST_ERROR ) {
+ cout << m_appName << ": error changing to directory PKGDEST " << endl;
+ failed = true;
+ } else if ( result == InstallTransaction::PKGADD_FAILURE ) {
+ cout << m_appName << ": error while pkgadding " << endl;
+ } else if ( result == InstallTransaction::LOG_DIR_FAILURE ) {
+ cout << m_appName << ": can't create log file directory " << endl;
+ } else if ( result == InstallTransaction::LOG_FILE_FAILURE ) {
+ cout << m_appName << ": can't create log file" << endl;
+ failed = true;
+ } else if ( result == InstallTransaction::NO_LOG_FILE ) {
+ cout << m_appName << ": no log file specified, but logging enabled"
+ << endl;
+ failed = true;
+ } else if ( result == InstallTransaction::CANT_LOCK_LOG_FILE ) {
+ cout << m_appName << ": can't create lock file for the log file. "
+ << "\nMaybe there's another instance of prt-get using the same "
+ << "file."
+ << "\nIf this is a stale not, please remove "
+ // TODO: file name of lock file
+ << endl;
+ failed = true;
+ } else if ( result != InstallTransaction::SUCCESS ) {
+ cout << m_appName << ": Unknown error " << result << endl;
+ failed = true;
+ }
+
+ if ( !failed ) {
+ evaluateResult( transaction, update );
+ if ( m_parser->isTest() ) {
+ cout << "\n*** " << m_appName << ": test mode end" << endl;
+ }
+ } else {
+ m_returnValue = PG_INSTALL_ERROR;
+ }
+
+ m_currentTransaction = 0;
+}
+
+/*!
+ print dependency listing
+ \param simpleListing Whether it should be in a simple format
+*/
+void PrtGet::printDepends( bool simpleListing )
+{
+ assertMinArgCount(1);
+
+ initRepo();
+
+ InstallTransaction transaction( m_parser->otherArgs(),
+ m_repo, m_pkgDB, m_config );
+ InstallTransaction::InstallResult result = transaction.calcDependencies();
+ if ( result == InstallTransaction::CYCLIC_DEPEND ) {
+ cerr << "prt-get: cyclic dependencies found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ } else if ( result == InstallTransaction::PACKAGE_NOT_FOUND ) {
+ warnPackageNotFound(transaction);
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ const list<string>& deps = transaction.dependencies();
+ if ( simpleListing ) {
+ if ( deps.size() > 0 ) {
+ list<string>::const_iterator it = deps.begin();
+ for ( ; it != deps.end(); ++it ) {
+ cout << *it << " ";
+ }
+ cout << endl;
+ }
+ } else {
+ if ( deps.size() > 0 ) {
+ cout << "-- dependencies ([i] = installed)" << endl;
+ list<string>::const_iterator it = deps.begin();
+
+ bool isAlias;
+ string provider;
+ for ( ; it != deps.end(); ++it ) {
+ isAlias = false;
+ if ( m_pkgDB->isInstalled( *it, true, &isAlias, &provider ) ) {
+ cout << "[i] ";
+ } else {
+ cout << "[ ] ";
+ }
+ if (m_parser->printPath() > 0) {
+ cout << m_repo->getPackage(*it)->path() << "/";
+ }
+ cout << *it;
+
+ if (isAlias) {
+ cout << " (provided by " << provider << ")";
+ }
+ cout << endl;
+ }
+ } else {
+ cout << "No dependencies found" << endl;
+ }
+
+ const list< pair<string, string> >& missing = transaction.missing();
+ if ( missing.size() ) {
+ list< pair<string, string> >::const_iterator mit = missing.begin();
+ cout << endl << "-- missing packages" << endl;
+ for ( ; mit != missing.end(); ++mit ) {
+ cout << mit->first;
+ if ( !mit->second.empty() ) {
+ cout << " from " << mit->second;
+ }
+ cout << endl;
+ }
+ }
+ }
+}
+
+/*! read the config file */
+void PrtGet::readConfig()
+{
+ string fName = CONF_FILE;
+ if ( m_parser->isAlternateConfigGiven() ) {
+ fName = m_parser->alternateConfigFile();
+ }
+
+ if ( m_config ) {
+ return; // don't initialize twice
+ }
+ m_config = new Configuration( fName, m_parser );
+
+ if (!m_parser->noStdConfig()) {
+ if ( !m_config->parse() ) {
+ cerr << "Can't read config file " << fName
+ << ". Exiting" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+ }
+
+ const list< pair<char*, ArgParser::ConfigArgType> >& configData =
+ m_parser->configData();
+ list< pair<char*, ArgParser::ConfigArgType> >::const_iterator it =
+ configData.begin();
+ for (; it != configData.end(); ++it) {
+ m_config->addConfig(it->first,
+ it->second == ArgParser::CONFIG_SET,
+ it->second == ArgParser::CONFIG_PREPEND);
+ }
+}
+
+/*!
+ print a simple list of port which are installed in a different version
+ than they are in the repository
+*/
+void PrtGet::printQuickDiff()
+{
+ initRepo();
+
+ const map<string, string>& installed = m_pkgDB->installedPackages();
+ map<string, string>::const_iterator it = installed.begin();
+ const Package* p = 0;
+ for ( ; it != installed.end(); ++it ) {
+ if ( !m_locker.isLocked( it->first ) ) {
+ p = m_repo->getPackage( it->first );
+ if ( p ) {
+ if (greaterThan(p->version() + "-" + p->release(),
+ it->second)) {
+ cout << it->first.c_str() << " ";
+ }
+ }
+ }
+ }
+ cout << endl;
+}
+
+
+/*!
+ print an overview of port which are installed in a different version
+ than they are in the repository
+*/
+void PrtGet::printDiff()
+{
+ initRepo();
+ map< string, string > l;
+ if ( m_parser->otherArgs().size() > 0 ) {
+ expandWildcardsPkgDB( m_parser->otherArgs(), l );
+ }
+ if ( l.size() < m_parser->otherArgs().size() ) {
+ cerr << "prt-get: no matching installed packages found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+#if 0
+ // const list<char*>& l = m_parser->otherArgs();
+ // list<char*>::const_iterator checkIt = l.begin();
+
+ // check whether ports to be checked are installed
+ list< string >::iterator checkIt = l.begin();
+ for ( ; checkIt != l.end(); ++checkIt ) {
+ if ( ! m_pkgDB->isInstalled( *checkIt ) ) {
+ cerr << "Port not installed: " << *checkIt << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+ }
+#endif
+
+ const map<string, string>& installed = m_pkgDB->installedPackages();
+ map<string, string>::const_iterator it = installed.begin();
+ const Package* p = 0;
+ int count = 0;
+ for ( ; it != installed.end(); ++it ) {
+
+ p = m_repo->getPackage( it->first );
+ if ( p ) {
+ if ( l.size() && l.find( it->first ) == l.end() ) {
+ continue;
+ }
+
+ if ( greaterThan( p->version() + "-" + p->release(),
+ it->second ) ) {
+ if ( !m_locker.isLocked( it->first ) ||
+ m_parser->otherArgs().size() > 0 ||
+ m_parser->all() ) {
+
+
+ ++count;
+ if ( count == 1 ) {
+ cout << "Differences between installed packages "
+ << "and ports tree:\n" << endl;
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Ports";
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Installed";
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Available in the ports tree" << endl << endl;
+ }
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << it->first.c_str();
+
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << it->second.c_str();
+
+ string locked = "";
+ if ( m_locker.isLocked( it->first ) ) {
+ locked = "locked";
+ }
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << (p->version()+"-"+p->release()).c_str()
+ << locked << endl;
+ }
+ }
+ }
+ }
+
+ if ( count == 0 ) {
+ cout << "No differences found" << endl;
+ }
+}
+
+/*! print path to a port */
+void PrtGet::printPath()
+{
+ assertExactArgCount(1);
+
+ initRepo();
+ string arg = *(m_parser->otherArgs().begin());
+ const Package* p = m_repo->getPackage( arg );
+ if ( p ) {
+ cout << p->path() << "/" << p->name() << endl;
+ } else {
+ cerr << "Package '" << arg << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+}
+
+
+/*! helper method to print the result of an InstallTransaction */
+void PrtGet::evaluateResult( InstallTransaction& transaction,
+ bool update,
+ bool interrupted )
+{
+ int errors = 0;
+
+ // TODO: this is a duplicate, it's in install() as well
+ string command[] = { "install", "installed" };
+ if ( update ) {
+ command[0] = "update";
+ command[1] = "updated";
+ }
+
+ const list<string>& ignored = transaction.ignoredPackages();
+ if ( ignored.size() ) {
+ cout << endl << "-- Packages ignored" << endl;
+ list<string>::const_iterator iit = ignored.begin();
+
+ for ( ; iit != ignored.end(); ++iit ) {
+ cout << *iit << endl;
+ }
+ }
+
+
+ const list< pair<string, string> >& missing = transaction.missing();
+ if ( missing.size() ) {
+ ++errors;
+ cout << endl << "-- Packages not found" << endl;
+ list< pair<string, string> >::const_iterator mit = missing.begin();
+
+ for ( ; mit != missing.end(); ++mit ) {
+ cout << mit->first;
+ if ( mit->second != "" ) {
+ cout << " from " << mit->second;
+ }
+ cout << endl;
+ }
+ }
+
+ const list< pair<string, InstallTransaction::InstallInfo> >& error =
+ transaction.installError();
+ if ( error.size() ) {
+ ++errors;
+ cout << endl << "-- Packages where "
+ << command[0] << " failed" << endl;
+ list< pair<string, InstallTransaction::InstallInfo> >::const_iterator
+ eit = error.begin();
+
+ for ( ; eit != error.end(); ++eit ) {
+ cout << eit->first;
+ reportPrePost(eit->second);
+ cout << endl;
+ }
+ }
+
+ const list<string>& already = transaction.alreadyInstalledPackages();
+ if ( already.size() ) {
+ cout << endl << "-- Packages installed before this run (ignored)"
+ << endl;
+ list<string>::const_iterator ait = already.begin();
+
+ bool isAlias;
+ string provider;
+ for ( ; ait != already.end(); ++ait ) {
+ isAlias = false;
+ cout << *ait;
+ m_pkgDB->isInstalled(*ait, true, &isAlias, &provider);
+
+ if (isAlias) {
+ cout << " (provided by " << provider << ")";
+ }
+ cout << endl;
+ }
+ }
+
+
+ const list< pair<string, InstallTransaction::InstallInfo> >& inst =
+ transaction.installedPackages();
+ if ( inst.size() ) {
+ cout << endl << "-- Packages " << command[1] << endl;
+ list< pair<string, InstallTransaction::InstallInfo> >::const_iterator
+ iit = inst.begin();
+
+ bool atLeastOnePackageHasReadme = false;
+
+ for ( ; iit != inst.end(); ++iit ) {
+ cout << iit->first;
+ if ( iit->second.hasReadme ) {
+ if ( m_config->readmeMode() ==
+ Configuration::COMPACT_README ) {
+ cout << " (README)";
+ }
+ atLeastOnePackageHasReadme = true;
+ }
+ reportPrePost(iit->second);
+ cout << endl;
+ }
+
+ // readme's
+ if ( atLeastOnePackageHasReadme ) {
+ if ( m_config->readmeMode() == Configuration::VERBOSE_README ) {
+ cout << endl << "-- " << command[1]
+ << " packages with README files:" << endl;
+ iit = inst.begin();
+ for ( ; iit != inst.end(); ++iit ) {
+ if ( iit->second.hasReadme ) {
+ cout << iit->first;
+ cout << endl;
+ }
+ }
+ }
+ }
+
+ cout << endl;
+ }
+
+ if ( errors == 0 && !interrupted ) {
+ cout << "prt-get: " << command[1] << " successfully" << endl;
+ } else {
+ m_returnValue = PG_PARTIAL_INSTALL_ERROR;
+ }
+}
+
+void PrtGet::reportPrePost(const InstallTransaction::InstallInfo& info) {
+ if (info.preState != InstallTransaction::NONEXISTENT) {
+ string preString = "failed";
+ if (info.preState == InstallTransaction::EXEC_SUCCESS) {
+ preString = "ok";
+ }
+ cout << " [pre: " << preString << "]";
+ }
+ if ( info.postState != InstallTransaction::NONEXISTENT) {
+ string postString = "failed";
+ if (info.postState == InstallTransaction::EXEC_SUCCESS){
+ postString = "ok";
+ }
+ cout << " [post: " << postString << "]";
+ }
+
+}
+
+/*! create a cache */
+void PrtGet::createCache()
+{
+ if ( m_parser->wasCalledAsPrtCached() ) {
+ cerr << m_appName << ": Can't create cache from cache. "
+ << "Use prt-get instead" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ initRepo();
+ if (m_config->cacheFile() != "") {
+ m_cacheFile = m_config->cacheFile();
+ }
+
+ Repository::WriteResult result = m_repo->writeCache( m_cacheFile );
+ if ( result == Repository::DIR_ERR ) {
+ cerr << "Can't create cache directory " << m_cacheFile << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+ if ( result == Repository::FILE_ERR ) {
+ cerr << "Can't open cache file " << m_cacheFile << " for writing"
+ << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+}
+
+/*!
+ \return true if v1 is greater than v2
+ */
+bool PrtGet::greaterThan( const string& v1, const string& v2 )
+{
+ using namespace VersionComparator;
+
+ if (v1 == v2) {
+ return false;
+ }
+
+
+ if (m_parser->preferHigher() ||
+ (m_config->preferHigher() && !m_parser->strictDiff())) {
+
+ COMP_RESULT result = compareVersions(v1, v2);
+ return (result == GREATER);
+ }
+
+ return v1 != v2;
+}
+
+int PrtGet::returnValue() const
+{
+ return m_returnValue;
+}
+
+
+/*! print a list of packages available in the repository */
+void PrtGet::printf()
+{
+ map<string, string> sortedOutput;
+
+ assertExactArgCount(1);
+
+ initRepo();
+ string filter = "*";
+ if ( m_parser->hasFilter() ) {
+ filter = m_parser->filter();
+ }
+ list<Package*> packages;
+ m_repo->getMatchingPackages( filter, packages );
+ list<Package*>::const_iterator it = packages.begin();
+
+ const string formatString = *(m_parser->otherArgs().begin());
+ string sortString =
+ StringHelper::stripWhiteSpace( m_parser->sortArgs() );
+ sortString += "%n"; // make it unique
+
+ for ( ; it != packages.end(); ++it ) {
+ string output = formatString;
+ string sortkey = sortString;
+
+ const Package* p = *it;
+
+ StringHelper::replaceAll( output, "%n", p->name() );
+ StringHelper::replaceAll( output, "%u", p->url() );
+ StringHelper::replaceAll( output, "%p", p->path() );
+ StringHelper::replaceAll( output, "%v", p->version() );
+ StringHelper::replaceAll( output, "%r", p->release() );
+ StringHelper::replaceAll( output, "%d", p->description() );
+ StringHelper::replaceAll( output, "%e", p->dependencies() );
+ StringHelper::replaceAll( output, "%P", p->packager() );
+ StringHelper::replaceAll( output, "%M", p->maintainer() );
+
+ StringHelper::replaceAll( output, "\\t", "\t" );
+ StringHelper::replaceAll( output, "\\n", "\n" );
+
+ StringHelper::replaceAll( sortkey, "%n", p->name() );
+ StringHelper::replaceAll( sortkey, "%u", p->url() );
+ StringHelper::replaceAll( sortkey, "%p", p->path() );
+ StringHelper::replaceAll( sortkey, "%v", p->version() );
+ StringHelper::replaceAll( sortkey, "%r", p->release() );
+ StringHelper::replaceAll( sortkey, "%d", p->description() );
+ StringHelper::replaceAll( sortkey, "%e", p->dependencies() );
+ StringHelper::replaceAll( sortkey, "%P", p->packager() );
+ StringHelper::replaceAll( sortkey, "%M", p->maintainer() );
+
+ string isInst = "no";
+ if ( m_pkgDB->isInstalled( p->name() ) ) {
+ string ip = p->name() + "-" +
+ m_pkgDB->getPackageVersion( p->name() );
+ if ( ip == p->name() + "-" + p->version() + "-" + p->release() ) {
+ isInst = "yes";
+ } else {
+ isInst = "diff";
+ }
+ }
+ StringHelper::replaceAll( output, "%i", isInst );
+ StringHelper::replaceAll( sortkey, "%i", isInst );
+
+ string isLocked = m_locker.isLocked( p->name() ) ? "yes" : "no";
+ StringHelper::replaceAll( output, "%l", isLocked );
+ StringHelper::replaceAll( sortkey, "%l", isLocked );
+
+ string hasReadme = p->hasReadme() ? "yes" : "no";
+ StringHelper::replaceAll( output, "%R", hasReadme );
+ StringHelper::replaceAll( sortkey, "%R", hasReadme );
+
+ string hasPreInstall = p->hasPreInstall() ? "yes" : "no";
+ StringHelper::replaceAll( output, "%E", hasPreInstall );
+ StringHelper::replaceAll( sortkey, "%E", hasPreInstall );
+
+ string hasPostInstall = p->hasPostInstall() ? "yes" : "no";
+ StringHelper::replaceAll( output, "%O", hasPostInstall );
+ StringHelper::replaceAll( sortkey, "%O", hasPostInstall );
+
+ sortedOutput[sortkey] = output;
+ }
+
+ map<string, string>::iterator sortIt = sortedOutput.begin();
+ for ( ; sortIt != sortedOutput.end(); ++sortIt ) {
+ if ( StringHelper::stripWhiteSpace(sortIt->second).length() > 0) {
+ cout << sortIt->second;
+ }
+ }
+}
+
+void PrtGet::readme()
+{
+ assertExactArgCount(1);
+
+ initRepo();
+ string arg = *(m_parser->otherArgs().begin());
+ const Package* p = m_repo->getPackage( arg );
+ if ( p ) {
+ string file = p->path() + "/" + p->name() + "/README";
+ FILE* fp = fopen( file.c_str(), "r" );
+ char buf[255];
+ if ( fp ) {
+ while ( fgets( buf, 255, fp ) ) {
+ cout << buf;
+ }
+ fclose( fp );
+ }
+
+ } else {
+ cerr << "Package '" << arg << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+}
+
+
+void PrtGet::printDependendent()
+{
+ assertExactArgCount(1);
+
+ initRepo();
+ string arg = *(m_parser->otherArgs().begin());
+ map<string, Package*>::const_iterator it = m_repo->packages().begin();
+
+ set<const Package*> dependent;
+ for ( ; it != m_repo->packages().end(); ++it ) {
+
+ // TODO: is the following line needed?
+ const Package* p = it->second;
+ if ( p && p->dependencies().find( arg ) != string::npos ) {
+ list<string> tokens;
+ StringHelper::split( p->dependencies(), ',', tokens );
+ list<string>::iterator it = find( tokens.begin(),
+ tokens.end(),
+ arg );
+ if ( it != tokens.end() ) {
+ dependent.insert( p );
+ }
+ }
+ }
+
+ // prepared for recursive search
+ set<const Package*>::iterator it2 = dependent.begin();
+ for ( ; it2 != dependent.end(); ++it2 ) {
+ const Package* p = *it2;
+ if ( m_parser->all() || m_pkgDB->isInstalled( p->name() ) ) {
+ cout << p->name();
+ if ( m_parser->verbose() > 0 ) {
+ cout << " " << p->version() << "-" << p->release();
+ }
+ if ( m_parser->verbose() > 1 ) {
+ cout << ": " << p->description();
+ }
+
+ cout << endl;
+ }
+ }
+}
+
+void PrtGet::warnPackageNotFound(InstallTransaction& transaction)
+{
+ cerr << "The package '";
+ cerr << transaction.missing().begin()->first;
+ cerr << "' could not be found: " << endl;
+}
+
+void PrtGet::sysup()
+{
+ // TODO: refactor getDifferentPackages from diff/quickdiff
+ initRepo();
+
+ list<string>* target;
+ list<string> packagesToUpdate;
+ list<string> sortedList;
+
+ const map<string, string>& installed = m_pkgDB->installedPackages();
+ map<string, string>::const_iterator it = installed.begin();
+ const Package* p = 0;
+ for ( ; it != installed.end(); ++it ) {
+ if ( !m_locker.isLocked( it->first ) ) {
+ p = m_repo->getPackage( it->first );
+ if ( p ) {
+ if ( greaterThan( p->version() + "-" + p->release(),
+ it->second ) ) {
+ packagesToUpdate.push_back( it->first );
+ }
+ }
+ }
+ }
+
+ if ( packagesToUpdate.empty() ) {
+ cout << "System is up to date" << endl;
+ return;
+ }
+
+ if ( m_parser->nodeps() ) {
+ target = &packagesToUpdate;
+ } else {
+ // sort by dependency
+
+ // TODO: refactor code from printDepends
+ InstallTransaction depTrans( packagesToUpdate,
+ m_repo, m_pkgDB, m_config );
+ InstallTransaction::InstallResult result = depTrans.calcDependencies();
+ if ( result == InstallTransaction::CYCLIC_DEPEND ) {
+ cerr << "cyclic dependencies" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ } else if ( result == InstallTransaction::PACKAGE_NOT_FOUND ) {
+ warnPackageNotFound(depTrans);
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ const list<string>& deps = depTrans.dependencies();
+ if ( deps.size() > 0 ) {
+ list<string>::const_iterator it = deps.begin();
+ for ( ; it != deps.end(); ++it ) {
+ if ( find( packagesToUpdate.begin(),
+ packagesToUpdate.end(), *it ) !=
+ packagesToUpdate.end() ) {;
+ sortedList.push_back( *it );
+ }
+ }
+ }
+
+ target = &sortedList;
+ }
+
+ InstallTransaction transaction( *target,
+ m_repo, m_pkgDB, m_config );
+ executeTransaction( transaction, true, false );
+}
+
+
+void PrtGet::expandWildcardsPkgDB( const list<char*>& in,
+ map<string, string>& target )
+{
+ list<char*>::const_iterator it = in.begin();
+ for ( ; it != in.end(); ++it ) {
+ map<string, string> l;
+ m_pkgDB->getMatchingPackages( *it, l, m_useRegex );
+ map<string, string>::iterator iit = l.begin();
+ for ( ; iit != l.end(); ++iit ) {
+ target[iit->first] = iit->second;
+ }
+ }
+}
+
+void PrtGet::expandWildcardsRepo( const list<char*>& in, list<string>& target )
+{
+ list<char*>::const_iterator it = in.begin();
+
+ for ( ; it != in.end(); ++it ) {
+ list<Package*> l;
+ m_repo->getMatchingPackages( *it, l );
+ list<Package*>::iterator iit = l.begin();
+ for ( ; iit != l.end(); ++iit ) {
+ target.push_back( (*iit)->name() );
+ }
+ }
+}
+
+
+void PrtGet::current()
+{
+ assertExactArgCount(1);
+
+ const map<string, string>& installed = m_pkgDB->installedPackages();
+ map<string, string>::const_iterator it = installed.begin();
+ string search = *(m_parser->otherArgs().begin());
+
+ for ( ; it != installed.end(); ++it ) {
+ if ( it->first == search ) {
+ cout << it->second.c_str() << endl;
+ return;
+ }
+ }
+
+ cout << "Package " << search << " not installed" << endl;
+ m_returnValue = 1;
+}
+
+SignalHandler::HandlerResult PrtGet::handleSignal( int signal )
+{
+ // TODO: second argument could also be true:
+ // TODO: kill installtransaction
+
+ cout << "prt-get: interrupted" << endl;
+ if ( m_currentTransaction ) {
+ evaluateResult( *m_currentTransaction, false, true );
+ }
+}
+
+/*!
+ find files matching a pattern in repository
+
+ \sa Repository::getMatchingPackages()
+*/
+void PrtGet::fsearch()
+{
+ assertMinArgCount(1);
+
+ string arg = "*";
+ if ( m_parser->otherArgs().size() == 1 ) {
+ arg = *(m_parser->otherArgs().begin());
+ }
+
+ initRepo();
+ const map<string, Package*>& packages = m_repo->packages();
+ map<string, Package*>::const_iterator it = packages.begin();
+ bool first = true;
+ for ( ; it != packages.end(); ++it ) {
+ list<string> matches;
+ string fp =
+ it->second->path() + "/" +
+ it->second->name() + "/" + ".footprint";
+ if ( File::grep( fp, arg, matches,
+ m_parser->fullPath(),
+ m_useRegex)) {
+ if ( matches.size() > 0 ) {
+ if ( first ) {
+ first = false;
+ } else {
+ cout << endl;
+ }
+ cout << "Found in "
+ << it->second->path() << "/"
+ << it->first << ":" << endl;
+ list<string>::iterator it = matches.begin();
+ for ( ; it != matches.end(); ++it ) {
+ cout << " " << *it << endl;
+ }
+ }
+ }
+ }
+
+ if ( first ) {
+ m_returnValue = PG_GENERAL_ERROR;
+ }
+}
+
+void PrtGet::setLock( bool lock )
+{
+ assertMinArgCount(1);
+
+ if ( lock ) {
+ initRepo();
+ }
+
+ const list<char*>& args = m_parser->otherArgs();
+ list<char*>::const_iterator it = args.begin();
+ for ( ; it != args.end(); ++it ) {
+ if ( lock ) {
+ const Package* p = m_repo->getPackage( *it );
+ if ( p ) {
+ if (!m_locker.lock( *it )) {
+ cerr << "Already locked: " << *it << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ }
+ } else {
+ cerr << "Package '" << *it << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ }
+
+ } else {
+ if ( !m_locker.unlock( *it ) ) {
+ cerr << "Not locked previously: " << *it << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ }
+ }
+ }
+ if (!m_locker.store()) {
+ cerr << "Failed to write lock data" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ }
+}
+
+void PrtGet::listLocked()
+{
+ // shares some code with listInstalled
+ if ( m_locker.openFailed() ) {
+ cerr << "Failed to open lock data file" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ }
+
+ const map<string, string>& l = m_pkgDB->installedPackages();
+
+ if ( l.empty() ) {
+ return;
+ }
+
+ if ( m_parser->verbose() > 1 ) {
+ // warning: will slow down the process...
+ initRepo();
+ }
+
+
+ const vector<string>& lockedPackages = m_locker.lockedPackages();
+ vector<string>::const_iterator it = lockedPackages.begin();
+ for ( ; it != lockedPackages.end(); ++it ) {
+ cout << *it;
+ if ( m_parser->verbose() > 0 ) {
+ cout << " " << m_pkgDB->getPackageVersion(*it);
+ }
+ if ( m_parser->verbose() > 1 ) {
+ const Package* p = m_repo->getPackage( *it );
+ if ( p ) {
+ cout << ": " << p->description();
+ }
+ }
+
+ cout << endl;
+
+ }
+}
+
+
+void PrtGet::edit()
+{
+ assertMinArgCount(1);
+ assertMaxArgCount(2);
+
+ char* editor = getenv("EDITOR");
+ if (editor) {
+ initRepo();
+
+ list<char*>::const_iterator it = m_parser->otherArgs().begin();
+ string arg = *it;
+ const Package* p = m_repo->getPackage( arg );
+ if ( p ) {
+ string fileName = "Pkgfile";
+ if (++it != m_parser->otherArgs().end()) {
+ fileName = *it;
+ }
+ string file = p->path() + "/" + p->name() + "/" + fileName;
+ Process proc(editor, file);
+ m_returnValue = proc.executeShell();
+ if (m_returnValue) {
+ cerr << "error while execution the editor" << endl;
+ }
+ } else {
+ cerr << "Package '" << arg << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ } else {
+ cerr << "Environment variable EDITOR not set" << endl;;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+}
+
+void PrtGet::ls()
+{
+ assertExactArgCount(1);
+
+ initRepo();
+
+ list<char*>::const_iterator it = m_parser->otherArgs().begin();
+ string arg = *it;
+ const Package* p = m_repo->getPackage( arg );
+ if ( p ) {
+ string dirname = p->path() + "/" + p->name();
+ DIR* dir = opendir(dirname.c_str());
+ struct dirent* entry;
+ vector<string> files;
+ while (entry = readdir(dir)) {
+ string dName = entry->d_name;
+ if (dName != "." && dName != "..") {
+ files.push_back(dName);
+ }
+ }
+ closedir(dir);
+
+ sort(files.begin(), files.end());
+ vector<string>::iterator fit = files.begin();
+ for (; fit != files.end(); ++fit) {
+ if (m_parser->printPath()) {
+ cout << p->path() + "/" +p->name() + "/";
+ }
+ cout << *fit << endl;
+ }
+ } else {
+ cerr << "Package '" << arg << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+}
+
+void PrtGet::cat()
+{
+ assertMinArgCount(1);
+ assertMaxArgCount(2);
+
+ initRepo();
+
+ list<char*>::const_iterator it = m_parser->otherArgs().begin();
+ string arg = *it;
+ const Package* p = m_repo->getPackage( arg );
+ if ( p ) {
+ string fileName = "Pkgfile";
+ if (++it != m_parser->otherArgs().end()) {
+ fileName = *it;
+ }
+ string file = p->path() + "/" + p->name() + "/" + fileName;
+ FILE* fp = fopen( file.c_str(), "r" );
+ char buf[255];
+ if ( fp ) {
+ while ( fgets( buf, 255, fp ) ) {
+ cout << buf;
+ }
+ fclose( fp );
+ } else {
+ cerr << "File '" << *it << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ } else {
+ cerr << "Package '" << arg << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+}
+
+void PrtGet::remove()
+{
+ assertMinArgCount(1);
+
+ list<string> removed;
+ list<string> failed;
+ list<string> notInstalled;
+
+ if ( m_parser->isTest() ) {
+ cout << "*** " << m_appName << ": test mode" << endl;
+ }
+
+ string command = InstallTransaction::PKGRM_DEFAULT_COMMAND;
+ if (m_config->removeCommand() != "") {
+ command = m_config->removeCommand();
+ }
+
+ const list<char*>& args = m_parser->otherArgs();
+ list<char*>::const_iterator it = args.begin();
+ for ( ; it != args.end(); ++it ) {
+ if (m_pkgDB->isInstalled(*it)) {
+ // TODO: prettify
+ string args = "";
+ if (m_parser->installRoot() != "") {
+ args = "-r " + m_parser->installRoot() + " ";
+ }
+ args += (m_parser->pkgrmArgs() + " " + *it);
+
+ Process proc(command, args);
+ if (m_parser->isTest() || proc.executeShell() == 0) {
+ removed.push_back(*it);
+ } else {
+ failed.push_back(*it);
+ }
+ } else {
+ notInstalled.push_back(*it);
+ }
+ }
+
+ if ( removed.size() ) {
+ cout << endl << "-- Packages removed"
+ << endl;
+ list<string>::const_iterator it = removed.begin();
+
+ for ( ; it != removed.end(); ++it ) {
+ cout << *it << endl;
+ }
+ }
+
+ if ( failed.size() ) {
+ cout << endl << "-- Packages where removal failed"
+ << endl;
+ list<string>::const_iterator it = failed.begin();
+
+ for ( ; it != failed.end(); ++it ) {
+ cout << *it << endl;
+ }
+ }
+
+ if ( notInstalled.size() ) {
+ cout << endl << "-- Packages which were not installed"
+ << endl;
+ list<string>::const_iterator it = notInstalled.begin();
+
+ for ( ; it != notInstalled.end(); ++it ) {
+ cout << *it << endl;
+ }
+ }
+
+ if ( m_parser->isTest() ) {
+ cout << "*** " << m_appName << ": test mode end" << endl;
+ }
+
+
+
+}
+
+void PrtGet::assertMaxArgCount(int count)
+{
+ if ( m_parser->otherArgs().size() > count ) {
+ argCountFailure(count, "at most");
+ }
+}
+
+void PrtGet::assertExactArgCount(int count)
+{
+ if ( m_parser->otherArgs().size() != count ) {
+ argCountFailure(count, "exactly");
+ }
+}
+
+void PrtGet::assertMinArgCount(int count)
+{
+ if ( m_parser->otherArgs().size() < count ) {
+ argCountFailure(count, "at least");
+ }
+}
+
+void PrtGet::argCountFailure(int count, const string& specifier)
+{
+ cerr << m_appName << " "
+ << m_parser->commandName() << " takes " << specifier << " "
+ << count << (count > 1 ? " arguments" : " argument") << endl;
+ exit(PG_ARG_ERROR);
+}
+
+
+void PrtGet::printDependTree()
+{
+ assertExactArgCount(1);
+
+ initRepo();
+
+ list<char*>::const_iterator it = m_parser->otherArgs().begin();
+ string arg = *it;
+ const Package* p = m_repo->getPackage( arg );
+ if (!p) {
+ cerr << "Package '" << arg << "' not found" << endl;
+ m_returnValue = PG_GENERAL_ERROR;
+ return;
+ }
+
+ if (p->dependencies().length() > 0) {
+
+ cout << "-- dependencies ([i] = installed";
+ if (!m_parser->all()) {
+ cout << ", '-->' = seen before";
+ }
+ cout << ")" << endl;
+ if ( m_pkgDB->isInstalled( *it ) ) {
+ cout << "[i] ";
+ } else {
+ cout << "[ ] ";
+ }
+ cout << p->name() << endl;
+ printDepsLevel(2, p);
+ }
+
+}
+
+void PrtGet::printDepsLevel(int indent, const Package* package)
+{
+ static map<string, bool> shownMap;
+
+ list<string> deps;
+ StringHelper::split(package->dependencies(), ',', deps);
+ list<string>::iterator it = deps.begin();
+ for (; it != deps.end(); ++it) {
+ if ( m_pkgDB->isInstalled( *it ) ) {
+ cout << "[i] ";
+ } else {
+ cout << "[ ] ";
+ }
+ for (int i = 0; i < indent; ++i) {
+ cout << " ";
+ }
+ cout << *it;
+ const Package* p = m_repo->getPackage( *it );
+ if (p) {
+ if (p->dependencies().length() > 0) {
+ map<string, bool>::iterator shownIt = shownMap.find(*it);
+ if (shownIt != shownMap.end()) {
+ cout << " -->" << endl;;
+ } else {
+ cout << endl;
+ printDepsLevel(indent+2, p);
+ if (!m_parser->all()) {
+ shownMap[*it] = true;
+ }
+ }
+ } else {
+ cout << endl;
+ }
+ } else {
+ cout << " (not found in ports tree)" << endl;
+ }
+ }
+}
+
+void PrtGet::dumpConfig()
+{
+
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Alias file: " << PkgDB::ALIAS_STORE << endl;
+
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Ext. dep. file: "
+ << Repository::EXTERNAL_DEPENDENCY_FILE << endl;
+
+
+ if (!m_parser->noStdConfig()) {
+ string fName = CONF_FILE;
+ if ( m_parser->isAlternateConfigGiven() ) {
+ fName = m_parser->alternateConfigFile();
+ }
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Configuration file: " << fName << endl;
+ }
+
+ if (m_config->cacheFile() != "") {
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Cache file: " << m_config->cacheFile() << endl;
+ }
+ if (m_config->makeCommand() != "") {
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Make command file: " << m_config->makeCommand() << endl;
+ }
+ if (m_config->addCommand() != "") {
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Add command: " << m_config->addCommand() << endl;
+ }
+ if (m_config->removeCommand() != "") {
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Remove command: " << m_config->removeCommand() << endl;
+ }
+ if (m_config->runscriptCommand() != "") {
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Runscript command: " << m_config->runscriptCommand() << endl;
+ }
+
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Run scripts: " <<(m_config->runScripts() ? "yes" : "no" )
+ << endl;
+
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Keep higher version:" <<(m_config->preferHigher() ? "yes" : "no" )
+ << endl;
+
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Readme mode: ";
+ switch (m_config->readmeMode()) {
+ case Configuration::VERBOSE_README:
+ cout << "verbose";
+ break;
+ case Configuration::COMPACT_README:
+ cout << "compact";
+ break;
+ case Configuration::NO_README:
+ cout << "off";
+ break;
+ }
+ cout << endl;
+
+ cout << endl;
+
+ if (m_config->logFilePattern() != "") {
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << "Log file: " << m_config->logFilePattern() << endl;
+ }
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << " Write log: " << (m_config->writeLog() ? "yes" : "no" ) << endl;
+ cout.setf( ios::left, ios::adjustfield );
+ cout.width( 20 );
+ cout.fill( ' ' );
+ cout << " Append log: " <<(m_config->appendLog() ? "yes" : "no" ) << endl;
+
+
+
+ cout << endl;
+ list< pair<string, string> >::const_iterator it =
+ m_config->rootList().begin();
+ cout << "Port "
+ << (m_config->rootList().size() == 1 ? "directory" : "directories")
+ << ": " << endl;
+ for (; it != m_config->rootList().end(); ++it) {
+ cout << " " << it->first;
+ if (it->second != "") {
+ cout << " (" << it->second << ")";
+ }
+ cout << endl;
+ }
+}
diff --git a/src/prtget.h b/src/prtget.h
new file mode 100644
index 0000000..1b93fbb
--- /dev/null
+++ b/src/prtget.h
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: prtget.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _PRTGET_H_
+#define _PRTGET_H_
+
+class Repository;
+class ArgParser;
+class Configuration;
+
+#include <list>
+#include <utility>
+#include <string>
+using namespace std;
+
+#include "pkgdb.h"
+#include "signaldispatcher.h"
+#include "locker.h"
+#include "installtransaction.h"
+
+/*!
+ \class PrtGet
+ \brief Main class
+
+ This is prt-get's main class, controlling all the commands
+*/
+class PrtGet
+ : public SignalHandler
+{
+public:
+
+ enum PGReturnStates {
+ PG_GENERAL_ERROR = -1,
+ PG_OK = 0,
+ PG_ARG_ERROR,
+ PG_INSTALL_ERROR,
+ PG_PARTIAL_INSTALL_ERROR
+ };
+
+ PrtGet( const ArgParser* parser );
+ ~PrtGet();
+
+ void printVersion();
+ void printUsage();
+
+ void listPackages();
+ void listShadowed();
+ void listInstalled();
+
+ void searchPackages( bool searchDesc=false );
+ void printInfo();
+ void isInstalled();
+ void readme();
+
+ void install( bool update=false,
+ bool group=false,
+ bool dependencies=false );
+ void sysup();
+ void current();
+ void printDepends( bool simpleListing=false );
+ void printDependTree();
+ void printDependendent();
+ void printDiff();
+ void printQuickDiff();
+
+ void createCache();
+
+ void printPath();
+ void printf();
+
+ void cat();
+ void ls();
+ void edit();
+
+ void remove();
+
+ void setLock( bool lock );
+ void listLocked();
+
+ void fsearch();
+
+ void dumpConfig();
+
+ bool greaterThan( const string& v1, const string& v2 );
+
+ int returnValue() const;
+
+ SignalHandler::HandlerResult handleSignal( int signal );
+
+protected:
+
+ void printDepsLevel(int indent, const Package* package);
+
+ void executeTransaction( InstallTransaction& transaction,
+ bool update, bool group );
+ void evaluateResult( InstallTransaction& transaction,
+ bool update,
+ bool interrupted=false );
+ void reportPrePost(const InstallTransaction::InstallInfo& info);
+
+ void readConfig();
+ void initRepo( bool listDuplicate=false );
+
+ void expandWildcardsPkgDB( const list<char*>& in,
+ map<string, string>& target );
+ void expandWildcardsRepo( const list<char*>& in,
+ list<string>& target );
+
+ void warnPackageNotFound(InstallTransaction& transaction);
+
+ Repository* m_repo;
+ PkgDB* m_pkgDB;
+ Configuration* m_config;
+ InstallTransaction* m_currentTransaction;
+
+ Locker m_locker;
+
+ const ArgParser* m_parser;
+ string m_appName;
+ string m_cacheFile;
+
+ int m_returnValue;
+
+ bool m_useRegex;
+
+ /*! Name of default configuration file */
+ static const string CONF_FILE;
+
+ /*! Name of default cache file */
+ static const string DEFAULT_CACHE_FILE;
+
+
+ void assertMinArgCount(int count);
+ void assertMaxArgCount(int count);
+ void assertExactArgCount(int count);
+ void argCountFailure(int count, const string& specifier);
+
+};
+
+#endif /* _PRTGET_H_ */
diff --git a/src/repository.cpp b/src/repository.cpp
new file mode 100644
index 0000000..0b91c3d
--- /dev/null
+++ b/src/repository.cpp
@@ -0,0 +1,447 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: repository.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <cstdio>
+#include <cstring>
+#include <iostream>
+#include <algorithm>
+#include <vector>
+using namespace std;
+
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <fnmatch.h>
+
+#include "datafileparser.h"
+#include "repository.h"
+#include "stringhelper.h"
+#include "pg_regex.h"
+using namespace StringHelper;
+
+
+const string Repository::CACHE_VERSION = "V5";
+const string Repository::EXTERNAL_DEPENDENCY_FILE =
+ LOCALSTATEDIR"/lib/pkg/prt-get.deplist";
+
+/*!
+ Create a repository
+*/
+Repository::Repository(bool useRegex)
+ : m_useRegex(useRegex)
+{
+}
+
+/*!
+ Destroy a repository
+*/
+Repository::~Repository()
+{
+ map<string, Package*>::const_iterator it = m_packageMap.begin();
+ for ( ; it != m_packageMap.end(); ++it ) {
+ delete it->second;
+ }
+}
+
+
+/*!
+ \return a map of available packages
+*/
+const map<string, Package*>& Repository::packages() const
+{
+ return m_packageMap;
+}
+
+
+/*!
+ Returns a map of duplicate packages in the repository. The key is the name
+ of the package, the value a pair where \a first the shadowed port and
+ \a second is the port which preceeds over \a first
+ \return a map of duplicate packages in the repository
+*/
+const map<string, pair<string, string> >& Repository::shadowedPackages() const
+{
+ return m_shadowedPackages;
+}
+
+
+void Repository::parseDependencyList()
+{
+ map<string, string> depMap;
+ if (DataFileParser::parse(EXTERNAL_DEPENDENCY_FILE, depMap)) {
+ addDependencies(depMap);
+ }
+}
+
+
+/*!
+ \param name the package name to be returned
+ \return a Package pointer for a package name or 0 if not found
+*/
+const Package* Repository::getPackage( const string& name ) const
+{
+ map<string, Package*>::const_iterator it = m_packageMap.find( name );
+ if ( it == m_packageMap.end() ) {
+ return 0;
+ }
+ return it->second;
+}
+
+
+/*!
+ Search packages for a match of \a pattern in name, and description of
+ \a searchDesc is true.
+ \note Name searches can often done without opening the Pkgfiles, but not
+ description search. Therefore, the later is much slower
+
+ \param pattern the pattern to be found
+ \param searchDesc whether descriptions should be searched as well
+ \return a list of matching packages
+*/
+
+void Repository::searchMatchingPackages( const string& pattern,
+ list<Package*>& target,
+ bool searchDesc ) const
+ // note: searchDesc true will read _every_ Pkgfile
+{
+ map<string, Package*>::const_iterator it = m_packageMap.begin();
+ if (m_useRegex) {
+ RegEx re(pattern);
+ for ( ; it != m_packageMap.end(); ++it ) {
+ if (re.match(it->first)) {
+ target.push_back( it->second );
+ } else if ( searchDesc ) {
+ if ( re.match(it->second->description())) {
+ target.push_back( it->second );
+ }
+ }
+ }
+ } else {
+ for ( ; it != m_packageMap.end(); ++it ) {
+ if ( it->first.find( pattern ) != string::npos ) {
+ target.push_back( it->second );
+ } else if (searchDesc ) {
+ string s = toLowerCase( it->second->description() );
+ if ( s.find( toLowerCase( pattern ) ) != string::npos ) {
+ target.push_back( it->second );
+ }
+ }
+ }
+ }
+}
+
+
+/*!
+ init repository by reading the directories passed. Doesn't search
+ recursively, so if you want /dir and /dir/subdir checked, you have to
+ specify both
+
+ \param rootList a list of directories to look for ports in
+ \param listDuplicate whether duplicates should registered (slower)
+*/
+void Repository::initFromFS( const list< pair<string, string> >& rootList,
+ bool listDuplicate )
+{
+ list< pair<string, string> >::const_iterator it = rootList.begin();
+ DIR* d;
+ struct dirent* de;
+ string name;
+
+ std::map<string, bool> alreadyChecked;
+
+
+ for ( ; it != rootList.end(); ++it ) {
+
+ string path = it->first;
+ string pkgInput = stripWhiteSpace( it->second );
+
+ if ( alreadyChecked[path] ) {
+ continue;
+ }
+
+ bool filter = false;
+ if ( pkgInput.length() > 0 ) {
+ filter = true;
+ // create a proper input string
+ while ( pkgInput.find( " " ) != string::npos ) {
+ pkgInput = pkgInput.replace( pkgInput.find(" "), 1, "," );
+ }
+ while ( pkgInput.find( "\t" ) != string::npos ) {
+ pkgInput = pkgInput.replace( pkgInput.find("\t"), 1, "," );
+ }
+ while ( pkgInput.find( ",," ) != string::npos ) {
+ pkgInput = pkgInput.replace( pkgInput.find(",,"), 2, "," );
+ }
+ }
+
+ if (!filter) {
+ alreadyChecked[path] = true;
+ }
+
+ list<string> packages;
+ split( pkgInput, ',', packages );
+
+
+
+ // TODO: think about whether it would be faster (more
+ // efficient) to put all packages into a map, and the iterate
+ // over the list of allowed packages and copy them
+ // over. depending in the efficiency of find(), this might be
+ // faster
+ d = opendir( path.c_str() );
+ while ( ( de = readdir( d ) ) != NULL ) {
+ name = de->d_name;
+
+ // TODO: review this
+ struct stat buf;
+ if ( stat( (path + "/" + name + "/Pkgfile").c_str(), &buf )
+ != 0 ) {
+ // no Pkgfile -> no port
+ continue;
+ }
+
+ if ( filter && find( packages.begin(),
+ packages.end(), name ) == packages.end() ) {
+ // not found -> ignore this port
+ continue;
+ }
+
+ if ( name != "." && name != ".." ) {
+
+ map<string, Package*>::iterator hidden;
+ hidden = m_packageMap.find( name );
+ Package* p = new Package( name, path );
+ if ( p ) {
+ if ( hidden == m_packageMap.end() ) {
+ // no such package found, add
+ m_packageMap[name] = p;
+ } else if ( listDuplicate ) {
+ Package* old = hidden->second;
+ string ps = p->path() + "/" + p->name() +
+ "-" + p->version();
+ string os = old->path() + "/" + old->name() +
+ "-" + old->version();
+ m_shadowedPackages[name] = make_pair( ps, os );
+ }
+ }
+ }
+ }
+ closedir( d );
+ }
+
+ parseDependencyList();
+}
+
+/*!
+ Init from a cache file
+ \param cacheFile the name of the cache file to be parser
+ \return true on success, false indicates file opening problems
+*/
+Repository::CacheReadResult
+Repository::initFromCache( const string& cacheFile )
+{
+ FILE* fp = fopen( cacheFile.c_str(), "r" );
+ if ( !fp ) {
+ return ACCESS_ERR;
+ }
+
+ const int length = BUFSIZ;
+ char input[length];
+ string line;
+
+ // read version
+ if ( fgets( input, length, fp ) ) {
+ line = stripWhiteSpace( input );
+ if ( line != CACHE_VERSION ) {
+ return FORMAT_ERR;
+ }
+ }
+
+ // FIELDS:
+ // name, path, version, release,
+ // description, dependencies, url,
+ // packager, maintainer, hasReadme;
+ // hasPreInstall, hasPostInstall
+ const int fieldCount = 12;
+ string fields[fieldCount];
+ int fieldPos = 0;
+
+ while ( fgets( input, length, fp ) ) {
+ line = StringHelper::stripWhiteSpace( input );
+
+ fields[fieldPos] = line;
+ ++fieldPos;
+ if ( fieldPos == fieldCount ) {
+ fieldPos = 0;
+ Package* p = new Package( fields[0], fields[1],
+ fields[2], fields[3],
+ fields[4], fields[5], fields[6],
+ fields[7], fields[8], fields[9],
+ fields[10], fields[11]);
+ m_packageMap[p->name()] = p;
+ fgets( input, length, fp ); // read empty line
+ }
+ }
+ fclose( fp );
+
+ parseDependencyList();
+
+ return READ_OK;
+}
+
+/*!
+ Store repository data in a cache file
+ \param cacheFile the file where the data is stored
+ \return whether the operation was successfully
+*/
+Repository::WriteResult Repository::writeCache( const string& cacheFile )
+{
+ string path = cacheFile;
+ string::size_type pos = cacheFile.rfind( '/' );
+ if ( pos != string::npos ) {
+ path = path.erase( pos );
+ }
+ if ( !createOutputDir( path ) ) {
+ return DIR_ERR;
+ }
+
+ FILE* fp = fopen( cacheFile.c_str(), "w" );
+ if ( !fp ) {
+ return FILE_ERR;
+ }
+
+ map<string, Package*>::const_iterator it = m_packageMap.begin();
+
+ char yesStr[] = "yes";
+ char noStr[] = "no";
+ char* hasReadme;
+ char* hasPreInstall;
+ char* hasPostInstall;
+
+ // write version
+ fprintf( fp, "%s\n", CACHE_VERSION.c_str() );
+
+ for ( ; it != m_packageMap.end(); ++it ) {
+ const Package* p = it->second;
+
+ // TODO: encode
+ hasReadme = noStr;
+ if ( p->hasReadme() ) {
+ hasReadme = yesStr;
+ }
+
+ hasPreInstall = noStr;
+ if ( p->hasPreInstall() ) {
+ hasPreInstall = yesStr;
+ }
+
+ hasPostInstall = noStr;
+ if ( p->hasPostInstall() ) {
+ hasPostInstall = yesStr;
+ }
+
+ fprintf( fp, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n",
+ p->name().c_str(),
+ p->path().c_str(),
+ p->version().c_str(),
+
+ p->release().c_str(),
+ p->description().c_str(),
+ p->dependencies().c_str(),
+ p->url().c_str(),
+ p->packager().c_str(),
+ p->maintainer().c_str(),
+ hasReadme, hasPreInstall, hasPostInstall );
+ }
+
+ fclose( fp );
+ return SUCCESS;
+}
+
+/*!
+ create all components of \path which don't exist
+ \param path the path to be created
+ \return true on success. false indicates permission problems
+ */
+bool Repository::createOutputDir( const string& path )
+{
+ list<string> dirs;
+ split( path, '/', dirs, 1 );
+ string tmpPath;
+
+ for ( list<string>::iterator it = dirs.begin(); it != dirs.end(); ++it ) {
+
+ tmpPath += *it + "/";
+ DIR* d;
+ if ( ( d = opendir( tmpPath.c_str() ) ) == NULL ) {
+ // doesn't exist
+ if ( mkdir( tmpPath.c_str(), 0755 ) == -1 ) {
+ cout << "- can't create output directory " << tmpPath
+ << endl;
+ return false;
+ }
+ } else {
+ closedir( d );
+ }
+
+ }
+ return true;
+}
+
+
+/*!
+ Search packages for a match of \a pattern in name. The name can
+ contain shell wildcards.
+
+ \param pattern the pattern to be found
+ \return a list of matching packages
+*/
+
+void Repository::getMatchingPackages( const string& pattern,
+ list<Package*>& target ) const
+{
+ map<string, Package*>::const_iterator it = m_packageMap.begin();
+ RegEx re(pattern);
+
+ if (m_useRegex) {
+ for ( ; it != m_packageMap.end(); ++it ) {
+ if (re.match(it->first)) {
+ target.push_back( it->second );
+ }
+ }
+ } else {
+ for ( ; it != m_packageMap.end(); ++it ) {
+ // I assume fnmatch will be quite fast for "match all" (*), so
+ // I didn't add a boolean to check for this explicitely
+ if ( fnmatch( pattern.c_str(), it->first.c_str(), 0 ) == 0 ) {
+ target.push_back( it->second );
+ }
+ }
+ }
+}
+
+void Repository::addDependencies( std::map<string, string>& deps )
+{
+ map<string, string>::iterator it = deps.begin();
+ for ( ; it != deps.end(); ++it ) {
+ map<string, Package*>::const_iterator pit =
+ m_packageMap.find( it->first );
+ if ( pit != m_packageMap.end() ) {
+ Package* p = pit->second;
+ if (p->dependencies().length() == 0) {
+ // only use if no dependencies in Pkgfile
+ p->setDependencies(it->second);
+ }
+ }
+ }
+}
diff --git a/src/repository.h b/src/repository.h
new file mode 100644
index 0000000..2f0ce7a
--- /dev/null
+++ b/src/repository.h
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: repository.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _REPOSITORY_H_
+#define _REPOSITORY_H_
+
+#include <string>
+#include <list>
+#include <map>
+#include <utility>
+using namespace std;
+
+#include "package.h"
+
+/*!
+ \class Repository
+ \brief Repository of available ports
+
+ The repository is an abstraction of the available ports in the ports tree
+*/
+class Repository
+{
+public:
+ Repository(bool useRegex);
+ ~Repository();
+
+ const Package* getPackage( const string& name ) const;
+ const map<string, Package*>& packages() const;
+ const map<string, pair<string, string> >& shadowedPackages() const;
+
+ void searchMatchingPackages( const string& pattern,
+ list<Package*>& target,
+ bool searchDesc ) const;
+
+ void getMatchingPackages( const string& pattern,
+ list<Package*>& target ) const;
+
+ void initFromFS( const list< pair<string, string> >& rootList,
+ bool listDuplicate );
+
+
+ /*! Result of a cache write operation */
+ enum CacheReadResult {
+ ACCESS_ERR, /*!< Error creating/accessing the file */
+ FORMAT_ERR, /*!< bad/old format */
+ READ_OK /*!< Success */
+ };
+ CacheReadResult initFromCache( const string& cacheFile );
+
+ /*! Result of a cache write operation */
+ enum WriteResult {
+ DIR_ERR, /*!< Error creating/accessing the directory */
+ FILE_ERR, /*!< Error creating/accessing the file */
+ SUCCESS /*!< Success */
+ };
+ WriteResult writeCache( const string& cacheFile );
+
+ static bool createOutputDir( const string& path );
+ void addDependencies( std::map<string, string>& deps );
+
+ static const std::string EXTERNAL_DEPENDENCY_FILE;
+
+private:
+ static const std::string CACHE_VERSION;
+ bool m_useRegex;
+
+ void parseDependencyList();
+
+ map<string, pair<string, string> > m_shadowedPackages;
+ map<string, Package*> m_packageMap;
+};
+
+#endif /* _REPOSITORY_H_ */
diff --git a/src/signaldispatcher.cpp b/src/signaldispatcher.cpp
new file mode 100644
index 0000000..e71793b
--- /dev/null
+++ b/src/signaldispatcher.cpp
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: signaldispatcher.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include <iostream>
+using namespace std;
+
+#include "signaldispatcher.h"
+
+SignalDispatcher* SignalDispatcher::m_instance = 0;
+
+SignalDispatcher::SignalDispatcher()
+{
+
+}
+
+SignalDispatcher* SignalDispatcher::instance()
+{
+ if ( m_instance == 0 ) {
+ m_instance = new SignalDispatcher();
+ }
+
+ return m_instance;
+}
+
+void SignalDispatcher::dispatch( int signalNumber )
+{
+ map<int, SignalHandler*>::iterator it =
+ SignalDispatcher::instance()->m_signalHandlers.find( signalNumber );
+ if ( it != SignalDispatcher::instance()->m_signalHandlers.end() ) {
+ it->second->handleSignal( signalNumber );
+ } else {
+ cerr << "prt-get: caught signal " << signalNumber << endl;
+ }
+ exit( signalNumber );
+}
+
+void SignalDispatcher::registerHandler( SignalHandler* handler,
+ int signalNumber )
+{
+ m_signalHandlers[signalNumber] = handler;
+}
+
+void SignalDispatcher::unregisterHandler( int signalNumber )
+{
+ m_signalHandlers.erase( signalNumber );
+}
diff --git a/src/signaldispatcher.h b/src/signaldispatcher.h
new file mode 100644
index 0000000..d29cdab
--- /dev/null
+++ b/src/signaldispatcher.h
@@ -0,0 +1,58 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: signaldispatcher.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _SIGNALDISPATCHER_H_
+#define _SIGNALDISPATCHER_H_
+
+#include <map>
+
+/*!
+ signal handler for the SignalDispatcher class. Implement this class to
+ receive signals
+ \brief SignalHandler for SignalDispatcher
+*/
+class SignalHandler
+{
+public:
+ /*! Result of a handlSignal() call */
+ enum HandlerResult {
+ SIGNAL_NOT_HANDLED, /*!< not handled */
+ EXIT, /*!< signal handled, exit now */
+ CONTINUE /*!< signal handled, don't exit */
+ };
+ virtual HandlerResult handleSignal( int signalNumber ) = 0;
+};
+
+/*!
+ dispatches signals. Singleton, use the instance() method to access
+ the instance of this class. Register your SignalHandler to handle signals
+
+ \brief Dispatch unix signals
+*/
+class SignalDispatcher
+{
+public:
+ static SignalDispatcher* instance();
+ static void dispatch( int signalNumber );
+
+ void registerHandler( SignalHandler* handler, int signalNumber );
+ void unregisterHandler( int signalNumber );
+
+protected:
+ SignalDispatcher();
+
+private:
+ static SignalDispatcher* m_instance;
+ std::map<int, SignalHandler*> m_signalHandlers;
+
+};
+
+#endif /* _SIGNALDISPATCHER_H_ */
diff --git a/src/stringhelper.cpp b/src/stringhelper.cpp
new file mode 100644
index 0000000..5d8853c
--- /dev/null
+++ b/src/stringhelper.cpp
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: stringhelper.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#include "stringhelper.h"
+#include <cctype>
+
+using namespace std;
+
+namespace StringHelper
+{
+
+
+
+
+/*!
+ \param s the string to be searched
+ \param del the delimiter char
+ \return the value after the first occurance of \a del
+ */
+string getValue( const string& s, char del )
+{
+ string::size_type pos = s.find( del );
+ if ( pos != string::npos && pos+1 < s.length() ) {
+ return s.substr( pos + 1 );
+ }
+ return "";
+}
+
+/*!
+ \param s the string to be searched
+ \param del the delimiter char
+ \return the value before the first occurance of \a del
+ */
+string getValueBefore( const string& s, char del )
+{
+ string::size_type pos = s.find( del );
+ if ( pos != string::npos ) {
+ return s.substr( 0, pos );
+ }
+ return s;
+}
+
+/*!
+ strip whitespace in the beginning and end of string \a s
+ \return a stripped string
+*/
+string stripWhiteSpace( const string& s )
+{
+ if ( s.empty() ) {
+ return s;
+ }
+
+ int pos = 0;
+ string line = s;
+ string::size_type len = line.length();
+ while ( pos < len && isspace( line[pos] ) ) {
+ ++pos;
+ }
+ line.erase( 0, pos );
+ pos = line.length()-1;
+ while ( pos > -1 && isspace( line[pos] ) ) {
+ --pos;
+ }
+ if ( pos != -1 ) {
+ line.erase( pos+1 );
+ }
+ return line;
+}
+
+/*!
+ make sure s1 starts with s2
+*/
+bool startwith_nocase( const string& s1, const string& s2 )
+{
+ string::const_iterator p1 = s1.begin();
+ string::const_iterator p2 = s2.begin();
+
+ while ( p1 != s1.end() && p2 != s2.end() ) {
+ if ( toupper( *p1 ) != toupper( *p2 ) ) {
+ return false;
+ }
+ ++p1;
+ ++p2;
+ }
+
+ if ( p1 == s1.end() && p2 != s2.end() ) {
+ return false;
+ }
+
+ return true;
+}
+
+/*!
+ Convert a string into a lowercase representation
+ \param s the string to be converted
+ \return a lowercase representation of \a s
+*/
+string toLowerCase( const string& s )
+{
+ string result = "";
+ for ( string::size_type i = 0; i < s.length(); ++i ) {
+ result += tolower( s[i] );
+ }
+
+ return result;
+}
+
+/*!
+ Convert a string into a uppercase representation
+ \param s the string to be converted
+ \return a uppercase representation of \a s
+*/
+string toUpperCase( const string& s )
+{
+ string result = "";
+ for ( string::size_type i = 0; i < s.length(); ++i ) {
+ result += toupper( s[i] );
+ }
+
+ return result;
+}
+
+/*!
+ replace all occurances of \a oldString in \a in with \a newString
+*/
+string replaceAll( string& in,
+ const string& oldString,
+ const string& newString )
+{
+ size_t pos;
+ while ( (pos = in.find( oldString )) != string::npos ) {
+ in =
+ in.replace( pos, oldString.length(), newString );
+ }
+
+ return in;
+}
+
+
+}; // Namespace
diff --git a/src/stringhelper.h b/src/stringhelper.h
new file mode 100644
index 0000000..42bdc5b
--- /dev/null
+++ b/src/stringhelper.h
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: stringhelper.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2002 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _STRINGHELPER_H_
+#define _STRINGHELPER_H_
+
+#include <list>
+#include <string>
+using namespace std;
+
+/*!
+ \brief A generic place with string functions
+*/
+namespace StringHelper
+{
+
+template <class T>
+void split( const string& s, char del,
+ T& target,
+ int startPos=0, bool useEmpty=true );
+
+string stripWhiteSpace( const string& s );
+bool startwith_nocase( const string& s1, const string& s2 );
+
+string getValue( const string& s, char del );
+string getValueBefore( const string& s, char del );
+
+string toLowerCase( const string& s );
+string toUpperCase( const string& s );
+
+string replaceAll( string& in,
+ const string& oldString,
+ const string& newString );
+
+
+/*!
+ split a string into parts
+
+ \param s string to be split
+ \param del delimter
+ \param startPos position to start at
+ \param useEmpty include empty (whitespace only9 results in the result
+
+ \return a list of string
+*/
+template <class T>
+void split( const string& s, char del,
+ T& target,
+ int startPos, bool useEmpty )
+{
+ string line = s;
+
+ string::size_type pos;
+ int offset = startPos;
+ while ( ( pos = line.find( del, offset ) ) != string::npos ) {
+ offset = 0;
+
+ string val = line.substr( 0, pos );
+ if ( useEmpty || !stripWhiteSpace( val ).empty() ) {
+ target.push_back( val );
+ }
+ line.erase( 0, pos+1 );
+ }
+
+ if ( line.length() > 0 ) {
+ target.push_back( line );
+ }
+}
+
+
+};
+#endif /* _STRINGHELPER_H_ */
diff --git a/src/versioncomparator.cpp b/src/versioncomparator.cpp
new file mode 100644
index 0000000..351eec9
--- /dev/null
+++ b/src/versioncomparator.cpp
@@ -0,0 +1,250 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: versioncomparator.cpp
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2004 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+// Get a test application with the following command:
+// g++ -o vcomp -DTEST stringhelper.cpp versioncomparator.cpp
+
+
+#include <string>
+#include <cctype>
+#include <vector>
+#include <iostream>
+using namespace std;
+
+#include "stringhelper.h"
+using namespace StringHelper;
+
+#include "versioncomparator.h"
+
+namespace VersionComparator
+{
+
+// this is a one day hack; I'll refactor that to be nicer, clearer and
+// hopefully faster. It should work pretty well though
+
+COMP_RESULT compareVersions(const string& v1, const string& v2)
+{
+ vector<string> blocks1;
+ vector<string> blocks2;
+
+ tokenizeIntoBlocks(v1, blocks1);
+ tokenizeIntoBlocks(v2, blocks2);
+ int blockLen = normalizeVectors(blocks1, blocks2);
+
+ for (int i = 0; i < blockLen; ++i) {
+ vector<string> tokens1;
+ vector<string> tokens2;
+ split(blocks1[i], '.', tokens1);
+ split(blocks2[i], '.', tokens2);
+ int tokLen = normalizeVectors(tokens1, tokens2);
+
+ for (int j = 0; j < tokLen; ++j) {
+ if (tokens1[j] == tokens2[j]) {
+ continue;
+ }
+
+ char* error1 = 0;
+ char* error2 = 0;
+ error1 = 0;
+ error2 = 0;
+ long vl1 = strtol(tokens1[j].c_str(), &error1, 10);
+ long vl2 = strtol(tokens2[j].c_str(), &error2, 10);
+
+ if (*error1 != 0 || *error2 != 0) {
+ // subtokenize
+ vector<string> subtokens1;
+ vector<string> subtokens2;
+
+ tokenizeMixed(tokens1[j], subtokens1);
+ tokenizeMixed(tokens2[j], subtokens2);
+ int subTokLen = normalizeVectors(subtokens1, subtokens2);
+ for (int k = 0; k < subTokLen; ++k) {
+ if (isdigit(subtokens1[k][0])) {
+ long sl1 = strtol(subtokens1[k].c_str(), &error1, 10);
+ long sl2 = strtol(subtokens2[k].c_str(), &error2, 10);
+
+ if (sl1 < sl2) {
+ return LESS;
+ } else if (sl1 > sl2) {
+ return GREATER;
+ }
+ } else {
+ // pure string tokens
+ if (subtokens1[k][1] == 0 && subtokens2[k][1] == 0) {
+
+ if (subtokens1[k][0] < subtokens2[k][0]) {
+ return LESS;
+ } else if (subtokens1[k][0] > subtokens2[k][0]) {
+ return GREATER;
+ }
+ } else {
+ // smart guessing...
+ // leaving out 'test', 'pre' and 'rc'
+ static const string versions =
+ "alpha beta gamma delta";
+ string::size_type pos1 =
+ versions.find(subtokens1[k]);
+ string::size_type pos2 =
+ versions.find(subtokens2[k]);
+ if (pos1 != string::npos && pos2 != string::npos) {
+ if (pos1 < pos2) {
+ return LESS;
+ } else if (pos1 > pos2) {
+ return GREATER;
+ }
+ }
+ }
+
+ if (subtokens1[k] != subtokens2[k]) {
+ return UNDEFINED;
+ }
+ }
+ }
+
+ } else if (vl1 < vl2) {
+ return LESS;
+ } else if (vl1 > vl2) {
+ return GREATER;
+ }
+ }
+ }
+
+
+ return EQUAL;
+}
+
+int normalizeVectors(vector<string>& v1, vector<string>& v2)
+{
+ int length = max(v1.size(), v2.size());
+
+ while (v1.size() < length) {
+ v1.push_back("-1");
+ }
+ while (v2.size() < length) {
+ v2.push_back("-1");
+ }
+
+ return length;
+}
+
+void tokenizeMixed(const string& s, vector<string>& tokens)
+{
+ vector<bool> digitMask;
+ for (int i = 0; i < s.length(); ++i) {
+ digitMask.push_back(isdigit(s[i]));
+ }
+
+ bool state = digitMask[0];
+ string tok;
+ tok = s[0];
+ for (int i = 1; i < digitMask.size(); ++i) {
+ if (digitMask[i] != state) {
+ tokens.push_back(tok);
+ tok = s[i];
+ state = digitMask[i];
+ } else {
+ tok += s[i];
+ }
+ }
+ if (tok.length() > 0) {
+ tokens.push_back(tok);
+ }
+}
+
+/*
+ find last - (for release) -> version, release
+ subdivide version in blocks, where a block is separated by any of
+ the following: [-_]
+
+ -> list of blocks, e.g.
+ . 1.4.2-pre1-2 -> [ (1.4.2) (-pre1) (2) ]
+ . 1.4.2pre1-1 -> [ (1.4.2pre1) (-1) ]
+ . 1_2_2pre2-2 -> [ (1) (2) (2pre2) (2)
+*/
+void tokenizeIntoBlocks(const string& version, vector<string>& blocks)
+{
+ string v = version;
+ v = replaceAll(v, "-", "_");
+ split(v, '_', blocks);
+}
+
+}
+
+
+void check(const string& v1, const string& v2,
+ VersionComparator::COMP_RESULT expected, bool compare=true)
+{
+ VersionComparator::COMP_RESULT result =
+ VersionComparator::compareVersions(v1, v2);
+
+ if (compare) {
+ cout << ((result == expected) ? "OK " : "FAIL ");
+ }
+
+ cout << v1 << " ";
+ switch (result)
+ {
+ case VersionComparator::LESS:
+ cout << "<";
+ break;
+ case VersionComparator::GREATER:
+ cout << ">";
+ break;
+ case VersionComparator::EQUAL:
+ cout << "=";
+ break;
+ case VersionComparator::UNDEFINED:
+ cout << "?";
+ break;
+ }
+
+ cout << " " << v2 << endl;
+}
+
+
+#ifdef TEST
+
+int main(int argc, char** argv)
+{
+ using namespace VersionComparator;
+
+ if (argc < 3) {
+ check("1", "2", LESS);
+ check("1.1", "1.2", LESS);
+ check("1.1pre1", "1.1pre2", LESS);
+ check("1.1pre1", "1.2pre1", LESS);
+ check("1.1-pre1", "1.1-pre2", LESS);
+ check("1.1_2", "1.1.2", LESS);
+ check("1.1", "1.1", EQUAL);
+
+ check("1.0PR1", "1.0PR1", EQUAL);
+ check("1.0PR1", "1.0PR2", LESS);
+ check("1.0PR1", "1.0RC1", UNDEFINED);
+
+ check("1.2.3-2", "1.2.3-1", GREATER);
+ check("1.0.0", "0.9", GREATER);
+
+ check("1.4.2_3-1", "1.4.3-2", LESS);
+ check("1.4.2_3-1", "1.4.2_3-2", LESS);
+ check("1.4.2_3-1", "1.4.2_1-1", GREATER);
+
+ check("1.4.2-alpha2", "1.4.2-beta1", LESS);
+ check("1.4.2a-2", "1.4.2a-3", LESS);
+ check("1.4.2a-2", "1.4.2b-2", LESS);
+ check("1.4.2aa-2", "1.4.2bb-2", UNDEFINED);
+ check("1.4.2a1-2", "1.4.2a2-2", LESS);
+ check("1.4.2b1-2", "1.4.2a2-2", GREATER);
+ check("1.4.2beta3", "1.4.2alpha2", GREATER);
+ } else {
+ check(argv[1], argv[2], UNDEFINED, false);
+ }
+}
+#endif
diff --git a/src/versioncomparator.h b/src/versioncomparator.h
new file mode 100644
index 0000000..767b148
--- /dev/null
+++ b/src/versioncomparator.h
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////
+// FILE: versioncomparator.h
+// AUTHOR: Johannes Winkelmann, jw@tks6.net
+// COPYRIGHT: (c) 2004 by Johannes Winkelmann
+// ---------------------------------------------------------------------
+// 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.
+////////////////////////////////////////////////////////////////////////
+
+#ifndef _VERSIONCOMP_H_
+#define _VERSIONCOMP_H_
+
+namespace VersionComparator
+{
+
+enum COMP_RESULT { LESS, GREATER, EQUAL, UNDEFINED };
+
+COMP_RESULT compareVersions(const string& v1, const string& v2) ;
+void tokenizeIntoBlocks(const string& version, vector<string>& blocks);
+int normalizeVectors(vector<string>& v1, vector<string>& v2);
+void tokenizeMixed(const string& s, vector<string>& tokens);
+
+}
+
+#endif /* _VERSIONCOMP_H_ */
+

Generated by cgit