tarruby 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. data/README.txt +99 -0
  2. data/ext/extconf.rb +19 -0
  3. data/ext/libtar/COPYRIGHT +35 -0
  4. data/ext/libtar/ChangeLog +243 -0
  5. data/ext/libtar/ChangeLog-1.0.x +141 -0
  6. data/ext/libtar/INSTALL +183 -0
  7. data/ext/libtar/Makefile.in +51 -0
  8. data/ext/libtar/README +121 -0
  9. data/ext/libtar/TODO +10 -0
  10. data/ext/libtar/autoconf/ac_path_generic.m4 +136 -0
  11. data/ext/libtar/autoconf/aclocal.m4 +199 -0
  12. data/ext/libtar/autoconf/encap.m4 +133 -0
  13. data/ext/libtar/autoconf/install-sh +251 -0
  14. data/ext/libtar/autom4te.cache/output.0 +8102 -0
  15. data/ext/libtar/autom4te.cache/requests +112 -0
  16. data/ext/libtar/autom4te.cache/traces.0 +382 -0
  17. data/ext/libtar/compat/ChangeLog +31 -0
  18. data/ext/libtar/compat/README +12 -0
  19. data/ext/libtar/compat/TODO +4 -0
  20. data/ext/libtar/compat/basename.c +91 -0
  21. data/ext/libtar/compat/compat.h +260 -0
  22. data/ext/libtar/compat/dirname.c +96 -0
  23. data/ext/libtar/compat/fnmatch.c +237 -0
  24. data/ext/libtar/compat/gethostbyname_r.c +41 -0
  25. data/ext/libtar/compat/gethostname.c +36 -0
  26. data/ext/libtar/compat/getservbyname_r.c +41 -0
  27. data/ext/libtar/compat/glob.c +898 -0
  28. data/ext/libtar/compat/inet_aton.c +27 -0
  29. data/ext/libtar/compat/module.ac +591 -0
  30. data/ext/libtar/compat/snprintf.c +788 -0
  31. data/ext/libtar/compat/strdup.c +62 -0
  32. data/ext/libtar/compat/strlcat.c +72 -0
  33. data/ext/libtar/compat/strlcpy.c +68 -0
  34. data/ext/libtar/compat/strmode.c +199 -0
  35. data/ext/libtar/compat/strrstr.c +40 -0
  36. data/ext/libtar/compat/strsep.c +87 -0
  37. data/ext/libtar/config.h.in +187 -0
  38. data/ext/libtar/configure +8102 -0
  39. data/ext/libtar/configure.ac +114 -0
  40. data/ext/libtar/doc/Makefile.in +152 -0
  41. data/ext/libtar/doc/tar_append_file.3 +50 -0
  42. data/ext/libtar/doc/tar_block_read.3 +24 -0
  43. data/ext/libtar/doc/tar_extract_all.3 +43 -0
  44. data/ext/libtar/doc/tar_extract_file.3 +84 -0
  45. data/ext/libtar/doc/tar_open.3 +97 -0
  46. data/ext/libtar/doc/th_get_pathname.3 +63 -0
  47. data/ext/libtar/doc/th_print_long_ls.3 +22 -0
  48. data/ext/libtar/doc/th_read.3 +34 -0
  49. data/ext/libtar/doc/th_set_from_stat.3 +45 -0
  50. data/ext/libtar/lib/Makefile.in +92 -0
  51. data/ext/libtar/lib/append.c +272 -0
  52. data/ext/libtar/lib/block.c +384 -0
  53. data/ext/libtar/lib/decode.c +130 -0
  54. data/ext/libtar/lib/encode.c +237 -0
  55. data/ext/libtar/lib/extract.c +656 -0
  56. data/ext/libtar/lib/handle.c +150 -0
  57. data/ext/libtar/lib/internal.h +46 -0
  58. data/ext/libtar/lib/libtar.h +311 -0
  59. data/ext/libtar/lib/output.c +146 -0
  60. data/ext/libtar/lib/util.c +153 -0
  61. data/ext/libtar/lib/wrapper.c +175 -0
  62. data/ext/libtar/libtar/Makefile.in +73 -0
  63. data/ext/libtar/libtar/libtar.c +363 -0
  64. data/ext/libtar/listhash/ChangeLog +15 -0
  65. data/ext/libtar/listhash/TODO +21 -0
  66. data/ext/libtar/listhash/hash.c.in +344 -0
  67. data/ext/libtar/listhash/hash_new.3.in +74 -0
  68. data/ext/libtar/listhash/list.c.in +458 -0
  69. data/ext/libtar/listhash/list_new.3.in +86 -0
  70. data/ext/libtar/listhash/listhash.h.in +196 -0
  71. data/ext/libtar/listhash/module.ac +21 -0
  72. data/ext/libtar/win32/config.h +190 -0
  73. data/ext/libtar/win32/dirent.c +115 -0
  74. data/ext/libtar/win32/dirent.h +24 -0
  75. data/ext/libtar/win32/grp.h +4 -0
  76. data/ext/libtar/win32/listhash/libtar_hash.c +344 -0
  77. data/ext/libtar/win32/listhash/libtar_list.c +458 -0
  78. data/ext/libtar/win32/listhash/libtar_listhash.h +196 -0
  79. data/ext/libtar/win32/pwd.h +4 -0
  80. data/ext/libtar/win32/sys/param.h +8 -0
  81. data/ext/libtar/win32/tar.h +35 -0
  82. data/ext/libtar/win32/utime.h +6 -0
  83. data/ext/libtar/win32/win32/types.h +10 -0
  84. data/ext/tarruby.c +648 -0
  85. metadata +150 -0
