PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/boa-0.94.14rc21/aclocal.m4

#
m4 | 203 lines | 176 code | 17 blank | 10 comment | 0 complexity | e9c6e6017740fe9dd9d5bbb36f8c4b97 MD5 | raw file
Possible License(s): GPL-2.0
  1. # aclocal.m4 generated automatically by aclocal 1.6.2 -*- Autoconf -*-
  2. # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
  3. # Free Software Foundation, Inc.
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  9. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  10. # PARTICULAR PURPOSE.
  11. dnl Many of the following macros courtesy of:
  12. dnl http://www.gnu.org/software/ac-archive/
  13. dnl
  14. dnl The Following macros courtesy of:
  15. dnl Installed_Packages/check_gnu_make.html
  16. dnl
  17. dnl Copyrights are by the individual authors, as listed.
  18. dnl License: GPL
  19. dnl
  20. dnl CHECK_GNU_MAKE()
  21. dnl
  22. dnl This macro searches for a GNU version of make. If a match is found, the
  23. dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
  24. dnl set to "#". This is useful for including a special features in a Makefile,
  25. dnl which cannot be handled by other versions of make. The variable
  26. dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
  27. dnl the empty string otherwise.
  28. dnl
  29. dnl Here is an example of its use:
  30. dnl
  31. dnl Makefile.in might contain:
  32. dnl
  33. dnl # A failsafe way of putting a dependency rule into a makefile
  34. dnl $(DEPEND):
  35. dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
  36. dnl
  37. dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
  38. dnl @ifGNUmake@ include $(DEPEND)
  39. dnl @ifGNUmake@ endif
  40. dnl
  41. dnl Then configure.in would normally contain:
  42. dnl
  43. dnl CHECK_GNU_MAKE()
  44. dnl AC_OUTPUT(Makefile)
  45. dnl
  46. dnl Then perhaps to cause gnu make to override any other make, we could do
  47. dnl something like this (note that GNU make always looks for GNUmakefile first):
  48. dnl
  49. dnl if ! test x$_cv_gnu_make_command = x ; then
  50. dnl mv Makefile GNUmakefile
  51. dnl echo .DEFAULT: > Makefile ;
  52. dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
  53. dnl fi
  54. dnl
  55. dnl Then, if any (well almost any) other make is called, and GNU make also exists,
  56. dnl then the other make wraps the GNU make.
  57. dnl
  58. dnl John Darrington <j.darrington@elvis.murdoch.edu.au>
  59. dnl 1.3 (2002/01/04)
  60. dnl
  61. dnl Modified 18 Sep 2002 by Jon Nelson <jnelson@boa.org>
  62. AC_DEFUN([CHECK_GNU_MAKE],
  63. [ AC_CACHE_CHECK( for GNU make, _cv_gnu_make_command,
  64. [_cv_gnu_make_command=''
  65. dnl Search all the common names for GNU make
  66. for a in "$MAKE" make gmake gnumake ; do
  67. if test -z "$a" ; then continue ; fi
  68. if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ); then
  69. _cv_gnu_make_command=$a
  70. break;
  71. fi
  72. done
  73. if test "x$_cv_gnu_make_command" = "x"; then
  74. _cv_gnu_make_command="Not found"
  75. fi
  76. ])
  77. dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
  78. if test "$_cv_gnu_make_command" != "Not found"; then
  79. ifGNUmake='';
  80. else
  81. ifGNUmake='#';
  82. _cv_gnu_make_command='';
  83. fi
  84. AC_SUBST(ifGNUmake)
  85. ])
  86. dnl AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
  87. dnl 1.1 (2000/09/19)
  88. dnl Wes Hardaker <wjhardaker@ucdavis.edu>
  89. dnl ----------------------------------------------------------
  90. AC_DEFUN([AC_CHECK_STRUCT_FOR],[
  91. ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
  92. ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
  93. ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
  94. changequote(, )dnl
  95. ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  96. changequote([, ])dnl
  97. AC_MSG_CHECKING([for $2.$3])
  98. AC_CACHE_VAL($ac_safe_all,
  99. [
  100. if test "x$4" = "x"; then
  101. defineit="= 0"
  102. elif test "x$4" = "xno"; then
  103. defineit=""
  104. else
  105. defineit="$4"
  106. fi
  107. AC_TRY_COMPILE([
  108. $1
  109. ],[
  110. struct $2 testit;
  111. testit.$3 $defineit;
  112. ], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
  113. ])
  114. if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
  115. AC_MSG_RESULT(yes)
  116. AC_DEFINE_UNQUOTED($ac_uc_define)
  117. else
  118. AC_MSG_RESULT(no)
  119. fi
  120. ])
  121. dnl @synopsis AC_C_VAR_FUNC
  122. dnl
  123. dnl This macro tests if the C complier supports the C9X standard
  124. dnl __func__ indentifier.
  125. dnl
  126. dnl The new C9X standard for the C language stipulates that the
  127. dnl identifier __func__ shall be implictly declared by the compiler
  128. dnl as if, immediately following the opening brace of each function
  129. dnl definition, the declaration
  130. dnl
  131. dnl static const char __func__[] = "function-name";
  132. dnl
  133. dnl appeared, where function-name is the name of the function where
  134. dnl the __func__ identifier is used.
  135. dnl
  136. dnl @version $Id: aclocal.m4,v 1.1.2.5 2003/01/20 20:53:52 jnelson Exp $
  137. dnl @author Christopher Currie <christopher@currie.com>
  138. AC_DEFUN([AC_C_VAR_FUNC],
  139. [AC_REQUIRE([AC_PROG_CC])
  140. AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func,
  141. AC_TRY_COMPILE(,
  142. [int main() {
  143. char *s = __func__;
  144. }],
  145. AC_DEFINE(HAVE_FUNC,,
  146. [Define if the C complier supports __func__]) ac_cv_c_var_func=yes,
  147. ac_cv_c_var_func=no) )
  148. ])dnl
  149. dnl Exports one of ac_cv_func_poll or ac_cv_func_select
  150. dnl Author - Jon Nelson <jnelson@boa.org>
  151. dnl Copyright 2002
  152. AC_DEFUN([POLL_OR_SELECT],
  153. [
  154. AC_MSG_CHECKING(whether to use poll or select)
  155. AC_ARG_WITH(poll,
  156. [ --with-poll Use poll],
  157. [
  158. if test "$withval" = "yes" ; then
  159. AC_MSG_RESULT(trying poll)
  160. ac_x=1
  161. else
  162. AC_MSG_RESULT(trying select)
  163. ac_x=0
  164. fi
  165. ],
  166. [
  167. AC_MSG_RESULT(trying select)
  168. ac_x=0
  169. ])
  170. if test $ac_x = 1; then
  171. AC_CHECK_HEADERS(sys/poll.h)
  172. AC_CHECK_FUNCS(poll)
  173. if test "x$ac_cv_func_poll" = "x"; then
  174. AC_MSG_ERROR(We attempted to find poll but could not. Please try again with --without-poll)
  175. fi
  176. BOA_ASYNC_IO="poll"
  177. else
  178. AC_CHECK_HEADERS(sys/select.h)
  179. AC_CHECK_FUNCS(select)
  180. if test "x$ac_cv_func_select" = "x"; then
  181. AC_MSG_ERROR(We attempted to find select but could not. Please try again with --with-poll)
  182. fi
  183. BOA_ASYNC_IO="select"
  184. fi
  185. ]
  186. )