configure.in 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_INIT(eAthena)
  4. AC_REVISION($Revision$)
  5. AC_PREREQ([2.59])
  6. AC_CONFIG_SRCDIR([src/common/cbasetypes.h])
  7. AC_CONFIG_FILES([Makefile src/common/Makefile])
  8. AC_CONFIG_FILES([src/char/Makefile src/login/Makefile])
  9. AC_CONFIG_FILES([src/char_sql/Makefile src/txt-converter/Makefile])
  10. AC_CONFIG_FILES([src/map/Makefile src/plugins/Makefile src/tool/Makefile])
  11. #
  12. # Memory managers
  13. #
  14. AC_ARG_ENABLE(
  15. [manager],
  16. AC_HELP_STRING(
  17. [--enable-manager=ARG],
  18. [memory managers: no, builtin, memwatch, dmalloc, gcollect, bcheck (defaults to builtin)]
  19. ),
  20. [
  21. enable_manager="$enableval"
  22. case $enableval in
  23. "no");;
  24. "builtin");;
  25. "memwatch");;
  26. "dmalloc");;
  27. "gcollect");;
  28. "bcheck");;
  29. *) AC_MSG_ERROR([[unknown memory manager '$enableval'... stopping]]);;
  30. esac
  31. ],
  32. [enable_manager="builtin"]
  33. )
  34. #
  35. # packetver
  36. #
  37. AC_ARG_ENABLE(
  38. [packetver],
  39. AC_HELP_STRING(
  40. [--enable-packetver=ARG],
  41. [Sets the PACKETVER define of the map-server. (see src/map/clif.h)]
  42. ),
  43. [enable_packetver="$enableval"],
  44. [enable_packetver=""]
  45. )
  46. #
  47. # debug
  48. #
  49. AC_ARG_ENABLE(
  50. [debug],
  51. AC_HELP_STRING(
  52. [--enable-debug@<:@=ARG@:>@],
  53. [
  54. Compiles extra debug code. (disabled by default)
  55. (available options: yes, no, gdb)
  56. ]
  57. ),
  58. [
  59. enable_debug="$enableval"
  60. case $enableval in
  61. "no");;
  62. "yes");;
  63. "gdb");;
  64. *) AC_MSG_ERROR([[invalid argument --enable-debug=$enableval... stopping]]);;
  65. esac
  66. ],
  67. [enable_debug="no"]
  68. )
  69. #
  70. # RDTSC as Tick Source
  71. #
  72. AC_ARG_ENABLE(
  73. [rdtsc],
  74. AC_HELP_STRING(
  75. [--enable-rdtsc],
  76. [
  77. Uses rdtsc as timing source (disabled by default)
  78. Enable it when you've timing issues.
  79. (For example: in conjunction with XEN or Other Virtualization mechanisms)
  80. Note:
  81. Please ensure that you've disabled dynamic CPU-Frequencys, such as power saving options.
  82. (On the most modern Dedicated Servers cpufreq is preconfigured, see your distribution's manual
  83. how to disable it)
  84. ]
  85. ),
  86. [
  87. enable_rdtsc=1
  88. ],
  89. [enable_rdtsc=0]
  90. )
  91. #
  92. # Profiler
  93. #
  94. AC_ARG_ENABLE(
  95. [profiler],
  96. AC_HELP_STRING(
  97. [--enable-profiler=ARG],
  98. [Profilers: no, gprof (disabled by default)]
  99. ),
  100. [
  101. enable_profiler="$enableval"
  102. case $enableval in
  103. "no");;
  104. "gprof");;
  105. *) AC_MSG_ERROR([[invalid argument --enable-profiler=$enableval... stopping]]);;
  106. esac
  107. ],
  108. [enable_profiler="no"]
  109. )
  110. #
  111. # 64bit
  112. #
  113. AC_ARG_ENABLE(
  114. [64bit],
  115. AC_HELP_STRING(
  116. [--enable-64bit],
  117. [
  118. Don't force 32 bit. (disabled by default)
  119. 64bit support is still being tested, not recommended for production servers.
  120. ]
  121. ),
  122. [
  123. enable_64bit="$enableval"
  124. case $enableval in
  125. "no");;
  126. "yes");;
  127. *) AC_MSG_ERROR([[invalid argument --enable-64bit=$enableval... stopping]]);;
  128. esac
  129. ],
  130. [enable_64bit="no"]
  131. )
  132. #
  133. # Enable/disable MySql and optionally specify the path to mysql_config (optional library)
  134. #
  135. AC_ARG_WITH(
  136. [mysql],
  137. AC_HELP_STRING(
  138. [--with-mysql@<:@=ARG@:>@],
  139. [use MySQL client library, optionally specify the path to the mysql_config executable (by default mysql is used if found)]
  140. ),
  141. [
  142. if test "$withval" = "no" ; then
  143. want_mysql="no"
  144. else
  145. want_mysql="yes"
  146. require_mysql="yes"
  147. if test "$withval" != "yes" ; then
  148. if test ! -x "$withval" ; then
  149. AC_MSG_ERROR([$withval is not an executable file])
  150. fi
  151. MYSQL_CONFIG_HOME="$withval"
  152. fi
  153. fi
  154. ],
  155. [want_mysql="yes" require_mysql="no"]
  156. )
  157. #
  158. # Manual MYSQL_CFLAGS (optional)
  159. #
  160. AC_ARG_WITH(
  161. [MYSQL_CFLAGS],
  162. AC_HELP_STRING(
  163. [--with-MYSQL_CFLAGS=ARG],
  164. [specify MYSQL_CFLAGS manually (instead of using "mysql_config --include")]
  165. ),
  166. [
  167. manual_MYSQL_CFLAGS="yes"
  168. MYSQL_CFLAGS="$withval"
  169. ],
  170. [manual_MYSQL_CFLAGS="no"]
  171. )
  172. #
  173. # Manual MYSQL_LIBS (optional)
  174. #
  175. AC_ARG_WITH(
  176. [MYSQL_LIBS],
  177. AC_HELP_STRING(
  178. [--with-MYSQL_LIBS=ARG],
  179. [specify MYSQL_LIBS manually (instead of using "mysql_config --libs")]
  180. ),
  181. [
  182. manual_MYSQL_LIBS="yes"
  183. MYSQL_LIBS="$withval"
  184. ],
  185. [manual_MYSQL_LIBS="no"]
  186. )
  187. #
  188. # Enable/disable PCRE and optionally specify the path (optional library)
  189. #
  190. AC_ARG_WITH(
  191. [pcre],
  192. AC_HELP_STRING(
  193. [--with-pcre@<:@=ARG@:>@],
  194. [use PCRE library, optionally specify the full path of pcre installation directory (by default pcre is used if found)]
  195. ),
  196. [
  197. if test "$withval" = "no" ; then
  198. want_pcre="no"
  199. else
  200. want_pcre="yes"
  201. require_pcre="yes"
  202. if test "$withval" != "yes" ; then
  203. if test ! -d "$withval" ; then
  204. AC_MSG_ERROR([$withval is not a directoy])
  205. fi
  206. PCRE_HOME="$withval"
  207. fi
  208. fi
  209. ],
  210. [want_pcre="yes" require_pcre="no"]
  211. )
  212. #
  213. # Specify the path of the zlib library (required library)
  214. #
  215. AC_ARG_WITH(
  216. [zlib],
  217. AC_HELP_STRING(
  218. [--with-zlib=DIR],
  219. [root directory path of zlib installation (defaults to /usr/local or /usr if not found in /usr/local).
  220. Assumes that the header files are in DIR/include and the library files are in DIR/lib]
  221. ),
  222. [
  223. test -n "$withval" && ZLIB_HOME="$withval"
  224. ],
  225. [
  226. ZLIB_HOME=/usr/local
  227. test ! -f "${ZLIB_HOME}/include/zlib.h" && ZLIB_HOME=/usr
  228. ]
  229. )
  230. ###############################################################################
  231. # Check for programs and types.
  232. #
  233. AC_PROG_MAKE_SET
  234. AC_PROG_CC
  235. AC_PROG_CPP
  236. AC_LANG([C])
  237. CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wno-sign-compare"
  238. CPPFLAGS="$CPPFLAGS -I../common"
  239. AC_C_BIGENDIAN(
  240. [AC_MSG_ERROR([[bigendian is not supported... stopping]])],
  241. ,
  242. [AC_MSG_WARN([[unable to determine endianess, only little endian is supported]])]
  243. )
  244. if test "$enable_64bit" = "no" ; then
  245. AC_MSG_CHECKING([whether pointers can be stored in ints (old code)])
  246. pointers_fit_in_ints="no"
  247. AC_COMPILE_IFELSE(
  248. [AC_LANG_PROGRAM([[static int test_array[((long int)sizeof(int)) == ((long int)sizeof(void*)) ? 1 : -1];]])],
  249. [pointers_fit_in_ints="yes"],
  250. []
  251. )
  252. if test "$pointers_fit_in_ints" = "no" ; then
  253. CFLAGS="$CFLAGS -m32"
  254. LDFLAGS="$LDFLAGS -m32"
  255. AC_COMPILE_IFELSE(
  256. [AC_LANG_PROGRAM([[static int test_array[((long int)sizeof(int)) == ((long int)sizeof(void *)) ? 1 : -1];]])],
  257. [pointers_fit_in_ints="yes (with -m32)"],
  258. []
  259. )
  260. fi
  261. AC_MSG_RESULT($pointers_fit_in_ints)
  262. if test "$pointers_fit_in_ints" = "no" ; then
  263. AC_MSG_ERROR([pointers cannot be stored in ints, required for old code... stopping])
  264. fi
  265. fi
  266. AC_MSG_CHECKING([whether $CC supports -Wno-unused-parameter])
  267. OLD_CFLAGS="$CFLAGS"
  268. CFLAGS="$CFLAGS -Wno-unused-parameter"
  269. AC_COMPILE_IFELSE(
  270. [int foo;],
  271. [AC_MSG_RESULT([yes])],
  272. [
  273. AC_MSG_RESULT([no])
  274. CFLAGS="$OLD_CFLAGS"
  275. ]
  276. )
  277. AC_MSG_CHECKING([whether $CC supports -Wno-pointer-sign])
  278. OLD_CFLAGS="$CFLAGS"
  279. CFLAGS="$CFLAGS -Wno-pointer-sign"
  280. AC_COMPILE_IFELSE(
  281. [int foo;],
  282. [AC_MSG_RESULT([yes])],
  283. [
  284. AC_MSG_RESULT([no])
  285. CFLAGS="$OLD_CFLAGS"
  286. ]
  287. )
  288. AC_MSG_CHECKING([whether $CC supports -Wno-switch])
  289. OLD_CFLAGS="$CFLAGS"
  290. CFLAGS="$CFLAGS -Wno-switch"
  291. AC_COMPILE_IFELSE(
  292. [int foo;],
  293. [AC_MSG_RESULT([yes])],
  294. [
  295. AC_MSG_RESULT([no])
  296. CFLAGS="$OLD_CFLAGS"
  297. ]
  298. )
  299. AC_MSG_CHECKING([whether $CC supports -fPIC])
  300. OLD_CFLAGS="$CFLAGS"
  301. CFLAGS="$CFLAGS -fPIC"
  302. AC_COMPILE_IFELSE(
  303. [int foo;],
  304. [
  305. AC_MSG_RESULT([yes])
  306. compiler_supports_pic="yes"
  307. ],
  308. [
  309. AC_MSG_RESULT([no])
  310. compiler_supports_pic="no"
  311. ]
  312. )
  313. CFLAGS="$OLD_CFLAGS"
  314. #
  315. # -shared needs position independent code; some platforms emit it
  316. # always, others need -fPIC
  317. #
  318. AC_MSG_CHECKING([whether $CC needs -fPIC for shared objects])
  319. OLD_CFLAGS="$CFLAGS"
  320. CFLAGS="$CFLAGS -shared"
  321. WITH_PLUGINS="yes"
  322. AC_LINK_IFELSE(
  323. [
  324. int foo(void)
  325. {
  326. return 0;
  327. }
  328. ],
  329. [
  330. AC_MSG_RESULT([no])
  331. CFLAGS="$OLD_CFLAGS"
  332. ],
  333. [
  334. if test "$compiler_supports_pic" = "yes" ; then
  335. # Verify if -shared really fails due to lack of -fPIC or something else
  336. CFLAGS="$CFLAGS -fPIC"
  337. AC_LINK_IFELSE(
  338. [
  339. int foo(void)
  340. {
  341. return 0;
  342. }
  343. ],
  344. [
  345. AC_MSG_RESULT([yes])
  346. CFLAGS="$OLD_CFLAGS -fPIC"
  347. ],
  348. [
  349. AC_MSG_RESULT([no, but fails for another reason])
  350. AC_MSG_ERROR([compiler is unable to compile shared objects for an unhandled reason, please report this with attached config.log... stopping])
  351. ]
  352. )
  353. else
  354. # Disable compilation of plugins (optional), so 'make all' does not fail
  355. AC_MSG_RESULT([yes, but unsupported])
  356. AC_MSG_NOTICE([compiler is unable to generate position independent code, disabled plugins (optional)])
  357. WITH_PLUGINS="no"
  358. fi
  359. ]
  360. )
  361. AC_SUBST([WITH_PLUGINS])
  362. #
  363. # DB_MANUAL_CAST_TO_UNION
  364. #
  365. AC_MSG_CHECKING([whether $CC is able to typecast to union])
  366. AC_COMPILE_IFELSE(
  367. [
  368. typedef union Foonion
  369. {
  370. int i;
  371. unsigned int ui;
  372. const char* s;
  373. }
  374. Foonion;
  375. int bar(Foonion onion)
  376. {
  377. return onion.i;
  378. }
  379. int foo(void)
  380. {
  381. int i = 0;
  382. return bar(((Foonion)(int)i));
  383. }
  384. ],
  385. [
  386. AC_MSG_RESULT([yes])
  387. ],
  388. [
  389. AC_MSG_RESULT([no])
  390. CFLAGS="$CFLAGS -DDB_MANUAL_CAST_TO_UNION"
  391. ]
  392. )
  393. ###############################################################################
  394. # Check for libraries and header files.
  395. #
  396. #
  397. # setrlimit - used to set the socket limit
  398. #
  399. AC_CHECK_FUNC([setrlimit],[CFLAGS="$CFLAGS -DHAVE_SETRLIMIT"])
  400. #
  401. # strnlen - string length with upper scan bound
  402. #
  403. AC_CHECK_FUNC([strnlen],[CFLAGS="$CFLAGS -DHAVE_STRNLEN"])
  404. #
  405. # Memory manager
  406. #
  407. case $enable_manager in
  408. "no")
  409. CFLAGS="$CFLAGS -DNO_MEMMGR"
  410. ;;
  411. "builtin")
  412. # enabled by default
  413. ;;
  414. "memwatch")
  415. CFLAGS="$CFLAGS -DMEMWATCH"
  416. AC_CHECK_HEADER([memwatch.h], , [AC_MSG_ERROR([memwatch header not found... stopping])])
  417. ;;
  418. "dmalloc")
  419. CFLAGS="$CFLAGS -DDMALLOC -DDMALLOC_FUNC_CHECK"
  420. LIBS="$LIBS -ldmalloc"
  421. AC_CHECK_HEADER([dmalloc.h], , [AC_MSG_ERROR([dmalloc header not found... stopping])])
  422. ;;
  423. "gcollect")
  424. CFLAGS="$CFLAGS -DGCOLLECT"
  425. LIBS="$LIBS -lgc"
  426. AC_CHECK_HEADER([gc.h], , [AC_MSG_ERROR([gcollect header not found... stopping])])
  427. ;;
  428. "bcheck")
  429. CFLAGS="$CFLAGS -DBCHECK"
  430. ;;
  431. esac
  432. #
  433. # Packetver
  434. #
  435. if test -n "$enable_packetver" ; then
  436. CFLAGS="$CFLAGS -DPACKETVER=$enable_packetver"
  437. fi
  438. #
  439. # Debug
  440. #
  441. case $enable_debug in
  442. "no")
  443. # default value
  444. CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses"
  445. ;;
  446. "yes")
  447. CFLAGS="$CFLAGS -g -DDEBUG"
  448. ;;
  449. "gdb")
  450. CFLAGS="$CFLAGS -ggdb -DDEBUG"
  451. ;;
  452. esac
  453. #
  454. # RDTSC
  455. #
  456. case $enable_rdtsc in
  457. 0)
  458. #default value
  459. ;;
  460. 1)
  461. CFLAGS="$CFLAGS -DENABLE_RDTSC"
  462. ;;
  463. esac
  464. #
  465. # Profiler
  466. #
  467. case $enable_profiler in
  468. "no")
  469. # default value
  470. ;;
  471. "gprof")
  472. CFLAGS="$CFLAGS -pg"
  473. LDFLAGS="$LDFLAGS -pg"
  474. ;;
  475. esac
  476. #
  477. # zlib library (required)
  478. #
  479. if test -n "${ZLIB_HOME}" ; then
  480. LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
  481. CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
  482. fi
  483. AC_CHECK_LIB([z], [inflateEnd], [],[AC_MSG_ERROR([zlib library not found or incompatible, please specify the correct path with --with-zlib=DIR... stopping])])
  484. AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([zlib header not found, please specify the correct path with --with-zlib=DIR... stopping])])
  485. #
  486. # math library (required)
  487. #
  488. AC_CHECK_LIB([m], [sqrt], [], [AC_MSG_ERROR([math library not found... stopping])])
  489. #
  490. # clock_gettime (rt on Debian)
  491. #
  492. AC_CHECK_LIB([rt], [clock_gettime])
  493. #
  494. # MySQL library (optional)
  495. #
  496. if test "$want_mysql" = "no" ; then
  497. MYSQL_VERSION=""
  498. MYSQL_CFLAGS=""
  499. MYSQL_LIBS=""
  500. AC_MSG_NOTICE([ignoring MySQL (optional)])
  501. else
  502. if test -z "$MYSQL_CONFIG_HOME"; then
  503. AC_PATH_PROG([MYSQL_CONFIG_HOME], [mysql_config], [no])
  504. fi
  505. if test "$MYSQL_CONFIG_HOME" != "no" ; then
  506. MYSQL_VERSION="`$MYSQL_CONFIG_HOME --version`"
  507. if test "$manual_MYSQL_CFLAGS" = "no" ; then
  508. MYSQL_CFLAGS="`$MYSQL_CONFIG_HOME --include`"
  509. fi
  510. if test "$manual_MYSQL_LIBS" = "no" ; then
  511. MYSQL_LIBS="`$MYSQL_CONFIG_HOME --libs`"
  512. fi
  513. else
  514. MYSQL_VERSION="unknown"
  515. fi
  516. MYSQL_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS $MYSQL_LIBS"
  517. MYSQL_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
  518. AC_CHECK_LIB([mysqlclient], [mysql_init], [HAVE_MYSQL="yes"], [])
  519. AC_CHECK_HEADER([mysql.h], [], [HAVE_MYSQL=""])
  520. CPPFLAGS="$MYSQL_OLD_CPPFLAGS"
  521. LDFLAGS="$MYSQL_OLD_LDFLAGS"
  522. AC_MSG_CHECKING([MySQL library (optional)])
  523. if test "$HAVE_MYSQL" = "yes" ; then
  524. AC_MSG_RESULT([yes ($MYSQL_VERSION)])
  525. else
  526. AC_MSG_RESULT([no])
  527. if test "$require_mysql" = "yes" ; then
  528. AC_MSG_ERROR([MySQL not found or incompatible (requested)])
  529. else
  530. AC_MSG_NOTICE([disabling MySQL (optional)])
  531. MYSQL_VERSION=""
  532. MYSQL_CFLAGS=""
  533. MYSQL_LIBS=""
  534. fi
  535. fi
  536. fi
  537. AC_SUBST([HAVE_MYSQL])
  538. AC_SUBST([MYSQL_VERSION])
  539. AC_SUBST([MYSQL_CFLAGS])
  540. AC_SUBST([MYSQL_LIBS])
  541. #
  542. # PCRE library (optional)
  543. #
  544. ##TODO PCRE version
  545. PCRE_LIBS=""
  546. PCRE_CFLAGS=""
  547. if test "$want_pcre" = "no" ; then
  548. AC_MSG_NOTICE([ignoring PCRE (optional)])
  549. else
  550. if test -z "$PCRE_HOME" ; then
  551. AC_CHECK_LIB([pcre], [pcre_study], [HAVE_PCRE="yes"], [])
  552. if test "$HAVE_PCRE" = "yes" ; then
  553. PCRE_LIBS="-lpcre"
  554. fi
  555. else
  556. PCRE_OLD_LDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$PCRE_HOME/lib"
  557. PCRE_OLD_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$PCRE_HOME/include"
  558. AC_CHECK_LIB(pcre, pcre_compile, [HAVE_PCRE="yes"], [])
  559. CPPFLAGS="$PCRE_OLD_CPPFLAGS"
  560. LDFLAGS="$PCRE_OLD_LDFLAGS"
  561. if test "$HAVE_PCRE" = "yes" ; then
  562. PCRE_LIBS="-L$PCRE_HOME/lib -lpcre"
  563. test -d "$PCRE_HOME/include" && PCRE_CFLAGS="-I$PCRE_HOME/include"
  564. fi
  565. fi
  566. AC_MSG_CHECKING([PCRE library (optional)])
  567. if test "$HAVE_PCRE" = "yes" ; then
  568. AC_MSG_RESULT([yes])
  569. else
  570. AC_MSG_RESULT([no])
  571. if test "$require_pcre" = "yes" ; then
  572. AC_MSG_ERROR([PCRE not found or incompatible (requested)])
  573. else
  574. AC_MSG_NOTICE([disabling PCRE (optional)])
  575. fi
  576. fi
  577. fi
  578. AC_SUBST([HAVE_PCRE])
  579. AC_SUBST([PCRE_LIBS])
  580. AC_SUBST([PCRE_CFLAGS])
  581. #
  582. # Host specific stuff
  583. #
  584. AC_MSG_CHECKING([host OS])
  585. host_os="`uname`"
  586. AC_MSG_RESULT([$host_os])
  587. fd_setsize=""
  588. DLLEXT=".so"
  589. case $host_os in
  590. Solaris* )
  591. LIBS="$LIBS -lsocket -lnsl -ldl"
  592. ;;
  593. Linux* )
  594. LIBS="$LIBS -ldl"
  595. ;;
  596. FreeBSD*)
  597. CPPFLAGS="$CPPFLAGS -D__FREEBSD__"
  598. ;;
  599. NetBSD*)
  600. CPPFLAGS="$CPPFLAGS -D__NETBSD__"
  601. ;;
  602. CYGWIN*)
  603. CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=4096 -DCYGWIN"
  604. fd_setsize="done"
  605. DLLEXT=".dll"
  606. ;;
  607. esac
  608. AC_SUBST([DLLEXT])
  609. AC_MSG_CHECKING([for MinGW])
  610. if test -n "`$CC --version | grep -i mingw`" ; then
  611. AC_MSG_RESULT([yes])
  612. CPPFLAGS="$CPPFLAGS -DMINGW"
  613. if test -z "$fd_setsize" ; then
  614. CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=4096"
  615. fi
  616. LIBS="$LIBS -lws2_32"
  617. else
  618. AC_MSG_RESULT([no])
  619. fi
  620. ###############################################################################
  621. AC_OUTPUT