acinclude.m4 14 KB

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