aclocal.m4 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. dnl aclocal.m4 generated automatically by aclocal 1.4
  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. # Do all the work for Automake. This macro actually does too much --
  128. # some checks are only needed if your package does certain things.
  129. # But this isn't really a big deal.
  130. # serial 1
  131. dnl Usage:
  132. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  133. AC_DEFUN(AM_INIT_AUTOMAKE,
  134. [AC_REQUIRE([AC_PROG_INSTALL])
  135. PACKAGE=[$1]
  136. AC_SUBST(PACKAGE)
  137. VERSION=[$2]
  138. AC_SUBST(VERSION)
  139. dnl test to see if srcdir already configured
  140. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  141. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  142. fi
  143. ifelse([$3],,
  144. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  145. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  146. AC_REQUIRE([AM_SANITY_CHECK])
  147. AC_REQUIRE([AC_ARG_PROGRAM])
  148. dnl FIXME This is truly gross.
  149. missing_dir=`cd $ac_aux_dir && pwd`
  150. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  151. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  152. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  153. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  154. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  155. AC_REQUIRE([AC_PROG_MAKE_SET])])
  156. #
  157. # Check to make sure that the build environment is sane.
  158. #
  159. AC_DEFUN(AM_SANITY_CHECK,
  160. [AC_MSG_CHECKING([whether build environment is sane])
  161. # Just in case
  162. sleep 1
  163. echo timestamp > conftestfile
  164. # Do `set' in a subshell so we don't clobber the current shell's
  165. # arguments. Must try -L first in case configure is actually a
  166. # symlink; some systems play weird games with the mod time of symlinks
  167. # (eg FreeBSD returns the mod time of the symlink's containing
  168. # directory).
  169. if (
  170. set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  171. if test "[$]*" = "X"; then
  172. # -L didn't work.
  173. set X `ls -t $srcdir/configure conftestfile`
  174. fi
  175. if test "[$]*" != "X $srcdir/configure conftestfile" \
  176. && test "[$]*" != "X conftestfile $srcdir/configure"; then
  177. # If neither matched, then we have a broken ls. This can happen
  178. # if, for instance, CONFIG_SHELL is bash and it inherits a
  179. # broken ls alias from the environment. This has actually
  180. # happened. Such a system could not be considered "sane".
  181. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  182. alias in your environment])
  183. fi
  184. test "[$]2" = conftestfile
  185. )
  186. then
  187. # Ok.
  188. :
  189. else
  190. AC_MSG_ERROR([newly created file is older than distributed files!
  191. Check your system clock])
  192. fi
  193. rm -f conftest*
  194. AC_MSG_RESULT(yes)])
  195. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  196. dnl The program must properly implement --version.
  197. AC_DEFUN(AM_MISSING_PROG,
  198. [AC_MSG_CHECKING(for working $2)
  199. # Run test in a subshell; some versions of sh will print an error if
  200. # an executable is not found, even if stderr is redirected.
  201. # Redirect stdin to placate older versions of autoconf. Sigh.
  202. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  203. $1=$2
  204. AC_MSG_RESULT(found)
  205. else
  206. $1="$3/missing $2"
  207. AC_MSG_RESULT(missing)
  208. fi
  209. AC_SUBST($1)])
  210. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  211. AC_DEFUN(AM_CONFIG_HEADER,
  212. [AC_PREREQ([2.12])
  213. AC_CONFIG_HEADER([$1])
  214. dnl When config.status generates a header, we must update the stamp-h file.
  215. dnl This file resides in the same directory as the config header
  216. dnl that is generated. We must strip everything past the first ":",
  217. dnl and everything past the last "/".
  218. AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  219. ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
  220. <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
  221. <<am_indx=1
  222. for am_file in <<$1>>; do
  223. case " <<$>>CONFIG_HEADERS " in
  224. *" <<$>>am_file "*<<)>>
  225. echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
  226. ;;
  227. esac
  228. am_indx=`expr "<<$>>am_indx" + 1`
  229. done<<>>dnl>>)
  230. changequote([,]))])
  231. # Define a conditional.
  232. AC_DEFUN(AM_CONDITIONAL,
  233. [AC_SUBST($1_TRUE)
  234. AC_SUBST($1_FALSE)
  235. if $2; then
  236. $1_TRUE=
  237. $1_FALSE='#'
  238. else
  239. $1_TRUE='#'
  240. $1_FALSE=
  241. fi])