configure.ac 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. # configure.ac
  2. AC_INIT(tmate, 2.2.1)
  3. AC_CONFIG_AUX_DIR(etc)
  4. AM_INIT_AUTOMAKE([foreign subdir-objects])
  5. AC_CANONICAL_HOST
  6. # When CFLAGS isn't set at this stage and gcc is detected by the macro below,
  7. # autoconf will automatically use CFLAGS="-O2 -g". Prevent that by using an
  8. # empty default.
  9. : ${CFLAGS=""}
  10. # Set up the compiler in two different ways and say yes we may want to install.
  11. AC_PROG_CC
  12. AM_PROG_CC_C_O
  13. AC_PROG_CPP
  14. AC_PROG_EGREP
  15. AC_PROG_INSTALL
  16. PKG_PROG_PKG_CONFIG
  17. # Default tmux.conf goes in /etc not ${prefix}/etc.
  18. test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
  19. # Is this --enable-debug?
  20. found_debug=yes
  21. AC_ARG_ENABLE(
  22. debug,
  23. AC_HELP_STRING(--enable-debug, enable debug build flags),
  24. found_debug=$enable_debug
  25. )
  26. AM_CONDITIONAL(IS_DEBUG, test "x$found_debug" = xyes)
  27. # Is this --enable-coverage?
  28. AC_ARG_ENABLE(
  29. coverage,
  30. AC_HELP_STRING(--enable-coverage, enable coverage build flags),
  31. found_coverage=$enable_coverage
  32. )
  33. AM_CONDITIONAL(IS_COVERAGE, test "x$found_coverage" = xyes)
  34. # Is this a static build?
  35. AC_ARG_ENABLE(
  36. static,
  37. AC_HELP_STRING(--enable-static, create a static build),
  38. found_static=$enable_static
  39. )
  40. if test "x$found_static" = xyes; then
  41. PKG_CONFIG="pkg-config --static"
  42. CFLAGS="$CFLAGS -flto"
  43. LDFLAGS="$LDFLAGS -flto"
  44. PKG_CHECK_MODULES([ZLIB], [zlib], [
  45. CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
  46. LIBS="$ZLIB_LIBS $LIBS"
  47. ])
  48. PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto], [
  49. CPPFLAGS="$LIBCRYPTO_CFLAGS $CPPFLAGS"
  50. LIBS="$LIBCRYPTO_LIBS $LIBS"
  51. ])
  52. # See more static settings below... (search for found_static)
  53. fi
  54. # Is this gcc?
  55. AM_CONDITIONAL(IS_GCC, test "x$GCC" = xyes)
  56. # Is this Sun CC?
  57. AC_EGREP_CPP(
  58. yes,
  59. [
  60. #ifdef __SUNPRO_C
  61. yes
  62. #endif
  63. ],
  64. found_suncc=yes,
  65. found_suncc=no
  66. )
  67. AM_CONDITIONAL(IS_SUNCC, test "x$found_suncc" = xyes)
  68. # Is this glibc?
  69. AC_MSG_CHECKING(for glibc)
  70. AC_EGREP_CPP(
  71. yes,
  72. [
  73. #include <features.h>
  74. #ifdef __GLIBC__
  75. yes
  76. #endif
  77. ],
  78. found_glibc=yes,
  79. found_glibc=no
  80. )
  81. AM_CONDITIONAL(IS_GLIBC, test "x$found_glibc" = xyes)
  82. AC_MSG_RESULT($found_glibc)
  83. # Check for various headers. Alternatives included from compat.h.
  84. AC_CHECK_HEADERS(
  85. [ \
  86. bitstring.h \
  87. curses.h \
  88. dirent.h \
  89. fcntl.h \
  90. inttypes.h \
  91. libutil.h \
  92. ncurses.h \
  93. ndir.h \
  94. paths.h \
  95. pty.h \
  96. stdint.h \
  97. sys/dir.h \
  98. sys/ndir.h \
  99. sys/tree.h \
  100. term.h \
  101. util.h \
  102. ]
  103. )
  104. # Look for library needed for flock.
  105. AC_SEARCH_LIBS(flock, bsd)
  106. # Check for some functions that are replaced or omitted.
  107. AC_CHECK_FUNCS(
  108. [ \
  109. dirfd \
  110. flock \
  111. setproctitle \
  112. sysconf \
  113. cfmakeraw \
  114. ]
  115. )
  116. # Look for clock_gettime. Must come before event_init.
  117. AC_SEARCH_LIBS(clock_gettime, rt)
  118. # Look for libevent.
  119. PKG_CHECK_MODULES(
  120. LIBEVENT,
  121. libevent,
  122. [
  123. CPPFLAGS="$LIBEVENT_CFLAGS $CPPFLAGS"
  124. LIBS="$LIBEVENT_LIBS $LIBS"
  125. found_libevent=yes
  126. ],
  127. [
  128. AC_SEARCH_LIBS(
  129. event_init,
  130. [event event-1.4 event2],
  131. found_libevent=yes,
  132. found_libevent=no
  133. )
  134. ]
  135. )
  136. if test "x$found_libevent" = xno; then
  137. AC_MSG_ERROR("libevent not found")
  138. fi
  139. # Look for ncurses
  140. PKG_CHECK_MODULES(
  141. LIBNCURSES,
  142. ncurses,
  143. [
  144. CPPFLAGS="$LIBNCURSES_CFLAGS $CPPFLAGS"
  145. LIBS="$LIBNCURSES_LIBS $LIBS"
  146. found_curses=yes
  147. ],
  148. [
  149. AC_SEARCH_LIBS(
  150. setupterm,
  151. [ncurses curses terminfo],
  152. found_curses=yes,
  153. found_curses=no
  154. )
  155. ]
  156. )
  157. if test "x$found_curses" = xno; then
  158. AC_MSG_ERROR("curses not found")
  159. fi
  160. # Look for utempter.
  161. AC_CHECK_HEADER(utempter.h, found_utempter=yes, found_utempter=no)
  162. if test "x$found_utempter" = xyes; then
  163. AC_SEARCH_LIBS(
  164. utempter_add_record,
  165. utempter,
  166. found_utempter=yes,
  167. found_utempter=no
  168. )
  169. if test "x$found_utempter" = xyes; then
  170. AC_DEFINE(HAVE_UTEMPTER)
  171. fi
  172. fi
  173. PKG_CHECK_MODULES(
  174. MSGPACK,
  175. msgpack >= 1.1.0,
  176. [
  177. CPPFLAGS="$MSGPACK_CFLAGS $CPPFLAGS"
  178. LIBS="$MSGPACK_LIBS $LIBS"
  179. found_msgpack=yes
  180. ],
  181. found_msgpack=no
  182. )
  183. if test "x$found_msgpack" = xno; then
  184. AC_MSG_ERROR("msgpack >= 1.1.0 not found")
  185. fi
  186. PKG_CHECK_MODULES(
  187. LIBSSH,
  188. libssh >= 0.6.0,
  189. [
  190. CPPFLAGS="$LIBSSH_CFLAGS $CPPFLAGS"
  191. LIBS="$LIBSSH_LIBS $LIBS"
  192. found_libssh=yes
  193. ],
  194. found_libssh=no
  195. )
  196. if test "x$found_libssh" = xno; then
  197. AC_MSG_ERROR("libssh >= 0.6.0 not found")
  198. fi
  199. # Check for b64_ntop.
  200. AC_MSG_CHECKING(for b64_ntop)
  201. AC_TRY_LINK(
  202. [
  203. #include <sys/types.h>
  204. #include <netinet/in.h>
  205. #include <resolv.h>
  206. ],
  207. [b64_ntop(NULL, 0, NULL, 0);],
  208. found_b64_ntop=yes,
  209. found_b64_ntop=no
  210. )
  211. if test "x$found_b64_ntop" = xno; then
  212. AC_MSG_RESULT(no)
  213. AC_MSG_CHECKING(for b64_ntop with -lresolv)
  214. LIBS="$LIBS -lresolv"
  215. AC_TRY_LINK(
  216. [
  217. #include <sys/types.h>
  218. #include <netinet/in.h>
  219. #include <resolv.h>
  220. ],
  221. [b64_ntop(NULL, 0, NULL, 0);],
  222. found_b64_ntop=yes,
  223. found_b64_ntop=no
  224. )
  225. if test "x$found_b64_ntop" = xno; then
  226. AC_MSG_RESULT(no)
  227. fi
  228. fi
  229. if test "x$found_b64_ntop" = xyes; then
  230. AC_DEFINE(HAVE_B64_NTOP)
  231. AC_MSG_RESULT(yes)
  232. fi
  233. AM_CONDITIONAL(NO_B64_NTOP, [test "x$found_b64_ntop" = xno])
  234. # Look for networking libraries.
  235. AC_SEARCH_LIBS(inet_ntoa, nsl)
  236. AC_SEARCH_LIBS(socket, socket)
  237. AC_CHECK_LIB(xnet, socket)
  238. # Check for CMSG_DATA. Some platforms require _XOPEN_SOURCE_EXTENDED (for
  239. # example see xopen_networking(7) on HP-UX).
  240. XOPEN_DEFINES=
  241. AC_MSG_CHECKING(for CMSG_DATA)
  242. AC_EGREP_CPP(
  243. yes,
  244. [
  245. #include <sys/socket.h>
  246. #ifdef CMSG_DATA
  247. yes
  248. #endif
  249. ],
  250. found_cmsg_data=yes,
  251. found_cmsg_data=no
  252. )
  253. AC_MSG_RESULT($found_cmsg_data)
  254. if test "x$found_cmsg_data" = xno; then
  255. AC_MSG_CHECKING(if CMSG_DATA needs _XOPEN_SOURCE_EXTENDED)
  256. AC_EGREP_CPP(
  257. yes,
  258. [
  259. #define _XOPEN_SOURCE 1
  260. #define _XOPEN_SOURCE_EXTENDED 1
  261. #include <sys/socket.h>
  262. #ifdef CMSG_DATA
  263. yes
  264. #endif
  265. ],
  266. found_cmsg_data=yes,
  267. found_cmsg_data=no
  268. )
  269. AC_MSG_RESULT($found_cmsg_data)
  270. if test "x$found_cmsg_data" = xyes; then
  271. XOPEN_DEFINES="-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED"
  272. else
  273. AC_MSG_ERROR("CMSG_DATA not found")
  274. fi
  275. fi
  276. AC_SUBST(XOPEN_DEFINES)
  277. # Look for imsg in libutil. compat/imsg.c is linked by Makefile.am if missing.
  278. AC_SEARCH_LIBS(imsg_init, util, found_imsg_init=yes, found_imsg_init=no)
  279. if test "x$found_imsg_init" = xyes; then
  280. AC_DEFINE(HAVE_IMSG)
  281. fi
  282. AM_CONDITIONAL(NO_IMSG, [test "x$found_imsg_init" = xno])
  283. # Look for forkpty in libutil. compat/forkpty-*.c is linked if not found.
  284. AC_SEARCH_LIBS(forkpty, util, found_forkpty=yes, found_forkpty=no)
  285. if test "x$found_forkpty" = xyes; then
  286. AC_DEFINE(HAVE_FORKPTY)
  287. fi
  288. AM_CONDITIONAL(NO_FORKPTY, [test "x$found_forkpty" = xno])
  289. # Look for closefrom, compat/closefrom.c used if missing.
  290. AC_CHECK_FUNC(closefrom, found_closefrom=yes, found_closefrom=no)
  291. if test "x$found_closefrom" = xyes; then
  292. AC_DEFINE(HAVE_CLOSEFROM)
  293. fi
  294. AM_CONDITIONAL(NO_CLOSEFROM, [test "x$found_closefrom" = xno])
  295. # Look for daemon, compat/daemon.c used if missing.
  296. AC_CHECK_FUNC(daemon, found_daemon=yes, found_daemon=no)
  297. if test "x$found_daemon" = xyes; then
  298. AC_DEFINE(HAVE_DAEMON)
  299. fi
  300. AM_CONDITIONAL(NO_DAEMON, [test "x$found_daemon" = xno])
  301. # Look for setenv, compat/setenv.c used if missing.
  302. AC_CHECK_FUNC(setenv, found_setenv=yes, found_setenv=no)
  303. if test "x$found_setenv" = xyes; then
  304. AC_DEFINE(HAVE_SETENV)
  305. fi
  306. AM_CONDITIONAL(NO_SETENV, [test "x$found_setenv" = xno])
  307. # Look for strlcpy, compat/strlcpy.c used if missing.
  308. AC_CHECK_FUNC(strlcpy, found_strlcpy=yes, found_strlcpy=no)
  309. if test "x$found_strlcpy" = xyes; then
  310. AC_DEFINE(HAVE_STRLCPY)
  311. fi
  312. AM_CONDITIONAL(NO_STRLCPY, [test "x$found_strlcpy" = xno])
  313. # Look for strlcat, compat/strlcat.c used if missing.
  314. AC_CHECK_FUNC(strlcat, found_strlcat=yes, found_strlcat=no)
  315. if test "x$found_strlcat" = xyes; then
  316. AC_DEFINE(HAVE_STRLCAT)
  317. fi
  318. AM_CONDITIONAL(NO_STRLCAT, [test "x$found_strlcat" = xno])
  319. # Look for asprintf, compat/asprintf.c used if missing.
  320. AC_CHECK_FUNC(asprintf, found_asprintf=yes, found_asprintf=no)
  321. if test "x$found_asprintf" = xyes; then
  322. AC_DEFINE(HAVE_ASPRINTF)
  323. fi
  324. AM_CONDITIONAL(NO_ASPRINTF, [test "x$found_asprintf" = xno])
  325. # Look for fgetln, compat/fgetln.c used if missing.
  326. AC_CHECK_FUNC(fgetln, found_fgetln=yes, found_fgetln=no)
  327. if test "x$found_fgetln" = xyes; then
  328. AC_DEFINE(HAVE_FGETLN)
  329. fi
  330. AM_CONDITIONAL(NO_FGETLN, [test "x$found_fgetln" = xno])
  331. # Look for fparseln, compat/fparseln.c used if missing.
  332. AC_CHECK_FUNC(fparseln, found_fparseln=yes, found_fparseln=no)
  333. if test "x$found_fparseln" = xyes; then
  334. AC_DEFINE(HAVE_FPARSELN)
  335. fi
  336. AM_CONDITIONAL(NO_FPARSELN, [test "x$found_fparseln" = xno])
  337. # Look for strcasestr, compat/strcasestr.c used if missing.
  338. AC_CHECK_FUNC(strcasestr, found_strcasestr=yes, found_strcasestr=no)
  339. if test "x$found_strcasestr" = xyes; then
  340. AC_DEFINE(HAVE_STRCASESTR)
  341. fi
  342. AM_CONDITIONAL(NO_STRCASESTR, [test "x$found_strcasestr" = xno])
  343. # Look for strsep, compat/strsep.c used if missing.
  344. AC_CHECK_FUNC(strsep, found_strsep=yes, found_strsep=no)
  345. if test "x$found_strsep" = xyes; then
  346. AC_DEFINE(HAVE_STRSEP)
  347. fi
  348. AM_CONDITIONAL(NO_STRSEP, [test "x$found_strsep" = xno])
  349. # Look for strtonum, compat/strtonum.c used if missing.
  350. AC_CHECK_FUNC(strtonum, found_strtonum=yes, found_strtonum=no)
  351. if test "x$found_strtonum" = xyes; then
  352. AC_DEFINE(HAVE_STRTONUM)
  353. fi
  354. AM_CONDITIONAL(NO_STRTONUM, [test "x$found_strtonum" = xno])
  355. # Look for stravis, compat/{vis,unvis}.c used if missing.
  356. AC_CHECK_FUNC(stravis, found_stravis=yes, found_stravis=no)
  357. if test "x$found_stravis" = xyes; then
  358. AC_MSG_CHECKING(if strnvis is broken)
  359. AC_EGREP_HEADER([strnvis\(char \*, const char \*, size_t, int\)],
  360. vis.h,
  361. AC_MSG_RESULT(no),
  362. [found_stravis=no])
  363. if test "x$found_stravis" = xno; then
  364. AC_MSG_RESULT(yes)
  365. fi
  366. fi
  367. if test "x$found_stravis" = xyes; then
  368. AC_DEFINE(HAVE_VIS)
  369. fi
  370. AM_CONDITIONAL(NO_VIS, [test "x$found_stravis" = xno])
  371. # Look for cfmakeraw, compat/cfmakeraw.c used if missing.
  372. AC_CHECK_FUNC(cfmakeraw, found_cfmakeraw=yes, found_cfmakeraw=no)
  373. if test "x$found_cfmakeraw" = xyes; then
  374. AC_DEFINE(HAVE_CFMAKERAW)
  375. fi
  376. AM_CONDITIONAL(NO_CFMAKERAW, [test "x$found_cfmakeraw" = xno])
  377. # Look for openat, compat/openat.c used if missing.
  378. AC_CHECK_FUNC(openat, found_openat=yes, found_openat=no)
  379. if test "x$found_openat" = xyes; then
  380. AC_DEFINE(HAVE_OPENAT)
  381. fi
  382. AM_CONDITIONAL(NO_OPENAT, [test "x$found_openat" = xno])
  383. # Look for reallocarray, compat/reallocarray.c used if missing.
  384. AC_CHECK_FUNC(reallocarray, found_reallocarray=yes, found_reallocarray=no)
  385. if test "x$found_reallocarray" = xyes; then
  386. AC_DEFINE(HAVE_REALLOCARRAY)
  387. fi
  388. AM_CONDITIONAL(NO_REALLOCARRAY, [test "x$found_reallocarray" = xno])
  389. # Look for getopt. glibc's getopt does not enforce argument order and the ways
  390. # of making it do so are stupid, so just use our own instead.
  391. AC_CHECK_FUNC(getopt, found_getopt=yes, found_getopt=no)
  392. if test "x$found_getopt" != xno; then
  393. AC_CHECK_DECLS(
  394. [optarg, optind, optreset],
  395. ,
  396. found_getopt=no,
  397. [
  398. #include <unistd.h>
  399. ]
  400. )
  401. if test "x$found_getopt" != xno; then
  402. AC_MSG_CHECKING(if system getopt should be avoided)
  403. if test "x$found_glibc" = xyes; then
  404. found_getopt=no
  405. AC_MSG_RESULT(yes)
  406. else
  407. AC_MSG_RESULT(no)
  408. AC_DEFINE(HAVE_GETOPT)
  409. fi
  410. fi
  411. fi
  412. AM_CONDITIONAL(NO_GETOPT, [test "x$found_getopt" = xno])
  413. if test "x$found_static" = xyes; then
  414. # libc and libdl should be dynamically linked.
  415. # but we want to lower our requirements for libc's version.
  416. # so we extract some symobls and add them here
  417. if test `uname -m` = x86_64; then
  418. LIBS="compat/memcpy.o -Wl,--wrap=memcpy $LIBS"
  419. fi
  420. LIBS="compat/clock_gettime.o libc/fdelt_chk.o $LIBS"
  421. LIBS="-Wl,-Bstatic ${LIBS/-ldl/} -Wl,-Bdynamic -ldl"
  422. fi
  423. # Check for BSD-style integer types.
  424. AC_MSG_CHECKING(for BSD-style unsigned types)
  425. AC_COMPILE_IFELSE([AC_LANG_SOURCE(
  426. [
  427. #include <sys/types.h>
  428. #ifdef HAVE_STDINT_H
  429. #include <stdint.h>
  430. #else
  431. #include <inttypes.h>
  432. #endif
  433. int main(void)
  434. { u_int8_t u8; u_int16_t u16; u_int32_t u32; u_int64_t u64; }
  435. ])],
  436. [AC_DEFINE(HAVE_BSD_TYPES) AC_MSG_RESULT(yes)],
  437. AC_MSG_RESULT(no)
  438. )
  439. # Look for a suitable queue.h.
  440. AC_CHECK_DECL(
  441. TAILQ_PREV,
  442. found_queue_h=yes,
  443. found_queue_h=no,
  444. [#include <sys/queue.h>]
  445. )
  446. AC_CHECK_DECL(
  447. TAILQ_REPLACE,
  448. ,
  449. found_queue_h=no,
  450. [#include <sys/queue.h>]
  451. )
  452. if test "x$found_queue_h" = xyes; then
  453. AC_DEFINE(HAVE_QUEUE_H)
  454. fi
  455. # Look for __progname.
  456. AC_MSG_CHECKING(for __progname)
  457. AC_LINK_IFELSE([AC_LANG_SOURCE(
  458. [
  459. #include <stdio.h>
  460. #include <stdlib.h>
  461. extern char *__progname;
  462. int main(void) {
  463. const char *cp = __progname;
  464. printf("%s\n", cp);
  465. exit(0);
  466. }
  467. ])],
  468. [AC_DEFINE(HAVE___PROGNAME) AC_MSG_RESULT(yes)],
  469. AC_MSG_RESULT(no)
  470. )
  471. # Look for fcntl(F_CLOSEM).
  472. AC_CHECK_DECL(
  473. F_CLOSEM,
  474. AC_DEFINE(HAVE_FCNTL_CLOSEM),
  475. ,
  476. [#include <fcntl.h>]
  477. )
  478. # Look for /proc/$$.
  479. AC_MSG_CHECKING(for /proc/\$\$)
  480. if test -d /proc/$$; then
  481. AC_DEFINE(HAVE_PROC_PID)
  482. AC_MSG_RESULT(yes)
  483. else
  484. AC_MSG_RESULT(no)
  485. fi
  486. # Man page defaults to mdoc.
  487. MANFORMAT=mdoc
  488. AC_SUBST(MANFORMAT)
  489. # Figure out the platform for osdep-*.c and forkpty-*.c.
  490. AC_MSG_CHECKING(platform)
  491. case "$host_os" in
  492. *aix*)
  493. AC_MSG_RESULT(aix)
  494. PLATFORM=aix
  495. ;;
  496. *darwin*)
  497. AC_MSG_RESULT(darwin)
  498. AC_DEFINE(BROKEN_CMSG_FIRSTHDR)
  499. PLATFORM=darwin
  500. ;;
  501. *dragonfly*)
  502. AC_MSG_RESULT(dragonfly)
  503. PLATFORM=dragonfly
  504. ;;
  505. *linux*)
  506. AC_MSG_RESULT(linux)
  507. PLATFORM=linux
  508. AC_DEFINE(IS_LINUX)
  509. ;;
  510. *freebsd*)
  511. AC_MSG_RESULT(freebsd)
  512. PLATFORM=freebsd
  513. ;;
  514. *netbsd*)
  515. AC_MSG_RESULT(netbsd)
  516. PLATFORM=netbsd
  517. ;;
  518. *openbsd*)
  519. AC_MSG_RESULT(openbsd)
  520. PLATFORM=openbsd
  521. ;;
  522. *sunos*)
  523. AC_MSG_RESULT(sunos)
  524. PLATFORM=sunos
  525. ;;
  526. *solaris*)
  527. AC_MSG_RESULT(sunos)
  528. PLATFORM=sunos
  529. MANFORMAT=man
  530. ;;
  531. *hpux*)
  532. AC_MSG_RESULT(hpux)
  533. PLATFORM=hpux
  534. ;;
  535. *cygwin*)
  536. AC_MSG_RESULT(cygwin)
  537. PLATFORM=cygwin
  538. ;;
  539. *)
  540. AC_MSG_RESULT(unknown)
  541. PLATFORM=unknown
  542. ;;
  543. esac
  544. AC_SUBST(PLATFORM)
  545. AM_CONDITIONAL(IS_AIX, test "x$PLATFORM" = xaix)
  546. AM_CONDITIONAL(IS_DARWIN, test "x$PLATFORM" = xdarwin)
  547. AM_CONDITIONAL(IS_DRAGONFLY, test "x$PLATFORM" = xdragonfly)
  548. AM_CONDITIONAL(IS_LINUX, test "x$PLATFORM" = xlinux)
  549. AM_CONDITIONAL(IS_FREEBSD, test "x$PLATFORM" = xfreebsd)
  550. AM_CONDITIONAL(IS_NETBSD, test "x$PLATFORM" = xnetbsd)
  551. AM_CONDITIONAL(IS_OPENBSD, test "x$PLATFORM" = xopenbsd)
  552. AM_CONDITIONAL(IS_SUNOS, test "x$PLATFORM" = xsunos)
  553. AM_CONDITIONAL(IS_HPUX, test "x$PLATFORM" = xhpux)
  554. AM_CONDITIONAL(IS_UNKNOWN, test "x$PLATFORM" = xunknown)
  555. # autoconf should create a Makefile.
  556. AC_OUTPUT(Makefile)