ctags.rb 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. data/Gemfile +2 -0
  2. data/Rakefile +23 -0
  3. data/ctags.rb.gemspec +23 -0
  4. data/ext/.gitignore +3 -0
  5. data/ext/extconf.rb +15 -0
  6. data/ext/vendor/exuberant-ctags/.gitignore +6 -0
  7. data/ext/vendor/exuberant-ctags/.indent.pro +31 -0
  8. data/ext/vendor/exuberant-ctags/COPYING +340 -0
  9. data/ext/vendor/exuberant-ctags/EXTENDING.html +386 -0
  10. data/ext/vendor/exuberant-ctags/FAQ +371 -0
  11. data/ext/vendor/exuberant-ctags/INSTALL +215 -0
  12. data/ext/vendor/exuberant-ctags/INSTALL.oth +73 -0
  13. data/ext/vendor/exuberant-ctags/MAINTAINERS +88 -0
  14. data/ext/vendor/exuberant-ctags/Makefile.in +222 -0
  15. data/ext/vendor/exuberant-ctags/NEWS +871 -0
  16. data/ext/vendor/exuberant-ctags/README +73 -0
  17. data/ext/vendor/exuberant-ctags/ant.c +42 -0
  18. data/ext/vendor/exuberant-ctags/argproc.c +505 -0
  19. data/ext/vendor/exuberant-ctags/args.c +274 -0
  20. data/ext/vendor/exuberant-ctags/args.h +63 -0
  21. data/ext/vendor/exuberant-ctags/asm.c +387 -0
  22. data/ext/vendor/exuberant-ctags/asp.c +328 -0
  23. data/ext/vendor/exuberant-ctags/awk.c +81 -0
  24. data/ext/vendor/exuberant-ctags/basic.c +203 -0
  25. data/ext/vendor/exuberant-ctags/beta.c +321 -0
  26. data/ext/vendor/exuberant-ctags/c.c +2932 -0
  27. data/ext/vendor/exuberant-ctags/cobol.c +50 -0
  28. data/ext/vendor/exuberant-ctags/config.h.in +277 -0
  29. data/ext/vendor/exuberant-ctags/configure +7704 -0
  30. data/ext/vendor/exuberant-ctags/configure.ac +532 -0
  31. data/ext/vendor/exuberant-ctags/ctags.1 +1186 -0
  32. data/ext/vendor/exuberant-ctags/ctags.h +28 -0
  33. data/ext/vendor/exuberant-ctags/ctags.html +2087 -0
  34. data/ext/vendor/exuberant-ctags/ctags.spec +40 -0
  35. data/ext/vendor/exuberant-ctags/debug.c +113 -0
  36. data/ext/vendor/exuberant-ctags/debug.h +70 -0
  37. data/ext/vendor/exuberant-ctags/descrip.mms +68 -0
  38. data/ext/vendor/exuberant-ctags/dosbatch.c +42 -0
  39. data/ext/vendor/exuberant-ctags/e_amiga.h +24 -0
  40. data/ext/vendor/exuberant-ctags/e_djgpp.h +47 -0
  41. data/ext/vendor/exuberant-ctags/e_mac.h +143 -0
  42. data/ext/vendor/exuberant-ctags/e_msoft.h +76 -0
  43. data/ext/vendor/exuberant-ctags/e_os2.h +37 -0
  44. data/ext/vendor/exuberant-ctags/e_qdos.h +34 -0
  45. data/ext/vendor/exuberant-ctags/e_riscos.h +58 -0
  46. data/ext/vendor/exuberant-ctags/e_vms.h +31 -0
  47. data/ext/vendor/exuberant-ctags/eiffel.c +1352 -0
  48. data/ext/vendor/exuberant-ctags/entry.c +847 -0
  49. data/ext/vendor/exuberant-ctags/entry.h +103 -0
  50. data/ext/vendor/exuberant-ctags/erlang.c +189 -0
  51. data/ext/vendor/exuberant-ctags/flex.c +2243 -0
  52. data/ext/vendor/exuberant-ctags/fortran.c +2197 -0
  53. data/ext/vendor/exuberant-ctags/general.h +127 -0
  54. data/ext/vendor/exuberant-ctags/get.c +669 -0
  55. data/ext/vendor/exuberant-ctags/get.h +50 -0
  56. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/all-wcprops +47 -0
  57. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/entries +112 -0
  58. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/README.txt.svn-base +5 -0
  59. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regcomp.c.svn-base +3818 -0
  60. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.c.svn-base +74 -0
  61. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.h.svn-base +575 -0
  62. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.c.svn-base +1713 -0
  63. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.h.svn-base +773 -0
  64. data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regexec.c.svn-base +4338 -0
  65. data/ext/vendor/exuberant-ctags/gnu_regex/README.txt +5 -0
  66. data/ext/vendor/exuberant-ctags/gnu_regex/regcomp.c +3818 -0
  67. data/ext/vendor/exuberant-ctags/gnu_regex/regex.c +74 -0
  68. data/ext/vendor/exuberant-ctags/gnu_regex/regex.h +575 -0
  69. data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.c +1713 -0
  70. data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.h +773 -0
  71. data/ext/vendor/exuberant-ctags/gnu_regex/regexec.c +4338 -0
  72. data/ext/vendor/exuberant-ctags/html.c +49 -0
  73. data/ext/vendor/exuberant-ctags/jscript.c +1572 -0
  74. data/ext/vendor/exuberant-ctags/keyword.c +258 -0
  75. data/ext/vendor/exuberant-ctags/keyword.h +34 -0
  76. data/ext/vendor/exuberant-ctags/lisp.c +139 -0
  77. data/ext/vendor/exuberant-ctags/lregex.c +704 -0
  78. data/ext/vendor/exuberant-ctags/lua.c +133 -0
  79. data/ext/vendor/exuberant-ctags/mac.c +273 -0
  80. data/ext/vendor/exuberant-ctags/magic.diff +21 -0
  81. data/ext/vendor/exuberant-ctags/main.c +584 -0
  82. data/ext/vendor/exuberant-ctags/main.h +32 -0
  83. data/ext/vendor/exuberant-ctags/maintainer.mak +476 -0
  84. data/ext/vendor/exuberant-ctags/make.c +217 -0
  85. data/ext/vendor/exuberant-ctags/matlab.c +44 -0
  86. data/ext/vendor/exuberant-ctags/mk_bc3.mak +46 -0
  87. data/ext/vendor/exuberant-ctags/mk_bc5.mak +49 -0
  88. data/ext/vendor/exuberant-ctags/mk_djg.mak +18 -0
  89. data/ext/vendor/exuberant-ctags/mk_manx.mak +65 -0
  90. data/ext/vendor/exuberant-ctags/mk_mingw.mak +31 -0
  91. data/ext/vendor/exuberant-ctags/mk_mpw.mak +130 -0
  92. data/ext/vendor/exuberant-ctags/mk_mvc.mak +40 -0
  93. data/ext/vendor/exuberant-ctags/mk_os2.mak +104 -0
  94. data/ext/vendor/exuberant-ctags/mk_qdos.mak +100 -0
  95. data/ext/vendor/exuberant-ctags/mk_sas.mak +63 -0
  96. data/ext/vendor/exuberant-ctags/mkinstalldirs +40 -0
  97. data/ext/vendor/exuberant-ctags/ocaml.c +1842 -0
  98. data/ext/vendor/exuberant-ctags/options.c +1842 -0
  99. data/ext/vendor/exuberant-ctags/options.h +155 -0
  100. data/ext/vendor/exuberant-ctags/parse.c +677 -0
  101. data/ext/vendor/exuberant-ctags/parse.h +129 -0
  102. data/ext/vendor/exuberant-ctags/parsers.h +63 -0
  103. data/ext/vendor/exuberant-ctags/pascal.c +267 -0
  104. data/ext/vendor/exuberant-ctags/perl.c +382 -0
  105. data/ext/vendor/exuberant-ctags/php.c +237 -0
  106. data/ext/vendor/exuberant-ctags/python.c +771 -0
  107. data/ext/vendor/exuberant-ctags/qdos.c +106 -0
  108. data/ext/vendor/exuberant-ctags/read.c +569 -0
  109. data/ext/vendor/exuberant-ctags/read.h +116 -0
  110. data/ext/vendor/exuberant-ctags/readtags.c +959 -0
  111. data/ext/vendor/exuberant-ctags/readtags.h +252 -0
  112. data/ext/vendor/exuberant-ctags/rexx.c +39 -0
  113. data/ext/vendor/exuberant-ctags/routines.c +891 -0
  114. data/ext/vendor/exuberant-ctags/routines.h +134 -0
  115. data/ext/vendor/exuberant-ctags/ruby.c +408 -0
  116. data/ext/vendor/exuberant-ctags/scheme.c +111 -0
  117. data/ext/vendor/exuberant-ctags/sh.c +115 -0
  118. data/ext/vendor/exuberant-ctags/slang.c +41 -0
  119. data/ext/vendor/exuberant-ctags/sml.c +212 -0
  120. data/ext/vendor/exuberant-ctags/sort.c +230 -0
  121. data/ext/vendor/exuberant-ctags/sort.h +32 -0
  122. data/ext/vendor/exuberant-ctags/source.mak +122 -0
  123. data/ext/vendor/exuberant-ctags/sql.c +2112 -0
  124. data/ext/vendor/exuberant-ctags/strlist.c +281 -0
  125. data/ext/vendor/exuberant-ctags/strlist.h +54 -0
  126. data/ext/vendor/exuberant-ctags/tcl.c +116 -0
  127. data/ext/vendor/exuberant-ctags/tex.c +524 -0
  128. data/ext/vendor/exuberant-ctags/verilog.c +340 -0
  129. data/ext/vendor/exuberant-ctags/vhdl.c +835 -0
  130. data/ext/vendor/exuberant-ctags/vim.c +636 -0
  131. data/ext/vendor/exuberant-ctags/vstring.c +232 -0
  132. data/ext/vendor/exuberant-ctags/vstring.h +85 -0
  133. data/ext/vendor/exuberant-ctags/yacc.c +40 -0
  134. data/lib/ctags/exuberant.rb +45 -0
  135. data/lib/ctags/version.rb +3 -0
  136. data/lib/ctags.rb +6 -0
  137. data/test/test_ctags.rb +24 -0
  138. metadata +233 -0
