acinclude.m4 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. dnl aclocal.m4
  2. dnl macros autoconf uses when building configure from configure.in
  3. dnl
  4. dnl
  5. dnl EGG_CHECK_CC()
  6. dnl
  7. AC_DEFUN([EGG_CHECK_CC],
  8. [
  9. if test "${cross_compiling-x}" = "x"
  10. then
  11. cat << 'EOF' >&2
  12. configure: error:
  13. This system does not appear to have a working C compiler.
  14. A working C compiler is required to compile Eggdrop.
  15. EOF
  16. exit 1
  17. fi
  18. if test -n "$GXX"; then
  19. CXXFLAGS="$CXXFLAGS -O3"
  20. fi
  21. ])
  22. dnl EGG_IPV6_OPTIONS()
  23. dnl
  24. AC_DEFUN([EGG_IPV6_OPTIONS],
  25. [
  26. AC_MSG_CHECKING(whether or not you disabled IPv6 support)
  27. AC_ARG_ENABLE(ipv6, [ --disable-ipv6 disable IPv6 support],
  28. [ ac_cv_dipv6="yes"
  29. AC_MSG_RESULT(yes)
  30. ],
  31. [ ac_cv_dipv6="no"
  32. if test "$egg_cv_ipv6_supported" = "no"; then
  33. ac_cv_dipv6="no"
  34. fi
  35. AC_MSG_RESULT($ac_cv_dipv6)
  36. ])
  37. if ! test "$EGG_CYGWIN" = "yes"; then
  38. if test "$ac_cv_dipv6" = "no"; then
  39. AC_DEFINE(USE_IPV6, 1, [Define if you want ipv6 support])
  40. fi
  41. fi
  42. ])
  43. dnl EGG_CHECK_SOCKLEN_T()
  44. dnl
  45. AC_DEFUN([EGG_CHECK_SOCKLEN_T],
  46. [
  47. AC_MSG_CHECKING(for socklen_t)
  48. AC_CACHE_VAL(egg_cv_socklen_t,[
  49. AC_TRY_RUN([
  50. #include <unistd.h>
  51. #include <sys/types.h>
  52. #include <sys/socket.h>
  53. #include <netinet/in.h>
  54. #include <arpa/inet.h>
  55. int main()
  56. {
  57. socklen_t test = sizeof(int);
  58. return 0;
  59. }
  60. ],
  61. egg_cv_socklen_t=yes, egg_cv_socklen_t=no, egg_cv_socklen_t=no)])
  62. if test "$egg_cv_socklen_t" = "yes"; then
  63. AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if you have support for socklen_t])
  64. AC_MSG_RESULT(yes)
  65. else
  66. AC_MSG_RESULT(no)
  67. fi
  68. ])
  69. dnl EGG_CHECK_CCPIPE()
  70. dnl
  71. dnl This function checks whether or not the compiler supports the `-pipe' flag,
  72. dnl which speeds up the compilation.
  73. dnl
  74. AC_DEFUN([EGG_CHECK_CCPIPE],
  75. [
  76. if test -n "$GXX" && test -z "$no_pipe"; then
  77. AC_CACHE_CHECK([whether the compiler understands -pipe], egg_cv_var_ccpipe, [
  78. ac_old_CXX="$CXX"
  79. CXX="$CXX -pipe"
  80. AC_COMPILE_IFELSE([[
  81. int main ()
  82. {
  83. return(0);
  84. }
  85. ]], [
  86. egg_cv_var_ccpipe="yes"
  87. ], [
  88. egg_cv_var_ccpipe="no"
  89. ])
  90. CXX="$ac_old_CXX"
  91. ])
  92. if test "$egg_cv_var_ccpipe" = "yes"; then
  93. CXX="$CXX -pipe"
  94. fi
  95. fi
  96. ])
  97. dnl EGG_CHECK_CCWALL()
  98. dnl
  99. dnl See if the compiler supports -Wall.
  100. dnl
  101. AC_DEFUN([EGG_CHECK_CCWALL],
  102. [
  103. if test -n "$GXX" && test -z "$no_wall"; then
  104. AC_CACHE_CHECK([whether the compiler understands -Wall], egg_cv_var_ccwall, [
  105. ac_old_CXXFLAGS="$CXXFLAGS"
  106. CXXFLAGS="$CXXFLAGS -Wall"
  107. AC_COMPILE_IFELSE([[
  108. int main ()
  109. {
  110. return(0);
  111. }
  112. ]], [
  113. egg_cv_var_ccwall="yes"
  114. ], [
  115. egg_cv_var_ccwall="no"
  116. ])
  117. CXXFLAGS="$ac_old_CXXFLAGS"
  118. ])
  119. if test "$egg_cv_var_ccwall" = "yes"; then
  120. CXXFLAGS="$CXXFLAGS -Wall"
  121. fi
  122. fi
  123. ])
  124. dnl EGG_CHECK_CCSTATIC()
  125. dnl
  126. dnl Checks whether the compiler supports the `-static' flag.
  127. AC_DEFUN([EGG_CHECK_CCSTATIC],
  128. [
  129. if test -z "$no_static"
  130. then
  131. if test -n "$GXX"
  132. then
  133. AC_CACHE_CHECK(whether the compiler understands -static, egg_cv_var_ccstatic, [dnl
  134. ac_old_CXX="$CXX"
  135. CXX="$CXX -static"
  136. AC_TRY_COMPILE(,, egg_cv_var_ccstatic="yes", egg_cv_var_ccstatic="no")
  137. CXX="$ac_old_CXX"
  138. ])
  139. if test "$egg_cv_var_ccstatic" = "yes"
  140. then
  141. CCDEBUG="$CXX"
  142. # CXX="$CXX -static"
  143. else
  144. cat << 'EOF' >&2
  145. configure: error:
  146. Your C compiler does not support -static.
  147. This compile flag is required for the botpack.
  148. EOF
  149. exit 1
  150. fi
  151. fi
  152. fi
  153. ])
  154. dnl EGG_PROG_HEAD_1()
  155. dnl
  156. AC_DEFUN([EGG_PROG_HEAD_1],
  157. [
  158. cat << 'EOF' > conftest.head
  159. a
  160. b
  161. c
  162. EOF
  163. for ac_prog in 'head -1' 'head -n 1' 'sed 1q';
  164. do
  165. AC_MSG_CHECKING([whether $ac_prog works])
  166. AC_CACHE_VAL(ac_cv_prog_HEAD_1,
  167. [ if test -n "$HEAD_1"
  168. then
  169. ac_cv_prog_HEAD_1="$HEAD_1" # Let the user override the test.
  170. else
  171. if test "`cat conftest.head | $ac_prog`" = "a";
  172. then
  173. AC_MSG_RESULT([yes])
  174. ac_cv_prog_HEAD_1=$ac_prog
  175. else
  176. AC_MSG_RESULT([no])
  177. fi
  178. fi])dnl
  179. test -n "$ac_cv_prog_HEAD_1" && break
  180. done
  181. if test "${ac_cv_prog_HEAD_1-x}" = "x"
  182. then
  183. cat << 'EOF' >&2
  184. configure: error:
  185. This system seems to lack a working 'head -1' or 'head -n 1' command.
  186. A working 'head -1' (or equivalent) command is required to compile Eggdrop.
  187. EOF
  188. exit 1
  189. fi
  190. rm -f conftest.head
  191. HEAD_1=$ac_cv_prog_HEAD_1
  192. AC_SUBST(HEAD_1)dnl
  193. ])
  194. dnl EGG_PROG_AWK()
  195. dnl
  196. AC_DEFUN([EGG_PROG_AWK],
  197. [
  198. # awk is needed for Tcl library and header checks, and eggdrop version subst
  199. AC_PROG_AWK
  200. if test "${AWK-x}" = "x"
  201. then
  202. cat << 'EOF' >&2
  203. configure: error:
  204. This system seems to lack a working 'awk' command.
  205. A working 'awk' command is required to compile Eggdrop.
  206. EOF
  207. exit 1
  208. fi
  209. ])
  210. dnl EGG_PROG_BASENAME()
  211. dnl
  212. AC_DEFUN([EGG_PROG_BASENAME],
  213. [
  214. # basename is needed for Tcl library and header checks
  215. AC_CHECK_PROG(BASENAME, basename, basename)
  216. if test "${BASENAME-x}" = "x"
  217. then
  218. cat << 'EOF' >&2
  219. configure: error:
  220. This system seems to lack a working 'basename' command.
  221. A working 'basename' command is required to compile Eggdrop.
  222. EOF
  223. exit 1
  224. fi
  225. ])
  226. dnl EGG_CHECK_OS()
  227. dnl
  228. dnl
  229. AC_DEFUN([EGG_CHECK_OS],
  230. [
  231. EGG_CYGWIN=no
  232. AC_CACHE_CHECK(system type, egg_cv_var_system_type, egg_cv_var_system_type=`$UNAME -s`)
  233. AC_CACHE_CHECK(system release, egg_cv_var_system_release, egg_cv_var_system_release=`$UNAME -r`)
  234. AC_CACHE_CHECK(system machine, egg_cv_var_system_machine, egg_cv_var_system_machine=`$UNAME -m`)
  235. BUILDOS="$egg_cv_var_system_type"
  236. BUILDARCH="$egg_cv_var_system_machine"
  237. case "$egg_cv_var_system_machine" in
  238. i*)
  239. CXX="$CXX -march=i486"
  240. BUILDARCH="i486"
  241. ;;
  242. *)
  243. ;;
  244. esac
  245. case "$egg_cv_var_system_type" in
  246. BSD/OS)
  247. ;;
  248. CYGWI*)
  249. AC_PROG_CC_WIN32
  250. CXX="$CXX $WIN32FLAGS"
  251. EGG_CYGWIN="yes"
  252. EGG_CYGWIN_BINMODE
  253. AC_DEFINE(CYGWIN_HACKS, 1, [Define if running under cygwin])
  254. AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Define if windows])
  255. ;;
  256. IRIX)
  257. ;;
  258. HP-UX)
  259. AC_DEFINE(MD32_XARRAY, 1, [Define under HPUX])
  260. ;;
  261. Ultrix)
  262. SHELL=/bin/sh5
  263. ;;
  264. SINIX*)
  265. ;;
  266. BeOS)
  267. ;;
  268. Linux)
  269. ;;
  270. Lynx)
  271. ;;
  272. QNX)
  273. ;;
  274. OSF1)
  275. case "`echo $egg_cv_var_system_release | cut -d . -f 1`" in
  276. V*)
  277. if test "$AWK" = "gawk"
  278. then
  279. AWK=awk
  280. fi
  281. ;;
  282. 1.0|1.1|1.2)
  283. AC_DEFINE(OSF1_HACKS, 1, [Define if running on OSF/1 platform])dnl
  284. ;;
  285. 1.*)
  286. AC_DEFINE(OSF1_HACKS, 1, [Define if running on OSF/1 platform])dnl
  287. ;;
  288. *)
  289. ;;
  290. esac
  291. AC_DEFINE(STOP_UAC, 1, [Define if running on OSF/1 platform])dnl
  292. AC_DEFINE(BROKEN_SNPRINTF, 1, [Define to use Eggdrop's snprintf functions without regard to HAVE_SNPRINTF])dnl
  293. ;;
  294. SunOS)
  295. SUNOS="yes"
  296. ;;
  297. *BSD)
  298. # FreeBSD/OpenBSD/NetBSD
  299. ;;
  300. *)
  301. AC_MSG_CHECKING(if system is Mach based)
  302. if test -r /mach
  303. then
  304. AC_MSG_RESULT(yes)
  305. AC_DEFINE(BORGCUBES, 1, [Define if running on NeXT Step])dnl
  306. else
  307. AC_MSG_RESULT(no)
  308. AC_MSG_CHECKING(if system is QNX)
  309. if test -r /cmds
  310. then
  311. AC_MSG_RESULT(yes)
  312. else
  313. AC_MSG_RESULT(no)
  314. AC_MSG_RESULT(Something unknown!)
  315. AC_MSG_RESULT([If you get dynamic modules to work, be sure to let the devel team know HOW :)])
  316. fi
  317. fi
  318. ;;
  319. esac
  320. AC_SUBST(BUILDOS)dnl
  321. AC_SUBST(BUILDARCH)dnl
  322. ])
  323. dnl EGG_CYGWIN_BINMODE
  324. dnl
  325. dnl Check for binmode.o on Cygwin.
  326. dnl
  327. AC_DEFUN([EGG_CYGWIN_BINMODE],
  328. [
  329. if test $EGG_CYGWIN = "yes"; then
  330. AC_MSG_CHECKING([for /usr/lib/binmode.o])
  331. if test -r /usr/lib/binmode.o; then
  332. AC_MSG_RESULT([yes])
  333. LIBS="$LIBS /usr/lib/binmode.o"
  334. else
  335. AC_MSG_RESULT([no])
  336. AC_MSG_WARN([Make sure the directory Eggdrop is installed into is mounted in binary mode.])
  337. fi
  338. fi
  339. ])
  340. dnl EGG_CHECK_LIBS()
  341. dnl
  342. AC_DEFUN([EGG_CHECK_LIBS],
  343. [
  344. AC_CHECK_LIB(socket, socket)
  345. # AC_CHECK_LIB(nsl, connect)
  346. # AC_CHECK_LIB(dl, dlopen)
  347. # AC_CHECK_LIB(nsl, gethostbyname)
  348. # AC_CHECK_LIB(dns, gethostbyname)
  349. # AC_CHECK_LIB(z, gzopen, ZLIB="-lz")
  350. # AC_CHECK_LIB(ssl, SSL_accept, SSL="-lssl -lcrypto", SSL="", -lcrypto)
  351. # AC_CHECK_LIB(ssl, SSL_accept, SSL="-lcrypto", SSL="", -lcrypto)
  352. # This is needed for Tcl libraries compiled with thread support
  353. # AC_CHECK_LIB(pthread, pthread_mutex_init, [dnl
  354. # ac_cv_lib_pthread_pthread_mutex_init=yes
  355. # ac_cv_lib_pthread="-lpthread"], [dnl
  356. # AC_CHECK_LIB(pthread, __pthread_mutex_init, [dnl
  357. # ac_cv_lib_pthread_pthread_mutex_init=yes
  358. # ac_cv_lib_pthread="-lpthread"], [dnl
  359. # AC_CHECK_LIB(pthreads, pthread_mutex_init, [dnl
  360. # ac_cv_lib_pthread_pthread_mutex_init=yes
  361. # ac_cv_lib_pthread="-lpthreads"], [dnl
  362. # AC_CHECK_FUNC(pthread_mutex_init, [dnl
  363. # ac_cv_lib_pthread_pthread_mutex_init=yes
  364. # ac_cv_lib_pthread=""],
  365. # ac_cv_lib_pthread_pthread_mutex_init=no)])])])
  366. if test "$SUNOS" = "yes"; then
  367. # For suns without yp
  368. AC_CHECK_LIB(dl, main)
  369. AC_CHECK_LIB(socket, main)
  370. AC_CHECK_LIB(nsl, main)
  371. fi
  372. ])
  373. dnl EGG_CHECK_FUNC_VSPRINTF()
  374. dnl
  375. AC_DEFUN([EGG_CHECK_FUNC_VSPRINTF],
  376. [
  377. AC_CHECK_FUNCS(vsprintf)
  378. if test "$ac_cv_func_vsprintf" = "no"
  379. then
  380. cat << 'EOF' >&2
  381. configure: error:
  382. Your system does not have the sprintf/vsprintf libraries.
  383. These are required to compile almost anything. Sorry.
  384. EOF
  385. exit 1
  386. fi
  387. ])
  388. dnl EGG_CHECK_FUNC_UNAME()
  389. dnl
  390. AC_DEFUN([EGG_CHECK_FUNC_UNAME],
  391. [
  392. AC_CHECK_FUNCS(uname)
  393. if test "$ac_cv_func_uname" = "no"
  394. then
  395. cat << 'EOF' >&2
  396. configure: error:
  397. Your system does not have the uname() function.
  398. This is required for the botpack.
  399. EOF
  400. exit 1
  401. fi
  402. ])
  403. dnl EGG_CHECK_ZLIB()
  404. dnl
  405. AC_DEFUN([EGG_CHECK_ZLIB],
  406. [
  407. if test "x${ZLIB}" = x; then
  408. cat >&2 <<EOF
  409. configure: error:
  410. Your system does not provide a working zlib compression library.
  411. It is required.
  412. EOF
  413. exit 1
  414. else
  415. if test "${ac_cv_header_zlib_h}" != yes; then
  416. cat >&2 <<EOF
  417. configure: error:
  418. Your system does not provide the necessary zlib header file.
  419. It is required.
  420. EOF
  421. exit 1
  422. fi
  423. fi
  424. ])
  425. dnl EGG_CHECK_SSL()
  426. dnl
  427. AC_DEFUN([EGG_CHECK_SSL],
  428. [
  429. if test "x${SSL}" = x; then
  430. cat >&2 <<EOF
  431. configure: error:
  432. Your system does not provide a working ssl library.
  433. It is required. Download openssl at www.openssl.org
  434. EOF
  435. exit 1
  436. else
  437. if test "${ac_cv_header_openssl_ssl_h}" != yes; then
  438. cat >&2 <<EOF
  439. configure: error:
  440. Your system does not provide the necessary ssl header file.
  441. It is required. Download openssl at www.openssl.org
  442. EOF
  443. exit 1
  444. fi
  445. fi
  446. ])
  447. dnl EGG_HEADER_STDC()
  448. dnl
  449. AC_DEFUN([EGG_HEADER_STDC],
  450. [
  451. if test "$ac_cv_header_stdc" = "no"
  452. then
  453. cat << 'EOF' >&2
  454. configure: error:
  455. Your system must support ANSI C Header files.
  456. These are required for the language support. Sorry.
  457. EOF
  458. exit 1
  459. fi
  460. ])
  461. dnl EGG_CACHE_UNSET(CACHE-ID)
  462. dnl
  463. dnl Unsets a certain cache item. Typically called before using
  464. dnl the AC_CACHE_*() macros.
  465. AC_DEFUN([EGG_CACHE_UNSET],
  466. [
  467. unset $1
  468. ])
  469. dnl EGG_SUBST_VERSION()
  470. dnl
  471. AC_DEFUN([EGG_SUBST_VERSION],
  472. [
  473. VERSION=`grep "char" $srcdir/src/main.c | $AWK '/egg_version/ {print [$]5}' | sed -e 's/\"//g' | sed -e 's/\;//g'`
  474. version_num=`echo $VERSION | $AWK 'BEGIN {FS = "."} {printf("%d%02d%02d", [$]1, [$]2, [$]3)}'`
  475. AC_DEFINE_UNQUOTED(EGG_VERSION, $version_num, [Defines the current pack version])dnl
  476. AC_SUBST(VERSION)dnl
  477. AC_SUBST(NUMVER)dnl
  478. ])
  479. dnl EGG_SUBST_MOD_UPDIR()
  480. dnl
  481. dnl Since module's Makefiles aren't generated by configure, some
  482. dnl paths in src/mod/Makefile.in take care of them. For correct
  483. dnl path "calculation", we need to keep absolute paths in mind
  484. dnl (which don't need a "../" pre-pended).
  485. AC_DEFUN([EGG_SUBST_MOD_UPDIR],
  486. [
  487. case "$srcdir" in
  488. [[\\/]]* | ?:[[\\/]]*)
  489. MOD_UPDIR=""
  490. ;;
  491. *)
  492. MOD_UPDIR="../"
  493. ;;
  494. esac
  495. AC_SUBST(MOD_UPDIR)dnl
  496. ])dnl
  497. dnl EGG_REPLACE_IF_CHANGED(FILE-NAME, CONTENTS-CMDS, INIT-CMDS)
  498. dnl
  499. dnl Replace FILE-NAME if the newly created contents differs from the existing
  500. dnl file contents. Otherwise, leave the file alone. This avoids needless
  501. dnl recompiles.
  502. m4_define(EGG_REPLACE_IF_CHANGED,
  503. [
  504. AC_CONFIG_COMMANDS([replace-if-changed],
  505. [[
  506. egg_replace_file="$1"
  507. $2
  508. if test -f "$egg_replace_file" && cmp -s conftest.out $egg_replace_file; then
  509. echo "$1 is unchanged"
  510. else
  511. echo "creating $1"
  512. mv conftest.out $egg_replace_file
  513. fi
  514. rm -f conftest.out
  515. ]],
  516. [[$3]])
  517. ])
  518. dnl EGG_SAVE_PARAMETERS()
  519. dnl
  520. AC_DEFUN([EGG_SAVE_PARAMETERS],
  521. [
  522. # Remove --cache-file and --srcdir arguments so they do not pile up.
  523. egg_ac_parameters=
  524. ac_prev=
  525. for ac_arg in $ac_configure_args; do
  526. if test -n "$ac_prev"; then
  527. ac_prev=
  528. continue
  529. fi
  530. case $ac_arg in
  531. -cache-file | --cache-file | --cache-fil | --cache-fi \
  532. | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  533. ac_prev=cache_file ;;
  534. -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  535. | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
  536. | --c=*)
  537. ;;
  538. --config-cache | -C)
  539. ;;
  540. -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  541. ac_prev=srcdir ;;
  542. -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  543. ;;
  544. *) egg_ac_parameters="$egg_ac_parameters $ac_arg" ;;
  545. esac
  546. done
  547. AC_SUBST(egg_ac_parameters)dnl
  548. ])
  549. AC_DEFUN([AC_PROG_CC_WIN32],
  550. [
  551. AC_MSG_CHECKING([how to access the Win32 API])
  552. WIN32FLAGS=
  553. AC_TRY_COMPILE(,[
  554. #ifndef WIN32
  555. # ifndef _WIN32
  556. # error WIN32 or _WIN32 not defined
  557. # endif
  558. #endif], [
  559. dnl found windows.h with the current config.
  560. AC_MSG_RESULT([present by default])
  561. ], [
  562. dnl try -mwin32
  563. ac_compile_save="$ac_compile"
  564. dnl we change CC so config.log looks correct
  565. save_CXX="$CXX"
  566. ac_compile="$ac_compile -mwin32"
  567. CXX="$CXX -mwin32"
  568. AC_TRY_COMPILE(,[
  569. #ifndef WIN32
  570. # ifndef _WIN32
  571. # error WIN32 or _WIN32 not defined
  572. # endif
  573. #endif], [
  574. dnl found windows.h using -mwin32
  575. AC_MSG_RESULT([found via -mwin32])
  576. ac_compile="$ac_compile_save"
  577. CXX="$save_CXX"
  578. WIN32FLAGS="-mwin32"
  579. ], [
  580. ac_compile="$ac_compile_save"
  581. CXX="$save_CXX"
  582. AC_MSG_RESULT([not found])
  583. ])
  584. ])
  585. ])
  586. AC_DEFUN([EGG_CHECK_RANDOM_MAX],
  587. [
  588. AC_MSG_CHECKING([for random limit])
  589. case "$egg_cv_var_system_type" in
  590. SunOS) RMAX=0x7FFFFFFF
  591. ;;
  592. *) RMAX=RAND_MAX
  593. ;;
  594. esac
  595. AC_MSG_RESULT([$RMAX])
  596. AC_DEFINE_UNQUOTED(RANDOM_MAX, $RMAX, [Define limit of random() function.])
  597. ])