configure.in 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323
  1. dnl# -*- sh -*-
  2. dnl#
  3. dnl# $Id: configure.in,v 1.126 2003/03/07 02:32:17 gcw Exp $
  4. dnl#
  5. dnl# Process this file with autoconf to produce a configure script.
  6. dnl#
  7. AC_INIT(src/feature.h)
  8. AC_CONFIG_AUX_DIR(autoconf)
  9. AC_CONFIG_HEADER(config.h:autoconf/config.h.in)
  10. dnl RXVT version
  11. changequote(, )dnl
  12. VERSION=`sed -n -e 's/^.*[ \t]VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
  13. DATE=`sed -n -e 's/^.*[ \t]DATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
  14. LSMDATE=`sed -n -e 's/^.*[ \t]LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
  15. LIBVERSION=`sed -n -e 's/^.*[ \t]LIBVERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
  16. changequote([, ])dnl
  17. AC_SUBST(VERSION)dnl
  18. AC_SUBST(DATE)dnl
  19. AC_SUBST(LSMDATE)dnl
  20. AC_SUBST(LIBVERSION)dnl
  21. echo ""
  22. echo "configuring for rxvt $VERSION"
  23. echo ""
  24. dnl# Checks for programs.
  25. dnl AC_MAKE_SET
  26. AC_PROG_CC
  27. AC_PROG_CPP
  28. AC_PROG_INSTALL
  29. AC_PROG_AWK
  30. dnl# system hacks
  31. AC_AIX
  32. AC_ISC_POSIX
  33. AC_ENABLE_SHARED(no)dnl# libtool
  34. AC_ENABLE_STATIC(yes)dnl# libtool
  35. AC_PROG_LIBTOOL()dnl# libtool
  36. MALLOC_TYPE=S
  37. support_addstrings=no
  38. support_frills=no
  39. support_linespace=no
  40. support_graphics=no
  41. support_inheritpixmap=no
  42. support_keepscrolling=no
  43. support_menubar=no
  44. support_mousewheel=no
  45. support_mouseslipwheel=no
  46. support_oldselection=no
  47. support_utmp=no
  48. support_wtmp=no
  49. support_lastlog=no
  50. support_xim=no
  51. support_xpm=no
  52. support_scroll_rxvt=no
  53. support_scroll_next=no
  54. support_scroll_xterm=no
  55. multichar_set=no
  56. dnl# --------------------------------------------------------------------------
  57. dnl# CHECKING COMMAND LINE OPTIONS
  58. dnl# --------------------------------------------------------------------------
  59. if test "x$enable_shared" = xyes; then
  60. AC_DEFINE(LIBRXVT, 1, Build shared library version - specify via configure only)
  61. INSTALL_LIBRXVT=yes
  62. fi
  63. AC_SUBST(INSTALL_LIBRXVT)
  64. AC_ARG_ENABLE(everything,
  65. [ --enable-everything enable standard non-multichoice features: marked *
  66. NOTE: this option is order dependent
  67. NOTE: automatically enabled with --enable-shared],
  68. [if test x$enableval = xyes; then
  69. support_24bit=yes
  70. support_frills=yes
  71. support_linespace=yes
  72. support_graphics=yes
  73. support_inheritpixmap=yes
  74. support_keepscrolling=yes
  75. support_lastlog=yes
  76. support_menubar=yes
  77. support_mousewheel=yes
  78. support_mouseslipwheel=yes
  79. support_oldselection=yes
  80. support_scroll_rxvt=yes
  81. support_scroll_next=yes
  82. support_scroll_xterm=yes
  83. support_utmp=yes
  84. support_wtmp=yes
  85. support_xim=yes
  86. support_xpm=yes
  87. fi])
  88. AC_ARG_ENABLE(languages,
  89. [ --enable-languages enable multichar glyph language support],
  90. [if test x$enableval = xyes; then
  91. AC_DEFINE(MULTICHAR_SET, 1, Define to enable multichar glyph language support) multichar_set=yes
  92. fi])
  93. AC_ARG_WITH(encoding,
  94. [ --with-encoding=NAME set language default encoding to NAME (default: sjis)
  95. (eucj|sjis|big5|gb|kr|noenc)],
  96. [if test x$enableval = xyes; then
  97. withval=`echo $withval | tr '[a-z]' '[A-Z]'`
  98. AC_DEFINE_UNQUOTED(MULTICHAR_ENCODING, $withval, Define default multichar glyph encoding)
  99. fi])
  100. AC_ARG_ENABLE(utmp,
  101. [ --enable-utmp enable utmp (utmpx) support *],
  102. [if test x$enableval = xyes -o x$enableval = xno; then
  103. support_utmp=$enableval
  104. fi])
  105. AC_ARG_ENABLE(wtmp,
  106. [ --enable-wtmp enable wtmp (wtmpx) support (requires --enable-utmp)*],
  107. [if test x$enableval = xyes -o x$enableval = xno; then
  108. support_wtmp=$enableval
  109. fi])
  110. AC_ARG_ENABLE(lastlog,
  111. [ --enable-lastlog enable lastlog support (requires --enable-utmp) *],
  112. [if test x$enableval = xyes -o x$enableval = xno; then
  113. support_lastlog=$enableval
  114. fi])
  115. AC_ARG_ENABLE(xpm-background,
  116. [ --enable-xpm-background enable XPM background pixmaps *],
  117. [if test x$enableval = xyes -o x$enableval = xno; then
  118. support_xpm=$enableval
  119. fi])
  120. AC_ARG_ENABLE(transparency,
  121. [ --enable-transparency enable transparent backgrounds *],
  122. [if test x$enableval = xyes -o x$enableval = xno; then
  123. support_inheritpixmap=$enableval
  124. fi])
  125. AC_ARG_ENABLE(menubar,
  126. [ --enable-menubar enable menubar *],
  127. [if test x$enableval = xyes -o x$enableval = xno; then
  128. support_menubar=$enableval
  129. fi])
  130. AC_ARG_ENABLE(graphics,
  131. [ --enable-graphics enable rxvt own graphics mode (see src/graphics) *],
  132. [if test x$enableval = xyes -o x$enableval = xno; then
  133. support_graphics=$enableval
  134. fi])
  135. AC_ARG_ENABLE(rxvt-scroll,
  136. [ --enable-rxvt-scroll enable rxvt style scrollbar *],
  137. [if test x$enableval = xyes; then
  138. support_scroll_rxvt=yes
  139. fi])
  140. AC_ARG_ENABLE(next-scroll,
  141. [ --enable-next-scroll enable NeXT style scrollbar *],
  142. [if test x$enableval = xyes; then
  143. support_scroll_next=yes
  144. fi])
  145. AC_ARG_ENABLE(xterm-scroll,
  146. [ --enable-xterm-scroll enable Xterm style scrollbar *],
  147. [if test x$enableval = xyes; then
  148. support_scroll_xterm=yes
  149. fi])
  150. AC_ARG_ENABLE(half-shadow,
  151. [ --enable-half-shadow use half width/height shadow on rxvt scrollbar],
  152. [if test x$enableval = xyes; then
  153. AC_DEFINE(HALFSHADOW, 1, Define if you want the depth of scrollbars and menus to be less)
  154. fi])
  155. AC_ARG_ENABLE(xim,
  156. [ --enable-xim XIM (X Input Method) protocol support *],
  157. [if test x$enableval = xyes -o x$enableval = xno; then
  158. support_xim=$enableval
  159. fi])
  160. AC_ARG_ENABLE(greek,
  161. [ --enable-greek enable greek keyboard support],
  162. [if test x$enableval = xyes; then
  163. AC_DEFINE(GREEK_SUPPORT, 1, Define if you want support for Greek Elot-928 & IBM-437 keyboard)
  164. OBJGRKELOT="grkelot.o"
  165. fi])
  166. AC_ARG_ENABLE(ttygid,
  167. [ --enable-ttygid enable tty setting to group named "tty"],
  168. [if test x$enableval = xyes; then
  169. AC_DEFINE(TTY_GID_SUPPORT, 1, Define to change gid of ttys to group tty)
  170. fi])
  171. AC_ARG_ENABLE(backspace-key,
  172. [ --disable-backspace-key disable handling of the backspace key],
  173. [if test x$enableval = xno; then
  174. AC_DEFINE(NO_BACKSPACE_KEY, 1, Define if you don't want support for the backspace key)
  175. fi])
  176. AC_ARG_ENABLE(delete-key,
  177. [ --disable-delete-key disable handling of the delete key],
  178. [if test x$enableval = xno; then
  179. AC_DEFINE(NO_DELETE_KEY, 1, Define if you don't want support for the (non-keypad) delete key)
  180. fi])
  181. AC_ARG_ENABLE(resources,
  182. [ --disable-resources disable all resource checking],
  183. [if test x$enableval = xno; then
  184. AC_DEFINE(NO_RESOURCES, 1, Define if you don't want any resources read)
  185. fi])
  186. AC_ARG_ENABLE(xgetdefault,
  187. [ --enable-xgetdefault enable resources via X instead of our small version],
  188. [if test x$enableval = xyes; then
  189. AC_DEFINE(USE_XGETDEFAULT, 1, Define if you want to use XGetDefault instead of our internal version)
  190. fi])
  191. AC_ARG_ENABLE(strings,
  192. [ --enable-strings enable some replacement system functions],
  193. [if test x$enableval = xyes -o x$enableval = xno; then
  194. support_addstrings=$enableval
  195. fi])
  196. AC_ARG_ENABLE(swapscreen,
  197. [ --disable-swapscreen disable swap screen support],
  198. [if test x$enableval = xno; then
  199. AC_DEFINE(NO_SECONDARY_SCREEN, 1, Disable the secondary screen. Many programs use the secondary screen as their workplace)
  200. fi])
  201. AC_ARG_ENABLE(frills,
  202. [ --enable-frills enable support for rarely used features *],
  203. [if test x$enableval = xyes -o x$enableval = xno; then
  204. support_frills=$enableval
  205. fi])
  206. AC_ARG_ENABLE(linespace,
  207. [ --enable-linespace enable support for linespace *],
  208. [if test x$enableval = xyes -o x$enableval = xno; then
  209. support_linespace=$enableval
  210. fi])
  211. AC_ARG_ENABLE(24bit,
  212. [ --enable-24bit enable support for using 24bit visuals if available *],
  213. [if test x$enableval = xyes -o x$enableval = xno; then
  214. support_24bit=$enableval
  215. fi])
  216. AC_ARG_ENABLE(keepscrolling,
  217. [ --enable-keepscrolling enable continual scrolling on scrollbar arrow press *],
  218. [if test x$enableval = xyes -o x$enableval = xno; then
  219. support_keepscrolling=$enableval
  220. fi])
  221. AC_ARG_ENABLE(mousewheel,
  222. [ --enable-mousewheel enable scrolling via mouse wheel or buttons 4 & 5 *],
  223. [if test x$enableval = xyes -o x$enableval = xno; then
  224. support_mousewheel=$enableval
  225. fi])
  226. AC_ARG_ENABLE(slipwheeling,
  227. [ --enable-slipwheeling enable slip wheel scrolling (requires previous) *],
  228. [if test x$enableval = xyes -o x$enableval = xno; then
  229. support_mouseslipwheel=$enableval
  230. fi])
  231. AC_ARG_ENABLE(old-selection,
  232. [ --enable-old-selection enable v2.20 (& prior) mouse selection style support*],
  233. [if test x$enableval = xyes -o x$enableval = xno; then
  234. support_oldselection=$enableval
  235. fi])
  236. AC_ARG_ENABLE(new-selection,
  237. [ --disable-new-selection disable new mouse (xterm) selection style support],
  238. [if test x$enableval = xno; then
  239. AC_DEFINE(NO_NEW_SELECTION, 1, Define to remove xterm style mouse selection)
  240. fi])
  241. AC_ARG_ENABLE(dmalloc,
  242. [ --enable-dmalloc enable Gray Watson's malloc - for debugging use],
  243. [if test x$enableval = xyes; then
  244. MALLOC_TYPE=G
  245. DEBUG=-DDEBUG_MALLOC
  246. DLIB="-L/usr/local/lib -ldmalloc"
  247. DINCLUDE=-I/usr/local/include
  248. fi])
  249. AC_ARG_ENABLE(dlmalloc,
  250. [ --enable-dlmalloc enable Doug Lea's malloc - for production use
  251. NOTE: enable only one malloc package],
  252. [if test x$enableval = xyes; then
  253. MALLOC_TYPE=D
  254. DEBUG=
  255. DLIB="-L/usr/local/lib -ldlmalloc"
  256. DINCLUDE=
  257. fi])
  258. AC_ARG_ENABLE(smart-resize,
  259. [ --enable-smart-resize enable smart growth/shrink behaviour],
  260. [if test x$enableval = xyes; then
  261. AC_DEFINE(SMART_RESIZE, 1, Define to use "smart" resize behavior)
  262. fi])
  263. AC_ARG_ENABLE(256-color,
  264. [ --enable-256-color enable 256-color support],
  265. [if test x$enableval = xyes; then
  266. AC_DEFINE(TTY_256COLOR, 1, Define if you want 256 colour support)
  267. fi])
  268. AC_ARG_WITH(term,
  269. [ --with-term=NAME set the terminal to NAME (default \"xterm\")],
  270. [if test x$withval != x; then
  271. AC_DEFINE_UNQUOTED(TERMENV, "$withval",Set TERM to the value given by configure) term="$withval"
  272. fi])
  273. AC_ARG_WITH(terminfo,
  274. [ --with-terminfo=PATH set the path to the terminfo tree to PATH],
  275. [if test x$withval != x; then
  276. AC_DEFINE_UNQUOTED(RXVT_TERMINFO, "$withval", Set TERMINFO value to the value given by configure) terminfo="$withval"
  277. fi])
  278. dnl# --------------------------------------------------------------------------
  279. AC_DEFINE(PROTOTYPES, 1, Define if you need function prototypes)
  280. dnl# --------------------------------------------------------------------------
  281. dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
  282. dnl#
  283. if test -z "$CFLAGS"; then
  284. if test -z "$CCOPTS"; then
  285. CCOPTS='-O'
  286. dnl> if test "x$GCC" = xyes; then
  287. dnl> if test x$system = xLinux; then
  288. dnl> CCOPTS="$CCOPTS "'-O2 -fno-strength-reduce'
  289. dnl> fi
  290. dnl> fi
  291. fi
  292. CFLAGS="$CCOPTS"
  293. fi
  294. AC_PATH_PROG(MV, mv, mv)
  295. AC_PATH_PROG(RM, rm, rm)
  296. AC_PATH_PROG(CP, cp, cp)
  297. AC_PATH_PROG(LN, ln, ln)
  298. AC_PATH_PROG(SED, sed, sed)
  299. AC_PATH_PROG(ECHO, echo, echo)
  300. AC_PATH_PROG(CMP, cmp, cmp)
  301. AC_PATH_PROG(TBL, tbl)
  302. dnl# need a neat way to detect SVR4 or its features
  303. dnl# in src/command.c we use these functions:
  304. dnl# grantpt(), unlockpt(), ptsname(), which are defined in <sys/ptms.h>
  305. dnl# - but are these also defined for other systems?
  306. dnl# hack to find if this is SVR4 -- who knows?
  307. dnl## AC_MSG_CHECKING(for SVR4)
  308. dnl## AC_EGREP_CPP(yes,
  309. dnl## [#if defined (SVR4) || defined (_SVR4) || defined (__svr4__)
  310. dnl## yes;
  311. dnl## #endif
  312. dnl## ], [AC_MSG_RESULT(yes); AC_DEFINE(PERHAPS_SVR4)], AC_MSG_RESULT(perhaps not?))
  313. AC_PATH_XTRA
  314. dnl# the only reasonable way to find libXpm is do-it-yourself
  315. dnl# only check if we want xpm-background
  316. if test x$support_xpm = xyes; then
  317. VT_FIND_LIBXPM
  318. if test x$no_xpm = xyes; then
  319. support_xpm=needsmanualspecification
  320. fi
  321. fi
  322. dnl# --------------------------------------------------------------------------
  323. dnl# CHECKING FOR HEADER FILES
  324. dnl# --------------------------------------------------------------------------
  325. AC_HEADER_SYS_WAIT
  326. AC_CHECK_HEADERS( \
  327. assert.h \
  328. fcntl.h \
  329. grp.h \
  330. libc.h \
  331. lastlog.h \
  332. stdarg.h \
  333. stdlib.h \
  334. string.h \
  335. termios.h \
  336. unistd.h \
  337. sys/byteorder.h \
  338. sys/ioctl.h \
  339. sys/select.h \
  340. sys/sockio.h \
  341. sys/strredir.h \
  342. sys/time.h \
  343. utmp.h \
  344. utmpx.h \
  345. )
  346. AC_HEADER_TIME
  347. dnl# check to allow both <termios.h> and <sys/ioctl.h>
  348. AC_CACHE_CHECK(whether termios.h and sys/ioctl.h may both be included, rxvt_cv_header_sysioctl,
  349. [AC_TRY_COMPILE([#include <stdio.h>
  350. #include <sys/ioctl.h>
  351. #ifdef HAVE_TERMIOS_H
  352. #include <termios.h>
  353. #endif], [int a = ECHO;], rxvt_cv_header_sysioctl=yes, rxvt_cv_header_sysioctl=no)])
  354. dnl# ELF systems may want to store paths for dynamic libraries.
  355. dnl# Lets see if the compiler can accept "-Rpath" or "-Wl,-Rpath"
  356. dnl# At least one version of SunOS wants "-R path" but it's not checked yet.
  357. if test -n "$GCC"; then
  358. LDARG="-Wl,"
  359. else
  360. LDARG=""
  361. fi
  362. changequote(, )dnl
  363. R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-rpath '$LDARG'\1/g'
  364. changequote([, ])dnl
  365. ac_save_CFLAGS=$CFLAGS
  366. ac_save_LIBS=$LIBS
  367. CFLAGS="$CFLAGS $X_CFLAGS"
  368. LIBS=`echo "$LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"`
  369. AC_CACHE_CHECK([for -rpath dynamic library path recording], rxvt_cv_rpath,
  370. [AC_TRY_RUN([
  371. main()
  372. {
  373. exit(0);
  374. (void) XOpenDisplay("foobar");
  375. }], rxvt_cv_rpath=yes, rxvt_cv_rpath=no, dnl
  376. AC_MSG_WARN([You may need to check the LIBS line]))])
  377. if test x$rxvt_cv_rpath != xyes; then
  378. changequote(, )dnl
  379. R_TRANSLATE='s/-L\([^ ]*\)/-L\1 '$LDARG'-R\1/g'
  380. changequote([, ])dnl
  381. LIBS=`echo "$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11" | sed "$R_TRANSLATE"`
  382. AC_CACHE_CHECK([for -R dynamic library path recording], rxvt_cv_R,
  383. [AC_TRY_RUN([
  384. main()
  385. {
  386. exit(0);
  387. (void) XOpenDisplay("foobar");
  388. }], rxvt_cv_R=yes, rxvt_cv_R=no, rxvt_cv_R=no)])
  389. if test x$rxvt_cv_R != xyes; then
  390. LIBS="$ac_save_LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
  391. fi
  392. fi
  393. AC_CACHE_CHECK([for XPointer], rxvt_cv_xpointer,
  394. [AC_TRY_COMPILE([#include <X11/Xlib.h>], [XPointer dummy;],
  395. rxvt_cv_xpointer=yes, rxvt_cv_xpointer=no)])
  396. if test x$rxvt_cv_xpointer = xyes; then
  397. AC_DEFINE(HAVE_XPOINTER, 1, Define if you have XPointer typedef)
  398. fi
  399. LIBS=$ac_save_LIBS
  400. CFLAGS=$ac_save_CFLAGS
  401. AC_C_CONST
  402. AC_C_INLINE
  403. dnl> AC_HEADER_STDC dnl# skip this test, Sun always fails anyhow.
  404. dnl# --------------------------------------------------------------------------
  405. dnl# CHECKING FOR MISSING TYPEDEFS
  406. dnl# --------------------------------------------------------------------------
  407. dnl# Missing typedefs and replacements
  408. AC_TYPE_MODE_T
  409. dnl> AC_CHECK_TYPE(umode_t, int)
  410. dnl> AC_CHECK_TYPE(off_t, long)
  411. AC_TYPE_PID_T
  412. AC_TYPE_UID_T
  413. AC_CHECK_SIZEOF(char, 1)
  414. AC_CHECK_SIZEOF(short, 2)
  415. AC_CHECK_SIZEOF(int, 4)
  416. AC_CHECK_SIZEOF(long, 4)
  417. AC_CHECK_SIZEOF(long long, 8)
  418. AC_CHECK_SIZEOF(int *, 4)
  419. dnl# see usage below
  420. AC_DEFUN(RXVT_CHECK_SIZE,
  421. [AC_CACHE_CHECK([for $2], $1,
  422. [AC_TRY_COMPILE([#include <sys/types.h>], $2 dummy;,
  423. [$1=yes],
  424. [dnl
  425. if test $ac_cv_sizeof_char -ge $3; then
  426. $1="$4 char"
  427. else
  428. if test $ac_cv_sizeof_short -ge $3; then
  429. $1="$4 short"
  430. else
  431. if test $ac_cv_sizeof_int -ge $3; then
  432. $1="$4 int"
  433. else
  434. if test $ac_cv_sizeof_long -ge $3; then
  435. $1="$4 long"
  436. else
  437. if test $ac_cv_sizeof_long_long -ge $3; then
  438. $1="$4 long long"
  439. else
  440. $1="$4 $5" # we _must_ have a (possibly wrong) default
  441. fi
  442. fi
  443. fi
  444. fi
  445. fi])])]
  446. if test x"$$1" != xyes; then
  447. $6="typedef $$1 $2;"
  448. else
  449. if test x"$4" = x; then
  450. $6="/* typedef $5 $2; */"
  451. else
  452. $6="/* typedef $4 $5 $2; */"
  453. fi
  454. fi dnl
  455. )
  456. dnl#
  457. dnl# Look for types the system may know about anyway.
  458. dnl#
  459. RXVT_CHECK_SIZE(rxvt_cv_int16_t, int16_t, 2, , short, rxvt_int16_typedef)
  460. AC_SUBST(rxvt_int16_typedef)
  461. RXVT_CHECK_SIZE(rxvt_cv_u_int16_t, u_int16_t, 2, unsigned, short, rxvt_u_int16_typedef)
  462. AC_SUBST(rxvt_u_int16_typedef)
  463. RXVT_CHECK_SIZE(rxvt_cv_int32_t, int32_t, 4, , int, rxvt_int32_typedef)
  464. AC_SUBST(rxvt_int32_typedef)
  465. RXVT_CHECK_SIZE(rxvt_cv_u_int32_t, u_int32_t, 4, unsigned, int, rxvt_u_int32_typedef)
  466. AC_SUBST(rxvt_u_int32_typedef)
  467. RXVT_CHECK_SIZE(rxvt_cv_int64_t, int64_t, 8, , long long, rxvt_int64_typedef)
  468. AC_SUBST(rxvt_int64_typedef)
  469. RXVT_CHECK_SIZE(rxvt_cv_u_int64_t, u_int64_t, 8, unsigned, long long, rxvt_u_int64_typedef)
  470. AC_SUBST(rxvt_u_int64_typedef)
  471. dnl#
  472. dnl# Now look for another we use
  473. dnl#
  474. if test $ac_cv_sizeof_int_p -eq 8; then
  475. rxvt_intp_define="#define intp_t int64_t"
  476. rxvt_u_intp_define="#define u_intp_t u_int64_t"
  477. else
  478. if test $ac_cv_sizeof_int_p -eq 4; then
  479. rxvt_intp_define="#define intp_t int32_t"
  480. rxvt_u_intp_define="#define u_intp_t u_int32_t"
  481. else
  482. if test $ac_cv_sizeof_int_p -eq 2; then
  483. rxvt_intp_define="#define intp_t int16_t"
  484. rxvt_u_intp_define="#define u_intp_t u_int16_t"
  485. else
  486. rxvt_intp_define="#error set intp_t"
  487. rxvt_u_intp_define="#error set u_intp_t"
  488. fi
  489. fi
  490. fi
  491. AC_SUBST(rxvt_intp_define)
  492. AC_SUBST(rxvt_u_intp_define)
  493. dnl# --------------------------------------------------------------------------
  494. dnl# CHECKING FOR LIBRARY FUNCTIONS
  495. dnl# --------------------------------------------------------------------------
  496. AC_TYPE_SIGNAL
  497. dnl> AC_FUNC_VPRINTF
  498. dnl# Note: On Ultrix, setsid() does weirdo stuff, disable it
  499. case "$host_alias" in
  500. *ultrix) ac_cv_func_setsid='no' ;;
  501. *) break;;
  502. esac
  503. AC_CHECK_FUNCS( \
  504. atexit \
  505. revoke \
  506. unsetenv \
  507. setutent \
  508. seteuid \
  509. setreuid \
  510. setsid \
  511. setpgrp \
  512. setpgid \
  513. openpty \
  514. _getpty \
  515. grantpt \
  516. unlockpt \
  517. isastream \
  518. on_exit \
  519. nanosleep \
  520. updwtmp \
  521. ttyslot \
  522. )
  523. dnl# Note: On NetBSD, openpty() exists in libutil. Don't pull it in
  524. dnl# --------------------------------------------------------------------------
  525. dnl# DO ALL UTMP AND WTMP CHECKING
  526. dnl# --------------------------------------------------------------------------
  527. dnl# check for host field in utmp structure
  528. dnl# --------------------------------------------
  529. AC_CHECK_HEADER(utmp.h,
  530. [AC_CACHE_CHECK([for struct utmp], rxvt_cv_struct_utmp,
  531. [AC_TRY_COMPILE([#include <sys/types.h>
  532. #include <utmp.h>],
  533. [struct utmp ut;],
  534. rxvt_cv_struct_utmp=yes, rxvt_cv_struct_utmp=no)])
  535. if test x$rxvt_cv_struct_utmp = xyes; then
  536. AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)
  537. fi
  538. ]
  539. AC_CACHE_CHECK(for ut_host in utmp struct, rxvt_cv_struct_utmp_host,
  540. [AC_TRY_COMPILE([#include <sys/types.h>
  541. #include <utmp.h>],
  542. [struct utmp ut; ut.ut_host;],
  543. rxvt_cv_struct_utmp_host=yes, rxvt_cv_struct_utmp_host=no)])
  544. if test x$rxvt_cv_struct_utmp_host = xyes; then
  545. AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)
  546. fi
  547. AC_CACHE_CHECK(for ut_pid in utmp struct, rxvt_cv_struct_utmp_pid,
  548. [AC_TRY_COMPILE([#include <sys/types.h>
  549. #include <utmp.h>],
  550. [struct utmp ut; ut.ut_pid;],
  551. rxvt_cv_struct_utmp_pid=yes, rxvt_cv_struct_utmp_pid=no)])
  552. if test x$rxvt_cv_struct_utmp_pid = xyes; then
  553. AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)
  554. fi
  555. ) dnl# AC_CHECK_HEADER(utmp.h
  556. dnl# --------------------------------------------
  557. AC_CHECK_HEADER(utmpx.h,
  558. [AC_CACHE_CHECK([for struct utmpx], rxvt_cv_struct_utmpx,
  559. [AC_TRY_COMPILE([#include <sys/types.h>
  560. #include <utmpx.h>],
  561. [struct utmpx ut;],
  562. rxvt_cv_struct_utmpx=yes, rxvt_cv_struct_utmpx=no)])
  563. if test x$rxvt_cv_struct_utmpx = xyes; then
  564. AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)
  565. fi
  566. ]
  567. AC_CACHE_CHECK(for host in utmpx struct, rxvt_cv_struct_utmpx_host,
  568. [AC_TRY_COMPILE([#include <sys/types.h>
  569. #include <utmpx.h>],
  570. [struct utmpx utx; utx.ut_host;],
  571. rxvt_cv_struct_utmpx_host=yes, rxvt_cv_struct_utmpx_host=no)])
  572. if test x$rxvt_cv_struct_utmpx_host = xyes; then
  573. AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)
  574. fi
  575. ) dnl# AC_CHECK_HEADER(utmpx.h
  576. dnl# --------------------------------------------------------------------------
  577. dnl# check for struct lastlog
  578. AC_CACHE_CHECK(for struct lastlog, rxvt_cv_struct_lastlog,
  579. [AC_TRY_COMPILE([#include <sys/types.h>
  580. #include <utmp.h>
  581. #ifdef HAVE_LASTLOG_H
  582. #include <lastlog.h>
  583. #endif
  584. ],
  585. [struct lastlog ll;],
  586. rxvt_cv_struct_lastlog=yes, rxvt_cv_struct_lastlog=no)])
  587. if test x$rxvt_cv_struct_lastlog = xyes; then
  588. AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)
  589. fi
  590. dnl# check for struct lastlogx
  591. AC_CACHE_CHECK(for struct lastlogx, rxvt_cv_struct_lastlogx,
  592. [AC_TRY_COMPILE([#include <sys/types.h>
  593. #include <utmpx.h>
  594. #ifdef HAVE_LASTLOG_H
  595. #include <lastlog.h>
  596. #endif
  597. ],
  598. [struct lastlogx ll;],
  599. rxvt_cv_struct_lastlogx=yes, rxvt_cv_struct_lastlogx=no)])
  600. if test x$rxvt_cv_struct_lastlogx = xyes; then
  601. AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)
  602. fi
  603. dnl# --------------------------------------------------------------------------
  604. dnl# FIND FILES
  605. dnl# --------------------------------------------------------------------------
  606. dnl# find utmp
  607. AC_CACHE_CHECK(where utmp is located, rxvt_cv_path_utmp,
  608. [AC_TRY_RUN([#include <stdio.h>
  609. #include <sys/types.h>
  610. #include <utmp.h>
  611. #include <errno.h>
  612. main()
  613. {
  614. char **u, *utmplist[] = {
  615. "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL };
  616. FILE *a, *f=fopen("conftestval", "w");
  617. if (!f) exit(1);
  618. #ifdef UTMP_FILE
  619. fprintf(f, "%s\n", UTMP_FILE);
  620. exit(0);
  621. #endif
  622. #ifdef _PATH_UTMP
  623. fprintf(f, "%s\n", _PATH_UTMP);
  624. exit(0);
  625. #endif
  626. for (u = utmplist; *u; u++) {
  627. if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
  628. fprintf(f, "%s\n", *u);
  629. exit(0);
  630. }
  631. }
  632. exit(0);
  633. }], rxvt_cv_path_utmp=`cat conftestval`, rxvt_cv_path_utmp=, dnl
  634. AC_MSG_WARN([Define RXVT_UTMP_FILE in config.h manually]))])
  635. if test x$rxvt_cv_path_utmp != x; then
  636. AC_DEFINE_UNQUOTED(RXVT_UTMP_FILE, "$rxvt_cv_path_utmp", Define location of utmp)
  637. fi
  638. dnl# --------------------------------------------------------------------------
  639. dnl# find utmpx - if a utmp file exists at the same location and is more than
  640. dnl# a day newer, then dump the utmpx. People leave lots of junk around.
  641. AC_CACHE_CHECK(where utmpx is located, rxvt_cv_path_utmpx,
  642. [AC_TRY_RUN([#include <stdio.h>
  643. #include <sys/types.h>
  644. #include <utmpx.h>
  645. #include <errno.h>
  646. #include <sys/stat.h>
  647. #ifdef HAVE_STRING_H
  648. #include <string.h>
  649. #endif
  650. main()
  651. {
  652. char **u, *p, *utmplist[] = {
  653. #ifdef UTMPX_FILE
  654. UTMPX_FILE,
  655. #endif
  656. #ifdef _PATH_UTMPX
  657. _PATH_UTMPX,
  658. #endif
  659. "/var/adm/utmpx", "/etc/utmpx", NULL };
  660. FILE *a, *f=fopen("conftestval", "w");
  661. struct stat statu, statux;
  662. if (!f) exit(1);
  663. for (u = utmplist; *u; u++) {
  664. if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
  665. if (stat(*u, &statux) < 0)
  666. continue;
  667. p = strdup(*u);
  668. p[strlen(p) - 1] = '\0';
  669. if (stat(p, &statu) >= 0
  670. && (statu.st_mtime - statux.st_mtime > 86400))
  671. continue;
  672. fprintf(f, "%s\n", *u);
  673. exit(0);
  674. }
  675. }
  676. exit(0);
  677. }], rxvt_cv_path_utmpx=`cat conftestval`, rxvt_cv_path_utmpx=, dnl
  678. AC_MSG_WARN([Define RXVT_UTMPX_FILE in config.h manually]))])
  679. if test x$rxvt_cv_path_utmpx != x; then
  680. AC_DEFINE_UNQUOTED(RXVT_UTMPX_FILE, "$rxvt_cv_path_utmpx", Define location of utmpx)
  681. fi
  682. dnl# --------------------------------------------------------------------------
  683. dnl# find wtmp
  684. AC_CACHE_CHECK(where wtmp is located, rxvt_cv_path_wtmp,
  685. [AC_TRY_RUN([#include <stdio.h>
  686. #include <sys/types.h>
  687. #ifdef HAVE_UTMP_H
  688. #include <utmp.h>
  689. #endif
  690. #include <errno.h>
  691. main()
  692. {
  693. char **w, *wtmplist[] = {
  694. "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL };
  695. FILE *a, *f=fopen("conftestval", "w");
  696. if (!f) exit(1);
  697. #ifdef WTMP_FILE
  698. fprintf(f, "%s\n", WTMP_FILE);
  699. exit(0);
  700. #endif
  701. #ifdef _PATH_WTMP
  702. fprintf(f, "%s\n", _PATH_WTMP);
  703. exit(0);
  704. #endif
  705. for (w = wtmplist; *w; w++) {
  706. if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
  707. fprintf(f, "%s\n", *w);
  708. exit(0);
  709. }
  710. }
  711. exit(0);
  712. }], rxvt_cv_path_wtmp=`cat conftestval`, rxvt_cv_path_wtmp=, dnl
  713. AC_MSG_WARN([Define RXVT_WTMP_FILE in config.h manually]))])
  714. if test x$rxvt_cv_path_wtmp != x; then
  715. AC_DEFINE_UNQUOTED(RXVT_WTMP_FILE, "$rxvt_cv_path_wtmp", Define location of wtmp)
  716. fi
  717. dnl# --------------------------------------------------------------------------
  718. dnl# find wtmpx
  719. AC_CACHE_CHECK(where wtmpx is located, rxvt_cv_path_wtmpx,
  720. [AC_TRY_RUN([#include <stdio.h>
  721. #ifdef HAVE_UTMPX_H
  722. #include <utmpx.h>
  723. #endif
  724. #include <errno.h>
  725. main()
  726. {
  727. char **w, *wtmplist[] = {
  728. "/var/log/wtmpx", "/var/adm/wtmpx", NULL };
  729. FILE *a, *f=fopen("conftestval", "w");
  730. if (!f) exit(1);
  731. #ifdef WTMPX_FILE
  732. fprintf(f, "%s\n", WTMPX_FILE);
  733. exit(0);
  734. #endif
  735. #ifdef _PATH_WTMPX
  736. fprintf(f, "%s\n", _PATH_WTMPX);
  737. exit(0);
  738. #endif
  739. for (w = wtmplist; *w; w++) {
  740. if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
  741. fprintf(f, "%s\n", *w);
  742. exit(0);
  743. }
  744. }
  745. exit(0);
  746. }], rxvt_cv_path_wtmpx=`cat conftestval`, rxvt_cv_path_wtmpx=, dnl
  747. AC_MSG_WARN([Define RXVT_WTMPX_FILE in config.h manually]))])
  748. if test x$rxvt_cv_path_wtmpx != x; then
  749. AC_DEFINE_UNQUOTED(RXVT_WTMPX_FILE, "$rxvt_cv_path_wtmpx", Define location of wtmpx)
  750. fi
  751. dnl# --------------------------------------------------------------------------
  752. dnl# find lastlog
  753. AC_CACHE_CHECK(where lastlog is located, rxvt_cv_path_lastlog,
  754. [AC_TRY_RUN([#include <stdio.h>
  755. #include <sys/types.h>
  756. #ifdef HAVE_UTMPX_H
  757. #include <utmpx.h>
  758. #elif defined(HAVE_UTMP_H)
  759. #include <utmp.h>
  760. #endif
  761. #ifdef HAVE_LASTLOG_H
  762. #include <lastlog.h>
  763. #endif
  764. #include <errno.h>
  765. main()
  766. {
  767. char **w, *lastloglist[] = { "/var/log/lastlog", NULL };
  768. FILE *a, *f=fopen("conftestval", "w");
  769. if (!f) exit(1);
  770. #ifdef LASTLOG_FILE
  771. fprintf(f, "%s\n", LASTLOG_FILE);
  772. exit(0);
  773. #endif
  774. #ifdef _PATH_LASTLOG
  775. fprintf(f, "%s\n", _PATH_LASTLOG);
  776. exit(0);
  777. #endif
  778. for (w = lastloglist; *w; w++) {
  779. if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
  780. fprintf(f, "%s\n", *w);
  781. exit(0);
  782. }
  783. }
  784. exit(0);
  785. }], rxvt_cv_path_lastlog=`cat conftestval`, rxvt_cv_path_lastlog=, dnl
  786. AC_MSG_WARN([Define RXVT_LASTLOG_FILE in config.h manually]))])
  787. if test x$rxvt_cv_path_lastlog != x; then
  788. AC_DEFINE_UNQUOTED(RXVT_LASTLOG_FILE, "$rxvt_cv_path_lastlog", Define location of lastlog)
  789. if test -d "$rxvt_cv_path_lastlog"; then
  790. AC_DEFINE(LASTLOG_IS_DIR, 1, Define if lastlog is provided via a directory)
  791. fi
  792. fi
  793. dnl# --------------------------------------------------------------------------
  794. dnl# find lastlogx
  795. AC_CACHE_CHECK(where lastlogx is located, rxvt_cv_path_lastlogx,
  796. [AC_TRY_RUN([#include <stdio.h>
  797. #ifdef HAVE_UTMPX_H
  798. #include <utmpx.h>
  799. #endif
  800. #include <errno.h>
  801. main()
  802. {
  803. char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL };
  804. FILE *a, *f=fopen("conftestval", "w");
  805. if (!f) exit(1);
  806. #ifdef LASTLOGX_FILE
  807. fprintf(f, "%s\n", LASTLOGX_FILE);
  808. exit(0);
  809. #endif
  810. #ifdef _PATH_LASTLOGX
  811. fprintf(f, "%s\n", _PATH_LASTLOGX);
  812. exit(0);
  813. #endif
  814. for (w = wtmplist; *w; w++) {
  815. if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
  816. fprintf(f, "%s\n", *w);
  817. exit(0);
  818. }
  819. }
  820. exit(0);
  821. }], rxvt_cv_path_lastlogx=`cat conftestval`, rxvt_cv_path_lastlogx=, dnl
  822. AC_MSG_WARN([Define RXVT_LASTLOGX_FILE in config.h manually]))])
  823. if test x$rxvt_cv_path_lastlogx != x; then
  824. AC_DEFINE_UNQUOTED(RXVT_LASTLOGX_FILE, "$rxvt_cv_path_lastlogx", Define location of lastlogx)
  825. fi
  826. dnl# --------------------------------------------------------------------------
  827. dnl# find ttys/ttytab
  828. AC_CACHE_CHECK(where ttys/ttytab is located, rxvt_cv_path_ttytab,
  829. [for ttys_file in dnl
  830. /etc/ttys /etc/ttytab;
  831. do
  832. if test -f "$ttys_file" ; then
  833. rxvt_cv_path_ttytab=$ttys_file
  834. break
  835. fi
  836. done
  837. ])
  838. if test x$rxvt_cv_path_ttytab != x; then
  839. AC_DEFINE_UNQUOTED(TTYTAB_FILENAME, "$rxvt_cv_path_ttytab", Define location of ttys/ttytab)
  840. fi
  841. dnl# --------------------------------------------------------------------------
  842. dnl# --------------------------------------------------------------------------
  843. dnl# this is a really hack test for some basic Xlocale stuff
  844. ac_save_LIBS=$LIBS
  845. ac_save_CFLAGS=$CFLAGS
  846. CFLAGS="$CFLAGS $X_CFLAGS"
  847. LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS -lX11"
  848. if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then
  849. LIBS=`echo $LIBS | sed "$R_TRANSLATE"`
  850. fi
  851. AC_CACHE_CHECK(for working Xlocale, rxvt_cv_func_xlocale,
  852. [AC_TRY_RUN([#include <X11/Xlib.h>
  853. main() {
  854. char *p;
  855. if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p)
  856. exit (XSupportsLocale() ? 0 : 1);
  857. else
  858. exit (1);}], dnl
  859. rxvt_cv_func_xlocale=yes, rxvt_cv_func_xlocale=no, dnl
  860. AC_MSG_WARN([Define NO_XLOCALE in config.h manually]))])
  861. if test x$rxvt_cv_func_xlocale = xyes; then
  862. AC_DEFINE(HAVE_XLOCALE, 1, Define if Xlocale support works)
  863. fi
  864. AC_CACHE_CHECK(for working X setlocale, rxvt_cv_func_xsetlocale,
  865. [AC_TRY_LINK([#define X_LOCALE 1
  866. #include <X11/Xlocale.h>],
  867. [setlocale(LC_CTYPE, "");],
  868. rxvt_cv_func_xsetlocale=yes, rxvt_cv_func_xsetlocale=no)])
  869. if test x$rxvt_cv_func_xsetlocale = xyes; then
  870. AC_DEFINE(HAVE_XSETLOCALE, 1, Define if setlocale (defined to Xsetlocale) works)
  871. fi
  872. LIBS=$ac_save_LIBS
  873. CFLAGS=$ac_save_CFLAGS
  874. AC_CACHE_CHECK(for working plain setlocale, rxvt_cv_func_setlocale,
  875. [AC_TRY_LINK([#include <locale.h>],
  876. [setlocale(LC_CTYPE, "");],
  877. rxvt_cv_func_setlocale=yes, rxvt_cv_func_setlocale=no)])
  878. if test x$rxvt_cv_func_setlocale = xyes; then
  879. AC_DEFINE(HAVE_SETLOCALE, 1, Define if plain old setlocale works)
  880. fi
  881. AC_CACHE_CHECK(for working nl_langinfo, rxvt_cv_func_nl_langinfo,
  882. [AC_TRY_LINK([#include <langinfo.h>],
  883. [nl_langinfo(CODESET);],
  884. rxvt_cv_func_nl_langinfo=yes, rxvt_cv_func_nl_langinfo=no)])
  885. if test x$rxvt_cv_func_nl_langinfo = xyes; then
  886. AC_DEFINE(HAVE_NL_LANGINFO, 1, Define if nl_langinfo(CODESET) works)
  887. fi
  888. AC_CACHE_CHECK(for getpt, rxvt_cv_func_getpt,
  889. [AC_TRY_LINK([#define _GNU_SOURCE
  890. #ifdef HAVE_STDLIB_H
  891. # include <stdlib.h>
  892. #endif],
  893. [(void)getpt();],
  894. rxvt_cv_func_getpt=yes, rxvt_cv_func_getpt=no)])
  895. if test x$rxvt_cv_func_getpt = xyes; then
  896. AC_DEFINE(HAVE_GETPT, 1, Define if you have _GNU_SOURCE getpt() )
  897. fi
  898. dnl# if we don't guess right then it's up to the user
  899. AC_CACHE_CHECK(for pty/tty type, rxvt_cv_ptys,
  900. [if test x$ac_cv_func_openpty = xyes; then
  901. rxvt_cv_ptys=OPENPTY
  902. else if test x$ac_cv_func__getpty = xyes; then
  903. rxvt_cv_ptys=SGI4
  904. else if test -c /dev/ttyp20; then
  905. rxvt_cv_ptys=SCO
  906. else if test -c /dev/ptym/clone; then
  907. rxvt_cv_ptys=HPUX
  908. else if test x$rxvt_cv_func_getpt = xyes; then
  909. rxvt_cv_ptys=GLIBC
  910. else if test -c /dev/ptc -a -c /dev/pts; then
  911. rxvt_cv_ptys=PTC
  912. else if test -c /dev/ptc -a -d /dev/pts; then
  913. rxvt_cv_ptys=PTC
  914. else if test -c /dev/ptmx -a -c /dev/pts/0; then
  915. rxvt_cv_ptys=STREAMS
  916. else if test x$ac_cv_func_grantpt = xyes && test x$ac_cv_func_unlockpt = xyes; then
  917. dnl# catch CYGWIN
  918. rxvt_cv_ptys=STREAMS
  919. else
  920. rxvt_cv_ptys=BSD
  921. fi
  922. fi
  923. fi
  924. fi
  925. fi
  926. fi
  927. fi
  928. fi
  929. fi
  930. ])
  931. if test x$rxvt_cv_ptys = xOPENPTY; then
  932. AC_DEFINE(PTYS_ARE_OPENPTY, 1, Define for this pty type)
  933. fi
  934. if test x$rxvt_cv_ptys = xSCO; then
  935. AC_DEFINE(PTYS_ARE_NUMERIC, 1, Define for this pty type)
  936. fi
  937. if test x$rxvt_cv_ptys = xSTREAMS; then
  938. AC_DEFINE(PTYS_ARE_PTMX, 1, Define for this pty type)
  939. fi
  940. if test x$rxvt_cv_ptys = xPTC; then
  941. AC_DEFINE(PTYS_ARE_PTC, 1, Define for this pty type)
  942. fi
  943. if test x$rxvt_cv_ptys = xSGI4; then
  944. AC_DEFINE(PTYS_ARE__GETPTY, 1, Define for this pty type)
  945. fi
  946. if test x$rxvt_cv_ptys = xCONVEX; then
  947. AC_DEFINE(PTYS_ARE_GETPTY, 1, Define for this pty type)
  948. fi
  949. if test x$rxvt_cv_ptys = xGLIBC; then
  950. AC_DEFINE(PTYS_ARE_GETPT, 1, Define for this pty type)
  951. fi
  952. if test x$rxvt_cv_ptys = xHPUX; then
  953. AC_DEFINE(PTYS_ARE_CLONE, 1, Define for this pty type)
  954. fi
  955. if test x$rxvt_cv_ptys = xBSD -o x$rxvt_cv_ptys = xHPUX -o x$rxvt_cv_ptys = xGLIBC; then
  956. AC_DEFINE(PTYS_ARE_SEARCHED, 1, Define for this pty type)
  957. fi
  958. AC_CHECKING(for pty ranges)
  959. ptys=`echo /dev/pty??`
  960. pch1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
  961. pch2=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
  962. if test x$pch1 != x; then
  963. AC_DEFINE_UNQUOTED(PTYCHAR1, "$pch1", Define for first char in devptyXX)
  964. fi
  965. if test x$pch2 != x; then
  966. AC_DEFINE_UNQUOTED(PTYCHAR2, "$pch2", Define for second char in devptyXX)
  967. fi
  968. dnl# FreeBSD needs to link libxpg4
  969. AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
  970. dnl# --------------------------------------------------------------------------
  971. dnl# now add and remove other stuff
  972. dnl# --------------------------------------------------------------------------
  973. if test x$support_graphics = xyes; then
  974. AC_DEFINE(RXVT_GRAPHICS, 1, Define if you want Rob Nation's own graphic mode)
  975. OBJGRAPHICS="graphics.o"
  976. fi
  977. if test x$support_inheritpixmap = xyes; then
  978. AC_DEFINE(TRANSPARENT, 1, Define if you want your background to use the parent window background)
  979. fi
  980. if test x$support_keepscrolling = xno; then
  981. AC_DEFINE(NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING, 1, Define for continual scrolling when you keep the scrollbar button pressed)
  982. fi
  983. if test x$support_menubar = xyes; then
  984. AC_DEFINE(MENUBAR, 1, Define if you want Menubar support)
  985. OBJMENUBAR="menubar.o"
  986. fi
  987. if test x$support_frills = xno; then
  988. AC_DEFINE(NO_FRILLS, 1, Define if you don't want handling for rarely used features)
  989. fi
  990. if test x$support_linespace = xno; then
  991. AC_DEFINE(NO_LINESPACE, 1, Define if you don't want support linespace)
  992. fi
  993. if test x$support_24bit = xyes; then
  994. AC_DEFINE(PREFER_24BIT, 1, Define to use a 24 bit visual if the screen has 24 bit mode, even if the default is 8 bit)
  995. fi
  996. if test x$support_mousewheel = xyes; then
  997. AC_DEFINE(MOUSE_WHEEL, 1, Define to use wheel events (button4 and button5) to scroll)
  998. fi
  999. if test x$support_mouseslipwheel = xyes; then
  1000. AC_DEFINE(MOUSE_SLIP_WHEELING, 1, Define to have CTRL cause wheel events to accelerate scrolling. Release CTRL to halt scrolling)
  1001. fi
  1002. if test x$support_oldselection = xno; then
  1003. AC_DEFINE(NO_OLD_SELECTION, 1, Define to remove old rxvt (ver 2.20 and before) style selection)
  1004. fi
  1005. if test x$support_utmp = xyes; then
  1006. AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support)
  1007. OBJLOGGING="logging.o"
  1008. fi
  1009. if test x$support_wtmp = xyes; then
  1010. AC_DEFINE(WTMP_SUPPORT, 1, Define if you want to have wtmp support when utmp/utmpx is enabled)
  1011. fi
  1012. if test x$support_lastlog = xyes; then
  1013. AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled)
  1014. fi
  1015. if test x$support_xim = xyes -o x$multichar_set = xyes; then
  1016. if test x$rxvt_cv_func_xlocale = xyes; then
  1017. AC_DEFINE(USE_XIM, 1, Define if you want to have XIM (X Input Method) protocol support - required for multibyte characters input)
  1018. fi
  1019. fi
  1020. if test x$support_xpm = xyes; then
  1021. AC_DEFINE(XPM_BACKGROUND, 1, Define if you want to have sexy-looking background pixmaps. Needs libXpm)
  1022. OBJXPM="xpm.o"
  1023. fi
  1024. if test x$support_scroll_rxvt = xyes; then
  1025. AC_DEFINE(RXVT_SCROLLBAR, 1, Support Rxvt original style scrollbars - specify via configure only)
  1026. OBJSCROLLBAR="scrollbar-rxvt.o"
  1027. scrolltypes="rxvt"
  1028. fi
  1029. if test x$support_scroll_next = xyes; then
  1030. AC_DEFINE(NEXT_SCROLLBAR, 1, Support NeXT style scrollbars - specify via configure only)
  1031. OBJSCROLLBAR="$OBJSCROLLBAR scrollbar-next.o"
  1032. scrolltypes="$scrolltypes next"
  1033. fi
  1034. if test x$support_scroll_xterm = xyes; then
  1035. AC_DEFINE(XTERM_SCROLLBAR, 1, Support Xterm style scrollbars - specify via configure only)
  1036. OBJSCROLLBAR="$OBJSCROLLBAR scrollbar-xterm.o"
  1037. scrolltypes="$scrolltypes xterm"
  1038. fi
  1039. dnl> AC_CHECK_FUNCS(gettimeofday putenv select socket)
  1040. CFLAGS=${CFLAGS--O}
  1041. LDFLAGS=${LDFLAGS--O}
  1042. CPPFLAGS="$CPPFLAGS"
  1043. AC_SUBST(DEBUG)
  1044. AC_SUBST(DINCLUDE)
  1045. AC_SUBST(CFLAGS)
  1046. AC_SUBST(CPPFLAGS)
  1047. AC_SUBST(LDFLAGS)
  1048. AC_SUBST(X_CFLAGS)
  1049. dnl# Attack the libs
  1050. if test x$rxvt_cv_rpath = xyes -o x$rxvt_cv_R = xyes; then
  1051. DLIB=`echo $DLIB | sed "$R_TRANSLATE"`
  1052. LIBS=`echo $LIBS | sed "$R_TRANSLATE"`
  1053. X_LIBS=`echo $X_LIBS | sed "$R_TRANSLATE"`
  1054. X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed "$R_TRANSLATE"`
  1055. XPM_LIBS=`echo $XPM_LIBS | sed "$R_TRANSLATE"`
  1056. fi
  1057. AC_SUBST(DLIB)
  1058. AC_SUBST(LIBS)
  1059. AC_SUBST(X_LIBS)
  1060. AC_SUBST(X_EXTRA_LIBS)
  1061. if test x$support_addstrings = xyes; then
  1062. OBJSTRINGS="strings.o"
  1063. else
  1064. AC_DEFINE(NO_STRINGS, 1, Define if you don't need to use our replacement string functions)
  1065. fi
  1066. OBJLIST="command.o defaultfont.o init.o $OBJGRAPHICS $OBJGRKELOT $OBJLOGGING main.o $OBJMENUBAR misc.o netdisp.o ptytty.o screen.o scrollbar.o $OBJSCROLLBAR $OBJSTRINGS xdefaults.o $OBJXPM"
  1067. AC_SUBST(OBJLIST)
  1068. LIBOBJLIST=`echo $OBJLIST | sed 's/\.o/.lo/g'`
  1069. AC_SUBST(LIBOBJLIST)
  1070. dnl# common parts of the Makefile
  1071. MCOMMON=./autoconf/Make.common
  1072. AC_SUBST_FILE(MCOMMON)
  1073. AC_ARG_PROGRAM
  1074. RXVTNAME=`echo rxvt|sed "$program_transform_name"`
  1075. AC_SUBST(RXVTNAME)
  1076. dnl# test for "sun" or "__sun__" before include sys_ioctl
  1077. dnl# revert HAVE_BLAH_H into a "#include <blah.h>"
  1078. AC_DEFUN(RXVT_DEFINE_TO_INCLUDE, dnl
  1079. [if test "$$3" = "$4" -o "$$5" = "$6"; then
  1080. $1="#include <$2>"
  1081. else
  1082. $1="/* #include <$2> */"
  1083. fi dnl
  1084. AC_SUBST($1)])
  1085. RXVT_DEFINE_TO_INCLUDE(include_stdarg_h, stdarg.h, ac_cv_header_stdarg_h, yes, notset, dontmatch)
  1086. RXVT_DEFINE_TO_INCLUDE(include_stdlib_h, stdlib.h, ac_cv_header_stdlib_h, yes, notset, dontmatch)
  1087. RXVT_DEFINE_TO_INCLUDE(include_unistd_h, unistd.h, ac_cv_header_unistd_h, yes, notset, dontmatch)
  1088. RXVT_DEFINE_TO_INCLUDE(include_string_h, string.h, ac_cv_header_string_h, yes, notset, dontmatch)
  1089. RXVT_DEFINE_TO_INCLUDE(include_fcntl_h, fcntl.h, ac_cv_header_fcntl_h, yes, notset, dontmatch)
  1090. RXVT_DEFINE_TO_INCLUDE(include_util_h, util.h, ac_cv_header_util_h, yes, notset, dontmatch)
  1091. RXVT_DEFINE_TO_INCLUDE(include_assert_h, assert.h, ac_cv_header_assert_h, yes, notset, dontmatch)
  1092. RXVT_DEFINE_TO_INCLUDE(include_sys_ioctl_h, sys/ioctl.h, rxvt_cv_header_sysioctl, yes, notset, dontmatch)
  1093. RXVT_DEFINE_TO_INCLUDE(include_sys_select_h, sys/select.h, ac_cv_header_sys_select_h, yes, notset, dontmatch)
  1094. RXVT_DEFINE_TO_INCLUDE(include_sys_strredir_h, sys/strredir.h, ac_cv_header_sys_strredir_h, yes, notset, dontmatch)
  1095. RXVT_DEFINE_TO_INCLUDE(include_sys_time_h, sys/time.h, ac_cv_header_sys_time_h, yes, notset, dontmatch)
  1096. RXVT_DEFINE_TO_INCLUDE(include_time_h, time.h, ac_cv_header_sys_time_h, no, ac_cv_header_time, yes)
  1097. if test "$multichar_set" = yes; then
  1098. lib_multicharset="#define MULTICHAR_SET 1"
  1099. else
  1100. lib_multicharset="/* #undef MULTICHAR_SET */"
  1101. fi
  1102. AC_SUBST(lib_multicharset)
  1103. AC_OUTPUT(autoconf/Make.common \
  1104. Makefile \
  1105. doc/Makefile \
  1106. src/Makefile \
  1107. src/graphics/Makefile \
  1108. src/test/Makefile \
  1109. src/rxvtlib.h \
  1110. rclock/Makefile \
  1111. W11/Makefile \
  1112. )
  1113. echo "Configuration:
  1114. Rxvt version: $VERSION : $DATE
  1115. Source code location: $srcdir
  1116. Install path: ${prefix}/bin
  1117. Compiler: $CC
  1118. Compiler flags: $CFLAGS"
  1119. if test "$MALLOC_TYPE" = S; then
  1120. echo " malloc support: system default"
  1121. fi
  1122. if test "$MALLOC_TYPE" = G; then
  1123. echo " malloc support: Gray Watson's dmalloc"
  1124. fi
  1125. if test "$MALLOC_TYPE" = D; then
  1126. echo " malloc support: Doug Lea's malloc"
  1127. fi
  1128. if test x$support_xpm = xyes; then
  1129. echo " Xpm library: $XPM_LIBS"
  1130. fi
  1131. echo "
  1132. Adding modules:"
  1133. if test x$OBJGRAPHICS != x; then HASIT="yes"; else HASIT="no"; fi
  1134. echo " graphics.o: "$HASIT
  1135. if test x$OBJGRKELOT != x; then HASIT="yes"; else HASIT="no"; fi
  1136. echo " grkelot.o: "$HASIT
  1137. if test x$OBJLOGGING != x; then HASIT="yes"; else HASIT="no"; fi
  1138. echo " logging.o: "$HASIT
  1139. if test x$OBJMENUBAR != x; then HASIT="yes"; else HASIT="no"; fi
  1140. echo " menubar.o: "$HASIT
  1141. if test x$support_scroll_rxvt = xyes; then HASIT="yes"; else HASIT="no"; fi
  1142. echo " scrollbar-rxvt.o: "$HASIT
  1143. if test x$support_scroll_next = xyes; then HASIT="yes"; else HASIT="no"; fi
  1144. echo " scrollbar-next.o: "$HASIT
  1145. if test x$support_scroll_xterm = xyes; then HASIT="yes"; else HASIT="no"; fi
  1146. echo " scrollbar-xterm.o: "$HASIT
  1147. if test x$OBJSTRINGS != x; then HASIT="yes"; else HASIT="no"; fi
  1148. echo " strings.o: "$HASIT
  1149. if test x$OBJXPM != x; then HASIT="yes"; else HASIT="no"; fi
  1150. echo " xpm.o: "$HASIT
  1151. echo "
  1152. The following are set in config.h
  1153. "
  1154. echo " multichar glyph languages: "$multichar_set
  1155. echo " pty/tty type: "$rxvt_cv_ptys
  1156. if test x$support_utmp != xyes; then
  1157. echo " utmp support: disabled
  1158. "
  1159. else
  1160. echo " utmp support: enabled
  1161. utmp file: $rxvt_cv_path_utmp
  1162. utmpx file: $rxvt_cv_path_utmpx
  1163. wtmp file: $rxvt_cv_path_wtmp
  1164. wtmpx file: $rxvt_cv_path_wtmpx
  1165. lastlog file: $rxvt_cv_path_lastlog
  1166. ttys/ttytab file: $rxvt_cv_path_ttytab
  1167. "
  1168. fi
  1169. if test x$term != x; then
  1170. echo " set TERM to: $term
  1171. "
  1172. fi
  1173. if test x$terminfo != x; then
  1174. echo " set TERMINFO to: $terminfo
  1175. "
  1176. fi
  1177. if test x$rxvt_cv_ptys = xUNKNOWN; then
  1178. echo ".----------------------------------------------------------------."
  1179. echo ". WARNING: could not determine pty/tty type. Do not build until ."
  1180. echo ". the appropriate PTYS_ARE_* is defined in config.h ."
  1181. echo ".----------------------------------------------------------------."
  1182. fi
  1183. if test x$support_xpm = xneedsmanualspecification; then
  1184. echo ".----------------------------------------------------------------."
  1185. echo ". WARNING: --enable-xpm-background was specified however the ."
  1186. echo ". XPM includes files and libraries could not be found. ."
  1187. echo ". XPM backgrounds are now being DISABLED! If you want ."
  1188. echo ". to use them you should rerun configure with the ."
  1189. echo ". appropriate --with-xpm-includes=/path/to/xpm/includes ."
  1190. echo ". and --with-xpm-library=/path/to/xpm/library lines. ."
  1191. echo ".----------------------------------------------------------------."
  1192. fi
  1193. if test x$support_xim = xyes -a x$rxvt_cv_func_xlocale = xno; then
  1194. echo ".----------------------------------------------------------------."
  1195. echo ". WARNING: --enable-xim was specified however the locale support ."
  1196. echo ". functions could not be found. ."
  1197. echo ". XIM is now being DISABLED! ."
  1198. echo ".----------------------------------------------------------------."
  1199. fi
  1200. echo " *** Please check src/feature.h for further options ***
  1201. "