configure.in 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. # Process this file with autoconf to produce a configure script.
  2. AC_INIT(physfs.c)
  3. dnl ---------------------------------------------------------------------
  4. dnl System/version info
  5. dnl ---------------------------------------------------------------------
  6. # Making releases:
  7. # MICRO_VERSION += 1;
  8. # INTERFACE_AGE += 1;
  9. # BINARY_AGE += 1;
  10. # if any functions have been added, set INTERFACE_AGE to 0.
  11. # if backwards compatibility has been broken,
  12. # set BINARY_AGE and INTERFACE_AGE to 0.
  13. MAJOR_VERSION=1
  14. MINOR_VERSION=0
  15. MICRO_VERSION=1
  16. INTERFACE_AGE=1
  17. BINARY_AGE=1
  18. VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
  19. AC_SUBST(MAJOR_VERSION)
  20. AC_SUBST(MINOR_VERSION)
  21. AC_SUBST(MICRO_VERSION)
  22. AC_SUBST(INTERFACE_AGE)
  23. AC_SUBST(BINARY_AGE)
  24. AC_SUBST(VERSION)
  25. # libtool versioning
  26. LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
  27. LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
  28. LT_REVISION=$INTERFACE_AGE
  29. LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
  30. AC_SUBST(LT_RELEASE)
  31. AC_SUBST(LT_CURRENT)
  32. AC_SUBST(LT_REVISION)
  33. AC_SUBST(LT_AGE)
  34. dnl Detect the canonical host and target build environment
  35. AC_CANONICAL_SYSTEM
  36. dnl Setup for automake
  37. AM_CONFIG_HEADER(config.h)
  38. AM_INIT_AUTOMAKE(physfs, $VERSION)
  39. dnl ---------------------------------------------------------------------
  40. dnl Compilers and other tools
  41. dnl ---------------------------------------------------------------------
  42. AC_PROG_CC
  43. AC_PROG_CXX
  44. AC_PROG_INSTALL
  45. AC_PROG_LN_S
  46. AC_LIBTOOL_WIN32_DLL
  47. LIBTOOL="libtool"
  48. AM_PROG_LIBTOOL
  49. AC_CHECK_PROG(we_have_sed, sed, yes, no)
  50. dnl ---------------------------------------------------------------------
  51. dnl Debug mode?
  52. dnl ---------------------------------------------------------------------
  53. AC_ARG_ENABLE(debug,
  54. [ --enable-debug enable debug mode [default=no]],
  55. , enable_debug=no)
  56. if test x$enable_debug = xyes; then
  57. if test x$ac_cv_prog_cc_g = xyes; then
  58. PHYSFSCFLAGS="$PHYSFSCFLAGS -g -O0"
  59. else
  60. PHYSFSCFLAGS="$PHYSFSCFLAGS -O0"
  61. fi
  62. PHYSFSCFLAGS="$PHYSFSCFLAGS -Werror -Wall"
  63. AC_DEFINE([DEBUG], 1, [define if debug build is enabled])
  64. AC_DEFINE([DEBUG_CHATTER], 1, [define if debug chatter is enabled])
  65. else
  66. PHYSFSCFLAGS="$PHYSFSCFLAGS -O2"
  67. AC_DEFINE([NDEBUG], 1, [define if debug build is disabled])
  68. fi
  69. dnl ---------------------------------------------------------------------
  70. dnl Have GCC's -fvisibility option?
  71. dnl ---------------------------------------------------------------------
  72. AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
  73. have_gcc_fvisibility=no
  74. visibility_CFLAGS="-fvisibility=hidden"
  75. save_CFLAGS="$CFLAGS"
  76. CFLAGS="$save_CFLAGS $visibility_CFLAGS"
  77. AC_TRY_COMPILE([
  78. int placeholder = 1;
  79. ],[
  80. ],[
  81. have_gcc_fvisibility=yes
  82. ])
  83. AC_MSG_RESULT($have_gcc_fvisibility)
  84. CFLAGS="$save_CFLAGS"
  85. if test x$have_gcc_fvisibility = xyes; then
  86. PHYSFSCFLAGS="$PHYSFSCFLAGS $visibility_CFLAGS"
  87. fi
  88. dnl ---------------------------------------------------------------------
  89. dnl Profile sorts, etc?
  90. dnl ---------------------------------------------------------------------
  91. AC_ARG_ENABLE(profiling,
  92. [ --enable-profiling do algorithm profiling [default=no]],
  93. , enable_profiling=no)
  94. if test x$enable_profiling = xyes; then
  95. AC_DEFINE([PHYSFS_PROFILING], 1, [define to profile sorting, etc algorithms])
  96. fi
  97. dnl ---------------------------------------------------------------------
  98. dnl Build test program?
  99. dnl ---------------------------------------------------------------------
  100. AC_ARG_ENABLE(testprog,
  101. [ --enable-testprog build test program [default=yes]],
  102. , enable_testprog=yes)
  103. dnl ---------------------------------------------------------------------
  104. dnl Checks for libraries.
  105. dnl ---------------------------------------------------------------------
  106. require_zlib="no"
  107. dnl Check for zip archiver inclusion...
  108. AC_ARG_ENABLE(zip,
  109. [ --enable-zip enable ZIP support [default=yes]],
  110. , enable_zip=yes)
  111. if test x$enable_zip = xyes; then
  112. AC_DEFINE([PHYSFS_SUPPORTS_ZIP], 1, [define if zip support is enabled])
  113. require_zlib="yes"
  114. fi
  115. dnl Check for grp archiver inclusion...
  116. AC_ARG_ENABLE(grp,
  117. [ --enable-grp enable Build Engine GRP support [default=yes]],
  118. , enable_grp=yes)
  119. if test x$enable_grp = xyes; then
  120. AC_DEFINE([PHYSFS_SUPPORTS_GRP], 1, [define if grp support is enabled])
  121. fi
  122. dnl Check for wad archiver inclusion...
  123. AC_ARG_ENABLE(wad,
  124. [ --enable-wad enable Doom WAD support [default=yes]],
  125. , enable_wad=yes)
  126. if test x$enable_wad = xyes; then
  127. AC_DEFINE([PHYSFS_SUPPORTS_WAD], 1, [define if wad support is enabled])
  128. fi
  129. dnl Check for hog archiver inclusion...
  130. AC_ARG_ENABLE(hog,
  131. [ --enable-hog enable Descent I/II HOG support [default=yes]],
  132. , enable_hog=yes)
  133. if test x$enable_hog = xyes; then
  134. AC_DEFINE([PHYSFS_SUPPORTS_HOG], 1, [define if hog support is enabled])
  135. fi
  136. dnl Check for mvl archiver inclusion...
  137. AC_ARG_ENABLE(mvl,
  138. [ --enable-mvl enable Descent II MVL support [default=yes]],
  139. , enable_mvl=yes)
  140. if test x$enable_mvl = xyes; then
  141. AC_DEFINE([PHYSFS_SUPPORTS_MVL], 1, [define if mvl support is enabled])
  142. fi
  143. dnl Check for qpak archiver inclusion...
  144. AC_ARG_ENABLE(qpak,
  145. [ --enable-qpak enable Quake PAK support [default=yes]],
  146. , enable_qpak=yes)
  147. if test x$enable_qpak = xyes; then
  148. AC_DEFINE([PHYSFS_SUPPORTS_QPAK], 1, [define if qpak support is enabled])
  149. fi
  150. dnl Check for mix archiver inclusion...
  151. AC_ARG_ENABLE(mix,
  152. [ --enable-mix enable Westwood MIX support [default=no]],
  153. , enable_mix=no)
  154. if test x$enable_mix = xyes; then
  155. AC_DEFINE([PHYSFS_SUPPORTS_MIX], 1, [define if mix support is enabled])
  156. fi
  157. dnl Check if we should statically link the included zlib...
  158. AC_ARG_ENABLE(internal-zlib,
  159. [ --enable-internal-zlib use included zlib [default=only if needed]],
  160. , enable_internal_zlib=maybe)
  161. dnl Check for zlib if needed.
  162. have_external_zlib="no"
  163. if test x$enable_internal_zlib != xyes; then
  164. if test x$require_zlib = xyes; then
  165. AC_CHECK_HEADER(zlib.h, have_zlib_hdr=yes)
  166. AC_CHECK_LIB(z, zlibVersion, have_zlib_lib=yes)
  167. if test x$have_zlib_hdr = xyes -a x$have_zlib_lib = xyes; then
  168. have_external_zlib="yes"
  169. fi
  170. fi
  171. fi
  172. AC_MSG_CHECKING([what zlib to use])
  173. dnl no zlib is needed at all if we aren't supporting ZIP files.
  174. if test x$require_zlib = xno; then
  175. enable_internal_zlib="no"
  176. enable_external_zlib="no"
  177. AC_MSG_RESULT([no zlib needed])
  178. else
  179. if test x$enable_internal_zlib = xmaybe; then
  180. if test x$have_external_zlib = xyes; then
  181. enable_internal_zlib="no"
  182. enable_external_zlib="yes"
  183. else
  184. enable_internal_zlib="yes"
  185. enable_external_zlib="no"
  186. fi
  187. else
  188. if test x$enable_internal_zlib = xno -a x$have_external_zlib = xyes; then
  189. enable_internal_zlib="no"
  190. enable_external_zlib="yes"
  191. fi
  192. fi
  193. if test x$enable_internal_zlib = xyes; then
  194. AC_MSG_RESULT([internal zlib])
  195. PHYSFSCFLAGS="$PHYSFSCFLAGS -DZ_PREFIX"
  196. else
  197. if test x$enable_external_zlib = xyes; then
  198. AC_MSG_RESULT([external zlib])
  199. LIBS="$LIBS -lz"
  200. else
  201. AC_MSG_ERROR([Need zlib, but you disabled our copy and have no system lib])
  202. fi
  203. fi
  204. fi
  205. dnl determine if we should include readline support...
  206. AC_ARG_ENABLE(readline,
  207. [ --enable-readline use GNU readline in test program [default=yes]],
  208. , enable_readline=yes)
  209. if test x$enable_readline = xyes; then
  210. AC_CHECK_HEADER(readline/readline.h, have_readline_hdr=yes)
  211. AC_CHECK_LIB(readline, readline, have_readline_lib=yes, , -lcurses)
  212. AC_CHECK_HEADER(readline/history.h, have_history_hdr=yes)
  213. AC_CHECK_LIB(readline, add_history, have_history_lib=yes, , -lcurses)
  214. if test x$have_readline_hdr = xyes -a x$have_readline_lib = xyes; then
  215. if test x$have_history_hdr = xyes -a x$have_history_lib = xyes; then
  216. AC_DEFINE([PHYSFS_HAVE_READLINE], 1, [define if we have readline])
  217. have_readline="yes"
  218. fi
  219. fi
  220. fi
  221. dnl !!! FIXME: Not sure how to detect this...
  222. dnl check for 64-bit llseek()...
  223. dnl AC_CHECK_LIB(c, llseek, have_llseek=yes)
  224. if test x$have_llseek = xyes; then
  225. AC_DEFINE([PHYSFS_HAVE_LLSEEK], 1, [define if we have llseek])
  226. fi
  227. dnl determine if we should use the stubbed pthread code.
  228. AC_ARG_ENABLE(pthreads,
  229. [ --enable-pthreads include POSIX threads support [default=yes]],
  230. , enable_pthreads=yes)
  231. if test x$enable_pthreads = xyes; then
  232. AC_CHECK_HEADER(pthread.h, have_pthread_hdr=yes)
  233. if test x$have_pthread_hdr != xyes; then
  234. enable_pthreads=no
  235. fi
  236. fi
  237. dnl determine if we should use the stubbed CD-ROM detection code.
  238. AC_ARG_ENABLE(cdrom,
  239. [ --enable-cdrom include CD-ROM support [default=yes]],
  240. , enable_cdrom=yes)
  241. if test x$enable_cdrom = xyes; then
  242. dnl reset this and let header detection reenable...
  243. enable_cdrom=no
  244. dnl BSD systems use sys/ucred.h for getting mounted volumes.
  245. dnl Linux and others use mntent.h.
  246. AC_CHECK_HEADER(sys/ucred.h, have_ucred_hdr=yes)
  247. if test x$have_ucred_hdr = xyes; then
  248. AC_DEFINE([PHYSFS_HAVE_SYS_UCRED_H], 1, [define if we have sys/ucred.h])
  249. enable_cdrom=yes
  250. fi
  251. AC_CHECK_HEADER(mntent.h, have_mntent_hdr=yes)
  252. if test x$have_mntent_hdr = xyes; then
  253. AC_DEFINE([PHYSFS_HAVE_MNTENT_H], 1, [define if we have mntent.h])
  254. enable_cdrom=yes
  255. fi
  256. fi
  257. dnl determine language.
  258. AC_ARG_ENABLE(language,
  259. [ --enable-language=lang Select natural language. [default=english]],
  260. physfslang=`echo $enable_language |tr A-Z a-z`, physfslang=english)
  261. AC_MSG_CHECKING([if language choice is supported])
  262. physfs_valid_lang=no
  263. if test x$physfslang = xenglish; then
  264. physfs_valid_lang=yes
  265. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_ENGLISH, [define desired natural language])
  266. fi
  267. if test x$physfslang = xgerman; then
  268. physfs_valid_lang=yes
  269. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_GERMAN, [define desired natural language])
  270. fi
  271. if test x$physfslang = xfrench; then
  272. physfs_valid_lang=yes
  273. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_FRENCH, [define desired natural language])
  274. fi
  275. if test x$physfslang = xspanish; then
  276. physfs_valid_lang=yes
  277. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_SPANISH, [define desired natural language])
  278. fi
  279. if test x$physfslang = xportuguese-br; then
  280. physfs_valid_lang=yes
  281. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_PORTUGUESE_BR, [define desired natural language])
  282. fi
  283. if test x$physfslang = xrussian-koi8-r; then
  284. physfs_valid_lang=yes
  285. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_KOI8_R, [define desired natural language])
  286. fi
  287. if test x$physfslang = xrussian-cp1251; then
  288. physfs_valid_lang=yes
  289. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_CP866, [define desired natural language])
  290. fi
  291. if test x$physfslang = xrussian-cp866; then
  292. physfs_valid_lang=yes
  293. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_CP866, [define desired natural language])
  294. fi
  295. if test x$physfslang = xrussian-iso-8859-5; then
  296. physfs_valid_lang=yes
  297. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_RUSSIAN_ISO_8859_5, [define desired natural language])
  298. fi
  299. if test x$physfslang = xportuguese-br; then
  300. physfs_valid_lang=yes
  301. AC_DEFINE([PHYSFS_LANG], PHYSFS_LANG_PORTUGUESE_BR, [define desired natural language])
  302. fi
  303. dnl Add other language checks here...
  304. AC_MSG_RESULT([$physfs_valid_lang])
  305. if test x$physfs_valid_lang = xno; then
  306. AC_MSG_WARN([***])
  307. AC_MSG_WARN([*** You've asked for "$physfslang" language support...])
  308. AC_MSG_WARN([*** ...but we don't support that.])
  309. AC_MSG_WARN([*** You could choose another language,])
  310. AC_MSG_WARN([*** but is this what you REALLY wanted?])
  311. AC_MSG_WARN([*** Please see the LANG section of physfs_internal.h])
  312. AC_MSG_WARN([*** for info on writing a translation.])
  313. AC_MSG_WARN([***])
  314. AC_MSG_WARN([*** Currently known languages:])
  315. AC_MSG_WARN([*** --enable-language=english])
  316. AC_MSG_WARN([*** --enable-language=spanish])
  317. AC_MSG_WARN([*** --enable-language=german])
  318. AC_MSG_WARN([*** --enable-language=french])
  319. AC_MSG_WARN([*** --enable-language=spanish])
  320. AC_MSG_WARN([*** --enable-language=portuguese-br])
  321. AC_MSG_WARN([*** --enable-language=russian-koi8-r])
  322. AC_MSG_WARN([*** --enable-language=russian-cp1251])
  323. AC_MSG_WARN([*** --enable-language=russian-cp866])
  324. AC_MSG_WARN([*** --enable-language=russian-iso-8859-5])
  325. AC_MSG_WARN([*** --enable-language=portuguese-br])
  326. AC_MSG_WARN([***])
  327. AC_MSG_ERROR([*** unsupported language. stop.])
  328. fi
  329. have_non_posix_threads=no
  330. AC_MSG_CHECKING([if this is BeOS])
  331. if test x$target_os = xbeos; then
  332. this_is_beos=yes
  333. have_non_posix_threads=yes
  334. enable_cdrom=yes
  335. enable_pthreads=no
  336. LIBS="$LIBS -lroot -lbe"
  337. else
  338. this_is_beos=no
  339. fi
  340. AC_MSG_RESULT([$this_is_beos])
  341. AC_MSG_CHECKING([if this is Cygwin])
  342. if test x$target_os = xcygwin; then
  343. this_is_cygwin=yes
  344. PHYSFSCFLAGS="$PHYSFSCFLAGS -DWIN32"
  345. enable_cdrom=yes
  346. enable_pthreads=no
  347. have_non_posix_threads=yes
  348. else
  349. this_is_cygwin=no
  350. fi
  351. AC_MSG_RESULT([$this_is_cygwin])
  352. AC_MSG_CHECKING([if this is mingw])
  353. if test x$target_os = xmingw32; then
  354. this_is_mingw=yes
  355. fi
  356. if test x$target_os = xmingw32msvc; then
  357. this_is_mingw=yes
  358. fi
  359. if test x$this_is_mingw = xyes; then
  360. PHYSFSCFLAGS="$PHYSFSCFLAGS -DWIN32"
  361. enable_cdrom=yes
  362. enable_pthreads=no
  363. have_non_posix_threads=yes
  364. else
  365. this_is_mingw=no
  366. fi
  367. AC_MSG_RESULT([$this_is_mingw])
  368. this_is_macosx=no
  369. if test x$we_have_sed = xyes; then
  370. AC_MSG_CHECKING([if this is MacOS X])
  371. x=`echo $target_os |sed "s/darwin.*/darwin/"`
  372. if test x$x = xdarwin -a x$target_vendor = xapple; then
  373. this_is_macosx=yes
  374. PHYSFSLDFLAGS="$PHYSFSLDFLAGS -Wl,-framework -Wl,Carbon -Wl,-framework -Wl,IOKit"
  375. fi
  376. AC_MSG_RESULT([$this_is_macosx])
  377. fi
  378. this_is_freebsd=no
  379. if test x$we_have_sed = xyes; then
  380. AC_MSG_CHECKING([if this is FreeBSD])
  381. x=`echo $target_os |tr A-Z a-z |sed "s/.*freebsd.*/freebsd/"`
  382. if test x$x = xfreebsd; then
  383. this_is_freebsd=yes
  384. PHYSFSLDFLAGS="$PHYSFSLDFLAGS -pthread"
  385. fi
  386. AC_MSG_RESULT([$this_is_freebsd])
  387. fi
  388. this_is_openbsd=no
  389. if test x$we_have_sed = xyes; then
  390. AC_MSG_CHECKING([if this is OpenBSD])
  391. x=`echo $target_os |tr A-Z a-z |sed "s/.*openbsd.*/openbsd/"`
  392. if test x$x = xopenbsd; then
  393. this_is_openbsd=yes
  394. PHYSFSLDFLAGS="$PHYSFSLDFLAGS -pthread"
  395. fi
  396. AC_MSG_RESULT([$this_is_openbsd])
  397. fi
  398. this_is_atheos=no
  399. if test x$we_have_sed = xyes; then
  400. AC_MSG_CHECKING([if this is AtheOS])
  401. x=`echo $target_os |tr A-Z a-z |sed "s/.*atheos.*/atheos/"`
  402. if test x$x = xatheos; then
  403. this_is_atheos=yes
  404. enable_cdrom=no
  405. enable_pthreads=no
  406. fi
  407. AC_MSG_RESULT([$this_is_atheos])
  408. fi
  409. this_is_os2=no
  410. if test x$we_have_sed = xyes; then
  411. AC_MSG_CHECKING([if this is OS/2])
  412. x=`echo $target_os |tr A-Z a-z |sed "s/.*os2.*/os2/"`
  413. if test x$x = xos2; then
  414. this_is_os2=yes
  415. have_non_posix_threads=yes
  416. enable_cdrom=yes
  417. enable_pthreads=no
  418. PHYSFSCFLAGS="$PHYSFSCFLAGS -DOS2"
  419. fi
  420. AC_MSG_RESULT([$this_is_os2])
  421. fi
  422. this_is_mint=no
  423. if test x$we_have_sed = xyes; then
  424. AC_MSG_CHECKING([if this is MiNT])
  425. x=`echo $target_os |tr A-Z a-z |sed "s/.*mint.*/mint/"`
  426. if test x$x = xmint; then
  427. this_is_mint=yes
  428. enable_cdrom=no
  429. enable_pthreads=no
  430. fi
  431. AC_MSG_RESULT([$this_is_mint])
  432. fi
  433. dnl Some platform might disable this, so check this down here...
  434. if test x$enable_cdrom != xyes; then
  435. AC_DEFINE([PHYSFS_NO_CDROM_SUPPORT], 1, [define if we have no CD support])
  436. AC_MSG_WARN([***])
  437. AC_MSG_WARN([*** There is no CD-ROM support in this build!])
  438. AC_MSG_WARN([*** PhysicsFS will just pretend there are no discs.])
  439. AC_MSG_WARN([*** This may be fine, depending on how PhysicsFS is used,])
  440. AC_MSG_WARN([*** but is this what you REALLY wanted?])
  441. AC_MSG_WARN([*** (Maybe fix configure.in, or write a platform driver?)])
  442. AC_MSG_WARN([***])
  443. fi
  444. if test x$enable_pthreads != xyes; then
  445. AC_DEFINE([PHYSFS_NO_PTHREADS_SUPPORT], 1, [define if we have no POSIX threads support])
  446. if test x$have_non_posix_threads != xyes; then
  447. AC_MSG_WARN([***])
  448. AC_MSG_WARN([*** There is no thread support in this build!])
  449. AC_MSG_WARN([*** PhysicsFS will NOT be reentrant!])
  450. AC_MSG_WARN([*** This may be fine, depending on how PhysicsFS is used,])
  451. AC_MSG_WARN([*** but is this what you REALLY wanted?])
  452. AC_MSG_WARN([*** (Maybe fix configure.in, or write a platform driver?)])
  453. AC_MSG_WARN([***])
  454. fi
  455. fi
  456. # Checks for header files.
  457. AC_HEADER_STDC
  458. AC_CHECK_HEADERS([stdlib.h string.h assert.h])
  459. # Checks for typedefs, structures, and compiler characteristics.
  460. dnl AC_C_CONST
  461. dnl AC_TYPE_SIZE_T
  462. # Checks for library functions.
  463. # This is only in the bleeding edge autoconf distro...
  464. #AC_FUNC_MALLOC
  465. AC_FUNC_MEMCMP
  466. AC_CHECK_FUNCS([memset strrchr])
  467. AC_CHECK_SIZEOF(int, 4)
  468. CFLAGS="$PHYSFSCFLAGS $CFLAGS -D_REENTRANT -D_THREAD_SAFE"
  469. LDFLAGS="$LDFLAGS $PHYSFSLDFLAGS -no-undefined"
  470. dnl Add Makefile conditionals
  471. AM_CONDITIONAL(BUILD_ZLIB, test x$enable_internal_zlib = xyes)
  472. AM_CONDITIONAL(BUILD_TEST_PHYSFS, test x$enable_testprog = xyes)
  473. AM_CONDITIONAL(BUILD_MACOSX, test x$this_is_macosx = xyes)
  474. AM_CONDITIONAL(BUILD_BEOS, test x$this_is_beos = xyes)
  475. AM_CONDITIONAL(BUILD_CYGWIN, test x$this_is_cygwin = xyes)
  476. AM_CONDITIONAL(BUILD_READLINE, test x$have_readline = xyes)
  477. AC_OUTPUT([
  478. Makefile
  479. archivers/Makefile
  480. platform/Makefile
  481. zlib123/Makefile
  482. test/Makefile
  483. extras/Makefile
  484. physfs.spec
  485. ])
  486. dnl end of configure.in ...