configure.in
Upload User: tsgydb
Upload Date: 2007-04-14
Package Size: 10674k
Code Size: 21k
Category:

MySQL

Development Platform:

Visual C++

  1. dnl Some reminders:
  2. dnl "dnl" is a "delete to newline" command for m4 - the remainder of the
  3. dnl line it's on, including the newline, will be discarded
  4. dnl "#" comments will usually be copied through
  5. dnl "[]" are quoting characters; use changequote around code that really
  6. dnl needs to use them, but try not to invoke autoconf macros
  7. dnl within such code
  8. dnl
  9. dnl When you change this file, re-run "autoreconf" -- that'll automatically
  10. dnl re-run both autoconf and autoheader.
  11. dnl
  12. dnl
  13. dnl To do:
  14. dnl CLOCKS_PER_SEC (default 100, Ultrix differs)
  15. dnl CLK_TCK (default 100, Ultrix differs)
  16. dnl clockid_t (not on all systems)
  17. dnl timer_t (not on all systems)
  18. dnl
  19. dnl
  20. dnl Now, the real stuff.
  21. dnl
  22. dnl This must be first.
  23. AC_INIT(config.flags.in)
  24. dnl
  25. dnl This file does require autoconf 2.0 or better...
  26. dnl
  27. AC_PREREQ(2.0)dnl
  28. dnl
  29. dnl Hook for the "--enable-dce-compat" option, when Chris actually
  30. dnl implements it.
  31. dnl
  32. AC_ARG_ENABLE(dce-compat,
  33.     --enable-dce-compat   DCE compatibility,
  34. [dnl "true" action
  35.   AC_MSG_ERROR([Actually, DCE compatibility doesn't work yet...])
  36. ],
  37. [dnl "false" action
  38.   true
  39. ])
  40. dnl What C compiler?
  41. AC_PROG_CC
  42. AC_PROG_CXX
  43. dnl Apparently autoconf doesn't test to see if the C compiler it locates
  44. dnl actually works... oops!
  45. AC_MSG_CHECKING(compiler availability and simple error detection)
  46. AC_TRY_COMPILE(,[ exit(0); ],[
  47.   dnl true
  48.   AC_TRY_COMPILE(,[ syntax errors galore! ],
  49.     dnl true
  50.     AC_MSG_ERROR(Can't detect syntax errors!  Is CC set right?),
  51.     dnl false
  52.     true)],
  53.   dnl false
  54.   AC_MSG_ERROR(Can't compile test program!  Is CC set right?))
  55. AC_TRY_COMPILE(,[
  56.   typedef int Integer;
  57.   extern int i;
  58.   extern Integer i;
  59. ], , AC_MSG_ERROR(Can't redeclare variables with this compiler??))
  60. AC_TRY_COMPILE(,[
  61.   typedef long Long;
  62.   extern int i;
  63.   extern Long i;
  64. ], AC_MSG_ERROR(Compiler doesn't detect conflicting declarations.))
  65. AC_MSG_RESULT(ok)
  66. if test $ac_cv_prog_gcc = yes ; then
  67.   CFLAGS="$CFLAGS -Werror"
  68. fi
  69. AC_PROG_CPP
  70. AC_PROG_RANLIB
  71. dnl Default value of prefix should be /usr/local/pthreads, not /usr/local.
  72. AC_PREFIX_DEFAULT(/usr/local/pthreads)
  73. dnl Determine $host, by guessing if necessary.
  74. AC_CANONICAL_SYSTEM
  75. syscall=NONE
  76. sysincludes=NONE
  77. extraincludes=NONE
  78. # Treat all x86 machines the same.
  79. # (Yet below, we pretend we can distinguish between the MIPS r2000 and r4000?)
  80. # (What about 680x0 machines?)
  81. changequote(,)dnl
  82. case $host in
  83.     i[456]86-*)
  84. host=`echo $host | sed 's/^i[456]86/i386/'`
  85. host_cpu=i386
  86. ;;
  87. esac
  88. changequote([,])dnl
  89. # Here, you should set the following variables:
  90. #  name
  91. # The "name" of this configuration.  Used for "engine-*.c" file name,
  92. # default for syscall file names.  Chris seems to have a thing for
  93. # putting "-" between OS and version number, but the configure script
  94. # will already have $host_cpu and $host_os available for you to use
  95. # in constructing a name.
  96. #  sysincludes
  97. # Name of machdep directory with "sys" include file
  98. # replacements, if any.  This directory is optional;
  99. # if you don't provide it, don't set this variable.
  100. #  except
  101. # Names of any syscalls that shouldn't be generated
  102. # from the template, if any.
  103. #  syscall
  104. # Base name of the syscall template files, if not the
  105. # same as <name>.  If they're the same, omit this.
  106. #
  107. # Also, you may define random symbols and update CFLAGS if
  108. # necessary.  However, for ease of porting to new machines,
  109. # it's best if you can create portable autoconf tests for
  110. # whatever you're trying to do, rather than hard-coding it
  111. # here based on the OS name.  So please, try to keep this
  112. # section as minimal as possible.
  113. except=""
  114. name=$host_cpu-$host_os
  115. case $host in
  116. changequote(,)dnl
  117.     alpha-*-netbsd1.3[H-Z]|alpha-*-netbsd1.[45]*)
  118. name=alpha-netbsd-1.3
  119. sysincludes=netbsd-1.1
  120. except="fork lseek pipe fstat"
  121. available_syscalls="sigsuspend sigprocmask"
  122. ;;
  123. changequote([,])dnl
  124.     alpha-*-netbsd1.3*)
  125. name=alpha-netbsd-1.3
  126. sysincludes=netbsd-1.1
  127. except="fork lseek pipe sigsuspend sigprocmask fstat"
  128. ;;
  129.     alpha-*-netbsd1.1* | alpha-*-netbsd1.2*)
  130. name=alpha-netbsd-1.1
  131. sysincludes=netbsd-1.1
  132. except="fork lseek pipe sigsuspend sigprocmask"
  133. ;;
  134.     alpha-*-osf*)
  135. name=alpha-osf1
  136. sysincludes=alpha-osf1
  137. except="fork sigsuspend"
  138. if test $ac_cv_prog_gcc = no ; then
  139.   CFLAGS="$CFLAGS -std"
  140. fi
  141. ;;
  142. changequote(,)dnl
  143.     arm32-*-netbsd1.3[H-Z]|arm32-*-netbsd1.[45]*)
  144. name=arm32-netbsd-1.3
  145. sysincludes=netbsd-1.1
  146. except="fork pipe lseek ftruncate fstat"
  147. available_syscalls="sigsuspend sigprocmask"
  148. ;;
  149. changequote([,])dnl
  150.     arm32-*-netbsd1.3*)
  151. name=arm32-netbsd-1.3
  152. sysincludes=netbsd-1.1
  153. except="fork pipe lseek ftruncate sigsuspend sigprocmask fstat"
  154. ;;
  155.     hppa1.0-*-hpux10.20 | hppa1.1-*-hpux10.20)
  156. name=hppa-hpux-10.20
  157. sysincludes=hpux-10.20
  158. except="fork"
  159. ;;
  160.     hppa1.1-*-hpux*9.*)
  161. name=hppa-hpux-9.03
  162. sysincludes=hpux-9.03
  163. # hpux-9.03.mk seems to be missing; what should this be?
  164. except="fork"
  165. ;;
  166.     powerpc-*-netbsd1.*)
  167. name=powerpc-netbsd
  168. sysincludes=netbsd-1.1
  169. except="fork lseek ftruncate pipe fstat"
  170. available_syscalls="sigprocmask sigaction sigsuspend"
  171. ;;
  172.     sparc-*-sunos4.1.3* | sparc-*-sunos4.1.4*)
  173. name=sparc-sunos-4.1.3
  174. sysincludes=sunos-4.1.3
  175. syscall=sparc-sunos4
  176. except="fork pipe getpgrp getdirentries"
  177. AC_DEFINE(sunos4) # is this really needed??
  178. ;;
  179.     sparc-*-solaris2.3* | sparc-*-solaris2.4*)
  180. name=sparc-sunos-5.3
  181. sysincludes=sunos-5.3
  182. except="fork sigaction"
  183. # Should really come up with a test for this...
  184. AC_DEFINE(LD_LINKS_STATIC_DATA)
  185. AC_DEFINE(BROKEN_SIGNALS)
  186. ;;
  187.     sparc-*-solaris2*)
  188. name=sparc-sunos-5.3
  189. sysincludes=sunos-5.5
  190. except="fork sigaction"
  191. # Should really come up with a test for this...
  192. AC_DEFINE(LD_LINKS_STATIC_DATA)
  193. AC_DEFINE(BROKEN_SIGNALS)
  194. ;;
  195. changequote(,)dnl
  196.     sparc-*-netbsd1.3[H-Z]|sparc-*-netbsd1.[45]*)
  197. name=sparc-netbsd-1.3
  198. sysincludes=netbsd-1.1
  199. except="pipe fork lseek ftruncate fstat"
  200. available_syscalls="sigprocmask sigsuspend"
  201. ;;
  202. changequote([,])dnl
  203.     sparc-*-netbsd1.3*)
  204. name=sparc-netbsd-1.3
  205. sysincludes=netbsd-1.1
  206. except="pipe fork lseek ftruncate sigprocmask sigsuspend fstat"
  207. ;;
  208.     sparc-*-netbsd1.0A | sparc-*-netbsd1.1* | sparc-*-netbsd1.2*)
  209. name=sparc-sunos-4.1.3
  210. sysincludes=netbsd-1.0
  211. syscall=sparc-netbsd-1.1
  212. except="pipe fork sigprocmask sigsuspend"
  213. ;;
  214.     i386-*-openbsd2.*)
  215.         name=i386-openbsd-2.0
  216.         sysincludes=openbsd-2.0
  217.         except="fork lseek ftruncate sigsuspend sigprocmask"
  218.         ;;
  219.     i386-*-linux*)
  220. #name=i386-linux-1.0
  221. #sysincludes=linux-1.0
  222. name=i386-linux-2.0
  223. sysincludes=linux-2.0
  224. extraincludes="bits"
  225. ;;
  226.     i386-*-bsdi1.1)
  227. name=i386-bsdi-1.1
  228. sysincludes=bsdi-1.1
  229. ;;
  230. i386-*-bsdi2.0* | i386-*-bsdi2.1*)
  231. name=i386-bsdi-2.0
  232.         sysincludes=bsdi-2.0
  233.         syscall=i386-bsdi-2.0
  234.         except="fork lseek ftruncate sigsuspend"
  235. ;;
  236. changequote(,)dnl
  237.     i386-*-netbsd1.3[H-Z]|i386-*-netbsd1.[45]*)
  238. name=i386-netbsd-1.3
  239. sysincludes=netbsd-1.1
  240. except="fork lseek ftruncate pipe fstat"
  241. available_syscalls="sigsuspend sigprocmask"
  242. ;;
  243. changequote([,])dnl
  244.     i386-*-netbsd1.3*)
  245. name=i386-netbsd-1.3
  246. sysincludes=netbsd-1.1
  247. except="fork lseek ftruncate pipe sigsuspend sigprocmask fstat"
  248. ;;
  249.     i386-*-netbsd1.1* | i386-*-netbsd1.2*)
  250. name=i386-netbsd-1.0
  251. sysincludes=netbsd-1.1
  252. syscall=i386-netbsd-1.1
  253. except="fork lseek ftruncate pipe sigsuspend sigprocmask"
  254. ;;
  255.     i386-*-netbsd1.0*)
  256. name=i386-netbsd-1.0
  257. sysincludes=netbsd-1.0
  258. except="fork lseek ftruncate sigsuspend"
  259. ;;
  260.     i386-*-netbsd0.9*)
  261. name=i386-netbsd-0.9
  262. sysincludes=netbsd-0.9
  263. ;;
  264.     m68*-*-netbsd*)
  265. name=m68000-netbsd
  266. sysincludes=netbsd-1.1
  267. except="lseek ftruncate pipe fstat"
  268. available_syscalls="sigsuspend sigprocmask"
  269. ;;
  270.     i386-*-freebsd*)
  271.         name=i386-freebsd-2.0
  272.         sysincludes=freebsd-2.0
  273.         except="fork lseek ftruncate sigsuspend sigprocmask"
  274.         ;;
  275.     romp-*-bsd*)
  276. name=romp-bsd
  277. ;;
  278.     mips-dec-ultrix*)
  279. name=r2000-ultrix-4.2
  280. sysincludes=ultrix-4.2
  281. except="fork pipe"
  282. ;;
  283.     mips-sgi-irix*)
  284. name=ip22-irix-5.2
  285. sysincludes=irix-5.2
  286. except="fstat stat"
  287. AC_DEFINE(BROKEN_SIGNALS)
  288. ;;
  289.     i386-*-sco3.2v5*) 
  290.         name=i386-sco3.2.5
  291.         sysincludes=i386-sco3.2.5
  292. syscall=i386-sco3.2.5
  293. except="select socketcall accept bind connect getpeername getsockname getsockopt setsockopt listen recv recvfrom recvmsg send sendmsg sendto shutdown socket socketpair fork fcntl dup2 fstat fchmod fchown ftruncate pipe getdirentries sigaction sigpause wait3 waitpid getdtablesize"
  294. ;;
  295.     *)
  296. AC_MSG_ERROR(System type $host not recognized or not supported.
  297. See $srcdir/configure.in for supported systems.)
  298. exit 1
  299. ;;
  300. esac
  301. SYSCALL_EXCEPTIONS=$except
  302. AC_SUBST(SYSCALL_EXCEPTIONS)
  303. AC_CHECK_HEADERS(sys/termio.h termios.h termio.h alloc.h)
  304. dnl Don't use AC_CHECK_HEADERS for this one, we want to define a special
  305. dnl symbol name starting with pthread_ if it's found.
  306. AC_CHECK_HEADER(va_list.h, AC_DEFINE(pthread_have_va_list_h))
  307. dnl Generate a list of system calls that we could generate.  We later use
  308. dnl a syscall template .S file to produce a .o file for each syscall.  This
  309. dnl is a bit better for porting and development purposes than having every
  310. dnl syscall listed for every target system; this way we only need the
  311. dnl template, and special hanlding for only those syscalls that can't be
  312. dnl handled by the templates.
  313. AC_CHECK_HEADERS(syscall.h sys/syscall.h sys/filio.h)
  314. PTHREADS_CHECK_SYSCALLS(open write read creat close fcntl lseek dup2 dup pipe
  315. fchmod fchown execve fstat lstat link unlink chdir chown chmod stat
  316. rename select getdtablesize ioctl ftruncate flock fstatfs chroot uname
  317. dnl - signals
  318. sigsuspend sigaction sigpause sigprocmask ksigaction
  319. dnl - directory reading
  320. getdents readdir getdirentries
  321. dnl - variants of `wait' syscalls
  322. wait4 wait3 waitpid waitsys
  323. dnl - BSD socket calls
  324. socket bind connect accept listen getsockopt setsockopt socketpair
  325. dnl - SYSV stream calls
  326. poll putmsg getmsg
  327. dnl - Linux version uses one syscall
  328. socketcall
  329. dnl - Process info
  330. pgrpsys
  331. exit
  332. readv writev send sendto sendmsg recv recvfrom recvmsg
  333. getpeername getsockname
  334. shutdown
  335. getpgrp fork)
  336. AC_SUBST(available_syscalls)
  337. AC_SUBST(missing_syscalls)
  338. dnl Disabled for now -- generates warnings from autoconf.
  339. dnl ## Check some type sizes.
  340. dnl AC_CHECK_SIZEOF(int)
  341. dnl AC_CHECK_SIZEOF(long)
  342. dnl AC_CHECK_SIZEOF(char *)
  343. ## Determine some typedef values from the system header files.
  344. dnl
  345. dnl Autoconf provides these automatically.  They provide reasonable
  346. dnl fallbacks if the standard header files don't define the typedef names.
  347. dnl
  348. dnl AC_TYPE_MODE_T
  349. AC_TYPE_OFF_T
  350. dnl AC_TYPE_PID_T
  351. AC_TYPE_SIZE_T
  352. dnl AC_TYPE_UID_T
  353. AC_TYPE_SIGNAL
  354. dnl
  355. dnl Default these types if their definitions can't be found.
  356. dnl
  357. AC_CHECK_TYPE(ssize_t,int)
  358. AC_CHECK_TYPE(time_t,long)
  359. dnl
  360. AC_CHECK_HEADERS(sys/time.h)
  361. AC_HEADER_TIME
  362. dnl
  363. dnl Check for the existence of these types
  364. dnl
  365. dnl struct timespec
  366. dnl
  367. AC_MSG_CHECKING(for struct timespec in sys/time.h)
  368. AC_CACHE_VAL(pthreads_cv_timespec_in_time,
  369.   AC_TRY_COMPILE([#include <sys/time.h>], [struct timespec foo;],
  370. pthreads_cv_timespec_in_time=yes, pthreads_cv_timespec_in_time=no))
  371. AC_MSG_RESULT($pthreads_cv_timespec_in_time)
  372. if test $pthreads_cv_timespec_in_time = yes ; then
  373.   AC_DEFINE(_OS_HAS_TIMESPEC)
  374. fi
  375. dnl socklen_t
  376. AC_CACHE_VAL(pthreads_cv_socklen_t,
  377.   AC_TRY_COMPILE([#include <sys/types.h>
  378. #include <sys/socket.h>], [socklen_t foo;],
  379. pthreads_cv_socklen_t=yes, pthreads_cv_socklen_t=no))
  380. AC_MSG_RESULT($pthreads_cv_socklen_t)
  381. if test $pthreads_cv_socklen_t = yes ; then
  382.   AC_DEFINE(_OS_HAS_SOCKLEN_T)
  383. fi
  384. dnl
  385. dnl  Usage: PTHREADS_FIND_TYPE(system-typedef-name, new-macro-name,
  386. dnl list-of-includes-in-square-brackets,
  387. dnl comma-separated-list-of-types-to-try)
  388. dnl
  389. dnl  PTHREADS_FIND_INTEGRAL_TYPE automatically provides a set of integral
  390. dnl  types, and does not permit specification of additional types.
  391. dnl
  392. dnl  The specified types must all be able to work as prefixes -- i.e., no
  393. dnl  direct specification of array or function types.  If you need such
  394. dnl  types, add typedefs for them to include/pthread/xtypes.h, and include
  395. dnl  that in the set of header files.  For simple struct types, you can
  396. dnl  try including the definition directly here, but it had better not
  397. dnl  contain any commas or square brackets.
  398. dnl
  399. dnl  If necessary, you can include other preprocessing commands and such
  400. dnl  in the `includes' portion.
  401. dnl
  402. dnl  Note:  For now, each of these needs a corresponding entry
  403. dnl  in acconfig.h.
  404. dnl
  405. dnl size_t
  406. dnl
  407. PTHREADS_FIND_INTEGRAL_TYPE(size_t, pthread_size_t, [
  408. #include <stddef.h>
  409. #include <sys/types.h>
  410. #ifdef STDC_HEADERS
  411. #include <stdlib.h>
  412. #endif
  413. ])
  414. dnl
  415. dnl ssize_t
  416. dnl
  417. PTHREADS_FIND_INTEGRAL_TYPE(ssize_t, pthread_ssize_t, [
  418. #include <stddef.h>
  419. #include <stdlib.h>
  420. #include <unistd.h>
  421. ])
  422. dnl
  423. dnl clock_t ---FIXME I don't know if this is the right set of header files. KR
  424. dnl
  425. PTHREADS_FIND_INTEGRAL_TYPE(clock_t, pthread_clock_t, [
  426. #include <stddef.h>
  427. #if TIME_WITH_SYS_TIME
  428. # include <time.h>
  429. # include <sys/time.h>
  430. #else
  431. # if HAVE_SYS_TIME_H
  432. #  include <sys/time.h>
  433. # else
  434. #  include <time.h>
  435. # endif
  436. #endif
  437. ])
  438. dnl
  439. dnl time_t
  440. dnl
  441. PTHREADS_FIND_INTEGRAL_TYPE(time_t, pthread_time_t, [
  442. #include <stddef.h>
  443. #if TIME_WITH_SYS_TIME
  444. # include <time.h>
  445. # include <sys/time.h>
  446. #else
  447. # if HAVE_SYS_TIME_H
  448. #  include <sys/time.h>
  449. # else
  450. #  include <time.h>
  451. # endif
  452. #endif
  453. ])
  454. dnl
  455. dnl fpos_t
  456. dnl
  457. dnl If fpos_t isn't defined in stdio.h, define it to be off_t.  It
  458. dnl looks like AC_CHECK_TYPE won't work for this, because it doesn't
  459. dnl include stdio.h.
  460. dnl
  461. AC_MSG_CHECKING(for fpos_t in stdio.h)
  462. AC_CACHE_VAL(pthreads_cv_fpos_t_in_stdio,
  463.   AC_TRY_COMPILE([#include <stdio.h>], [fpos_t position;],
  464. pthreads_cv_fpos_t_in_stdio=yes, pthreads_cv_fpos_t_in_stdio=no))
  465. AC_MSG_RESULT($pthreads_cv_fpos_t_in_stdio)
  466. if test $pthreads_cv_fpos_t_in_stdio = yes ; then
  467.   PTHREADS_FIND_INTEGRAL_TYPE(fpos_t, pthread_fpos_t, [
  468. #include <stdio.h>
  469. #include <sys/types.h>
  470. #ifdef STDC_HEADERS
  471. #include <stdlib.h>
  472. #endif
  473. ])
  474. else
  475.   AC_DEFINE(fpos_t,off_t)
  476.   AC_DEFINE(pthread_fpos_t,pthread_off_t)
  477. fi
  478. dnl
  479. dnl off_t
  480. dnl
  481. PTHREADS_FIND_INTEGRAL_TYPE(off_t, pthread_off_t, [
  482. #include <stdio.h>
  483. #include <sys/types.h>
  484. #ifdef STDC_HEADERS
  485. #include <stdlib.h>
  486. #endif
  487. ])
  488. dnl
  489. dnl va_list -- This one could be tricky.  Fortunately, on some systems,
  490. dnl we can just include the gcc stdarg.h header file if we can't determine
  491. dnl the type here.  Won't work for non-gcc configurations though.
  492. dnl
  493. PTHREADS_FIND_TYPE(va_list, pthread_va_list, [#include <stdarg.h>],
  494. char *, char **, void *, void **, int *, long *)
  495. dnl
  496. dnl
  497. arpa_headers="#include <sys/types.h>
  498. #include <arpa/nameser.h>"
  499. dnl
  500. dnl Type for network (IP) addresses, 32 bits.
  501. dnl For now, I'm assuming that the return type from _getlong is it.
  502. dnl
  503. AC_MSG_CHECKING(IP address type)
  504. AC_CACHE_VAL(pthread_cv_type_ipaddr,
  505.   AC_TRY_COMPILE($arpa_headers,[ &_getlong; ],[
  506.     for type in "unsigned long" "unsigned int" ; do
  507.       AC_TRY_COMPILE($arpa_headers, extern $type _getlong ();,[
  508.         pthread_cv_type_ipaddr="$type"
  509.         break
  510.       ])
  511.     done
  512.   ],[ AC_MSG_WARN(Can't compile _getlong reference.) ])
  513.   if test "$pthread_cv_type_ipaddr" = "" ; then
  514. AC_MSG_WARN(Can't determine _getlong return type.)
  515. AC_MSG_WARN(Defaulting to unsigned long.)
  516. pthread_cv_type_ipaddr="unsigned long"
  517.   fi
  518. )
  519. AC_MSG_RESULT($pthread_cv_type_ipaddr)
  520. AC_DEFINE_UNQUOTED(pthread_ipaddr_type,$pthread_cv_type_ipaddr)
  521. dnl
  522. dnl Type for network (IP) ports, 16 bits.
  523. dnl For now, I'm assuming that the return type from _getshort is it.
  524. dnl
  525. AC_MSG_CHECKING(IP port type)
  526. AC_CACHE_VAL(pthread_cv_type_ipport,
  527.   AC_TRY_COMPILE($arpa_headers,[ &_getshort; ],[
  528.     for type in "unsigned short" "unsigned int" ; do
  529.       AC_TRY_COMPILE($arpa_headers, extern $type _getshort ();,[
  530.         pthread_cv_type_ipport="$type"
  531.         break
  532.       ])
  533.     done
  534.   ],[ AC_MSG_WARN(Can't compile _getshort reference.) ])
  535.   if test "$pthread_cv_type_ipport" = "" ; then
  536. AC_MSG_WARN(Can't determine _getshort return type.)
  537. AC_MSG_WARN(Defaulting to unsigned short.) 
  538. pthread_cv_type_ipport="unsigned short"
  539.   fi
  540. )
  541. AC_MSG_RESULT($pthread_cv_type_ipport)
  542. AC_DEFINE_UNQUOTED(pthread_ipport_type,$pthread_cv_type_ipport)
  543. dnl
  544. dnl Guess where terminal devices are stored.  This is for use in the
  545. dnl ttyname() implementation provided here.
  546. dnl
  547. AC_MSG_CHECKING(pathname for terminal devices directory)
  548. AC_CACHE_VAL(pthread_cv_pty_path,
  549.   if test -d /devices/pseudo ; then
  550.     pty_path=/devices/pseudo/
  551.   else
  552.     pty_path=/dev/
  553.   fi
  554.   pthread_cv_pty_path=$pty_path
  555. )
  556. AC_DEFINE_UNQUOTED(_PATH_PTY,"$pthread_cv_pty_path")
  557. AC_MSG_RESULT($pthread_cv_pty_path)
  558. dnl
  559. dnl Look for timezone info, for use in ctime.
  560. dnl
  561. AC_MSG_CHECKING(directory name for time zone info)
  562. tzdir=NONE
  563. for f in /usr/lib/zoneinfo /usr/share/zoneinfo /usr/share/lib/zoneinfo /etc/zoneinfo /usr/local/lib/zoneinfo
  564. do
  565.   if test -d $f ; then
  566.     tzdir=$f
  567.     break
  568.   fi
  569. done
  570. case $tzdir in
  571. NONE)
  572. AC_MSG_WARN(Can't find zoneinfo directory.) 
  573. AC_MSG_WARN(Defaulting zoneinfo directory to NULL.)
  574. tzdir=NULL
  575. ;;
  576. esac
  577. AC_DEFINE_UNQUOTED(_PATH_TZDIR,"$tzdir")
  578. AC_MSG_RESULT($tzdir)
  579. AC_MSG_CHECKING(filename for local time zone)
  580. tzfile=NONE
  581. for f in $tzdir/localtime /etc/localtime
  582. do
  583.   if test -f $f ; then
  584.     tzfile=$f
  585.     break
  586.   fi
  587. done
  588. case $tzfile in
  589. NONE) # Should this default to tzdir/localtime?
  590. AC_MSG_WARN(Can't find local time zone file.) 
  591. if test tzdir = NULL ; then
  592. AC_MSG_WARN(Defaulting local time zone file to NULL)
  593. tzfile=NULL
  594. else
  595. AC_MSG_WARN(Defaulting local time zone file to $tzdir/localtime.) 
  596. tzfile=$tzdir/localtime
  597. fi
  598. ;;
  599. esac
  600. AC_DEFINE_UNQUOTED(_PATH_TZFILE,"$tzfile")
  601. AC_MSG_RESULT($tzfile)
  602. dnl
  603. dnl Network stuff.  At the moment, I don't think there are any other
  604. dnl values we should expect.  If we find a system that does store these
  605. dnl files elsewhere -- or doesn't have them all -- then run some tests.
  606. dnl
  607. AC_DEFINE(_PATH_RESCONF, "/etc/resolv.conf")
  608. AC_DEFINE(_PATH_HOSTS, "/etc/hosts")
  609. AC_DEFINE(_PATH_NETWORKS, "/etc/networks")
  610. AC_DEFINE(_PATH_PROTOCOLS, "/etc/protocols")
  611. AC_DEFINE(_PATH_SERVICES, "/etc/services")
  612. dnl
  613. dnl Other stuff
  614. dnl
  615. AC_DEFINE(_PATH_BSHELL, "/bin/sh")
  616. dnl If the system provides vfork, autoconf scripts will detect it.
  617. dnl So we should hide it.
  618. AC_CHECK_FUNCS(vfork)
  619. srctop=`cd ${srcdir}/..;pwd`
  620. AC_SUBST(srctop)
  621. # Now we deal with symlinks &c.
  622. test -d include || mkdir include || 
  623. AC_MSG_ERROR(Can't create include directory.)
  624. test -d include/pthread || mkdir include/pthread || 
  625. AC_MSG_ERROR(Can't create include/pthread directory.)
  626. test -d lib || mkdir lib || 
  627. AC_MSG_ERROR(Can't create lib directory.)
  628. test -d lib/libpthreadutil || mkdir lib/libpthreadutil || 
  629. AC_MSG_ERROR(Can't create lib/libpthreadutil directory.)
  630. test -d bin || mkdir bin || 
  631. AC_MSG_ERROR(Can't create bin directory.)
  632. test -d bin/finger || mkdir bin/finger || 
  633. AC_MSG_ERROR(Can't create bin directory.)
  634. test -d tests || mkdir tests || 
  635. AC_MSG_ERROR(Can't create tests directory.)
  636. if test x$syscall = xNONE ; then
  637.   syscall=$name
  638. fi
  639. links="include/pthread/machdep.h include/pthread/posix.h 
  640. machdep.c syscall.S"
  641. targets="../machdep/engine-$name.h ../machdep/posix-$sysincludes.h 
  642. ../machdep/engine-$name.c ../machdep/syscall-$syscall.S"
  643. # Both these targets are optional.  (Autoconf-generated configure scripts
  644. # will require the existence of link targets, so check before adding them
  645. # to the list.)
  646. if test x$sysincludes != xNONE ; then
  647.   links="$links include/sys"
  648.   targets="$targets ../machdep/$sysincludes"
  649. fi
  650. if test x$extraincludes != xNONE ; then
  651.   for tmp in $extraincludes
  652.   do
  653.     links="$links include/$tmp"
  654.     targets="$targets ../machdep/$sysincludes/extra/$tmp"
  655.   done
  656. fi  
  657. syscall_file=../machdep/syscall-template-$syscall.S
  658. if test -r $srcdir/$syscall_file ; then
  659.   links="$links syscall-template.S"
  660.   targets="$targets $syscall_file"
  661.   HAVE_SYSCALL_TEMPLATE=yes
  662. else
  663.   # This really isn't a fatal problem.  In fact, it's expected, initially,
  664.   # for some targets.  This is just to persuade people to fix the targets
  665.   # they deal with to provide some sort of template.
  666.   #
  667.   # Eventually this file probably will be required...
  668.   AC_MSG_WARN(No syscall template file syscall-template-$syscall.S found.)
  669.   HAVE_SYSCALL_TEMPLATE=no
  670. fi
  671. AC_SUBST(HAVE_SYSCALL_TEMPLATE)
  672. dnl Now tell it to make the links.
  673. dnl (The links are actually made by config.status.)
  674. AC_LINK_FILES($targets, $links)
  675. if test x$makefile_frag != x ; then
  676.   makefile_frag=${srcdir}/$makefile_frag
  677. else
  678.   makefile_frag=/dev/null
  679. fi
  680. dnl Drop in file indicated by $makefile_frag on *the line after* the
  681. dnl magic @makefile_frag@ sequence.
  682. AC_SUBST_FILE(makefile_frag)
  683. dnl Generate output files...
  684. AC_CONFIG_HEADER(config.h)
  685. dnl This must be last.
  686. AC_OUTPUT(config.flags GNUmakefile Makefile 
  687. lib/Makefile:../lib/Makefile.in 
  688. lib/libpthreadutil/Makefile:../lib/libpthreadutil/Makefile.in 
  689. bin/Makefile:../bin/Makefile.in 
  690. bin/finger/Makefile:../bin/finger/Makefile.in 
  691. tests/Makefile:../tests/Makefile.in)