@@ -0,0 +1,532 @@
1
+ # $Id$
2
+
3
+ # Copyright (c) 2009, Darren Hiebert
4
+ #
5
+ # This source code is released for free distribution under the terms
6
+ # of the GNU General Public License.
7
+
8
+ # Process this file with autoconf to produce a configure script.
9
+
10
+ AC_PREREQ([2.61])
11
+ AC_INIT([ctags.h])
12
+ AC_CONFIG_HEADERS([config.h])
13
+
14
+ AH_TEMPLATE([PACKAGE], [Package name.])
15
+ AH_TEMPLATE([VERSION], [Package version.])
16
+ AH_TEMPLATE([clock_t],
17
+ [Define to the appropriate type if <time.h> does not define this.])
18
+ AH_TEMPLATE([fpos_t],
19
+ [Define to long if <stdio.h> does not define this.])
20
+ AH_TEMPLATE([L_tmpnam],
21
+ [Define to the appropriate size for tmpnam() if <stdio.h> does not define
22
+ this.])
23
+ AH_TEMPLATE([HAVE_STAT_ST_INO],
24
+ [Define this macro if the field "st_ino" exists in struct stat in
25
+ <sys/stat.h>.])
26
+ AH_TEMPLATE([remove],
27
+ [Define remove to unlink if you have unlink(), but not remove().])
28
+ AH_TEMPLATE([SEEK_SET],
29
+ [Define this value used by fseek() appropriately if <stdio.h>
30
+ (or <unistd.h> on SunOS 4.1.x) does not define them.])
31
+ AH_TEMPLATE([INT_MAX],
32
+ [Define as the maximum integer on your system if not defined <limits.h>.])
33
+ AH_TEMPLATE([CUSTOM_CONFIGURATION_FILE],
34
+ [You can define this label to be a string containing the name of a
35
+ site-specific configuration file containing site-wide default options. The
36
+ files /etc/ctags.conf and /usr/local/etc/ctags.conf are already checked,
37
+ so only define one here if you need a file somewhere else.])
38
+ AH_TEMPLATE([MACROS_USE_PATTERNS],
39
+ [Define this label if you want macro tags (defined lables) to use patterns
40
+ in the EX command by default (original ctags behavior is to use line
41
+ numbers).])
42
+ AH_VERBATIM([DEFAULT_FILE_FORMAT], [
43
+ /* Define this as desired.
44
+ * 1: Original ctags format
45
+ * 2: Extended ctags format with extension flags in EX-style comment.
46
+ */
47
+ #define DEFAULT_FILE_FORMAT 2
48
+ ])
49
+ AH_TEMPLATE([SYS_INTERPRETER],
50
+ [Define this label if your system supports starting scripts with a line of
51
+ the form "#! /bin/sh" to select the interpreter to use for the script.])
52
+ AH_TEMPLATE([CASE_INSENSITIVE_FILENAMES],
53
+ [Define this label if your system uses case-insensitive file names])
54
+ AH_VERBATIM([EXTERNAL_SORT], [
55
+ /* Define this label to use the system sort utility (which is probably more
56
+ * efficient) over the internal sorting algorithm.
57
+ */
58
+ #ifndef INTERNAL_SORT
59
+ # undef EXTERNAL_SORT
60
+ #endif
61
+ ])
62
+ AH_TEMPLATE([TMPDIR],
63
+ [If you wish to change the directory in which temporary files are stored,
64
+ define this label to the directory desired.])
65
+ AH_TEMPLATE([REGCOMP_BROKEN],
66
+ [Define this label if regcomp() is broken.])
67
+ AH_TEMPLATE([CHECK_REGCOMP],
68
+ [Define this label if you wish to check the regcomp() function at run time
69
+ for correct behavior. This function is currently broken on Cygwin.])
70
+ AH_TEMPLATE([__USE_FIXED_PROTOTYPES__],
71
+ [This corrects the problem of missing prototypes for certain functions
72
+ in some GNU installations (e.g. SunOS 4.1.x).])
73
+ AH_TEMPLATE([NON_CONST_PUTENV_PROTOTYPE],
74
+ [Define this is you have a prototype for putenv() in <stdlib.h>, but
75
+ doesn't declare its argument as "const char *".])
76
+ AH_TEMPLATE([NEED_PROTO_REMOVE],
77
+ [If you receive error or warning messages indicating that you are missing
78
+ a prototype for, or a type mismatch using, the following function, define
79
+ this label and remake.])
80
+ AH_TEMPLATE([NEED_PROTO_UNLINK],
81
+ [If you receive error or warning messages indicating that you are missing
82
+ a prototype for, or a type mismatch using, the following function, define
83
+ this label and remake.])
84
+ AH_TEMPLATE([NEED_PROTO_MALLOC],
85
+ [If you receive error or warning messages indicating that you are missing
86
+ a prototype for, or a type mismatch using, the following function, define
87
+ this label and remake.])
88
+ AH_TEMPLATE([NEED_PROTO_GETENV],
89
+ [If you receive error or warning messages indicating that you are missing
90
+ a prototype for, or a type mismatch using, the following function, define
91
+ this label and remake.])
92
+ AH_TEMPLATE([NEED_PROTO_FGETPOS],
93
+ [If you receive error or warning messages indicating that you are missing
94
+ a prototype for, or a type mismatch using, the following function, define
95
+ this label and remake.])
96
+ AH_TEMPLATE([NEED_PROTO_STAT],
97
+ [If you receive error or warning messages indicating that you are missing
98
+ a prototype for, or a type mismatch using, the following function, define
99
+ this label and remake.])
100
+ AH_TEMPLATE([NEED_PROTO_LSTAT],
101
+ [If you receive error or warning messages indicating that you are missing
102
+ a prototype for, or a type mismatch using, the following function, define
103
+ this label and remake.])
104
+ AH_TEMPLATE([NEED_PROTO_TRUNCATE],
105
+ [If you receive error or warning messages indicating that you are missing
106
+ a prototype for, or a type mismatch using, the following function, define
107
+ this label and remake.])
108
+ AH_TEMPLATE([NEED_PROTO_FTRUNCATE],
109
+ [If you receive error or warning messages indicating that you are missing
110
+ a prototype for, or a type mismatch using, the following function, define
111
+ this label and remake.])
112
+
113
+
114
+
115
+ # Report system info
116
+ # ------------------
117
+ program_name=[`grep 'PROGRAM_NAME *"' ctags.h | sed -e 's/.*"\([^"]*\)".*/\1/'`]
118
+ program_version=[`grep 'PROGRAM_VERSION *"' ctags.h | sed -e 's/.*"\([^"]*\)".*/\1/'`]
119
+ echo "$program_name, version $program_version"
120
+ uname -mrsv 2>/dev/null
121
+
122
+ # Define convenience macros
123
+ # -------------------------
124
+ # CHECK_HEADER_DEFINE(LABEL, HEADER [,ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ] ])
125
+ AC_DEFUN([CHECK_HEADER_DEFINE], [
126
+ AC_MSG_CHECKING([if $1 is defined in $2])
127
+ AC_EGREP_CPP(yes,
128
+ [#include <$2>
129
+ #ifdef $1
130
+ yes
131
+ #endif
132
+ ], [
133
+ AC_MSG_RESULT(yes)
134
+ [$3]
135
+ ], [
136
+ AC_MSG_RESULT(no)
137
+ [$4]
138
+ ]) ])
139
+
140
+ # Checks for configuration options
141
+ # --------------------------------
142
+
143
+ AC_ARG_WITH(posix-regex,
144
+ [ --with-posix-regex use Posix regex interface, if available])
145
+
146
+ AC_ARG_WITH(readlib,
147
+ [ --with-readlib include readtags library object during install])
148
+
149
+ # AC_ARG_WITH(perl-regex,
150
+ # [ --with-perl-regex use Perl pcre interface, if available])
151
+
152
+ AC_ARG_ENABLE(etags,
153
+ [ --enable-etags enable the installation of links for etags])
154
+
155
+ AC_ARG_ENABLE(extended-format,
156
+ [ --disable-extended-format
157
+ disable extension flags; use original ctags file
158
+ format only],
159
+ AC_DEFINE(DEFAULT_FILE_FORMAT, 1), AC_DEFINE(DEFAULT_FILE_FORMAT, 2))
160
+
161
+ AC_ARG_ENABLE(external-sort,
162
+ [ --disable-external-sort use internal sort algorithm instead of sort program])
163
+
164
+ AC_ARG_ENABLE(custom-config,
165
+ [ --enable-custom-config=FILE
166
+ enable custom config file for site-wide defaults])
167
+
168
+ AC_ARG_ENABLE(macro-patterns,
169
+ [ --enable-macro-patterns use patterns as default method to locate macros
170
+ instead of line numbers])
171
+
172
+ AC_ARG_ENABLE(maintainer-mode,
173
+ [ --enable-maintainer-mode
174
+ use maintainer makefile])
175
+
176
+ AC_ARG_ENABLE(shell-globbing,
177
+ [ --enable-shell-globbing=DIR
178
+ does shell expand wildcards (yes|no)? [yes]])
179
+
180
+ AC_ARG_ENABLE(tmpdir,
181
+ [ --enable-tmpdir=DIR default directory for temporary files [ARG=/tmp]],
182
+ tmpdir_specified=yes)
183
+
184
+
185
+ # Process configuration options
186
+ # -----------------------------
187
+
188
+ if test "$enable_maintainer_mode" = yes ; then
189
+ AC_MSG_RESULT(enabling maintainer mode)
190
+ fi
191
+
192
+ install_targets="install-ctags"
193
+ AC_MSG_CHECKING(whether to install link to etags)
194
+ if test yes = "$enable_etags"; then
195
+ AC_MSG_RESULT(yes)
196
+ install_targets="$install_targets install-etags"
197
+ else
198
+ AC_MSG_RESULT(no)
199
+ fi
200
+ AC_MSG_CHECKING(whether to install readtags object file)
201
+ if test yes = "$with_readlib"; then
202
+ AC_MSG_RESULT(yes)
203
+ install_targets="$install_targets install-lib"
204
+ else
205
+ AC_MSG_RESULT(no)
206
+ fi
207
+ AC_SUBST(install_targets)
208
+
209
+ if test "$enable_custom_config" = no -o "$enable_custom_config" = yes ; then
210
+ AC_MSG_RESULT(no name supplied for custom configuration file)
211
+ elif test -n "$enable_custom_config" ; then
212
+ AC_DEFINE_UNQUOTED(CUSTOM_CONFIGURATION_FILE, "$enable_custom_config")
213
+ AC_MSG_RESULT($enable_custom_config will be used as custom configuration file)
214
+ fi
215
+
216
+ if test "$enable_macro_patterns" = yes ; then
217
+ AC_DEFINE(MACROS_USE_PATTERNS)
218
+ AC_MSG_RESULT(tag file will use patterns for macros by default)
219
+ fi
220
+
221
+ # Checks for programs
222
+ # -------------------
223
+
224
+ AC_PROG_CC
225
+
226
+ case `uname` in
227
+ HP-UX)
228
+ AC_MSG_CHECKING(HP-UX native compiler)
229
+ if test "$CC" = "cc"; then
230
+ AC_MSG_RESULT(yes; adding compiler options for ANSI support)
231
+ CFLAGS="$CFLAGS -Aa -D_HPUX_SOURCE"
232
+ else
233
+ AC_MSG_RESULT(no)
234
+ fi
235
+ ;;
236
+ SunOS)
237
+ if uname -r | grep '5\.' >/dev/null 2>&1; then
238
+ AC_MSG_CHECKING(Solaris native compiler)
239
+ if test "$CC" = "cc" -a "`which cc`" = "/usr/ucb/cc"; then
240
+ AC_MSG_RESULT(yes; adding compiler option for ANSI support)
241
+ CC="$CC -Xa"
242
+ else
243
+ AC_MSG_RESULT(no)
244
+ fi
245
+ fi
246
+ ;;
247
+ esac
248
+
249
+ AC_PROG_LN_S
250
+ AC_CHECK_PROG(STRIP, strip, strip, :)
251
+
252
+
253
+ # Checks for operating environment
254
+ # --------------------------------
255
+
256
+ # Check for temporary directory
257
+ AC_MSG_CHECKING(directory to use for temporary files)
258
+ if test -n "$enable_tmpdir"; then
259
+ tmpdir="$enable_tmpdir"
260
+ elif test -n "$TMPDIR"; then
261
+ tmpdir="$TMPDIR"
262
+ elif test -n "$TMPDIR"; then
263
+ tmpdir="$TMPDIR"
264
+ elif test -n "$TMP"; then
265
+ tmpdir="$TMP"
266
+ elif test -n "$TEMP"; then
267
+ tmpdir="$TEMP"
268
+ elif test -d "c:/"; then
269
+ tmpdir="c:/"
270
+ else
271
+ tmpdir="/tmp"
272
+ fi
273
+ if test -d $tmpdir ; then
274
+ AC_MSG_RESULT($tmpdir)
275
+ AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir")
276
+ else
277
+ AC_MSG_ERROR($tmpdir does not exist)
278
+ fi
279
+
280
+ # Check whether system supports #! scripts
281
+ AC_SYS_INTERPRETER
282
+ if test yes = "$interpval"; then
283
+ AC_DEFINE(SYS_INTERPRETER)
284
+ fi
285
+
286
+ # Test for case-insensitive filenames
287
+ AC_MSG_CHECKING(for case-insensitive filenames)
288
+ touch conftest.cif
289
+ if test -f CONFTEST.CIF; then
290
+ AC_MSG_RESULT(yes)
291
+ AC_DEFINE(CASE_INSENSITIVE_FILENAMES)
292
+ else
293
+ AC_MSG_RESULT(no)
294
+ fi
295
+ rm -f conftest.cif
296
+
297
+ AC_MSG_CHECKING(selected sort method)
298
+ if test no = "$enable_external_sort"; then
299
+ AC_MSG_RESULT(simple internal algorithm)
300
+ else
301
+ AC_MSG_RESULT(external sort utility)
302
+ enable_external_sort=no
303
+ AC_CHECK_PROG(sort_found, sort, yes, no)
304
+ if test "$sort_found" = yes ; then
305
+ AC_MSG_CHECKING(if sort accepts our command line)
306
+ touch ${tmpdir}/sort.test
307
+ sort -u -f -o ${tmpdir}/sort.test ${tmpdir}/sort.test 1>/dev/null 2>&1
308
+ if test $? -ne 0 ; then
309
+ AC_MSG_RESULT(no)
310
+ else
311
+ AC_MSG_RESULT(yes)
312
+ AC_DEFINE(EXTERNAL_SORT)
313
+ enable_external_sort=yes
314
+ fi
315
+ rm -f ${tmpdir}/sort.test
316
+ fi
317
+ fi
318
+ if test "$enable_external_sort" != yes ; then
319
+ AC_MSG_RESULT(using internal sort algorithm as fallback)
320
+ fi
321
+
322
+
323
+ # Checks for header files
324
+ # -----------------------
325
+
326
+ AC_CHECK_HEADERS_ONCE([dirent.h fcntl.h fnmatch.h stat.h stdlib.h string.h])
327
+ AC_CHECK_HEADERS_ONCE([time.h types.h unistd.h])
328
+ AC_CHECK_HEADERS_ONCE([sys/dir.h sys/stat.h sys/times.h sys/types.h])
329
+
330
+
331
+ # Checks for header file macros
332
+ # -----------------------------
333
+
334
+ CHECK_HEADER_DEFINE(L_tmpnam, [stdio.h],, AC_DEFINE(L_tmpnam, 20))
335
+
336
+ CHECK_HEADER_DEFINE(INT_MAX, [limits.h],,
337
+ CHECK_HEADER_DEFINE(MAXINT, [limits.h],
338
+ AC_DEFINE(INT_MAX, MAXINT), AC_DEFINE(INT_MAX, 32767)))
339
+
340
+
341
+ # Checks for typedefs
342
+ # -------------------
343
+
344
+ AC_TYPE_SIZE_T
345
+ AC_TYPE_OFF_T
346
+
347
+ AC_MSG_CHECKING(for fpos_t)
348
+ AC_EGREP_HEADER(fpos_t, stdio.h, AC_MSG_RESULT(yes),
349
+ [
350
+ AC_MSG_RESULT(no)
351
+ AC_DEFINE(fpos_t, long)
352
+ ])
353
+
354
+ AC_MSG_CHECKING(for clock_t)
355
+ AC_EGREP_HEADER(clock_t, time.h, AC_MSG_RESULT(yes),
356
+ [
357
+ AC_MSG_RESULT(no)
358
+ AC_DEFINE(clock_t, long)
359
+ ])
360
+
361
+
362
+ # Checks for compiler characteristics
363
+ # -----------------------------------
364
+
365
+ # AC_CYGWIN
366
+ # AC_MINGW32
367
+ AC_C_CONST
368
+ AC_OBJEXT
369
+ AC_EXEEXT
370
+
371
+ AC_MSG_CHECKING(if struct stat contains st_ino)
372
+ AC_TRY_COMPILE([#include <sys/stat.h>], [
373
+ struct stat st;
374
+ stat(".", &st);
375
+ if (st.st_ino > 0)
376
+ exit(0);
377
+ ], have_st_ino=yes, have_st_ino=no)
378
+ AC_MSG_RESULT($have_st_ino)
379
+ if test yes = "$have_st_ino"; then
380
+ AC_DEFINE(HAVE_STAT_ST_INO)
381
+ fi
382
+
383
+
384
+ # Checks for library functions
385
+ # ----------------------------
386
+
387
+ AC_CHECK_FUNCS(fnmatch)
388
+ AC_CHECK_FUNCS(strstr)
389
+ AC_CHECK_FUNCS(strcasecmp stricmp, break)
390
+ AC_CHECK_FUNCS(strncasecmp strnicmp, break)
391
+ AC_CHECK_FUNCS(fgetpos, have_fgetpos=yes)
392
+
393
+ # SEEK_SET should be in stdio.h, but may be in unistd.h on SunOS 4.1.x
394
+ if test "$have_fgetpos" != yes ; then
395
+ CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,,
396
+ CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,,
397
+ AC_DEFINE(SEEK_SET, 0)))
398
+ fi
399
+
400
+ AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes)
401
+ if test "$have_mkstemp" != yes ; then
402
+ AC_CHECK_FUNCS(tempnam, have_tempnam=yes)
403
+ fi
404
+ if test "$have_mkstemp" != yes -a "$have_tempnam" != yes; then
405
+ AC_CHECK_FUNCS(chmod)
406
+ if test "$tmpdir_specified" = yes ; then
407
+ AC_MSG_RESULT(use of tmpnam overrides temporary directory selection)
408
+ fi
409
+ fi
410
+
411
+ AC_CHECK_FUNCS(opendir findfirst _findfirst, break)
412
+ AC_CHECK_FUNCS(strerror)
413
+ AC_CHECK_FUNCS(clock times, break)
414
+ AC_CHECK_FUNCS(remove, have_remove=yes,
415
+ CHECK_HEADER_DEFINE(remove, unistd.h,, AC_DEFINE(remove, unlink)))
416
+
417
+ AC_CHECK_FUNCS(truncate, have_truncate=yes)
418
+ # === Cannot nest AC_CHECK_FUNCS() calls
419
+ if test "$have_truncate" != yes ; then
420
+ AC_CHECK_FUNCS(ftruncate, have_ftruncate=yes)
421
+ if test "$have_ftruncate" != yes ; then
422
+ AC_CHECK_FUNCS(chsize)
423
+ fi
424
+ fi
425
+
426
+ AC_CHECK_FUNCS(setenv, have_setenv=yes)
427
+ # === Cannot nest AC_CHECK_FUNCS() calls
428
+ if test "$have_setenv" != yes ; then
429
+ AC_CHECK_FUNCS(putenv, have_putenv=yes)
430
+ if test "$have_putenv" = yes ; then
431
+ AC_EGREP_HEADER(putenv, stdlib.h, have_putenv_prototype=yes)
432
+ if test "$have_putenv_prototype" = yes ; then
433
+ AC_MSG_CHECKING(putenv prototype)
434
+ AC_EGREP_HEADER([[^A-Za-zo-9_]putenv[ ]*\(.*const.*\)[ ]*;],
435
+ stdlib.h, AC_MSG_RESULT(correct),
436
+ [
437
+ AC_MSG_RESULT(no const)
438
+ AC_DEFINE(NON_CONST_PUTENV_PROTOTYPE)
439
+ ])
440
+ fi
441
+ fi
442
+ fi
443
+
444
+ #
445
+ # if test yes = "$CYGWIN"; then with_posix_regex=no; fi
446
+ if test no != "$with_posix_regex"; then
447
+ AC_CHECK_FUNCS(regcomp)
448
+ AC_MSG_CHECKING(if regcomp works)
449
+ AC_TRY_RUN([
450
+ #include <sys/types.h>
451
+ #include <regex.h>
452
+ main() {
453
+ regex_t patbuf;
454
+ exit (regcomp (&patbuf, "/hello/", 0) != 0);
455
+ }],regcomp_works=yes,regcomp_works=no,AC_DEFINE(CHECK_REGCOMP))
456
+ AC_MSG_RESULT($regcomp_works)
457
+ if test yes != "$regcomp_works"; then
458
+ AC_DEFINE(REGCOMP_BROKEN)
459
+ fi
460
+ fi
461
+
462
+ # if test yes = "$with_perl_regex"; then
463
+ # AC_MSG_CHECKING(for Perl regex library)
464
+ # pcre_candidates="$with_perl_regex $HOME/local/lib* /usr*/local/lib* /usr/lib*"
465
+ # for lib in $pcre_candidates; do
466
+ # if test -f $lib/libpcreposix.so; then
467
+ # pcre_lib="-L$lib -lpcreposix"
468
+ # break
469
+ # elif test -f $lib/libpcreposix.a; then
470
+ # pcre_lib="$lib/libpcreposix.a"
471
+ # break
472
+ # fi
473
+ # done
474
+ # if test -z "$pcre_lib"; then
475
+ # AC_MSG_RESULT(not found)
476
+ # else
477
+ # AC_MSG_RESULT($lib)
478
+ # AC_DEFINE(HAVE_REGCOMP)
479
+ # LDFLAGS="$LDFLAGS $pcre_lib"
480
+ # have_regex=yes
481
+ # fi
482
+ # fi
483
+
484
+
485
+ # Checks for missing prototypes
486
+ # -----------------------------
487
+ AC_CHECKING(for new missing prototypes)
488
+
489
+ AC_DEFUN(CHECK_PROTO, [
490
+ AC_EGREP_HEADER([[^A-Za-z0-9_]$1([ ]+[A-Za-z0-9_]*)?[ ]*\(],
491
+ $2,
492
+ ,
493
+ [
494
+ AC_MSG_RESULT([adding prototype for $1])
495
+ AC_DEFINE(patsubst([NEED_PROTO_NAME], [NAME], translit([$1], [[a-z]], [[A-Z]])))
496
+ ])])
497
+
498
+ if test "$have_remove" = yes ; then
499
+ CHECK_PROTO(remove, stdio.h)
500
+ else
501
+ CHECK_PROTO(unlink, unistd.h)
502
+ fi
503
+ CHECK_PROTO(malloc, stdlib.h)
504
+ CHECK_PROTO(getenv, stdlib.h)
505
+ CHECK_PROTO(stat, sys/stat.h)
506
+ CHECK_PROTO(lstat, sys/stat.h)
507
+ if test "$have_fgetpos" = yes ; then
508
+ CHECK_PROTO(fgetpos, stdio.h)
509
+ fi
510
+ if test "$have_truncate" = yes ; then
511
+ CHECK_PROTO(truncate, unistd.h)
512
+ fi
513
+ if test "$have_ftruncate" = yes ; then
514
+ CHECK_PROTO(ftruncate, unistd.h)
515
+ fi
516
+
517
+
518
+ # Output files
519
+ # ------------
520
+
521
+
522
+ rm -f Makefile
523
+ if test "$enable_maintainer_mode" = yes ; then
524
+ AC_MSG_RESULT(creating maintainer Makefile)
525
+ ln -s maintainer.mak Makefile
526
+ makefile_out=
527
+ else
528
+ makefile_out=Makefile
529
+ fi
530
+ AC_OUTPUT($makefile_out)
531
+
532
+ # vim:ts=4:sw=4: