2
0

configure.ac 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174
  1. dnl
  2. dnl Autoconf configuration file for APR
  3. dnl
  4. dnl Process this file with autoconf to produce a configure script.
  5. dnl Use ./buildconf to prepare build files and run autoconf for APR.
  6. AC_PREREQ(2.50)
  7. AC_INIT(build/apr_common.m4)
  8. AC_CONFIG_HEADER(include/arch/unix/fspr_private.h)
  9. AC_CONFIG_AUX_DIR(build)
  10. dnl
  11. dnl Include our own M4 macros along with those for libtool
  12. dnl
  13. sinclude(build/apr_common.m4)
  14. sinclude(build/apr_network.m4)
  15. sinclude(build/apr_threads.m4)
  16. sinclude(build/apr_hints.m4)
  17. sinclude(build/libtool.m4)
  18. sinclude(build/ltsugar.m4)
  19. CFLAGS="$CFLAGS $CONFIGURE_CFLAGS"
  20. CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS"
  21. LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS"
  22. dnl Hard-coded inclusion at the tail end of fspr_private.h:
  23. AH_BOTTOM([
  24. /* switch this on if we have a BeOS version below BONE */
  25. #if BEOS && !HAVE_BONE_VERSION
  26. #define BEOS_R5 1
  27. #else
  28. #define BEOS_BONE 1
  29. #endif
  30. /*
  31. * Include common private declarations.
  32. */
  33. #include "../fspr_private_common.h"
  34. ])
  35. dnl Save user-defined environment settings for later restoration
  36. dnl
  37. APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
  38. APR_SAVE_THE_ENVIRONMENT(CFLAGS)
  39. APR_SAVE_THE_ENVIRONMENT(LDFLAGS)
  40. APR_SAVE_THE_ENVIRONMENT(LIBS)
  41. APR_SAVE_THE_ENVIRONMENT(INCLUDES)
  42. dnl Generate ./config.nice for reproducing runs of configure
  43. dnl
  44. APR_CONFIG_NICE(config.nice)
  45. AC_CANONICAL_SYSTEM
  46. echo "Configuring APR library"
  47. echo "Platform: $host"
  48. dnl Some initial steps for configuration. We setup the default directory
  49. dnl and which files are to be configured.
  50. dnl Setup the directory macros now
  51. # Absolute source/build directory
  52. apr_srcdir=`(cd $srcdir && pwd)`
  53. apr_builddir=`pwd`
  54. AC_SUBST(apr_srcdir)
  55. AC_SUBST(apr_builddir)
  56. if test "$apr_builddir" != "$apr_srcdir"; then
  57. USE_VPATH=1
  58. APR_CONFIG_LOCATION=build
  59. else
  60. APR_CONFIG_LOCATION=source
  61. fi
  62. AC_SUBST(APR_CONFIG_LOCATION)
  63. # Libtool might need this symbol -- it must point to the location of
  64. # the generated libtool script (not necessarily the "top" build dir).
  65. #
  66. top_builddir="$apr_builddir"
  67. AC_SUBST(top_builddir)
  68. # Directory containing apr build macros, helpers, and make rules
  69. # NOTE: make rules (apr_rules.mk) will be in the builddir for vpath
  70. #
  71. apr_buildout=$apr_builddir/build
  72. apr_builders=$apr_srcdir/build
  73. AC_SUBST(apr_builders)
  74. MKDIR=$apr_builders/mkdir.sh
  75. dnl Initialize mkdir -p functionality.
  76. APR_MKDIR_P_CHECK($apr_builders/mkdir.sh)
  77. # get our version information
  78. get_version="$apr_builders/get-version.sh"
  79. version_hdr="$apr_srcdir/include/fspr_version.h"
  80. APR_MAJOR_VERSION="`$get_version major $version_hdr APR`"
  81. APR_DOTTED_VERSION="`$get_version all $version_hdr APR`"
  82. AC_SUBST(APR_DOTTED_VERSION)
  83. AC_SUBST(APR_MAJOR_VERSION)
  84. echo "APR Version: ${APR_DOTTED_VERSION}"
  85. dnl Enable the layout handling code, then reparse the prefix-style
  86. dnl arguments due to autoconf being a PITA.
  87. APR_ENABLE_LAYOUT(apr)
  88. APR_PARSE_ARGUMENTS
  89. dnl Set optional CC hints here in case autoconf makes an inappropriate choice.
  90. dnl This allows us to suggest what the compiler should be, but still
  91. dnl allows the user to override CC externally.
  92. APR_CC_HINTS
  93. dnl Do the various CC checks *before* preloading values. The preload code
  94. dnl may need to use compiler characteristics to make decisions. This macro
  95. dnl can only be used once within a configure script, so this prevents a
  96. dnl preload section from invoking the macro to get compiler info.
  97. AC_PROG_CC
  98. #Check for compiler vendor
  99. AX_COMPILER_VENDOR
  100. dnl Preload
  101. APR_PRELOAD
  102. dnl These added to allow default directories to be used...
  103. DEFAULT_OSDIR="unix"
  104. echo "(Default will be ${DEFAULT_OSDIR})"
  105. apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support random"
  106. dnl Checks for programs.
  107. AC_PROG_MAKE_SET
  108. AC_PROG_CPP
  109. AC_PROG_AWK
  110. AC_PROG_LN_S
  111. AC_PROG_RANLIB
  112. AC_PROG_INSTALL
  113. AC_CHECK_PROG(RM, rm, rm)
  114. AC_CHECK_PROG(AS, as, as)
  115. AC_CHECK_PROG(ASCPP, cpp, cpp)
  116. AC_CHECK_TOOL(AR, ar, ar)
  117. dnl Various OS checks that apparently set required flags
  118. AC_AIX
  119. AC_ISC_POSIX
  120. AC_MINIX
  121. APR_EBCDIC
  122. dnl this is our library name
  123. APR_LIBNAME="apr${libsuffix}"
  124. AC_SUBST(APR_LIBNAME)
  125. dnl prep libtool
  126. dnl
  127. echo "performing libtool configuration..."
  128. AC_ARG_ENABLE(experimental-libtool,[ --enable-experimental-libtool Use experimental custom libtool],
  129. [experimental_libtool=$enableval],[experimental_libtool=no])
  130. case $host in
  131. *-os2*)
  132. # Use a custom-made libtool replacement
  133. echo "using aplibtool"
  134. LIBTOOL="$srcdir/build/aplibtool"
  135. gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c
  136. ;;
  137. *)
  138. if test "x$LTFLAGS" = "x"; then
  139. LTFLAGS='--silent'
  140. fi
  141. if test "$experimental_libtool" = "yes"; then
  142. # Use a custom-made libtool replacement
  143. echo "using jlibtool"
  144. LIBTOOL="$apr_builddir/libtool"
  145. LIBTOOL_SRC="$apr_srcdir/build/jlibtool.c"
  146. $CC $CFLAGS $CPPFLAGS -o $LIBTOOL $LIBTOOL_SRC
  147. eval `$apr_builddir/libtool --config | grep "^shlibpath_var=[[A-Z_]]*$"`
  148. if test "x$shlibpath_var" = "x"; then
  149. shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR
  150. fi
  151. else
  152. dnl libtoolize requires that the following not be indented
  153. AC_PROG_LIBTOOL
  154. # get libtool's setting of shlibpath_var
  155. eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool`
  156. if test "x$shlibpath_var" = "x"; then
  157. shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR
  158. fi
  159. fi
  160. ;;
  161. esac
  162. AC_ARG_WITH(installbuilddir, [ --with-installbuilddir=DIR location to store APR build files (defaults to '${datadir}/build')],
  163. [ installbuilddir=$withval ], [ installbuilddir="${datadir}/build-${APR_MAJOR_VERSION}" ] )
  164. AC_SUBST(installbuilddir)
  165. AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library],
  166. [ use_libtool=$withval ], [ use_libtool="yes" ] )
  167. if test "x$use_libtool" = "xyes"; then
  168. lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@'
  169. lt_version="-version-info `$get_version libtool $version_hdr APR`"
  170. link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) ${lt_version} \$(ALL_LDFLAGS) -o \$@"
  171. so_ext='lo'
  172. lib_target='-rpath $(libdir) $(OBJECTS)'
  173. export_lib_target='-rpath \$(libdir) \$(OBJECTS)'
  174. else
  175. lt_compile='$(COMPILE) -o $@ -c $<'
  176. link='$(AR) cr $(TARGET_LIB) $(OBJECTS); $(RANLIB) $(TARGET_LIB)'
  177. so_ext='o'
  178. lib_target=''
  179. export_lib_target=''
  180. fi
  181. case $host in
  182. *-solaris2*)
  183. apr_platform_runtime_link_flag="-R"
  184. ;;
  185. *)
  186. ;;
  187. esac
  188. AC_SUBST(lt_compile)
  189. AC_SUBST(link)
  190. AC_SUBST(so_ext)
  191. AC_SUBST(lib_target)
  192. AC_SUBST(export_lib_target)
  193. AC_SUBST(shlibpath_var)
  194. AC_SUBST(LTFLAGS)
  195. AC_SUBST(LT_LDFLAGS)
  196. dnl ----------------------------- Checks for compiler flags
  197. nl='
  198. '
  199. echo "${nl}Check for compiler flags..."
  200. dnl AC_PROG_CC sets -g in CFLAGS (and -O2 for gcc) by default.
  201. dnl On OS/390 this causes the compiler to insert extra debugger
  202. dnl hook instructions. That's fine for debug/maintainer builds, not fine
  203. dnl otherwise.
  204. case $host in
  205. *os390)
  206. if test "$ac_test_CFLAGS" != set; then
  207. APR_REMOVEFROM(CFLAGS,-g)
  208. fi
  209. ;;
  210. esac
  211. AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings],
  212. [APR_ADDTO(CFLAGS,-g)
  213. if test "$GCC" = "yes"; then
  214. APR_ADDTO(CFLAGS,-Wall)
  215. elif test "$AIX_XLC" = "yes"; then
  216. APR_ADDTO(CFLAGS,-qfullpath)
  217. fi
  218. ])dnl
  219. # Enable 64 bit build
  220. AC_ARG_ENABLE(64,
  221. [AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
  222. # tweak compiler specific flags
  223. if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
  224. if test "${enable_64}" = "yes"; then
  225. APR_ADDTO(CFLAGS, -m64)
  226. fi
  227. fi
  228. AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings],
  229. [APR_ADDTO(CFLAGS,-g)
  230. if test "$GCC" = "yes"; then
  231. APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations])
  232. elif test "$AIX_XLC" = "yes"; then
  233. APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro)
  234. fi
  235. ])dnl
  236. AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)],
  237. if test "$GCC" = "yes"; then
  238. APR_ADDTO(CFLAGS, -pg)
  239. APR_REMOVEFROM(CFLAGS, -g)
  240. if test "$host" = "i586-pc-beos"; then
  241. APR_REMOVEFROM(CFLAGS, -O2)
  242. APR_ADDTO(CFLAGS, -O1)
  243. APR_ADDTO(LDFLAGS, -p)
  244. fi
  245. fi
  246. )dnl
  247. AC_ARG_ENABLE(pool-debug,
  248. [ --enable-pool-debug[[=yes|no|verbose|verbose-alloc|lifetime|owner|all]] Turn on pools debugging],
  249. [ if test -z "$enableval"; then
  250. APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=1)
  251. elif test ! "$enableval" = "no"; then
  252. apr_pool_debug=1
  253. for i in $enableval
  254. do
  255. flag=0
  256. case $i in
  257. yes)
  258. flag=1
  259. ;;
  260. verbose)
  261. flag=2
  262. ;;
  263. lifetime)
  264. flag=4
  265. ;;
  266. owner)
  267. flag=8
  268. ;;
  269. verbose-alloc)
  270. flag=16
  271. ;;
  272. all)
  273. apr_pool_debug=31
  274. ;;
  275. *)
  276. ;;
  277. esac
  278. if test $flag -gt 0; then
  279. apr_pool_debug=`expr '(' $apr_pool_debug - $apr_pool_debug % \
  280. '(' $flag '*' 2 ')' ')' + $flag + $apr_pool_debug % $flag`
  281. fi
  282. done
  283. APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=$apr_pool_debug)
  284. fi
  285. ])
  286. if test "$host" = "i586-pc-beos"; then
  287. AC_ARG_ENABLE(malloc-debug,[ --enable-malloc-debug Switch on malloc_debug for BeOS],
  288. APR_REMOVEFROM(CFLAGS, -O2)
  289. APR_ADDTO(CPPFLAGS, -fcheck-memory-usage -D_KERNEL_MODE)
  290. ) dnl
  291. fi
  292. # this is the place to put specific options for platform/compiler
  293. # combinations
  294. case "$host:$CC" in
  295. *-hp-hpux*:cc )
  296. APR_ADDTO(CFLAGS,[-Ae +Z])
  297. case $host in
  298. ia64-* )
  299. ;;
  300. * )
  301. if echo "$CFLAGS " | grep '+DA' >/dev/null; then :
  302. else
  303. APR_ADDTO(CFLAGS,[+DAportable])
  304. fi
  305. ;;
  306. esac
  307. ;;
  308. powerpc-*-beos:mwcc* )
  309. APR_SETVAR(CPP,[mwcc -E])
  310. APR_SETVAR(CC,mwcc)
  311. APR_SETVAR(AR,ar)
  312. ;;
  313. esac
  314. dnl Check the depend program we can use
  315. APR_CHECK_DEPEND
  316. proc_mutex_is_global=0
  317. config_subdirs="none"
  318. INSTALL_SUBDIRS="none"
  319. OBJECTS_PLATFORM='$(OBJECTS_unix)'
  320. case $host in
  321. i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*)
  322. OSDIR="aix"
  323. APR_ADDTO(LDFLAGS,-lld)
  324. eolstr="\\n"
  325. OBJECTS_PLATFORM='$(OBJECTS_aix)'
  326. ;;
  327. *-os2*)
  328. APR_ADDTO(CPPFLAGS,-DOS2)
  329. APR_ADDTO(CFLAGS,-Zmt)
  330. AC_CHECK_LIB(bsd, random)
  331. OSDIR="os2"
  332. enable_threads="system_threads"
  333. eolstr="\\r\\n"
  334. file_as_socket="0"
  335. proc_mutex_is_global=1
  336. OBJECTS_PLATFORM='$(OBJECTS_os2)'
  337. ;;
  338. *beos*)
  339. OSDIR="beos"
  340. APR_ADDTO(CPPFLAGS,-DBEOS)
  341. enable_threads="system_threads"
  342. native_mmap_emul="1"
  343. APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h)
  344. eolstr="\\n"
  345. osver=`uname -r`
  346. proc_mutex_is_global=1
  347. OBJECTS_PLATFORM='$(OBJECTS_beos)'
  348. case $osver in
  349. 5.0.4)
  350. file_as_socket="1"
  351. ;;
  352. *)
  353. file_as_socket="0"
  354. ;;
  355. esac
  356. ;;
  357. *os390)
  358. OSDIR="os390"
  359. OBJECTS_PLATFORM='$(OBJECTS_os390)'
  360. eolstr="\\n"
  361. ;;
  362. *os400)
  363. OSDIR="as400"
  364. eolstr="\\n"
  365. ;;
  366. *cygwin*)
  367. OSDIR="unix"
  368. APR_ADDTO(CPPFLAGS,-DCYGWIN)
  369. enable_threads="no"
  370. eolstr="\\n"
  371. ;;
  372. *hpux10* )
  373. enable_threads="no"
  374. OSDIR="unix"
  375. eolstr="\\n"
  376. ;;
  377. *)
  378. OSDIR="unix"
  379. eolstr="\\n"
  380. ;;
  381. esac
  382. AC_SUBST(OBJECTS_PLATFORM)
  383. # Check whether LFS has explicitly been disabled
  384. AC_ARG_ENABLE(lfs,[ --disable-lfs Disable large file support on 32-bit platforms],
  385. [apr_lfs_choice=$enableval], [apr_lfs_choice=yes])
  386. if test "$apr_lfs_choice" = "yes"; then
  387. # Check whether the transitional LFS API is sufficient
  388. AC_CACHE_CHECK([whether to enable -D_LARGEFILE64_SOURCE], [apr_cv_use_lfs64], [
  389. apr_save_CPPFLAGS=$CPPFLAGS
  390. CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
  391. AC_TRY_RUN([
  392. #include <sys/types.h>
  393. #include <sys/stat.h>
  394. #include <fcntl.h>
  395. #include <stdlib.h>
  396. #include <stdio.h>
  397. #include <unistd.h>
  398. int main(void)
  399. {
  400. int fd, ret = 0;
  401. struct stat64 st;
  402. off64_t off = 4242;
  403. if (sizeof(off64_t) != 8 || sizeof(off_t) != 4)
  404. exit(1);
  405. if ((fd = open("conftest.lfs", O_LARGEFILE|O_CREAT|O_WRONLY)) < 0)
  406. exit(2);
  407. if (ftruncate64(fd, off) != 0)
  408. ret = 3;
  409. else if (fstat64(fd, &st) != 0 || st.st_size != off)
  410. ret = 4;
  411. else if (lseek64(fd, off, SEEK_SET) != off)
  412. ret = 5;
  413. else if (close(fd) != 0)
  414. ret = 6;
  415. else if (lstat64("conftest.lfs", &st) != 0 || st.st_size != off)
  416. ret = 7;
  417. else if (stat64("conftest.lfs", &st) != 0 || st.st_size != off)
  418. ret = 8;
  419. unlink("conftest.lfs");
  420. exit(ret);
  421. }], [apr_cv_use_lfs64=yes], [apr_cv_use_lfs64=no], [apr_cv_use_lfs64=no])
  422. CPPFLAGS=$apr_save_CPPFLAGS])
  423. if test "$apr_cv_use_lfs64" = "yes"; then
  424. APR_ADDTO(CPPFLAGS, [-D_LARGEFILE64_SOURCE])
  425. fi
  426. fi
  427. AC_ARG_ENABLE(nonportable-atomics,
  428. [ --enable-nonportable-atomics Use optimized atomic code which may produce nonportable binaries],
  429. [if test $enableval = yes; then
  430. force_generic_atomics=no
  431. else
  432. force_generic_atomics=yes
  433. fi
  434. ],
  435. [case $host_cpu in
  436. i[[456]]86) force_generic_atomics=yes ;;
  437. *) force_generic_atomics=no ;;
  438. esac
  439. ])
  440. if test $force_generic_atomics = yes; then
  441. AC_DEFINE([USE_GENERIC_ATOMICS], 1,
  442. [Define if use of generic atomics is requested])
  443. fi
  444. AC_SUBST(proc_mutex_is_global)
  445. AC_SUBST(eolstr)
  446. AC_SUBST(INSTALL_SUBDIRS)
  447. # For some platforms we need a version string which allows easy numeric
  448. # comparisons.
  449. case $host in
  450. *freebsd*)
  451. if test -x /sbin/sysctl; then
  452. os_version=`/sbin/sysctl -n kern.osreldate`
  453. else
  454. os_version=000000
  455. fi
  456. ;;
  457. *linux*)
  458. os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'`
  459. ;;
  460. *darwin*)
  461. os_version=`uname -r | sed -e 's/\(.\)\.\(.\).*/\1\2/'`
  462. ;;
  463. *)
  464. os_version=OS_VERSION_IS_NOT_SET
  465. ;;
  466. esac
  467. echo "${nl}Checking for libraries..."
  468. dnl ----------------------------- Checks for Any required Libraries
  469. dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB.
  470. dnl It should check for LIBS being empty and set LIBS equal to the new value
  471. dnl without the extra " " in that case, but they didn't do that. So, we
  472. dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance.
  473. AC_SEARCH_LIBS(gethostbyname, nsl)
  474. AC_SEARCH_LIBS(gethostname, nsl)
  475. AC_SEARCH_LIBS(socket, socket)
  476. AC_SEARCH_LIBS(crypt, crypt ufc)
  477. AC_CHECK_LIB(truerand, main)
  478. AC_SEARCH_LIBS(modf, m)
  479. AC_CHECK_LIB(dl, dlopen)
  480. dnl ----------------------------- Checking for Threads
  481. echo "${nl}Checking for Threads..."
  482. if test -z "$enable_threads"; then
  483. AC_ARG_ENABLE(threads,
  484. [ --enable-threads Enable threading support in APR.],
  485. [ enable_threads=$enableval] ,
  486. [ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] ,
  487. [ enable_threads="no" ] ) ] )
  488. fi
  489. if test "$enable_threads" = "no"; then
  490. threads="0"
  491. pthreadh="0"
  492. pthreadser="0"
  493. else
  494. if test "$enable_threads" = "pthread"; then
  495. # We have specified pthreads for our threading library, just make sure
  496. # that we have everything we need
  497. APR_PTHREADS_CHECK_SAVE
  498. APR_PTHREADS_CHECK
  499. APR_CHECK_PTHREADS_H([
  500. threads="1"
  501. pthreadh="1"
  502. pthreadser="1" ], [
  503. threads="0"
  504. pthreadh="0"
  505. pthreadser="0"
  506. APR_PTHREADS_CHECK_RESTORE ] )
  507. elif test "$enable_threads" = "system_threads"; then
  508. threads="1"
  509. pthreadh="0"
  510. pthreadser="0"
  511. else
  512. # We basically specified that we wanted threads, but not how to implement
  513. # them. In this case, just look for pthreads. In the future, we can check
  514. # for other threading libraries as well.
  515. APR_PTHREADS_CHECK_SAVE
  516. APR_PTHREADS_CHECK
  517. APR_CHECK_PTHREADS_H([
  518. threads="1"
  519. pthreadh="1"
  520. pthreadser="1" ], [
  521. threads="0"
  522. pthreadser="0"
  523. pthreadh="0"
  524. APR_PTHREADS_CHECK_RESTORE ] )
  525. fi
  526. if test "$pthreadh" = "1"; then
  527. APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
  528. APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG
  529. APR_CHECK_PTHREAD_RECURSIVE_MUTEX
  530. AC_CHECK_FUNCS([pthread_key_delete pthread_rwlock_init \
  531. pthread_attr_setguardsize])
  532. if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
  533. dnl ----------------------------- Checking for pthread_rwlock_t
  534. AC_CACHE_CHECK([for pthread_rwlock_t], [apr_cv_type_rwlock_t],
  535. AC_TRY_COMPILE([#include <sys/types.h>
  536. #include <pthread.h>], [pthread_rwlock_t *rwlock;],
  537. [apr_cv_type_rwlock_t=yes], [apr_cv_type_rwlock_t=no],
  538. [apr_cv_type_rwlock_t=no]))
  539. if test "$apr_cv_type_rwlock_t" = "yes"; then
  540. AC_DEFINE(HAVE_PTHREAD_RWLOCKS, 1, [Define if pthread rwlocks are available])
  541. fi
  542. fi
  543. fi
  544. fi
  545. ac_cv_define_READDIR_IS_THREAD_SAFE=no
  546. ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no
  547. ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no
  548. if test "$threads" = "1"; then
  549. echo "APR will use threads"
  550. AC_CHECK_LIB(c_r, readdir,
  551. AC_DEFINE(READDIR_IS_THREAD_SAFE, 1,
  552. [Define if readdir is thread safe]))
  553. if test "x$apr_gethostbyname_is_thread_safe" = "x"; then
  554. AC_CHECK_LIB(c_r, gethostbyname, apr_gethostbyname_is_thread_safe=yes)
  555. fi
  556. if test "$apr_gethostbyname_is_thread_safe" = "yes"; then
  557. AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE, 1,
  558. [Define if gethostbyname is thread safe])
  559. fi
  560. if test "x$apr_gethostbyaddr_is_thread_safe" = "x"; then
  561. AC_CHECK_LIB(c_r, gethostbyaddr, apr_gethostbyaddr_is_thread_safe=yes)
  562. fi
  563. if test "$apr_gethostbyaddr_is_thread_safe" = "yes"; then
  564. AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE, 1,
  565. [Define if gethostbyaddr is thread safe])
  566. fi
  567. AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r)
  568. else
  569. echo "APR will be non-threaded"
  570. fi
  571. dnl Electric Fence malloc checker.
  572. dnl --with-efence specifies the path to Electric Fence.
  573. dnl This test should remain after the threads checks since libefence
  574. dnl may depend on libpthread.
  575. AC_ARG_WITH(efence,
  576. [ --with-efence[[=DIR]] path to Electric Fence installation],
  577. [ apr_efence_dir="$withval"
  578. if test "$apr_efence_dir" != "yes"; then
  579. APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib])
  580. if test "x$apr_platform_runtime_link_flag" != "x"; then
  581. APR_ADDTO(LDFLAGS,
  582. [$apr_platform_runtime_link_flag$apr_efence_dir/lib])
  583. fi
  584. fi
  585. AC_CHECK_LIB(efence, malloc,
  586. [ APR_ADDTO(LIBS,-lefence) ],
  587. [ AC_MSG_ERROR(Electric Fence requested but not detected) ])
  588. ])
  589. AC_CHECK_FUNCS(sigsuspend, [ have_sigsuspend="1" ], [ have_sigsuspend="0" ])
  590. AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ])
  591. dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function
  592. dnl is renamed in signal.h. Todo: Autodetect
  593. case $host in
  594. *alpha*-dec-osf* )
  595. have_sigwait="1"
  596. ;;
  597. esac
  598. AC_SUBST(threads)
  599. AC_SUBST(have_sigsuspend)
  600. AC_SUBST(have_sigwait)
  601. AC_CHECK_FUNCS(poll kqueue port_create)
  602. # Check for the Linux epoll interface; epoll* may be available in libc
  603. # but return ENOSYS on a pre-2.6 kernel, so do a run-time check.
  604. AC_CACHE_CHECK([for epoll support], [apr_cv_epoll],
  605. [AC_TRY_RUN([
  606. #include <sys/epoll.h>
  607. #include <unistd.h>
  608. int main()
  609. {
  610. return epoll_create(5) == -1;
  611. }], [apr_cv_epoll=yes], [apr_cv_epoll=no], [apr_cv_epoll=no])])
  612. if test "$apr_cv_epoll" = "yes"; then
  613. AC_DEFINE([HAVE_EPOLL], 1, [Define if the epoll interface is supported])
  614. fi
  615. dnl ----------------------------- Checking for missing POSIX thread functions
  616. AC_CHECK_FUNCS([getpwnam_r getpwuid_r getgrnam_r getgrgid_r])
  617. dnl ----------------------------- Checking for Shared Memory Support
  618. echo "${nl}Checking for Shared Memory Support..."
  619. # The real-time POSIX extensions (e.g. shm_*, sem_*) may only
  620. # be available if linking against librt.
  621. AC_SEARCH_LIBS(shm_open, rt)
  622. case $host in
  623. *-sysv*)
  624. ac_includes_default="$ac_includes_default
  625. #if HAVE_SYS_MUTEX_H /* needed to define lock_t for sys/shm.h */
  626. # include <sys/mutex.h>
  627. #endif";;
  628. esac
  629. AC_CHECK_HEADERS([sys/types.h sys/mman.h sys/ipc.h sys/mutex.h sys/shm.h sys/file.h kernel/OS.h os2.h])
  630. AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \
  631. create_area])
  632. APR_CHECK_DEFINE(MAP_ANON, sys/mman.h)
  633. AC_CHECK_FILE(/dev/zero)
  634. # Not all systems can mmap /dev/zero (such as HP-UX). Check for that.
  635. if test "$ac_cv_func_mmap" = "yes" &&
  636. test "$ac_cv_file__dev_zero" = "yes"; then
  637. AC_MSG_CHECKING(for mmap that can map /dev/zero)
  638. AC_TRY_RUN([
  639. #include <sys/types.h>
  640. #include <sys/stat.h>
  641. #include <fcntl.h>
  642. #ifdef HAVE_SYS_MMAN_H
  643. #include <sys/mman.h>
  644. #endif
  645. int main()
  646. {
  647. int fd;
  648. void *m;
  649. fd = open("/dev/zero", O_RDWR);
  650. if (fd < 0) {
  651. return 1;
  652. }
  653. m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
  654. if (m == (void *)-1) { /* aka MAP_FAILED */
  655. return 2;
  656. }
  657. if (munmap(m, sizeof(void*)) < 0) {
  658. return 3;
  659. }
  660. return 0;
  661. }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
  662. AC_MSG_RESULT($ac_cv_file__dev_zero)
  663. fi
  664. # Now we determine which one is our anonymous shmem preference.
  665. haveshmgetanon="0"
  666. havemmapzero="0"
  667. havemmapanon="0"
  668. case $host in
  669. *-*-cygwin | *-*-mingw* | *-*-pw32*)
  670. ;;
  671. *)
  672. APR_BEGIN_DECISION([anonymous shared memory allocation method])
  673. APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl
  674. func:shmget func:shmat func:shmdt func:shmctl,
  675. [haveshmgetanon="1"
  676. APR_DECIDE(USE_SHMEM_SHMGET_ANON, [SysV IPC shmget()])])
  677. APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero,
  678. [havemmapzero="1"
  679. APR_DECIDE(USE_SHMEM_MMAP_ZERO,
  680. [SVR4-style mmap() on /dev/zero])])
  681. APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON,
  682. [havemmapanon="1"
  683. APR_DECIDE(USE_SHMEM_MMAP_ANON,
  684. [4.4BSD-style mmap() via MAP_ANON])])
  685. APR_IFALLYES(header:os2.h,
  686. [haveos2shm="1"
  687. APR_DECIDE(USE_SHMEM_OS2_ANON, [OS/2 DosAllocSharedMem()])])
  688. APR_IFALLYES(header:kernel/OS.h func:create_area,
  689. [havebeosshm="1"
  690. APR_DECIDE(USE_SHMEM_BEOS_ANON,
  691. [BeOS areas])])
  692. case $host in
  693. *linux* )
  694. # Linux has problems with MM_SHMT_MMANON even though it reports
  695. # that it has it.
  696. # FIXME - find exact 2.3 version that MMANON was fixed in. It is
  697. # confirmed fixed in 2.4 series.
  698. if test $os_version -le "240"; then
  699. APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET_ANON)
  700. fi
  701. ;;
  702. *hpux11* )
  703. APR_DECISION_OVERRIDE(USE_SHMEM_SHMGET_ANON)
  704. ;;
  705. esac
  706. APR_END_DECISION
  707. ;;
  708. esac
  709. AC_DEFINE_UNQUOTED($ac_decision)
  710. useshmgetanon="0"
  711. usemmapzero="0"
  712. usemmapanon="0"
  713. case $ac_decision in
  714. USE_SHMEM_SHMGET_ANON )
  715. useshmgetanon="1"
  716. ;;
  717. USE_SHMEM_MMAP_ZERO )
  718. usemmapzero="1"
  719. ;;
  720. USE_SHMEM_MMAP_ANON )
  721. usemmapanon="1"
  722. ;;
  723. esac
  724. AC_SUBST(useshmgetanon)
  725. AC_SUBST(usemmapzero)
  726. AC_SUBST(usemmapanon)
  727. AC_SUBST(haveshmgetanon)
  728. AC_SUBST(havemmapzero)
  729. AC_SUBST(havemmapanon)
  730. # Now we determine which one is our name-based shmem preference.
  731. havemmaptmp="0"
  732. havemmapshm="0"
  733. haveshmget="0"
  734. havebeosarea="0"
  735. haveos2shm="0"
  736. case $host in
  737. *-*-cygwin | *-*-mingw* | *-*-pw32*)
  738. ;;
  739. *)
  740. APR_BEGIN_DECISION([namebased memory allocation method])
  741. APR_IFALLYES(header:sys/mman.h func:mmap func:munmap,
  742. [havemmaptmp="1"
  743. APR_DECIDE(USE_SHMEM_MMAP_TMP,
  744. [Classical mmap() on temporary file])])
  745. APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl
  746. func:shm_unlink,
  747. [havemmapshm="1"
  748. APR_DECIDE(USE_SHMEM_MMAP_SHM,
  749. [mmap() via POSIX.1 shm_open() on temporary file])])
  750. APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl
  751. func:shmget func:shmat func:shmdt func:shmctl,
  752. [haveshmget="1"
  753. APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])])
  754. APR_IFALLYES(header:kernel/OS.h func:create_area,
  755. [havebeosshm="1"
  756. APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])])
  757. APR_IFALLYES(header:os2.h,
  758. [haveos2shm="1"
  759. APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])])
  760. case $host in
  761. *linux* )
  762. # Linux has problems with MM_SHMT_MMANON even though it reports
  763. # that it has it.
  764. # FIXME - find exact 2.3 version that MMANON was fixed in. It is
  765. # confirmed fixed in 2.4 series.
  766. if test $os_version -le "240"; then
  767. APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_TMP USE_SHMEM_MMAP_SHM dnl
  768. USE_SHMEM_SHMGET)
  769. fi
  770. ;;
  771. esac
  772. APR_END_DECISION
  773. ;;
  774. esac
  775. AC_DEFINE_UNQUOTED($ac_decision)
  776. usemmaptmp="0"
  777. usemmapshm="0"
  778. useshmget="0"
  779. usebeosarea="0"
  780. useos2shm="0"
  781. case $ac_decision in
  782. USE_SHMEM_MMAP_TMP )
  783. usemmaptmp="1"
  784. ;;
  785. USE_SHMEM_MMAP_SHM )
  786. usemmapshm="1"
  787. ;;
  788. USE_SHMEM_SHMGET )
  789. useshmget="1"
  790. ;;
  791. USE_SHMEM_BEOS )
  792. usebeosarea="1"
  793. ;;
  794. USE_SHMEM_OS2 )
  795. useos2shm="1"
  796. ;;
  797. esac
  798. # Do we have any shared memory support?
  799. if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea$useos2shm" = "0000000"; then
  800. sharedmem="0"
  801. else
  802. sharedmem="1"
  803. fi
  804. AC_SUBST(usemmaptmp)
  805. AC_SUBST(usemmapshm)
  806. AC_SUBST(useshmget)
  807. AC_SUBST(usebeosarea)
  808. AC_SUBST(useos2shm)
  809. AC_SUBST(havemmaptmp)
  810. AC_SUBST(havemmapshm)
  811. AC_SUBST(haveshmget)
  812. AC_SUBST(havebeosarea)
  813. AC_SUBST(haveos2shm)
  814. AC_SUBST(sharedmem)
  815. dnl ----------------------------- Checks for Any required Functions
  816. dnl Checks for library functions. (N.B. poll is further down)
  817. AC_CHECK_FUNCS([alloca calloc setsid isinf isnan \
  818. getenv putenv setenv unsetenv \
  819. writev getifaddrs utime utimes])
  820. AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ])
  821. AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ])
  822. sendfile="0"
  823. AC_CHECK_LIB(sendfile, sendfilev)
  824. AC_CHECK_FUNCS(sendfile send_file sendfilev, [ sendfile="1" ])
  825. dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a
  826. dnl threaded poll() and we don't want to use sendfile on early FreeBSD
  827. dnl systems if we are also using threads.
  828. AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfile],
  829. [ if test "$withval" = "yes"; then
  830. sendfile="1"
  831. else
  832. sendfile="0"
  833. fi ], [
  834. orig_sendfile=$sendfile
  835. case $host in
  836. *freebsd*)
  837. # FreeBSD < 4.2 has issues with threads+sendfile
  838. if test $os_version -le "401999"; then
  839. if test "$threads" = "1"; then
  840. sendfile="0"
  841. fi
  842. fi
  843. ;;
  844. *alpha*-dec-osf* )
  845. sendfile="0"
  846. ;;
  847. s390-*-linux-gnu)
  848. # disable sendfile support for 2.2 on S/390
  849. if test $os_version -lt 240; then
  850. sendfile="0"
  851. fi
  852. ;;
  853. *aix*)
  854. # compiler-independent check for 64-bit build
  855. AC_CHECK_SIZEOF(void*, 4)
  856. if test "x$ac_cv_sizeof_voidp" = "x8"; then
  857. # sendfile not working for 64-bit build
  858. sendfile="0"
  859. fi
  860. ;;
  861. esac
  862. if test "$orig_sendfile" != "$sendfile"; then
  863. echo "sendfile support disabled to avoid system problem"
  864. fi ] )
  865. AC_SUBST(sendfile)
  866. AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ])
  867. AC_DECL_SYS_SIGLIST
  868. AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ])
  869. APR_CHECK_INET_ADDR
  870. APR_CHECK_INET_NETWORK
  871. AC_SUBST(apr_inaddr_none)
  872. AC_CHECK_FUNC(_getch)
  873. AC_CHECK_FUNCS(strerror_r, [ strerror_r="1" ], [ strerror_r="0" ])
  874. if test "$strerror_r" = "1"; then
  875. APR_CHECK_STRERROR_R_RC
  876. fi
  877. AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ])
  878. if test "$native_mmap_emul" = "1"; then
  879. mmap="1"
  880. fi
  881. AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ])
  882. AC_CHECK_FUNCS([getpass getpassphrase gmtime_r localtime_r mkstemp])
  883. AC_SUBST(fork)
  884. AC_SUBST(have_inet_addr)
  885. AC_SUBST(tcp_nodelay_inherited)
  886. AC_SUBST(o_nonblock_inherited)
  887. AC_SUBST(have_inet_network)
  888. AC_SUBST(have_sigaction)
  889. AC_SUBST(have_setrlimit)
  890. AC_SUBST(have_getrlimit)
  891. AC_SUBST(mmap)
  892. AC_SUBST(have_memmove)
  893. APR_CHECK_SIGWAIT_ONE_ARG
  894. APR_CHECK_DIRENT_INODE
  895. APR_CHECK_DIRENT_TYPE
  896. dnl ----------------------------- Checks for Any required Headers
  897. AC_HEADER_STDC
  898. APR_FLAG_HEADERS(
  899. alloca.h \
  900. ByteOrder.h \
  901. conio.h \
  902. crypt.h \
  903. ctype.h \
  904. dir.h \
  905. dirent.h \
  906. dl.h \
  907. dlfcn.h \
  908. errno.h \
  909. fcntl.h \
  910. grp.h \
  911. io.h \
  912. limits.h \
  913. mach-o/dyld.h \
  914. malloc.h \
  915. memory.h \
  916. netdb.h \
  917. osreldate.h \
  918. poll.h \
  919. process.h \
  920. pwd.h \
  921. semaphore.h \
  922. signal.h \
  923. stdarg.h \
  924. stddef.h \
  925. stdio.h \
  926. stdlib.h \
  927. string.h \
  928. strings.h \
  929. sysapi.h \
  930. sysgtime.h \
  931. termios.h \
  932. time.h \
  933. tpfeq.h \
  934. tpfio.h \
  935. unistd.h \
  936. unix.h \
  937. arpa/inet.h \
  938. kernel/OS.h \
  939. net/errno.h \
  940. netinet/in.h \
  941. netinet/sctp.h \
  942. netinet/sctp_uio.h \
  943. sys/file.h \
  944. sys/ioctl.h \
  945. sys/mman.h \
  946. sys/poll.h \
  947. sys/resource.h \
  948. sys/select.h \
  949. sys/sem.h \
  950. sys/sendfile.h \
  951. sys/signal.h \
  952. sys/socket.h \
  953. sys/sockio.h \
  954. sys/stat.h \
  955. sys/sysctl.h \
  956. sys/syslimits.h \
  957. sys/time.h \
  958. sys/types.h \
  959. sys/uio.h \
  960. sys/un.h \
  961. sys/wait.h)
  962. # IRIX 6.5 has a problem in <netinet/tcp.h> which prevents it from
  963. # being included by itself. Check for <netinet/tcp.h> manually,
  964. # including another header file first.
  965. AC_CACHE_CHECK([for netinet/tcp.h], [apr_cv_hdr_netinet_tcp_h],
  966. [AC_TRY_CPP(
  967. [#ifdef HAVE_NETINET_IN_H
  968. #include <netinet/in.h>
  969. #endif
  970. #include <netinet/tcp.h>
  971. ], [apr_cv_hdr_netinet_tcp_h=yes], [apr_cv_hdr_netinet_tcp_h=no])])
  972. if test "$apr_cv_hdr_netinet_tcp_h" = "yes"; then
  973. netinet_tcph=1
  974. AC_DEFINE([HAVE_NETINET_TCP_H], 1, [Defined if netinet/tcp.h is present])
  975. else
  976. netinet_tcph=0
  977. fi
  978. AC_SUBST(arpa_ineth)
  979. AC_SUBST(conioh)
  980. AC_SUBST(ctypeh)
  981. AC_SUBST(crypth)
  982. AC_SUBST(errnoh)
  983. AC_SUBST(direnth)
  984. AC_SUBST(fcntlh)
  985. AC_SUBST(ioh)
  986. AC_SUBST(limitsh)
  987. AC_SUBST(netdbh)
  988. AC_SUBST(sys_syslimitsh)
  989. AC_SUBST(netinet_inh)
  990. AC_SUBST(netinet_sctph)
  991. AC_SUBST(netinet_sctp_uioh)
  992. AC_SUBST(netinet_tcph)
  993. AC_SUBST(stdargh)
  994. AC_SUBST(stdioh)
  995. AC_SUBST(stdlibh)
  996. AC_SUBST(stringh)
  997. AC_SUBST(stringsh)
  998. AC_SUBST(sys_ioctlh)
  999. AC_SUBST(sys_sendfileh)
  1000. AC_SUBST(sys_signalh)
  1001. AC_SUBST(sys_socketh)
  1002. AC_SUBST(sys_sockioh)
  1003. AC_SUBST(sys_typesh)
  1004. AC_SUBST(sys_timeh)
  1005. AC_SUBST(sys_uioh)
  1006. AC_SUBST(sys_unh)
  1007. AC_SUBST(timeh)
  1008. AC_SUBST(unistdh)
  1009. AC_SUBST(signalh)
  1010. AC_SUBST(sys_waith)
  1011. AC_SUBST(pthreadh)
  1012. AC_SUBST(semaphoreh)
  1013. # Checking for h_errno in <netdb.h>
  1014. if test "$netdbh" = "1"; then
  1015. APR_CHECK_H_ERRNO_FLAG
  1016. if test "$ac_cv_h_errno_cflags" = "no"; then
  1017. AC_MSG_ERROR([can not find h_errno in netdb.h])
  1018. fi
  1019. fi
  1020. dnl ----------------------------- Checks for standard typedefs
  1021. AC_TYPE_OFF_T
  1022. AC_TYPE_PID_T
  1023. AC_TYPE_SIZE_T
  1024. AC_TYPE_UID_T
  1025. AC_CHECK_TYPE(ssize_t, int)
  1026. AC_C_INLINE
  1027. AC_C_CONST
  1028. AC_FUNC_SETPGRP
  1029. APR_CHECK_SOCKLEN_T
  1030. dnl Checks for pointer size
  1031. AC_CHECK_SIZEOF(void*, 4)
  1032. if test "x$ac_cv_sizeof_voidp" != "x"; then
  1033. voidp_size=$ac_cv_sizeof_voidp
  1034. else
  1035. AC_ERROR([Cannot determine size of void*])
  1036. fi
  1037. dnl Checks for integer size
  1038. AC_CHECK_SIZEOF(char, 1)
  1039. AC_CHECK_SIZEOF(int, 4)
  1040. AC_CHECK_SIZEOF(long, 4)
  1041. AC_CHECK_SIZEOF(short, 2)
  1042. AC_CHECK_SIZEOF(long long, 8)
  1043. if test "$ac_cv_sizeof_short" = "2"; then
  1044. short_value=short
  1045. fi
  1046. if test "$ac_cv_sizeof_int" = "4"; then
  1047. int_value=int
  1048. fi
  1049. # Now we need to find what fspr_int64_t (sizeof == 8) will be.
  1050. # The first match is our preference.
  1051. if test "$ac_cv_sizeof_int" = "8"; then
  1052. int64_literal='#define APR_INT64_C(val) (val)'
  1053. uint64_literal='#define APR_UINT64_C(val) (val##U)'
  1054. int64_t_fmt='#define APR_INT64_T_FMT "d"'
  1055. uint64_t_fmt='#define APR_UINT64_T_FMT "u"'
  1056. uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"'
  1057. int64_value="int"
  1058. long_value=int
  1059. int64_strfn="strtoi"
  1060. elif test "$ac_cv_sizeof_long" = "8"; then
  1061. int64_literal='#define APR_INT64_C(val) (val##L)'
  1062. uint64_literal='#define APR_UINT64_C(val) (val##UL)'
  1063. int64_t_fmt='#define APR_INT64_T_FMT "ld"'
  1064. uint64_t_fmt='#define APR_UINT64_T_FMT "lu"'
  1065. uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"'
  1066. int64_value="long"
  1067. long_value=long
  1068. int64_strfn="strtol"
  1069. elif test "$ac_cv_sizeof_long_long" = "8"; then
  1070. int64_literal='#define APR_INT64_C(val) (val##LL)'
  1071. uint64_literal='#define APR_UINT64_C(val) (val##ULL)'
  1072. # Linux, Solaris, FreeBSD all support ll with printf.
  1073. # BSD 4.4 originated 'q'. Solaris is more popular and
  1074. # doesn't support 'q'. Solaris wins. Exceptions can
  1075. # go to the OS-dependent section.
  1076. int64_t_fmt='#define APR_INT64_T_FMT "lld"'
  1077. uint64_t_fmt='#define APR_UINT64_T_FMT "llu"'
  1078. uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "llx"'
  1079. int64_value="long long"
  1080. long_value="long long"
  1081. int64_strfn="strtoll"
  1082. elif test "$ac_cv_sizeof_longlong" = "8"; then
  1083. int64_literal='#define APR_INT64_C(val) (val##LL)'
  1084. uint64_literal='#define APR_UINT64_C(val) (val##ULL)'
  1085. int64_t_fmt='#define APR_INT64_T_FMT "qd"'
  1086. uint64_t_fmt='#define APR_UINT64_T_FMT "qu"'
  1087. uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"'
  1088. int64_value="__int64"
  1089. long_value="__int64"
  1090. int64_strfn="strtoll"
  1091. else
  1092. # int64_literal may be overriden if your compiler thinks you have
  1093. # a 64-bit value but APR does not agree.
  1094. AC_ERROR([could not detect a 64-bit integer type])
  1095. fi
  1096. # If present, allow the C99 macro INT64_C to override our conversion.
  1097. #
  1098. # HP-UX's ANSI C compiler provides this without any includes, so we
  1099. # will first look for INT64_C without adding stdint.h
  1100. AC_CACHE_CHECK([for INT64_C], [apr_cv_define_INT64_C], [
  1101. AC_EGREP_CPP(YES_IS_DEFINED,
  1102. [#ifdef INT64_C
  1103. YES_IS_DEFINED
  1104. #endif], [apr_cv_define_INT64_C=yes], [
  1105. # Now check for INT64_C in stdint.h
  1106. AC_EGREP_CPP(YES_IS_DEFINED, [#include <stdint.h>
  1107. #ifdef INT64_C
  1108. YES_IS_DEFINED
  1109. #endif], [apr_cv_define_INT64_C=yes], [apr_cv_define_INT64_C=no])])])
  1110. if test "$apr_cv_define_INT64_C" = "yes"; then
  1111. int64_literal='#define APR_INT64_C(val) INT64_C(val)'
  1112. uint64_literal='#define APR_UINT64_C(val) UINT64_C(val)'
  1113. stdint=1
  1114. else
  1115. stdint=0
  1116. fi
  1117. if test "$ac_cv_type_size_t" = "yes"; then
  1118. size_t_value="size_t"
  1119. else
  1120. size_t_value="fspr_int32_t"
  1121. fi
  1122. if test "$ac_cv_type_ssize_t" = "yes"; then
  1123. ssize_t_value="ssize_t"
  1124. else
  1125. ssize_t_value="fspr_int32_t"
  1126. fi
  1127. if test "$ac_cv_socklen_t" = "yes"; then
  1128. socklen_t_value="socklen_t"
  1129. case $host in
  1130. *-hp-hpux*)
  1131. if test "$ac_cv_sizeof_long" = "8"; then
  1132. # 64-bit HP-UX requires 32-bit socklens in
  1133. # kernel, but user-space declarations say
  1134. # 64-bit (socklen_t == size_t == long).
  1135. # This will result in many compile warnings,
  1136. # but we're functionally busted otherwise.
  1137. socklen_t_value="int"
  1138. fi
  1139. ;;
  1140. esac
  1141. else
  1142. socklen_t_value="int"
  1143. fi
  1144. APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
  1145. if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
  1146. ssize_t_fmt='#define APR_SSIZE_T_FMT "d"'
  1147. elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
  1148. ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
  1149. else
  1150. ssize_t_fmt='#error Can not determine the proper size for ssize_t'
  1151. fi
  1152. APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
  1153. if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
  1154. size_t_fmt='#define APR_SIZE_T_FMT "d"'
  1155. elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
  1156. size_t_fmt='#define APR_SIZE_T_FMT "ld"'
  1157. else
  1158. size_t_fmt='#define APR_SIZE_T_FMT "zu"'
  1159. fi
  1160. APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
  1161. if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
  1162. # Enable LFS
  1163. aprlfs=1
  1164. AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 mkstemp64])
  1165. else
  1166. aprlfs=0
  1167. fi
  1168. AC_MSG_CHECKING([which type to use for fspr_off_t])
  1169. if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
  1170. # LFS is go!
  1171. off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
  1172. off_t_value='off64_t'
  1173. off_t_strfn='fspr_strtoi64'
  1174. elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then
  1175. # Special case: off_t may change size with _FILE_OFFSET_BITS
  1176. # on 32-bit systems with LFS support. To avoid compatibility
  1177. # issues when other packages do define _FILE_OFFSET_BITS,
  1178. # hard-code fspr_off_t to long.
  1179. off_t_value=long
  1180. off_t_fmt='#define APR_OFF_T_FMT "ld"'
  1181. off_t_strfn='strtol'
  1182. elif test "$ac_cv_type_off_t" = "yes"; then
  1183. off_t_value=off_t
  1184. # off_t is more commonly a long than an int; prefer that case
  1185. # where int and long are the same size.
  1186. if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then
  1187. off_t_fmt='#define APR_OFF_T_FMT "ld"'
  1188. off_t_strfn='strtol'
  1189. elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then
  1190. off_t_fmt='#define APR_OFF_T_FMT "d"'
  1191. off_t_strfn='strtoi'
  1192. elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then
  1193. off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
  1194. off_t_strfn='fspr_strtoi64'
  1195. else
  1196. AC_ERROR([could not determine the size of off_t])
  1197. fi
  1198. else
  1199. # Fallback on int
  1200. off_t_value=fspr_int32_t
  1201. off_t_fmt=d
  1202. off_t_strfn='strtoi'
  1203. fi
  1204. AC_MSG_RESULT($off_t_value)
  1205. APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8)
  1206. if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then
  1207. pid_t_fmt='#define APR_PID_T_FMT "hd"'
  1208. elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then
  1209. pid_t_fmt='#define APR_PID_T_FMT "d"'
  1210. elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then
  1211. pid_t_fmt='#define APR_PID_T_FMT "ld"'
  1212. elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then
  1213. pid_t_fmt='#define APR_PID_T_FMT APR_INT64_T_FMT'
  1214. else
  1215. pid_t_fmt='#error Can not determine the proper size for pid_t'
  1216. fi
  1217. # Checks for endianness
  1218. AC_C_BIGENDIAN
  1219. if test $ac_cv_c_bigendian = yes; then
  1220. bigendian=1
  1221. else
  1222. bigendian=0
  1223. fi
  1224. # Basically, we have tried to figure out the correct format strings
  1225. # for APR types which vary between platforms, but we don't always get
  1226. # it right. If you find that we don't get it right for your platform,
  1227. # you can override our decision below.
  1228. case $host in
  1229. s390*linux*)
  1230. # uniquely, the 31-bit Linux/s390 uses "unsigned long int"
  1231. # for size_t rather than "unsigned int":
  1232. size_t_fmt='#define APR_SIZE_T_FMT "lu"'
  1233. ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
  1234. ;;
  1235. *-os2*)
  1236. size_t_fmt='#define APR_SIZE_T_FMT "lu"'
  1237. ;;
  1238. *-solaris*)
  1239. pid_t_fmt='#define APR_PID_T_FMT "ld"'
  1240. ;;
  1241. *-netbsd*)
  1242. pid_t_fmt='#define APR_PID_T_FMT "ld"'
  1243. ;;
  1244. *aix4*|*aix5*)
  1245. ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
  1246. size_t_fmt='#define APR_SIZE_T_FMT "ld"'
  1247. ;;
  1248. *beos*)
  1249. ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
  1250. size_t_fmt='#define APR_SIZE_T_FMT "ld"'
  1251. ;;
  1252. *apple-darwin*)
  1253. osver=`uname -r`
  1254. case $osver in
  1255. [0-7].*)
  1256. ssize_t_fmt='#define APR_SSIZE_T_FMT "d"'
  1257. ;;
  1258. *)
  1259. ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
  1260. ;;
  1261. esac
  1262. size_t_fmt='#define APR_SIZE_T_FMT "lu"'
  1263. ;;
  1264. esac
  1265. AC_SUBST(voidp_size)
  1266. AC_SUBST(short_value)
  1267. AC_SUBST(int_value)
  1268. AC_SUBST(long_value)
  1269. AC_SUBST(int64_value)
  1270. AC_SUBST(off_t_value)
  1271. AC_SUBST(size_t_value)
  1272. AC_SUBST(ssize_t_value)
  1273. AC_SUBST(socklen_t_value)
  1274. AC_SUBST(int64_t_fmt)
  1275. AC_SUBST(uint64_t_fmt)
  1276. AC_SUBST(uint64_t_hex_fmt)
  1277. AC_SUBST(ssize_t_fmt)
  1278. AC_SUBST(size_t_fmt)
  1279. AC_SUBST(off_t_fmt)
  1280. AC_SUBST(pid_t_fmt)
  1281. AC_SUBST(int64_literal)
  1282. AC_SUBST(uint64_literal)
  1283. AC_SUBST(stdint)
  1284. AC_SUBST(bigendian)
  1285. AC_SUBST(aprlfs)
  1286. dnl ----------------------------- Checking for string functions
  1287. AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0")
  1288. AC_CHECK_FUNCS(strncasecmp, have_strncasecmp="1", have_strncasecmp="0")
  1289. AC_CHECK_FUNCS(stricmp, have_stricmp="1", have_stricmp="0")
  1290. AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0")
  1291. AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0")
  1292. AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0")
  1293. AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0")
  1294. AC_CHECK_FUNC($int64_strfn, have_int64_strfn="1", have_int64_strfn="0")
  1295. dnl ----------------------------- We have a fallback position
  1296. if test "$have_int64_strfn" = "0" && test "$int64_strfn" = "strtoll"; then
  1297. int64_strfn="strtoq"
  1298. AC_CHECK_FUNC(strtoq, [have_int64_strfn=1], [have_int64_strfn=0])
  1299. fi
  1300. if test "$have_int64_strfn" = "1"; then
  1301. AC_DEFINE_UNQUOTED(APR_INT64_STRFN, [$int64_strfn],
  1302. [Define as function which can be used for conversion of strings to fspr_int64_t])
  1303. fi
  1304. AC_SUBST(have_strnicmp)
  1305. AC_SUBST(have_strncasecmp)
  1306. AC_SUBST(have_stricmp)
  1307. AC_SUBST(have_strcasecmp)
  1308. AC_SUBST(have_strdup)
  1309. AC_SUBST(have_strstr)
  1310. AC_SUBST(have_memchr)
  1311. if test "$off_t_strfn" = "fspr_strtoi64" && test "$have_int64_strfn" = "1"; then
  1312. off_t_strfn=$int64_strfn
  1313. fi
  1314. AC_DEFINE_UNQUOTED(APR_OFF_T_STRFN, [$off_t_strfn],
  1315. [Define as function used for conversion of strings to fspr_off_t])
  1316. dnl ----------------------------- Checking for DSO support
  1317. echo "${nl}Checking for DSO..."
  1318. AC_ARG_ENABLE(dso,
  1319. [ --disable-dso Disable DSO support ],
  1320. [if test "x$enableval" = "xyes"; then
  1321. dsotype=any
  1322. else
  1323. dsotype=$enableval
  1324. fi
  1325. ], [dsotype=any])
  1326. if test "$dsotype" = "any"; then
  1327. # Darwin:
  1328. AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld])
  1329. if test "$dsotype" = "any"; then
  1330. # Original HP-UX:
  1331. AC_CHECK_LIB(dld, shl_load, [dsotype=shl; APR_ADDTO(LIBS,-ldld)])
  1332. fi
  1333. # Normal POSIX:
  1334. if test "$dsotype" = "any"; then
  1335. AC_CHECK_FUNC(dlopen, [dsotype=dlfcn])
  1336. fi
  1337. if test "$dsotype" = "any"; then
  1338. AC_CHECK_LIB(dl, dlopen, [dsotype=dlfcn; APR_ADDTO(LIBS,-ldl)])
  1339. fi
  1340. if test "$dsotype" = "dlfcn"; then
  1341. # ReliantUnix has dlopen() in libc but dlsym() in libdl :(
  1342. AC_CHECK_FUNC(dlsym, [],
  1343. [AC_CHECK_LIB(dl, dlsym,
  1344. [APR_ADDTO(LIBS, -ldl)],
  1345. [dsotype=any
  1346. echo "Weird: dlopen() was found but dlsym() was not found!"])])
  1347. fi
  1348. if test "$dsotype" = "any"; then
  1349. # BeOS:
  1350. AC_CHECK_LIB(root, load_image, [dsotype=other])
  1351. fi
  1352. # Everything else:
  1353. if test "$dsotype" = "any"; then
  1354. case $host in
  1355. *os390|*-os2*|*os400|*-aix*) dsotype=other ;;
  1356. esac
  1357. fi
  1358. fi
  1359. if test "$dsotype" = "any"; then
  1360. AC_MSG_ERROR([Could not detect suitable DSO implementation])
  1361. elif test "$dsotype" = "no"; then
  1362. aprdso="0"
  1363. else
  1364. case "$dsotype" in
  1365. dlfcn) AC_DEFINE(DSO_USE_DLFCN, 1, [Define if DSO support uses dlfcn.h]);;
  1366. shl) AC_DEFINE(DSO_USE_SHL, 1, [Define if DSO support uses shl_load]);;
  1367. dyld) AC_DEFINE(DSO_USE_DYLD, 1, [Define if DSO support uses dyld.h]);;
  1368. other) ;; # Use whatever is in dso/OSDIR
  1369. *) AC_MSG_ERROR([Unknown DSO implementation "$dsotype"]);;
  1370. esac
  1371. aprdso="1"
  1372. apr_modules="$apr_modules dso"
  1373. fi
  1374. AC_SUBST(aprdso)
  1375. dnl ----------------------------- Checking for Processes
  1376. echo "${nl}Checking for Processes..."
  1377. AC_CHECK_FUNCS(waitpid)
  1378. AC_ARG_ENABLE(other-child,
  1379. [ --enable-other-child Enable reliable child processes ],
  1380. [ if test "$enableval" = "yes"; then
  1381. oc="1"
  1382. else
  1383. oc="0"
  1384. fi ],
  1385. [ oc=1 ] )
  1386. AC_SUBST(oc)
  1387. AC_MSG_CHECKING(for Variable Length Arrays)
  1388. APR_TRY_COMPILE_NO_WARNING([],
  1389. [
  1390. int foo[argc];
  1391. foo[0] = 0;
  1392. ], vla_msg=yes, vla_msg=no )
  1393. AC_MSG_RESULT([$vla_msg])
  1394. if test "$vla_msg" = "yes"; then
  1395. AC_DEFINE(HAVE_VLA, 1, [Define if C compiler supports VLA])
  1396. fi
  1397. AC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[
  1398. AC_TRY_RUN([
  1399. #include <sys/types.h>
  1400. #include <sys/time.h>
  1401. #include <sys/resource.h>
  1402. #include <stdlib.h>
  1403. main()
  1404. {
  1405. struct rlimit limit;
  1406. limit.rlim_cur = 0;
  1407. limit.rlim_max = 0;
  1408. exit(0);
  1409. }], [
  1410. ac_cv_struct_rlimit=yes ], [
  1411. ac_cv_struct_rlimit=no ], [
  1412. ac_cv_struct_rlimit=no ] ) ] )
  1413. struct_rlimit=0
  1414. test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1
  1415. AC_SUBST(struct_rlimit)
  1416. dnl ----------------------------- Checking for Locking Characteristics
  1417. echo "${nl}Checking for Locking..."
  1418. AC_CHECK_FUNCS(semget semctl flock)
  1419. AC_CHECK_HEADERS(semaphore.h OS.h)
  1420. AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait create_sem)
  1421. # Some systems return ENOSYS from sem_open.
  1422. AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[
  1423. AC_TRY_RUN([
  1424. #include <errno.h>
  1425. #include <stdlib.h>
  1426. #include <fcntl.h>
  1427. #include <semaphore.h>
  1428. #include <stdlib.h>
  1429. main()
  1430. {
  1431. sem_t *psem;
  1432. const char *sem_name = "/apr_autoconf";
  1433. psem = sem_open(sem_name, O_CREAT, 0644, 1);
  1434. if (psem == (sem_t *)SEM_FAILED) {
  1435. exit(1);
  1436. }
  1437. sem_close(psem);
  1438. sem_unlink(sem_name);
  1439. exit(0);
  1440. }], [ac_cv_func_sem_open=yes], [ac_cv_func_sem_open=no],
  1441. [ac_cv_func_sem_open=no])])
  1442. # It's stupid, but not all platforms have union semun, even those that need it.
  1443. AC_MSG_CHECKING(for union semun in sys/sem.h)
  1444. AC_TRY_COMPILE([
  1445. #include <sys/types.h>
  1446. #include <sys/ipc.h>
  1447. #include <sys/sem.h>
  1448. ],[
  1449. union semun arg;
  1450. semctl(0, 0, 0, arg);
  1451. ], [have_union_semun="1" union_semun=yes ]
  1452. msg=yes, [
  1453. have_union_semun="0"
  1454. msg=no ] )
  1455. AC_MSG_RESULT([$msg])
  1456. AC_SUBST(have_union_semun)
  1457. dnl Checks for libraries.
  1458. APR_CHECK_DEFINE(LOCK_EX, sys/file.h)
  1459. APR_CHECK_DEFINE(F_SETLK, fcntl.h)
  1460. APR_CHECK_DEFINE(SEM_UNDO, sys/sem.h)
  1461. # We are assuming that if the platform doesn't have POLLIN, it doesn't have
  1462. # any POLL definitions.
  1463. APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h)
  1464. if test "$threads" = "1"; then
  1465. APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
  1466. AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
  1467. AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
  1468. # Some systems have setpshared and define PROCESS_SHARED, but don't
  1469. # really support PROCESS_SHARED locks. So, we must validate that we
  1470. # can go through the steps without receiving some sort of system error.
  1471. # Linux and older versions of AIX have this problem.
  1472. APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, [
  1473. AC_CACHE_CHECK([for working PROCESS_SHARED locks], apr_cv_process_shared_works, [
  1474. AC_TRY_RUN([
  1475. #include <sys/types.h>
  1476. #include <pthread.h>
  1477. #include <stdlib.h>
  1478. int main()
  1479. {
  1480. pthread_mutex_t mutex;
  1481. pthread_mutexattr_t attr;
  1482. if (pthread_mutexattr_init(&attr))
  1483. exit(1);
  1484. if (pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED))
  1485. exit(2);
  1486. if (pthread_mutex_init(&mutex, &attr))
  1487. exit(3);
  1488. if (pthread_mutexattr_destroy(&attr))
  1489. exit(4);
  1490. if (pthread_mutex_destroy(&mutex))
  1491. exit(5);
  1492. exit(0);
  1493. }], [apr_cv_process_shared_works=yes], [apr_cv_process_shared_works=no])])
  1494. # Override detection of pthread_mutexattr_setpshared
  1495. ac_cv_func_pthread_mutexattr_setpshared=$apr_cv_process_shared_works])
  1496. if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then
  1497. APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX
  1498. fi
  1499. fi
  1500. # See which lock mechanisms we can support on this system.
  1501. APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl
  1502. func:sem_unlink func:sem_post func:sem_wait,
  1503. hasposixser="1", hasposixser="0")
  1504. APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1",
  1505. hassysvser="0")
  1506. APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0")
  1507. APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0")
  1508. # note: the current APR use of shared mutex requires /dev/zero
  1509. APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
  1510. func:pthread_mutexattr_setpshared dnl
  1511. file:/dev/zero,
  1512. hasprocpthreadser="1", hasprocpthreadser="0")
  1513. APR_IFALLYES(header:OS.h func:create_sem, hasbeossem="1", hasbeossem="0")
  1514. # See which lock mechanism we'll select by default on this system.
  1515. # The last APR_DECIDE to execute sets the default.
  1516. # At this stage, we match the ordering in Apache 1.3
  1517. # which is (highest to lowest): sysvsem -> fcntl -> flock.
  1518. # POSIX semaphores and cross-process pthread mutexes are not
  1519. # used by default since they have less desirable behaviour when
  1520. # e.g. a process holding the mutex segfaults.
  1521. # The BEOSSEM decision doesn't require any substitutions but is
  1522. # included here to prevent the fcntl() branch being selected
  1523. # from the decision making.
  1524. APR_BEGIN_DECISION([apr_lock implementation method])
  1525. APR_IFALLYES(func:flock define:LOCK_EX,
  1526. APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()]))
  1527. APR_IFALLYES(header:fcntl.h define:F_SETLK,
  1528. APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
  1529. APR_IFALLYES(func:semget func:semctl define:SEM_UNDO,
  1530. APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
  1531. APR_IFALLYES(header:OS.h func:create_sem,
  1532. APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores]))
  1533. if test "x$apr_lock_method" != "x"; then
  1534. APR_DECISION_FORCE($apr_lock_method)
  1535. fi
  1536. APR_END_DECISION
  1537. AC_DEFINE_UNQUOTED($ac_decision)
  1538. flockser="0"
  1539. sysvser="0"
  1540. posixser="0"
  1541. procpthreadser="0"
  1542. fcntlser="0"
  1543. case $ac_decision in
  1544. USE_FLOCK_SERIALIZE )
  1545. flockser="1"
  1546. ;;
  1547. USE_FCNTL_SERIALIZE )
  1548. fcntlser="1"
  1549. ;;
  1550. USE_SYSVSEM_SERIALIZE )
  1551. sysvser="1"
  1552. ;;
  1553. USE_POSIXSEM_SERIALIZE )
  1554. posixser="1"
  1555. ;;
  1556. USE_PROC_PTHREAD_SERIALIZE )
  1557. procpthreadser="1"
  1558. ;;
  1559. USE_BEOSSEM )
  1560. beossem="1"
  1561. ;;
  1562. esac
  1563. AC_SUBST(hasflockser)
  1564. AC_SUBST(hassysvser)
  1565. AC_SUBST(hasposixser)
  1566. AC_SUBST(hasfcntlser)
  1567. AC_SUBST(hasprocpthreadser)
  1568. AC_SUBST(flockser)
  1569. AC_SUBST(sysvser)
  1570. AC_SUBST(posixser)
  1571. AC_SUBST(fcntlser)
  1572. AC_SUBST(procpthreadser)
  1573. AC_SUBST(pthreadser)
  1574. AC_MSG_CHECKING(if all interprocess locks affect threads)
  1575. if test "x$apr_process_lock_is_global" = "xyes"; then
  1576. proclockglobal="1"
  1577. AC_MSG_RESULT(yes)
  1578. else
  1579. proclockglobal="0"
  1580. AC_MSG_RESULT(no)
  1581. fi
  1582. AC_SUBST(proclockglobal)
  1583. AC_MSG_CHECKING(if POSIX sems affect threads in the same process)
  1584. if test "x$apr_posixsem_is_global" = "xyes"; then
  1585. AC_DEFINE(POSIXSEM_IS_GLOBAL, 1,
  1586. [Define if POSIX semaphores affect threads within the process])
  1587. AC_MSG_RESULT(yes)
  1588. else
  1589. AC_MSG_RESULT(no)
  1590. fi
  1591. AC_MSG_CHECKING(if SysV sems affect threads in the same process)
  1592. if test "x$apr_sysvsem_is_global" = "xyes"; then
  1593. AC_DEFINE(SYSVSEM_IS_GLOBAL, 1,
  1594. [Define if SysV semaphores affect threads within the process])
  1595. AC_MSG_RESULT(yes)
  1596. else
  1597. AC_MSG_RESULT(no)
  1598. fi
  1599. AC_MSG_CHECKING(if fcntl locks affect threads in the same process)
  1600. if test "x$apr_fcntl_is_global" = "xyes"; then
  1601. AC_DEFINE(FCNTL_IS_GLOBAL, 1,
  1602. [Define if fcntl locks affect threads within the process])
  1603. AC_MSG_RESULT(yes)
  1604. else
  1605. AC_MSG_RESULT(no)
  1606. fi
  1607. AC_MSG_CHECKING(if flock locks affect threads in the same process)
  1608. if test "x$apr_flock_is_global" = "xyes"; then
  1609. AC_DEFINE(FLOCK_IS_GLOBAL, 1,
  1610. [Define if flock locks affect threads within the process])
  1611. AC_MSG_RESULT(yes)
  1612. else
  1613. AC_MSG_RESULT(no)
  1614. fi
  1615. dnl ----------------------------- Checking for /dev/random
  1616. AC_MSG_CHECKING(for entropy source)
  1617. AC_ARG_WITH(egd,
  1618. [ --with-egd[[=DIR]] use EGD-compatible socket],
  1619. [ AC_DEFINE(HAVE_EGD, 1, [Define if EGD is supported])
  1620. if test "$withval" = "yes"; then
  1621. AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"],
  1622. [Define to list of paths to EGD sockets])
  1623. else
  1624. AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["$withval"])
  1625. fi
  1626. AC_MSG_RESULT(EGD-compatible daemon)
  1627. rand="1"
  1628. ])
  1629. if test "$rand" != "1"; then
  1630. AC_ARG_WITH(devrandom,
  1631. [ --with-devrandom[[=DEV]] use /dev/random or compatible [[searches by default]]],
  1632. [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ])
  1633. if test "$apr_devrandom" = "yes"; then
  1634. # /dev/random on OpenBSD doesn't provide random data, so
  1635. # prefer /dev/arandom, which does; see random(4).
  1636. for f in /dev/arandom /dev/random /dev/urandom; do
  1637. if test -r $f; then
  1638. apr_devrandom=$f
  1639. rand=1
  1640. break
  1641. fi
  1642. done
  1643. elif test "$apr_devrandom" != "no"; then
  1644. if test -r "$apr_devrandom"; then
  1645. rand="1"
  1646. else
  1647. AC_ERROR([$apr_devrandom not found or unreadable.])
  1648. fi
  1649. fi
  1650. if test "$rand" = "1"; then
  1651. AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of random device])
  1652. AC_MSG_RESULT([$apr_devrandom])
  1653. fi
  1654. fi
  1655. if test "$rand" != "1"; then
  1656. case $host in
  1657. # we have built in support for OS/2
  1658. *-os2*)
  1659. AC_MSG_RESULT([Using OS/2 builtin random])
  1660. rand="1"
  1661. ;;
  1662. *)
  1663. if test "$rand" != "1"; then
  1664. if test "$ac_cv_lib_truerand_main" = "yes"; then
  1665. AC_DEFINE(HAVE_TRUERAND, 1, [Define if truerand is supported])
  1666. AC_MSG_RESULT(truerand)
  1667. rand="1"
  1668. else
  1669. AC_MSG_RESULT(not found)
  1670. rand="0"
  1671. fi
  1672. fi
  1673. ;;
  1674. esac
  1675. fi
  1676. AC_SUBST(rand)
  1677. dnl ----------------------------- Checking for UUID Support
  1678. echo "${nl}Checking for OS UUID Support..."
  1679. AC_CHECK_HEADERS(uuid.h uuid/uuid.h sys/uuid.h, break)
  1680. apr_revert_save_LIBS=$LIBS
  1681. # Prefer the flavor(s) that live in libc;
  1682. AC_SEARCH_LIBS(uuid_create, uuid)
  1683. AC_SEARCH_LIBS(uuid_generate, uuid)
  1684. if test "$ac_cv_search_uuid_create" = "none required" -o \
  1685. "$ac_cv_search_uuid_generate" = "none required"; then
  1686. LIBS=$apr_revert_save_LIBS
  1687. fi
  1688. AC_CHECK_FUNCS(uuid_create uuid_generate)
  1689. AC_CACHE_CHECK([for os uuid usability], [apr_cv_osuuid], [
  1690. # Ensure this test closely mirrors misc/unix/rand.c!
  1691. uuid_includes="
  1692. #if defined(HAVE_SYS_TYPES_H)
  1693. #include <sys/types.h>
  1694. #endif
  1695. #if defined(HAVE_UNISTD_H)
  1696. #include <unistd.h>
  1697. #endif
  1698. #if defined(HAVE_UUID_H)
  1699. #include <uuid.h>
  1700. #elif defined(HAVE_UUID_UUID_H)
  1701. #include <uuid/uuid.h>
  1702. #elif defined(HAVE_SYS_UUID_H)
  1703. #include <sys/uuid.h>
  1704. #endif
  1705. "
  1706. apr_cv_osuuid=no
  1707. if test $ac_cv_func_uuid_create = yes; then
  1708. AC_TRY_LINK([$uuid_includes], [
  1709. uuid_t g;
  1710. uint32_t s;
  1711. uuid_create(&g, &s);
  1712. if (s == uuid_s_ok) s = 0;
  1713. ], [apr_cv_osuuid=yes], [apr_cv_func_uuid_create=no])
  1714. fi
  1715. if test $ac_cv_func_uuid_generate = yes; then
  1716. AC_TRY_LINK([$uuid_includes], [
  1717. uuid_t g;
  1718. uuid_generate(g);
  1719. ], [apr_cv_osuuid=yes], [apr_cv_func_uuid_generate=no])
  1720. fi
  1721. ])
  1722. if test $apr_cv_osuuid = yes; then
  1723. osuuid="1"
  1724. else
  1725. osuuid="0"
  1726. LIBS=$apr_revert_save_LIBS
  1727. fi
  1728. AC_SUBST(osuuid)
  1729. dnl ----------------------------- Checking for Time Support
  1730. echo "${nl}Checking for Time Support..."
  1731. AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[
  1732. #include <sys/types.h>
  1733. #include <time.h>])
  1734. dnl ----------------------------- Checking for Networking Support
  1735. echo "${nl}Checking for Networking support..."
  1736. AC_MSG_CHECKING(for in_addr in netinet/in.h)
  1737. AC_TRY_COMPILE([
  1738. #include <sys/types.h>
  1739. #include <netinet/in.h>
  1740. ],[
  1741. struct in_addr arg;
  1742. arg.s_addr = htonl(INADDR_ANY);
  1743. ], [ have_in_addr="1"
  1744. msg=yes ] , [ have_in_addr="0"
  1745. msg=no ])
  1746. AC_MSG_RESULT([$msg])
  1747. AC_MSG_CHECKING([if fd == socket on this platform])
  1748. if test "x$file_as_socket" != "x0" ; then
  1749. file_as_socket="1";
  1750. echo "yes"
  1751. else
  1752. echo "no"
  1753. fi
  1754. AC_SUBST(have_in_addr)
  1755. AC_SUBST(file_as_socket)
  1756. if test "$ac_cv_func_poll $file_as_socket" = "yes 1"; then
  1757. AC_DEFINE(WAITIO_USES_POLL, 1,
  1758. [Define if fspr_wait_for_io_or_timeout() uses poll(2)])
  1759. fi
  1760. # Check the types only if we have gethostbyname_r
  1761. if test "$ac_cv_func_gethostbyname_r" = "yes"; then
  1762. APR_CHECK_GETHOSTBYNAME_R_STYLE
  1763. fi
  1764. APR_CHECK_TCP_NODELAY_INHERITED
  1765. APR_CHECK_O_NONBLOCK_INHERITED
  1766. APR_CHECK_TCP_NODELAY_WITH_CORK
  1767. # Look for a way of corking TCP...
  1768. APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h)
  1769. APR_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h)
  1770. apr_tcp_nopush_flag="0"
  1771. have_corkable_tcp="0"
  1772. if test "x$ac_cv_define_TCP_CORK" = "xyes"; then
  1773. apr_tcp_nopush_flag="TCP_CORK"
  1774. have_corkable_tcp="1"
  1775. else
  1776. case $host in
  1777. *linux*)
  1778. AC_EGREP_CPP(yes,[
  1779. #include <linux/socket.h>
  1780. #ifdef TCP_CORK
  1781. yes
  1782. #endif
  1783. ],[
  1784. apr_tcp_nopush_flag="3"
  1785. have_corkable_tcp="1"
  1786. ])
  1787. ;;
  1788. *)
  1789. ;;
  1790. esac
  1791. fi
  1792. if test "x$ac_cv_define_TCP_NOPUSH" = "xyes"; then
  1793. apr_tcp_nopush_flag="TCP_NOPUSH"
  1794. have_corkable_tcp="1"
  1795. fi
  1796. APR_CHECK_DEFINE(SO_ACCEPTFILTER, sys/socket.h)
  1797. if test "x$ac_cv_define_SO_ACCEPTFILTER" = "xyes"; then
  1798. acceptfilter="1"
  1799. else
  1800. acceptfilter="0"
  1801. fi
  1802. APR_CHECK_SCTP
  1803. APR_CHECK_MCAST
  1804. AC_SUBST(apr_tcp_nopush_flag)
  1805. AC_SUBST(have_corkable_tcp)
  1806. AC_SUBST(acceptfilter)
  1807. AC_SUBST(have_sctp)
  1808. AC_CHECK_FUNCS(set_h_errno)
  1809. echo "${nl}Checking for IPv6 Networking support..."
  1810. dnl Start of checking for IPv6 support...
  1811. AC_ARG_ENABLE(ipv6,
  1812. [ --disable-ipv6 Disable IPv6 support in APR.],
  1813. [ if test "$enableval" = "no"; then
  1814. user_disabled_ipv6=1
  1815. fi ],
  1816. [ user_disabled_ipv6=0 ] )
  1817. case $host in
  1818. *)
  1819. broken_ipv6=0
  1820. esac
  1821. AC_SEARCH_LIBS(getaddrinfo, socket inet6)
  1822. AC_SEARCH_LIBS(gai_strerror, socket inet6)
  1823. AC_SEARCH_LIBS(getnameinfo, socket inet6)
  1824. AC_CHECK_FUNCS(gai_strerror)
  1825. APR_CHECK_WORKING_GETADDRINFO
  1826. APR_CHECK_NEGATIVE_EAI
  1827. APR_CHECK_WORKING_GETNAMEINFO
  1828. APR_CHECK_SOCKADDR_IN6
  1829. APR_CHECK_SOCKADDR_STORAGE
  1830. have_ipv6="0"
  1831. if test "$user_disabled_ipv6" = 1; then
  1832. ipv6_result="no -- disabled by user"
  1833. else
  1834. if test "x$broken_ipv6" = "x0"; then
  1835. if test "x$have_sockaddr_in6" = "x1"; then
  1836. if test "x$ac_cv_working_getaddrinfo" = "xyes"; then
  1837. if test "x$ac_cv_working_getnameinfo" = "xyes"; then
  1838. APR_CHECK_GETADDRINFO_ADDRCONFIG
  1839. have_ipv6="1"
  1840. ipv6_result="yes"
  1841. else
  1842. ipv6_result="no -- no getnameinfo"
  1843. fi
  1844. else
  1845. ipv6_result="no -- no working getaddrinfo"
  1846. fi
  1847. else
  1848. ipv6_result="no -- no sockaddr_in6"
  1849. fi
  1850. else
  1851. ipv6_result="no -- the platform has known problems supporting IPv6"
  1852. fi
  1853. fi
  1854. AC_MSG_CHECKING(if APR supports IPv6)
  1855. AC_MSG_RESULT($ipv6_result)
  1856. AC_SUBST(have_ipv6)
  1857. # hstrerror is only needed if IPv6 is not enabled,
  1858. # so getaddrinfo/gai_strerror are not used.
  1859. if test $have_ipv6 = 0; then
  1860. AC_SEARCH_LIBS(hstrerror, resolv,
  1861. [AC_DEFINE(HAVE_HSTRERROR, 1, [Define if hstrerror is present])])
  1862. fi
  1863. dnl Check for langinfo support
  1864. AC_CHECK_HEADERS(langinfo.h)
  1865. AC_CHECK_FUNCS(nl_langinfo)
  1866. dnl ----------------------------- Finalize the variables
  1867. echo "${nl}Restore user-defined environment settings..."
  1868. APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, EXTRA_)
  1869. APR_RESTORE_THE_ENVIRONMENT(CFLAGS, EXTRA_)
  1870. APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, EXTRA_)
  1871. APR_RESTORE_THE_ENVIRONMENT(LIBS, EXTRA_)
  1872. APR_RESTORE_THE_ENVIRONMENT(INCLUDES, EXTRA_)
  1873. AC_SUBST(NOTEST_CPPFLAGS)
  1874. AC_SUBST(NOTEST_CFLAGS)
  1875. AC_SUBST(NOTEST_LDFLAGS)
  1876. AC_SUBST(NOTEST_LIBS)
  1877. AC_SUBST(NOTEST_INCLUDES)
  1878. dnl ----------------------------- Construct the files
  1879. AC_SUBST(LDLIBS)
  1880. AC_SUBST(INCLUDES)
  1881. AC_SUBST(AR)
  1882. AC_SUBST(RM)
  1883. AC_SUBST(OSDIR)
  1884. AC_SUBST(DEFAULT_OSDIR)
  1885. AC_SUBST(EXEEXT)
  1886. AC_SUBST(LIBTOOL_LIBS)
  1887. # Use -no-install to link the test programs on all platforms
  1888. # but Darwin, where it would cause the programs to be linked
  1889. # against installed versions of libapr instead of those just
  1890. # built.
  1891. case $host in
  1892. *-apple-darwin*) LT_NO_INSTALL="" ;;
  1893. *) LT_NO_INSTALL="-no-install" ;;
  1894. esac
  1895. AC_SUBST(LT_NO_INSTALL)
  1896. #
  1897. # BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
  1898. #
  1899. case $host in
  1900. *bsdi*)
  1901. # Check whether they've installed GNU make
  1902. if make --version > /dev/null 2>&1; then
  1903. INCLUDE_RULES="include $apr_buildout/apr_rules.mk"
  1904. INCLUDE_OUTPUTS="include $apr_srcdir/build-outputs.mk"
  1905. else
  1906. # BSDi make
  1907. INCLUDE_RULES=".include \"$apr_buildout/apr_rules.mk\""
  1908. INCLUDE_OUTPUTS=".include \"$apr_srcdir/build-outputs.mk\""
  1909. fi
  1910. ;;
  1911. *)
  1912. INCLUDE_RULES="include $apr_buildout/apr_rules.mk"
  1913. INCLUDE_OUTPUTS="include $apr_srcdir/build-outputs.mk"
  1914. ;;
  1915. esac
  1916. AC_SUBST(INCLUDE_RULES)
  1917. AC_SUBST(INCLUDE_OUTPUTS)
  1918. AC_CONFIG_FILES([Makefile
  1919. include/fspr.h
  1920. build/apr_rules.mk
  1921. build/pkg/pkginfo
  1922. apr-$APR_MAJOR_VERSION-config:apr-config.in
  1923. apr.pc])
  1924. if test -d $srcdir/test; then
  1925. AC_CONFIG_FILES([test/Makefile test/internal/Makefile])
  1926. fi
  1927. dir=include/arch/unix
  1928. test -d $dir || $MKDIR $dir
  1929. AC_CONFIG_COMMANDS([default], [
  1930. # Commands run at the end of config.status:
  1931. for i in $APR_SAVE_HEADERS; do
  1932. if cmp -s $i $i.save 2>/dev/null; then
  1933. mv $i.save $i
  1934. AC_MSG_NOTICE([$i is unchanged])
  1935. fi
  1936. rm -f $i.save
  1937. done
  1938. chmod +x apr-$APR_MAJOR_VERSION-config
  1939. ],[
  1940. dnl This section is expanded by configure UNQUOTED so variable
  1941. dnl references must be backslash-escaped as necessary.
  1942. # Commands run at the beginning of config.status:
  1943. APR_SAVE_HEADERS="include/fspr.h include/arch/unix/fspr_private.h"
  1944. APR_MAJOR_VERSION=$APR_MAJOR_VERSION
  1945. for apri in \${APR_SAVE_HEADERS}; do
  1946. test -r \${apri} && mv \${apri} \${apri}.save
  1947. done
  1948. ])
  1949. AC_OUTPUT