aclocal.m4 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. dnl aclocal.m4 generated automatically by aclocal 1.4-p4
  2. dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. dnl This program is distributed in the hope that it will be useful,
  7. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. dnl PARTICULAR PURPOSE.
  10. dnl cloned from autoconf 2.13 acspecific.m4
  11. AC_DEFUN(AC_C_LONG_LONG,
  12. [AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
  13. [if test "$GCC" = yes; then
  14. ac_cv_c_long_long=yes
  15. else
  16. AC_TRY_RUN([int main() {
  17. long long foo = 0;
  18. exit(sizeof(long long) < sizeof(long)); }],
  19. ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
  20. fi])
  21. if test $ac_cv_c_long_long = yes; then
  22. AC_DEFINE(HAVE_LONG_LONG)
  23. fi
  24. ])
  25. dnl from autoconf 2.13 acgeneral.m4, with patch:
  26. dnl Date: Fri, 15 Jan 1999 05:52:41 -0800
  27. dnl Message-ID: <199901151352.FAA18237@shade.twinsun.com>
  28. dnl From: eggert@twinsun.com (Paul Eggert)
  29. dnl Subject: autoconf 2.13 AC_CHECK_TYPE doesn't allow shell vars
  30. dnl Newsgroups: gnu.utils.bug
  31. dnl from autoconf 2.13 acspecific.m4, with changes to check for daylight
  32. AC_DEFUN(AC_STRUCT_TIMEZONE_DAYLIGHT,
  33. [AC_REQUIRE([AC_STRUCT_TM])dnl
  34. AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
  35. [AC_TRY_COMPILE([#include <sys/types.h>
  36. #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
  37. ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
  38. if test "$ac_cv_struct_tm_zone" = yes; then
  39. AC_DEFINE(HAVE_TM_ZONE)
  40. fi
  41. AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
  42. [AC_TRY_LINK(
  43. changequote(<<, >>)dnl
  44. <<#include <time.h>
  45. #ifndef tzname /* For SGI. */
  46. extern char *tzname[]; /* RS6000 and others reject char **tzname. */
  47. #endif>>,
  48. changequote([, ])dnl
  49. [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
  50. if test $ac_cv_var_tzname = yes; then
  51. AC_DEFINE(HAVE_TZNAME)
  52. fi
  53. AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst,
  54. [AC_TRY_COMPILE([#include <sys/types.h>
  55. #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_isdst;],
  56. ac_cv_struct_tm_isdst=yes, ac_cv_struct_tm_isdst=no)])
  57. if test "$ac_cv_struct_tm_isdst" = yes; then
  58. AC_DEFINE(HAVE_TM_ISDST)
  59. fi
  60. AC_CACHE_CHECK(for daylight, ac_cv_var_daylight,
  61. [AC_TRY_LINK(
  62. changequote(<<, >>)dnl
  63. <<#include <time.h>
  64. #ifndef daylight /* In case IRIX #defines this, too */
  65. extern int daylight;
  66. #endif>>,
  67. changequote([, ])dnl
  68. [atoi(daylight);], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)])
  69. if test $ac_cv_var_daylight = yes; then
  70. AC_DEFINE(HAVE_DAYLIGHT)
  71. fi
  72. ])
  73. dnl AC_CHECK_TYPE2(TYPE, DEFAULT)
  74. AC_DEFUN(AC_CHECK_TYPE2,
  75. [AC_REQUIRE([AC_HEADER_STDC])dnl
  76. AC_MSG_CHECKING(for $1)
  77. AC_CACHE_VAL(ac_cv_type_$1,
  78. [AC_EGREP_CPP(dnl
  79. changequote(<<,>>)dnl
  80. <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
  81. changequote([,]), [#include <sys/types.h>
  82. #if STDC_HEADERS
  83. #include <stdlib.h>
  84. #include <stddef.h>
  85. #endif], eval "ac_cv_type_$1=yes", eval "ac_cv_type_$1=no")])dnl
  86. if eval "test \"`echo '$ac_cv_type_'$1`\" = yes"; then
  87. AC_MSG_RESULT(yes)
  88. else
  89. AC_MSG_RESULT(no)
  90. AC_DEFINE_UNQUOTED($1, $2)
  91. fi
  92. ])
  93. dnl from autoconf 2.13 acgeneral.m4, with additional third argument
  94. dnl AC_CHECK_SIZEOF_INCLUDES(TYPE [, CROSS-SIZE, [INCLUDES]])
  95. AC_DEFUN(AC_CHECK_SIZEOF_INCLUDES,
  96. [changequote(<<, >>)dnl
  97. dnl The name to #define.
  98. define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  99. dnl The cache variable name.
  100. define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  101. changequote([, ])dnl
  102. AC_MSG_CHECKING(size of $1)
  103. AC_CACHE_VAL(AC_CV_NAME,
  104. [AC_TRY_RUN([$3
  105. #include <stdio.h>
  106. main()
  107. {
  108. FILE *f=fopen("conftestval", "w");
  109. if (!f) exit(1);
  110. fprintf(f, "%d\n", sizeof($1));
  111. exit(0);
  112. }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
  113. AC_MSG_RESULT($AC_CV_NAME)
  114. AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
  115. undefine([AC_TYPE_NAME])dnl
  116. undefine([AC_CV_NAME])dnl
  117. ])
  118. dnl AC_CHECK_SIZEOF_STDC_HEADERS(TYPE [, CROSS_SIZE])
  119. AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS,
  120. [AC_CHECK_SIZEOF_INCLUDES($1, $2,
  121. [#include <sys/types.h>
  122. #ifdef STDC_HEADERS
  123. #include <stdlib.h>
  124. #endif
  125. ])
  126. ])
  127. #serial 19
  128. dnl By default, many hosts won't let programs access large files;
  129. dnl one must use special compiler options to get large-file access to work.
  130. dnl For more details about this brain damage please see:
  131. dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
  132. dnl Written by Paul Eggert <eggert@twinsun.com>.
  133. dnl Internal subroutine of AC_SYS_LARGEFILE.
  134. dnl AC_SYS_LARGEFILE_TEST_INCLUDES
  135. AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
  136. [[#include <sys/types.h>
  137. /* Check that off_t can represent 2**63 - 1 correctly.
  138. We can't simply "#define LARGE_OFF_T 9223372036854775807",
  139. since some C++ compilers masquerading as C compilers
  140. incorrectly reject 9223372036854775807. */
  141. # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  142. int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
  143. && LARGE_OFF_T % 2147483647 == 1)
  144. ? 1 : -1];
  145. ]])
  146. dnl Internal subroutine of AC_SYS_LARGEFILE.
  147. dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
  148. AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
  149. [AC_CACHE_CHECK([for $1 value needed for large files], $3,
  150. [$3=no
  151. AC_TRY_COMPILE([$5],
  152. [$6],
  153. ,
  154. [AC_TRY_COMPILE([#define $1 $2]
  155. [$5]
  156. ,
  157. [$6],
  158. [$3=$2])])])
  159. if test "[$]$3" != no; then
  160. AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
  161. fi])
  162. AC_DEFUN(AC_SYS_LARGEFILE,
  163. [AC_REQUIRE([AC_PROG_CC])
  164. AC_ARG_ENABLE(largefile,
  165. [ --disable-largefile omit support for large files])
  166. if test "$enable_largefile" != no; then
  167. AC_CACHE_CHECK([for special C compiler options needed for large files],
  168. ac_cv_sys_largefile_CC,
  169. [ac_cv_sys_largefile_CC=no
  170. if test "$GCC" != yes; then
  171. # IRIX 6.2 and later do not support large files by default,
  172. # so use the C compiler's -n32 option if that helps.
  173. AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
  174. [ac_save_CC="$CC"
  175. CC="$CC -n32"
  176. AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
  177. ac_cv_sys_largefile_CC=' -n32')
  178. CC="$ac_save_CC"])
  179. fi])
  180. if test "$ac_cv_sys_largefile_CC" != no; then
  181. CC="$CC$ac_cv_sys_largefile_CC"
  182. fi
  183. AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
  184. ac_cv_sys_file_offset_bits,
  185. [Number of bits in a file offset, on hosts where this is settable.],
  186. AC_SYS_LARGEFILE_TEST_INCLUDES)
  187. AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
  188. ac_cv_sys_large_files,
  189. [Define for large files, on AIX-style hosts.],
  190. AC_SYS_LARGEFILE_TEST_INCLUDES)
  191. fi
  192. ])
  193. AC_DEFUN(AC_FUNC_FSEEKO,
  194. [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
  195. ac_cv_sys_largefile_source,
  196. [Define to make fseeko visible on some hosts (e.g. glibc 2.2).],
  197. [#include <stdio.h>], [return !fseeko;])
  198. # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
  199. # in glibc 2.1.3, but that breaks too many other things.
  200. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
  201. AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko,
  202. [ac_cv_func_fseeko=no
  203. AC_TRY_LINK([#include <stdio.h>],
  204. [return fseeko && fseeko (stdin, 0, 0);],
  205. [ac_cv_func_fseeko=yes])])
  206. if test $ac_cv_func_fseeko != no; then
  207. AC_DEFINE(HAVE_FSEEKO, 1,
  208. [Define if fseeko (and presumably ftello) exists and is declared.])
  209. fi])
  210. # Do all the work for Automake. This macro actually does too much --
  211. # some checks are only needed if your package does certain things.
  212. # But this isn't really a big deal.
  213. # serial 1
  214. dnl Usage:
  215. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  216. AC_DEFUN(AM_INIT_AUTOMAKE,
  217. [AC_REQUIRE([AC_PROG_INSTALL])
  218. PACKAGE=[$1]
  219. AC_SUBST(PACKAGE)
  220. VERSION=[$2]
  221. AC_SUBST(VERSION)
  222. dnl test to see if srcdir already configured
  223. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  224. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  225. fi
  226. ifelse([$3],,
  227. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  228. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  229. AC_REQUIRE([AM_SANITY_CHECK])
  230. AC_REQUIRE([AC_ARG_PROGRAM])
  231. dnl FIXME This is truly gross.
  232. missing_dir=`cd $ac_aux_dir && pwd`
  233. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  234. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  235. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  236. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  237. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  238. AC_REQUIRE([AC_PROG_MAKE_SET])])
  239. #
  240. # Check to make sure that the build environment is sane.
  241. #
  242. AC_DEFUN(AM_SANITY_CHECK,
  243. [AC_MSG_CHECKING([whether build environment is sane])
  244. # Just in case
  245. sleep 1
  246. echo timestamp > conftestfile
  247. # Do `set' in a subshell so we don't clobber the current shell's
  248. # arguments. Must try -L first in case configure is actually a
  249. # symlink; some systems play weird games with the mod time of symlinks
  250. # (eg FreeBSD returns the mod time of the symlink's containing
  251. # directory).
  252. if (
  253. set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  254. if test "[$]*" = "X"; then
  255. # -L didn't work.
  256. set X `ls -t $srcdir/configure conftestfile`
  257. fi
  258. if test "[$]*" != "X $srcdir/configure conftestfile" \
  259. && test "[$]*" != "X conftestfile $srcdir/configure"; then
  260. # If neither matched, then we have a broken ls. This can happen
  261. # if, for instance, CONFIG_SHELL is bash and it inherits a
  262. # broken ls alias from the environment. This has actually
  263. # happened. Such a system could not be considered "sane".
  264. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  265. alias in your environment])
  266. fi
  267. test "[$]2" = conftestfile
  268. )
  269. then
  270. # Ok.
  271. :
  272. else
  273. AC_MSG_ERROR([newly created file is older than distributed files!
  274. Check your system clock])
  275. fi
  276. rm -f conftest*
  277. AC_MSG_RESULT(yes)])
  278. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  279. dnl The program must properly implement --version.
  280. AC_DEFUN(AM_MISSING_PROG,
  281. [AC_MSG_CHECKING(for working $2)
  282. # Run test in a subshell; some versions of sh will print an error if
  283. # an executable is not found, even if stderr is redirected.
  284. # Redirect stdin to placate older versions of autoconf. Sigh.
  285. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  286. $1=$2
  287. AC_MSG_RESULT(found)
  288. else
  289. $1="$3/missing $2"
  290. AC_MSG_RESULT(missing)
  291. fi
  292. AC_SUBST($1)])
  293. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  294. AC_DEFUN(AM_CONFIG_HEADER,
  295. [AC_PREREQ([2.12])
  296. AC_CONFIG_HEADER([$1])
  297. dnl When config.status generates a header, we must update the stamp-h file.
  298. dnl This file resides in the same directory as the config header
  299. dnl that is generated. We must strip everything past the first ":",
  300. dnl and everything past the last "/".
  301. AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  302. ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
  303. <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
  304. <<am_indx=1
  305. for am_file in <<$1>>; do
  306. case " <<$>>CONFIG_HEADERS " in
  307. *" <<$>>am_file "*<<)>>
  308. echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
  309. ;;
  310. esac
  311. am_indx=`expr "<<$>>am_indx" + 1`
  312. done<<>>dnl>>)
  313. changequote([,]))])
  314. # Define a conditional.
  315. AC_DEFUN(AM_CONDITIONAL,
  316. [AC_SUBST($1_TRUE)
  317. AC_SUBST($1_FALSE)
  318. if $2; then
  319. $1_TRUE=
  320. $1_FALSE='#'
  321. else
  322. $1_TRUE='#'
  323. $1_FALSE=
  324. fi])