@@ -0,0 +1,183 @@
1
+ Basic Installation
2
+ ==================
3
+
4
+ These are generic installation instructions.
5
+
6
+ The `configure' shell script attempts to guess correct values for
7
+ various system-dependent variables used during compilation. It uses
8
+ those values to create a `Makefile' in each directory of the package.
9
+ It may also create one or more `.h' files containing system-dependent
10
+ definitions. Finally, it creates a shell script `config.status' that
11
+ you can run in the future to recreate the current configuration, a file
12
+ `config.cache' that saves the results of its tests to speed up
13
+ reconfiguring, and a file `config.log' containing compiler output
14
+ (useful mainly for debugging `configure').
15
+
16
+ If you need to do unusual things to compile the package, please try
17
+ to figure out how `configure' could check whether to do them, and mail
18
+ diffs or instructions to the address given in the `README' so they can
19
+ be considered for the next release. If at some point `config.cache'
20
+ contains results you don't want to keep, you may remove or edit it.
21
+
22
+ The file `configure.in' is used to create `configure' by a program
23
+ called `autoconf'. You only need `configure.in' if you want to change
24
+ it or regenerate `configure' using a newer version of `autoconf'.
25
+
26
+ The simplest way to compile this package is:
27
+
28
+ 1. `cd' to the directory containing the package's source code and type
29
+ `./configure' to configure the package for your system. If you're
30
+ using `csh' on an old version of System V, you might need to type
31
+ `sh ./configure' instead to prevent `csh' from trying to execute
32
+ `configure' itself.
33
+
34
+ Running `configure' takes awhile. While running, it prints some
35
+ messages telling which features it is checking for.
36
+
37
+ 2. Type `make' to compile the package.
38
+
39
+ 3. Optionally, type `make check' to run any self-tests that come with
40
+ the package.
41
+
42
+ 4. Type `make install' to install the programs and any data files and
43
+ documentation.
44
+
45
+ 5. You can remove the program binaries and object files from the
46
+ source code directory by typing `make clean'. To also remove the
47
+ files that `configure' created (so you can compile the package for
48
+ a different kind of computer), type `make distclean'. There is
49
+ also a `make maintainer-clean' target, but that is intended mainly
50
+ for the package's developers. If you use it, you may have to get
51
+ all sorts of other programs in order to regenerate files that came
52
+ with the distribution.
53
+
54
+ Compilers and Options
55
+ =====================
56
+
57
+ Some systems require unusual options for compilation or linking that
58
+ the `configure' script does not know about. You can give `configure'
59
+ initial values for variables by setting them in the environment. Using
60
+ a Bourne-compatible shell, you can do that on the command line like
61
+ this:
62
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
63
+
64
+ Or on systems that have the `env' program, you can do it like this:
65
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
66
+
67
+ Compiling For Multiple Architectures
68
+ ====================================
69
+
70
+ You can compile the package for more than one kind of computer at the
71
+ same time, by placing the object files for each architecture in their
72
+ own directory. To do this, you must use a version of `make' that
73
+ supports the `VPATH' variable, such as GNU `make'. `cd' to the
74
+ directory where you want the object files and executables to go and run
75
+ the `configure' script. `configure' automatically checks for the
76
+ source code in the directory that `configure' is in and in `..'.
77
+
78
+ If you have to use a `make' that does not supports the `VPATH'
79
+ variable, you have to compile the package for one architecture at a time
80
+ in the source code directory. After you have installed the package for
81
+ one architecture, use `make distclean' before reconfiguring for another
82
+ architecture.
83
+
84
+ Installation Names
85
+ ==================
86
+
87
+ By default, `make install' will install the package's files in
88
+ `/usr/local/bin', `/usr/local/man', etc. You can specify an
89
+ installation prefix other than `/usr/local' by giving `configure' the
90
+ option `--prefix=PATH'.
91
+
92
+ You can specify separate installation prefixes for
93
+ architecture-specific files and architecture-independent files. If you
94
+ give `configure' the option `--exec-prefix=PATH', the package will use
95
+ PATH as the prefix for installing programs and libraries.
96
+ Documentation and other data files will still use the regular prefix.
97
+
98
+ In addition, if you use an unusual directory layout you can give
99
+ options like `--bindir=PATH' to specify different values for particular
100
+ kinds of files. Run `configure --help' for a list of the directories
101
+ you can set and what kinds of files go in them.
102
+
103
+ If the package supports it, you can cause programs to be installed
104
+ with an extra prefix or suffix on their names by giving `configure' the
105
+ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
106
+
107
+ Optional Features
108
+ =================
109
+
110
+ Some packages pay attention to `--enable-FEATURE' options to
111
+ `configure', where FEATURE indicates an optional part of the package.
112
+ They may also pay attention to `--with-PACKAGE' options, where PACKAGE
113
+ is something like `gnu-as' or `x' (for the X Window System). The
114
+ `README' should mention any `--enable-' and `--with-' options that the
115
+ package recognizes.
116
+
117
+ For packages that use the X Window System, `configure' can usually
118
+ find the X include and library files automatically, but if it doesn't,
119
+ you can use the `configure' options `--x-includes=DIR' and
120
+ `--x-libraries=DIR' to specify their locations.
121
+
122
+ Specifying the System Type
123
+ ==========================
124
+
125
+ There may be some features `configure' can not figure out
126
+ automatically, but needs to determine by the type of host the package
127
+ will run on. Usually `configure' can figure that out, but if it prints
128
+ a message saying it can not guess the host type, give it the
129
+ `--host=TYPE' option. TYPE can either be a short name for the system
130
+ type, such as `sun4', or a canonical name with three fields:
131
+ CPU-COMPANY-SYSTEM
132
+
133
+ See the file `config.sub' for the possible values of each field. If
134
+ `config.sub' isn't included in this package, then this package doesn't
135
+ need to know the host type.
136
+
137
+ If you are building compiler tools for cross-compiling, you can also
138
+ use the `--target=TYPE' option to select the type of system they will
139
+ produce code for and the `--build=TYPE' option to select the type of
140
+ system on which you are compiling the package.
141
+
142
+ Sharing Defaults
143
+ ================
144
+
145
+ If you want to set default values for `configure' scripts to share,
146
+ you can create a site shell script called `config.site' that gives
147
+ default values for variables like `CC', `cache_file', and `prefix'.
148
+ `configure' looks for `PREFIX/share/config.site' if it exists, then
149
+ `PREFIX/etc/config.site' if it exists. Or, you can set the
150
+ `CONFIG_SITE' environment variable to the location of the site script.
151
+ A warning: not all `configure' scripts look for a site script.
152
+
153
+ Operation Controls
154
+ ==================
155
+
156
+ `configure' recognizes the following options to control how it
157
+ operates.
158
+
159
+ `--cache-file=FILE'
160
+ Use and save the results of the tests in FILE instead of
161
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
162
+ debugging `configure'.
163
+
164
+ `--help'
165
+ Print a summary of the options to `configure', and exit.
166
+
167
+ `--quiet'
168
+ `--silent'
169
+ `-q'
170
+ Do not print messages saying which checks are being made. To
171
+ suppress all normal output, redirect it to `/dev/null' (any error
172
+ messages will still be shown).
173
+
174
+ `--srcdir=DIR'
175
+ Look for the package's source code in directory DIR. Usually
176
+ `configure' can determine that directory automatically.
177
+
178
+ `--version'
179
+ Print the version of Autoconf used to generate the `configure'
180
+ script, and exit.
181
+
182
+ `configure' also accepts some other, not widely useful, options.
183
+
@@ -0,0 +1,51 @@
1
+ # @configure_input@
2
+
3
+ ### Path settings
4
+ prefix = @prefix@
5
+ exec_prefix = @exec_prefix@
6
+ bindir = @bindir@
7
+ mandir = @mandir@
8
+ libdir = @libdir@
9
+ includedir = @includedir@
10
+ top_srcdir = @top_srcdir@
11
+
12
+ PACKAGE_NAME = @PACKAGE_NAME@
13
+ PACKAGE_VERSION = @PACKAGE_VERSION@
14
+
15
+ @ENCAP_DEFS@
16
+
17
+ @SET_MAKE@
18
+
19
+ INSTALL = @INSTALL@
20
+ INSTALL_DATA = @INSTALL_DATA@
21
+
22
+ SUBDIRS = lib libtar doc
23
+
24
+ all:
25
+ for n in $(SUBDIRS); do \
26
+ ( cd $$n && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; \
27
+ done
28
+
29
+ .PHONY: install install-recurse postinstall-encap clean distclean
30
+
31
+ install: install-recurse @ENCAP_INSTALL_TARGET@
32
+
33
+ install-recurse:
34
+ for n in $(SUBDIRS); do \
35
+ ( cd $$n && $(MAKE) install $(MAKE_FLAGS) ) || exit 1; \
36
+ done
37
+
38
+ postinstall-encap:
39
+ @ENCAP_INSTALL_RULES@
40
+
41
+ clean:
42
+ for n in $(SUBDIRS); do \
43
+ ( cd $$n && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; \
44
+ done
45
+
46
+ distclean:
47
+ for n in $(SUBDIRS); do \
48
+ ( cd $$n && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; \
49
+ done
50
+ rm -f config.cache config.log config.status config.h Makefile
51
+
data/ext/libtar/README ADDED
@@ -0,0 +1,121 @@
1
+ libtar - C library for manipulating tar files
2
+ ======
3
+
4
+ libtar is a library for manipulating tar files from within C programs.
5
+ Here are some of its features:
6
+
7
+ * Handles both POSIX tar file format and the GNU extensions.
8
+ * API provides functions for easy use, such as tar_extract_all().
9
+ * Also provides functions for more granular use, such as
10
+ tar_append_regfile().
11
+
12
+
13
+ Installation
14
+ ------------
15
+
16
+ To build libtar, you should be able to simply run these commands:
17
+
18
+ ./configure
19
+ make
20
+ make install
21
+
22
+
23
+ Encap Package Support
24
+ ---------------------
25
+
26
+ To build this software as an Encap package, you can pass the
27
+ --enable-encap option to configure. This will be automatically
28
+ enabled if the epkg or mkencap programs are detected on the system,
29
+ but can be overridden by the --disable-encap option.
30
+
31
+ When building an Encap package, the configure script will automatically
32
+ adjust the installation prefix to use an appropriate Encap package
33
+ directory. It does this using a heuristic algorithm which examines the
34
+ values of the ${ENCAP_SOURCE} and ${ENCAP_TARGET} environment variables
35
+ and the argument to configure's --prefix option.
36
+
37
+ If mkencap was detected on the system, it will be automatically run during
38
+ "make install". By default, epkg will also be run, but this can be
39
+ inhibited with the --disable-epkg-install configure option.
40
+
41
+ For information on the Encap package management system, see the WSG
42
+ Encap Archive:
43
+
44
+ http://www.encap.org/
45
+
46
+
47
+ zlib Support
48
+ ------------
49
+
50
+ The configure script will attempt to find the zlib library on your system
51
+ for use with the libtar driver program. The zlib package is available from:
52
+
53
+ http://www.gzip.org/zlib/
54
+
55
+ If zlib is installed on your system, but you do not wish to use it,
56
+ specify the --without-zlib option when you invoke configure.
57
+
58
+
59
+ More Information
60
+ ----------------
61
+
62
+ For documentation of the libtar API, see the enclosed manpages. For more
63
+ information on the libtar package, see:
64
+
65
+ http://www-dev.cites.uiuc.edu/libtar/
66
+
67
+ Source code for the latest version of libtar will be available there, as
68
+ well as Encap binary distributions for many common platforms.
69
+
70
+
71
+ Supported Platforms
72
+ -------------------
73
+
74
+ I develop and test libtar on the following platforms:
75
+
76
+ AIX 4.3.3 and 5.1
77
+ HP-UX 11.00
78
+ IRIX 6.5
79
+ RedHat Linux 7.2
80
+ Solaris 8 and 9
81
+
82
+ It should also build on the following platforms, but I do not actively
83
+ support them:
84
+
85
+ AIX 3.2.5
86
+ AIX 4.2.1
87
+ Cygwin
88
+ FreeBSD
89
+ HP-UX 10.20
90
+ Linux/libc5
91
+ OpenBSD
92
+ Solaris 2.5
93
+ Solaris 2.6
94
+ Solaris 7
95
+
96
+ If you successfully build libtar on another platform, please email me a
97
+ patch and/or configuration information.
98
+
99
+
100
+ Compatibility Code
101
+ ------------------
102
+
103
+ libtar depends on some library calls which are not available or not
104
+ usable on some platforms. To accomodate these systems, I've included
105
+ a version of these calls in the compat subdirectory.
106
+
107
+ I've slightly modified these functions for integration into this source
108
+ tree, but the functionality has not been modified from the original
109
+ source. Please note that while this code should work for you, I didn't
110
+ write it, so please don't send me bug reports on it.
111
+
112
+
113
+ Author
114
+ ------
115
+
116
+ Feedback and bug reports are welcome.
117
+
118
+ Mark D. Roth <roth@uiuc.edu>
119
+ Campus Information Technologies and Educational Services
120
+ University of Illinois at Urbana-Champaign
121
+
data/ext/libtar/TODO ADDED
@@ -0,0 +1,10 @@
1
+ * library API:
2
+ - revamp API (make analogs for Unix fs access calls)
3
+ - add dircache list to tar handle
4
+ - support star format(s)?
5
+ - add support for POSIX.1-2001 pax format
6
+ - large file support?
7
+ - support reading from tape devices with different block sizes?
8
+ * libtar program:
9
+ - make the libtar program a much more fully-featured tar
10
+ - move output.c and wrapper.c from lib directory to libtar directory
@@ -0,0 +1,136 @@
1
+ dnl @synopsis AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
2
+ dnl
3
+ dnl Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS
4
+ dnl
5
+ dnl The script must support `--cflags' and `--libs' args.
6
+ dnl If MINIMUM-VERSION is specified, the script must also support the
7
+ dnl `--version' arg.
8
+ dnl If the `--with-library-[exec-]prefix' arguments to ./configure are given,
9
+ dnl it must also support `--prefix' and `--exec-prefix'.
10
+ dnl (In other words, it must be like gtk-config.)
11
+ dnl
12
+ dnl For example:
13
+ dnl
14
+ dnl AC_PATH_GENERIC(Foo, 1.0.0)
15
+ dnl
16
+ dnl would run `foo-config --version' and check that it is at least 1.0.0
17
+ dnl
18
+ dnl If so, the following would then be defined:
19
+ dnl
20
+ dnl FOO_CFLAGS to `foo-config --cflags`
21
+ dnl FOO_LIBS to `foo-config --libs`
22
+ dnl
23
+ dnl At present there is no support for additional "MODULES" (see AM_PATH_GTK)
24
+ dnl (shamelessly stolen from gtk.m4 and then hacked around a fair amount)
25
+ dnl
26
+ dnl @author Angus Lees <gusl@cse.unsw.edu.au>
27
+ dnl @version $Id: ac_path_generic.m4,v 1.1.4.1 2002/09/06 19:43:55 roth Exp $
28
+
29
+ AC_DEFUN([AC_PATH_GENERIC],
30
+ [dnl
31
+ dnl we're going to need uppercase, lowercase and user-friendly versions of the
32
+ dnl string `LIBRARY'
33
+ pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
34
+ pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
35
+
36
+ dnl
37
+ dnl Get the cflags and libraries from the LIBRARY-config script
38
+ dnl
39
+ AC_ARG_WITH(DOWN-prefix,[ --with-]DOWN[-prefix=PFX Prefix where $1 is installed (optional)],
40
+ DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="")
41
+ AC_ARG_WITH(DOWN-exec-prefix,[ --with-]DOWN[-exec-prefix=PFX Exec prefix where $1 is installed (optional)],
42
+ DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="")
43
+
44
+ if test x$DOWN[]_config_exec_prefix != x ; then
45
+ DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix"
46
+ if test x${UP[]_CONFIG+set} != xset ; then
47
+ UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config
48
+ fi
49
+ fi
50
+ if test x$DOWN[]_config_prefix != x ; then
51
+ DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix"
52
+ if test x${UP[]_CONFIG+set} != xset ; then
53
+ UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config
54
+ fi
55
+ fi
56
+
57
+ AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no)
58
+ ifelse([$2], ,
59
+ AC_MSG_CHECKING(for $1),
60
+ AC_MSG_CHECKING(for $1 - version >= $2)
61
+ )
62
+ no_[]DOWN=""
63
+ if test "$UP[]_CONFIG" = "no" ; then
64
+ no_[]DOWN=yes
65
+ else
66
+ UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`"
67
+ UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`"
68
+ ifelse([$2], , ,[
69
+ DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \
70
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
71
+ DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \
72
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
73
+ DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \
74
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
75
+ DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])"
76
+ DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])"
77
+ DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])"
78
+
79
+ # Compare wanted version to what config script returned.
80
+ # If I knew what library was being run, i'd probably also compile
81
+ # a test program at this point (which also extracted and tested
82
+ # the version in some library-specific way)
83
+ if test "$DOWN[]_config_major_version" -lt \
84
+ "$DOWN[]_wanted_major_version" \
85
+ -o \( "$DOWN[]_config_major_version" -eq \
86
+ "$DOWN[]_wanted_major_version" \
87
+ -a "$DOWN[]_config_minor_version" -lt \
88
+ "$DOWN[]_wanted_minor_version" \) \
89
+ -o \( "$DOWN[]_config_major_version" -eq \
90
+ "$DOWN[]_wanted_major_version" \
91
+ -a "$DOWN[]_config_minor_version" -eq \
92
+ "$DOWN[]_wanted_minor_version" \
93
+ -a "$DOWN[]_config_micro_version" -lt \
94
+ "$DOWN[]_wanted_micro_version" \) ; then
95
+ # older version found
96
+ no_[]DOWN=yes
97
+ echo -n "*** An old version of $1 "
98
+ echo -n "($DOWN[]_config_major_version"
99
+ echo -n ".$DOWN[]_config_minor_version"
100
+ echo ".$DOWN[]_config_micro_version) was found."
101
+ echo -n "*** You need a version of $1 newer than "
102
+ echo -n "$DOWN[]_wanted_major_version"
103
+ echo -n ".$DOWN[]_wanted_minor_version"
104
+ echo ".$DOWN[]_wanted_micro_version."
105
+ echo "***"
106
+ echo "*** If you have already installed a sufficiently new version, this error"
107
+ echo "*** probably means that the wrong copy of the DOWN-config shell script is"
108
+ echo "*** being found. The easiest way to fix this is to remove the old version"
109
+ echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the"
110
+ echo "*** correct copy of DOWN-config. (In this case, you will have to"
111
+ echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf"
112
+ echo "*** so that the correct libraries are found at run-time)"
113
+ fi
114
+ ])
115
+ fi
116
+ if test "x$no_[]DOWN" = x ; then
117
+ AC_MSG_RESULT(yes)
118
+ ifelse([$3], , :, [$3])
119
+ else
120
+ AC_MSG_RESULT(no)
121
+ if test "$UP[]_CONFIG" = "no" ; then
122
+ echo "*** The DOWN-config script installed by $1 could not be found"
123
+ echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in"
124
+ echo "*** your path, or set the UP[]_CONFIG environment variable to the"
125
+ echo "*** full path to DOWN-config."
126
+ fi
127
+ UP[]_CFLAGS=""
128
+ UP[]_LIBS=""
129
+ ifelse([$4], , :, [$4])
130
+ fi
131
+ AC_SUBST(UP[]_CFLAGS)
132
+ AC_SUBST(UP[]_LIBS)
133
+
134
+ popdef([UP])
135
+ popdef([DOWN])
136
+ ])
@@ -0,0 +1,199 @@
1
+ m4_include([encap.m4])
2
+ m4_include([ac_path_generic.m4])
3
+
4
+
5
+ # PSG_LIB_READLINE
6
+ # ----------------
7
+ # Check for GNU readline library.
8
+ AC_DEFUN([PSG_LIB_READLINE], [
9
+ AC_CHECK_HEADERS([readline/readline.h])
10
+ AC_CHECK_HEADERS([readline/history.h])
11
+ if test "$ac_cv_header_readline_readline_h" = "yes"; then
12
+ AC_SEARCH_LIBS([tputs], [termcap curses])
13
+ AC_CHECK_LIB([readline], [rl_callback_handler_install])
14
+ fi
15
+ ])
16
+
17
+
18
+ # PSG_LIB_TAR
19
+ # -----------
20
+ # Check for usable version of libtar library.
21
+ AC_DEFUN([PSG_LIB_TAR], [
22
+ psg_old_libs="$LIBS"
23
+ LIBS="$LIBS -ltar"
24
+ AC_CACHE_CHECK([for usable version of libtar],
25
+ [psg_cv_lib_tar_usable],
26
+ [AC_TRY_RUN([
27
+ #include <stdio.h>
28
+ #include <string.h>
29
+ #include <libtar.h>
30
+
31
+ int main(int argc, char *argv[]) {
32
+ return (strcmp(libtar_version, "1.2") >= 0 ? 0 : 1);
33
+ }
34
+ ],
35
+ [psg_cv_lib_tar_usable=yes],
36
+ [psg_cv_lib_tar_usable=no],
37
+ [psg_cv_lib_tar_usable=no]
38
+ )]
39
+ )
40
+ if test "$psg_cv_lib_tar_usable" = "yes"; then
41
+ AC_DEFINE([HAVE_LIBTAR], 1,
42
+ [Define if your system has a current version of libtar])
43
+ else
44
+ LIBS="$psg_old_libs"
45
+ fi
46
+ ])
47
+
48
+
49
+ # PSG_LIB_FGET
50
+ # ------------
51
+ # Check for usable version of libfget library.
52
+ AC_DEFUN([PSG_LIB_FGET], [
53
+ psg_old_libs="$LIBS"
54
+ AC_CHECK_LIB([socket], [socket])
55
+ AC_CHECK_LIB([nsl], [gethostbyname])
56
+ LIBS="$LIBS -lfget"
57
+ AC_CACHE_CHECK([for usable version of libfget],
58
+ [psg_cv_lib_fget_usable],
59
+ [AC_TRY_COMPILE([
60
+ #include <libfget.h>
61
+ ], [
62
+ FTP *ftp;
63
+ char buf[10240];
64
+ struct ftp_url fu;
65
+
66
+ ftp_url_parse("ftp://host.com/dir/file.txt", &fu);
67
+
68
+ ftp_connect(&ftp, fu.fu_hostname, buf, sizeof(buf), 0, 0,
69
+ -1, -1, NULL, NULL);
70
+ ],
71
+ [psg_cv_lib_fget_usable=yes],
72
+ [psg_cv_lib_fget_usable=no]
73
+ )]
74
+ )
75
+ if test "$psg_cv_lib_fget_usable" = "yes"; then
76
+ AC_DEFINE([HAVE_LIBFGET], 1,
77
+ [Define if your system has a current version of libfget])
78
+ else
79
+ LIBS="$psg_old_libs";
80
+ fi
81
+ ])
82
+
83
+
84
+ # PSG_LIB_WRAP
85
+ # ------------
86
+ # Check for TCP Wrapper library.
87
+ AC_DEFUN([PSG_LIB_WRAP], [
88
+ AC_CHECK_HEADERS([tcpd.h])
89
+ if test "$ac_cv_header_tcpd_h" = "yes"; then
90
+ psg_old_libs="$LIBS"
91
+ LIBS="$LIBS -lwrap"
92
+ AC_CACHE_CHECK([for libwrap library],
93
+ [psg_cv_lib_wrap_hosts_ctl],
94
+ AC_TRY_LINK([
95
+ #include <stdio.h>
96
+ #include <tcpd.h>
97
+ int allow_severity;
98
+ int deny_severity;
99
+ ], [
100
+ hosts_ctl("test", STRING_UNKNOWN, "10.0.0.1", STRING_UNKNOWN);
101
+ ],
102
+ [psg_cv_lib_wrap_hosts_ctl=yes],
103
+ [psg_cv_lib_wrap_hosts_ctl=no]
104
+ )
105
+ )
106
+ if test "$psg_cv_lib_wrap_hosts_ctl" = "yes"; then
107
+ AC_DEFINE([HAVE_LIBWRAP], 1, [Define if you have libwrap])
108
+ else
109
+ LIBS="$psg_old_libs"
110
+ fi
111
+ fi
112
+ ])
113
+
114
+
115
+ # PSG_REPLACE_TYPE(type_t, default, [includes])
116
+ # ---------------------------------------------
117
+ # Check for arbitrary type in arbitrary header file(s).
118
+ AC_DEFUN([PSG_REPLACE_TYPE],
119
+ [AC_CHECK_TYPES([$1],
120
+ ,
121
+ [AC_DEFINE($1, $2,
122
+ [Define to `$2' if not defined in system header files.]
123
+ )],
124
+ $3
125
+ )]
126
+ )
127
+
128
+
129
+ # PSG_SHLIB(includes, code)
130
+ # -------------------------
131
+ # Check how to build shared libraries containing the specified code
132
+ # (very rudimentary).
133
+ AC_DEFUN([PSG_SHLIB], [
134
+ AC_MSG_CHECKING([how to build shared libraries])
135
+ cflag_options="-fpic";
136
+ ldflag_options="-G -shared";
137
+ if test "$CC" != "gcc"; then
138
+ case "`uname`" in
139
+ HP-UX)
140
+ cflag_options="+Z $cflag_options";
141
+ ldflag_options="-Wl,-b $ldflag_options";
142
+ ;;
143
+ SunOS)
144
+ cflag_options="-Kpic $cflag_options";
145
+ ;;
146
+ esac
147
+ fi
148
+ for SHLIB_CFLAGS in $cflag_options ""; do
149
+ for SHLIB_LDFLAGS in $ldflag_options ""; do
150
+ psg_old_cflags="$CFLAGS";
151
+ CFLAGS="$CFLAGS $SHLIB_CFLAGS";
152
+ psg_old_ldflags="$LDFLAGS";
153
+ LDFLAGS="$LDFLAGS $SHLIB_LDFLAGS";
154
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
155
+ $1
156
+
157
+ int
158
+ dummy(void)
159
+ {
160
+ $2
161
+ return 0;
162
+ }
163
+ ]])],
164
+ [psg_cv_flags_shlib="CFLAGS=$SHLIB_CFLAGS LDFLAGS=$SHLIB_LDFLAGS"],
165
+ [psg_cv_flags_shlib=no]
166
+ )
167
+ CFLAGS="$psg_old_cflags";
168
+ LDFLAGS="$psg_old_ldflags";
169
+ if test "$psg_cv_flags_shlib" != "no"; then
170
+ break;
171
+ fi
172
+ done
173
+ if test "$psg_cv_flags_shlib" != "no"; then
174
+ break;
175
+ fi
176
+ done
177
+ if test "$psg_cv_flags_shlib" = "no"; then
178
+ SHLIB_CFLAGS="";
179
+ SHLIB_LDFLAGS="";
180
+ fi
181
+ AC_SUBST([SHLIB_CFLAGS])
182
+ AC_SUBST([SHLIB_LDFLAGS])
183
+ AC_MSG_RESULT([$psg_cv_flags_shlib])
184
+ ])
185
+
186
+
187
+ # PSG_MODULE(subdir, [args, ...])
188
+ # -------------------------------
189
+ # Process the module.ac file in subdir. If the module.ac file defines a
190
+ # macro called subdir[]_INIT, call it with the arguments passed to
191
+ # PSG_MODULE().
192
+ AC_DEFUN([PSG_MODULE], [
193
+ m4_define([subdir], [$1])dnl
194
+ m4_include([$1/module.ac])dnl
195
+ m4_ifdef([$1][_INIT], [$1][_INIT($@)])dnl
196
+ m4_undefine([subdir])dnl
197
+ ])
198
+
199
+