configure.in 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837
  1. dnl***************************************************************************
  2. dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
  3. dnl *
  4. dnl Permission is hereby granted, free of charge, to any person obtaining a *
  5. dnl copy of this software and associated documentation files (the *
  6. dnl "Software"), to deal in the Software without restriction, including *
  7. dnl without limitation the rights to use, copy, modify, merge, publish, *
  8. dnl distribute, distribute with modifications, sublicense, and/or sell *
  9. dnl copies of the Software, and to permit persons to whom the Software is *
  10. dnl furnished to do so, subject to the following conditions: *
  11. dnl *
  12. dnl The above copyright notice and this permission notice shall be included *
  13. dnl in all copies or substantial portions of the Software. *
  14. dnl *
  15. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
  16. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
  17. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
  18. dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
  19. dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
  20. dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
  21. dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  22. dnl *
  23. dnl Except as contained in this notice, the name(s) of the above copyright *
  24. dnl holders shall not be used in advertising or otherwise to promote the *
  25. dnl sale, use or other dealings in this Software without prior written *
  26. dnl authorization. *
  27. dnl***************************************************************************
  28. dnl
  29. dnl Author: Thomas E. Dickey 1995-on
  30. dnl
  31. dnl $Id: configure.in,v 1.456 2008/11/16 00:36:30 tom Exp $
  32. dnl Process this file with autoconf to produce a configure script.
  33. dnl
  34. dnl See http://invisible-island.net/autoconf/ for additional information.
  35. dnl
  36. dnl ---------------------------------------------------------------------------
  37. AC_PREREQ(2.13.20020210)
  38. AC_REVISION($Revision: 1.456 $)
  39. AC_INIT(ncurses/base/lib_initscr.c)
  40. AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
  41. CF_TOP_BUILDDIR
  42. CF_SUBST_NCURSES_VERSION
  43. CF_WITH_REL_VERSION(NCURSES)
  44. CF_WITH_ABI_VERSION
  45. CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
  46. AC_ARG_WITH(system-type,
  47. [ --with-system-type=XXX test: override derived host system-type],
  48. [AC_MSG_WARN(overriding system type to $withval)
  49. cf_cv_system_name=$withval])
  50. ### Save the given $CFLAGS to allow user-override.
  51. cf_user_CFLAGS="$CFLAGS"
  52. ### Default install-location
  53. CF_CFG_DEFAULTS
  54. ### Checks for programs.
  55. AC_PROG_CC
  56. CF_GCC_VERSION
  57. AC_PROG_CPP
  58. AC_PROG_GCC_TRADITIONAL
  59. CF_PROG_CC_C_O(CC)
  60. AC_ISC_POSIX
  61. CF_ANSI_CC_REQD
  62. CF_PROG_EXT
  63. CF_PROG_LDCONFIG
  64. dnl DEFECT in autoconf 2.12: an attempt to set policy, this breaks the
  65. dnl configure script by not letting us test if C++
  66. dnl is present, making this option necessary.
  67. AC_MSG_CHECKING(if you want to ensure bool is consistent with C++)
  68. AC_ARG_WITH(cxx,
  69. [ --without-cxx do not adjust ncurses bool to match C++],
  70. [cf_with_cxx=$withval],
  71. [cf_with_cxx=yes])
  72. AC_MSG_RESULT($cf_with_cxx)
  73. if test "X$cf_with_cxx" = Xno ; then
  74. CXX=""
  75. GXX=""
  76. else
  77. # with autoconf 2.13, we can change the error to a warning:
  78. pushdef([AC_MSG_ERROR],
  79. [AC_MSG_RESULT(no)
  80. AC_MSG_WARN([You don't have any C++ compiler, too bad])
  81. cf_with_cxx=no; CXX=""; GXX="";])dnl
  82. AC_PROG_CXX
  83. popdef([AC_MSG_ERROR])dnl
  84. # autoconf 2.5x removed the error - by hardcoding it to g++.
  85. if test "$CXX" = "g++" ; then
  86. AC_PATH_PROG(CXX,g++)
  87. fi
  88. if test "$CXX" = "g++" ; then
  89. AC_MSG_WARN(ignoring hardcoded g++)
  90. cf_with_cxx=no; CXX=""; GXX="";
  91. fi
  92. fi
  93. CF_GXX_VERSION
  94. case $GXX_VERSION in
  95. 1*|2.[[0-6]]*)
  96. # GXX=""; CXX=""; ac_cv_prog_gxx=no
  97. # cf_cxx_library=no
  98. AC_MSG_WARN(templates do not work)
  99. ;;
  100. esac
  101. AC_MSG_CHECKING(if you want to build C++ binding and demo)
  102. AC_ARG_WITH(cxx-binding,
  103. [ --without-cxx-binding do not build C++ binding and demo],
  104. [cf_with_cxx_binding=$withval],
  105. [cf_with_cxx_binding=$cf_with_cxx])
  106. AC_MSG_RESULT($cf_with_cxx_binding)
  107. AC_MSG_CHECKING(if you want to build with Ada95)
  108. AC_ARG_WITH(ada,
  109. [ --without-ada suppress check for Ada95, don't build demo],
  110. [cf_with_ada=$withval],
  111. [cf_with_ada=yes])
  112. AC_MSG_RESULT($cf_with_ada)
  113. AC_MSG_CHECKING(if you want to install manpages)
  114. AC_ARG_WITH(manpages,
  115. [ --without-manpages suppress install of manpages],
  116. [cf_with_manpages=$withval],
  117. [cf_with_manpages=yes])
  118. AC_MSG_RESULT($cf_with_manpages)
  119. AC_MSG_CHECKING(if you want to build programs such as tic)
  120. AC_ARG_WITH(progs,
  121. [ --without-progs suppress build with programs (e.g., tic)],
  122. [cf_with_progs=$withval],
  123. [cf_with_progs=yes])
  124. AC_MSG_RESULT($cf_with_progs)
  125. AC_MSG_CHECKING(if you wish to install curses.h)
  126. AC_ARG_WITH(curses-h,
  127. [ --without-curses-h install curses.h as ncurses.h only],
  128. [with_curses_h=$withval],
  129. [with_curses_h=yes])
  130. AC_MSG_RESULT($with_curses_h)
  131. modules_to_build="ncurses"
  132. if test "X$cf_with_progs" != Xno ; then
  133. modules_to_build="$modules_to_build progs tack"
  134. fi
  135. modules_to_build="$modules_to_build panel menu form"
  136. AC_ARG_PROGRAM
  137. CF_PROG_AWK
  138. CF_PROG_EGREP
  139. CF_PROG_INSTALL
  140. CF_PROG_LINT
  141. AC_PROG_LN_S
  142. AC_SYS_LONG_FILE_NAMES
  143. AC_MSG_CHECKING(if we should assume mixed-case filenames)
  144. AC_ARG_ENABLE(mixed-case,
  145. [ --enable-mixed-case tic should assume mixed-case filenames],
  146. [enable_mixedcase=$enableval],
  147. [enable_mixedcase=auto])
  148. AC_MSG_RESULT($enable_mixedcase)
  149. if test "$enable_mixedcase" = "auto" ; then
  150. CF_MIXEDCASE_FILENAMES
  151. else
  152. cf_cv_mixedcase=$enable_mixedcase
  153. if test "$enable_mixedcase" = "yes" ; then
  154. AC_DEFINE(MIXEDCASE_FILENAMES)
  155. fi
  156. fi
  157. # do this after mixed-case option (tags/TAGS is not as important as tic).
  158. AC_PROG_MAKE_SET
  159. CF_MAKE_TAGS
  160. CF_MAKEFLAGS
  161. dnl These are standard among *NIX systems, but not when cross-compiling
  162. AC_CHECK_TOOL(RANLIB, ranlib, ':')
  163. AC_CHECK_TOOL(LD, ld, ld)
  164. AC_CHECK_TOOL(AR, ar, ar)
  165. CF_SUBST(archiver options,AR_OPTS,rv)
  166. dnl Special option for use by system-builders: the install-prefix is used to
  167. dnl adjust the location into which the actual install is done, so that an
  168. dnl archive can be built without modifying the host system's configuration.
  169. AC_MSG_CHECKING(if you have specified an install-prefix)
  170. AC_ARG_WITH(install-prefix,
  171. [ --with-install-prefix prefixes actual install-location ($DESTDIR)],
  172. [case "$withval" in #(vi
  173. yes|no) #(vi
  174. ;;
  175. *) DESTDIR="$withval"
  176. ;;
  177. esac])
  178. AC_MSG_RESULT($DESTDIR)
  179. AC_SUBST(DESTDIR)
  180. ###############################################################################
  181. CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
  182. # If we're cross-compiling, allow the user to override the tools and their
  183. # options. The configure script is oriented toward identifying the host
  184. # compiler, etc., but we need a build compiler to generate parts of the source.
  185. CF_BUILD_CC
  186. ###############################################################################
  187. CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
  188. ### Options to allow the user to specify the set of libraries which are used.
  189. ### Use "--without-normal --with-shared" to allow the default model to be
  190. ### shared, for example.
  191. cf_list_models=""
  192. AC_SUBST(cf_list_models)dnl the complete list of models ("normal debug")
  193. CF_WITH_LIBTOOL
  194. if test "$with_libtool" != "no" ; then
  195. cf_list_models="$cf_list_models libtool"
  196. else
  197. AC_MSG_CHECKING(if you want to build shared libraries)
  198. AC_ARG_WITH(shared,
  199. [ --with-shared generate shared-libraries],
  200. [with_shared=$withval],
  201. [with_shared=no])
  202. AC_MSG_RESULT($with_shared)
  203. test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
  204. AC_MSG_CHECKING(if you want to build static libraries)
  205. AC_ARG_WITH(normal,
  206. [ --with-normal generate normal-libraries (default)],
  207. [with_normal=$withval],
  208. [with_normal=yes])
  209. AC_MSG_RESULT($with_normal)
  210. test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
  211. AC_MSG_CHECKING(if you want to build debug libraries)
  212. AC_ARG_WITH(debug,
  213. [ --with-debug generate debug-libraries (default)],
  214. [with_debug=$withval],
  215. [with_debug=yes])
  216. AC_MSG_RESULT($with_debug)
  217. test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
  218. AC_MSG_CHECKING(if you want to build profiling libraries)
  219. AC_ARG_WITH(profile,
  220. [ --with-profile generate profile-libraries],
  221. [with_profile=$withval],
  222. [with_profile=no])
  223. AC_MSG_RESULT($with_profile)
  224. test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
  225. fi
  226. ###############################################################################
  227. AC_MSG_CHECKING(for specified models)
  228. test -z "$cf_list_models" && cf_list_models=normal
  229. dnl If we use libtool to generate libraries, then it must be the only
  230. dnl specified model.
  231. test "$with_libtool" != "no" && cf_list_models=libtool
  232. AC_MSG_RESULT($cf_list_models)
  233. ### Use the first model as the default, and save its suffix for use in building
  234. ### up test-applications.
  235. AC_MSG_CHECKING(for default model)
  236. DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
  237. AC_MSG_RESULT($DFT_LWR_MODEL)
  238. CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
  239. AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
  240. AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
  241. TICS_NAME=tic
  242. AC_SUBST(TICS_NAME)
  243. TINFO_NAME=tinfo
  244. AC_SUBST(TINFO_NAME)
  245. LIB_NAME=ncurses
  246. AC_SUBST(LIB_NAME)
  247. LIB_DIR=../lib
  248. LIB_2ND=../../lib
  249. CF_LIB_PREFIX(cf_prefix)
  250. LIB_PREFIX=$cf_prefix
  251. AC_SUBST(LIB_PREFIX)
  252. LIB_SUFFIX=
  253. AC_SUBST(LIB_SUFFIX)
  254. ###############################################################################
  255. AC_MSG_CHECKING(if you want to build a separate terminfo library)
  256. AC_ARG_WITH(termlib,
  257. [ --with-termlib generate separate terminfo library],
  258. [with_termlib=$withval],
  259. [with_termlib=no])
  260. AC_MSG_RESULT($with_termlib)
  261. AC_MSG_CHECKING(if you want to build a separate tic library)
  262. AC_ARG_WITH(ticlib,
  263. [ --with-ticlib generate separate tic library],
  264. [with_ticlib=$withval],
  265. [with_ticlib=no])
  266. AC_MSG_RESULT($with_ticlib)
  267. ### Checks for special libraries, must be done up-front.
  268. SHLIB_LIST=""
  269. CF_WITH_GPM
  270. if test "$with_gpm" != no ; then
  271. AC_MSG_CHECKING(if you want to load GPM dynamically)
  272. AC_ARG_WITH(dlsym,
  273. [ --without-dlsym do not use dlsym() to load GPM dynamically],
  274. [with_dlsym=$withval],
  275. [with_dlsym=yes])
  276. AC_MSG_RESULT($with_dlsym)
  277. if test "$with_dlsym" = yes ; then
  278. CF_FUNC_DLSYM
  279. if test "$with_gpm" != yes ; then
  280. CF_VERBOSE(assuming soname for gpm is $with_gpm)
  281. cf_cv_gpm_soname="$with_gpm"
  282. else
  283. CF_LIB_SONAME([#include <gpm.h>],[if (Gpm_Open(0,0)) Gpm_Close();],gpm)
  284. fi
  285. test "$cf_cv_gpm_soname" != "unknown" && AC_DEFINE_UNQUOTED(LIBGPM_SONAME,"$cf_cv_gpm_soname")
  286. SHLIB_LIST="-ldl $SHLIB_LIST"
  287. else
  288. SHLIB_LIST="-lgpm $SHLIB_LIST"
  289. fi
  290. AC_DEFINE(HAVE_LIBGPM)
  291. CF_CHECK_GPM_WGETCH
  292. fi
  293. CF_WITH_SYSMOUSE
  294. dnl Not all ports of gcc support the -g option
  295. if test X"$CC_G_OPT" = X"" ; then
  296. CC_G_OPT='-g'
  297. test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
  298. fi
  299. AC_SUBST(CC_G_OPT)
  300. if test X"$CXX_G_OPT" = X"" ; then
  301. CXX_G_OPT='-g'
  302. test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
  303. fi
  304. AC_SUBST(CXX_G_OPT)
  305. AC_MSG_CHECKING(for default loader flags)
  306. case $DFT_LWR_MODEL in
  307. libtool) LD_MODEL='' ;;
  308. normal) LD_MODEL='' ;;
  309. debug) LD_MODEL=$CC_G_OPT ;;
  310. profile) LD_MODEL='-pg';;
  311. shared) LD_MODEL='' ;;
  312. esac
  313. AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
  314. AC_MSG_RESULT($LD_MODEL)
  315. case $DFT_LWR_MODEL in
  316. shared)
  317. CF_ENABLE_RPATH
  318. AC_MSG_CHECKING(if shared libraries should be relinked during install)
  319. AC_ARG_ENABLE(relink,
  320. [ --disable-relink relink shared libraries during install],
  321. [cf_cv_do_relink=$enableval],
  322. [cf_cv_do_relink=yes])
  323. AC_MSG_RESULT($cf_cv_do_relink)
  324. ;;
  325. esac
  326. CF_SHARED_OPTS
  327. if test "$CC_SHARED_OPTS" = "unknown"; then
  328. for model in $cf_list_models; do
  329. if test "$model" = "shared"; then
  330. AC_ERROR(Shared libraries are not supported in this version)
  331. fi
  332. done
  333. fi
  334. ###############################################################################
  335. CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
  336. ### use option --disable-overwrite to leave out the link to -lcurses
  337. AC_MSG_CHECKING(if you wish to install ncurses overwriting curses)
  338. AC_ARG_ENABLE(overwrite,
  339. [ --disable-overwrite leave out the link to -lcurses],
  340. [with_overwrite=$enableval],
  341. [if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi])
  342. AC_MSG_RESULT($with_overwrite)
  343. AC_MSG_CHECKING(if external terminfo-database is used)
  344. AC_ARG_ENABLE(database,
  345. [ --disable-database do not use terminfo, only fallbacks/termcap],
  346. [use_database=$enableval],
  347. [use_database=yes])
  348. AC_MSG_RESULT($use_database)
  349. case $host_os in #(vi
  350. os2*) #(vi
  351. TERMINFO_SRC='${top_srcdir}/misc/emx.src'
  352. ;;
  353. *) #(vi
  354. TERMINFO_SRC='${top_srcdir}/misc/terminfo.src'
  355. ;;
  356. esac
  357. AC_SUBST(TERMINFO_SRC)
  358. CF_PATHSEP
  359. if test "$use_database" != no ; then
  360. AC_DEFINE(USE_DATABASE)
  361. AC_MSG_CHECKING(which terminfo source-file will be installed)
  362. AC_ARG_ENABLE(database,
  363. [ --with-database=XXX specify terminfo source to install],
  364. [TERMINFO_SRC=$withval])
  365. AC_MSG_RESULT($TERMINFO_SRC)
  366. AC_MSG_CHECKING(whether to use hashed database instead of directory/tree)
  367. AC_ARG_WITH(hashed-db,
  368. [ --with-hashed-db specify hashed-database library],,
  369. [with_hashed_db=no])
  370. AC_MSG_RESULT($with_hashed_db)
  371. else
  372. with_hashed_db=no
  373. fi
  374. AC_MSG_CHECKING(for list of fallback descriptions)
  375. AC_ARG_WITH(fallbacks,
  376. [ --with-fallbacks=XXX specify list of fallback terminal descriptions],
  377. [with_fallback=$withval],
  378. [with_fallback=])
  379. AC_MSG_RESULT($with_fallback)
  380. FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'`
  381. AC_SUBST(FALLBACK_LIST)
  382. AC_MSG_CHECKING(if you want modern xterm or antique)
  383. AC_ARG_WITH(xterm-new,
  384. [ --without-xterm-new specify if xterm terminfo should be old version],
  385. [with_xterm_new=$withval],
  386. [with_xterm_new=yes])
  387. case $with_xterm_new in
  388. no) with_xterm_new=xterm-old;;
  389. *) with_xterm_new=xterm-new;;
  390. esac
  391. AC_MSG_RESULT($with_xterm_new)
  392. WHICH_XTERM=$with_xterm_new
  393. AC_SUBST(WHICH_XTERM)
  394. MAKE_TERMINFO=
  395. if test "$use_database" = no ; then
  396. TERMINFO="${datadir}/terminfo"
  397. MAKE_TERMINFO="#"
  398. else
  399. AC_MSG_CHECKING(for list of terminfo directories)
  400. CF_WITH_PATHLIST(terminfo-dirs,
  401. [ --with-terminfo-dirs=XXX specify list of terminfo directories],
  402. TERMINFO_DIRS,
  403. DATADIR/terminfo,
  404. ${datadir}/terminfo)
  405. AC_MSG_RESULT($TERMINFO_DIRS)
  406. test -n "$TERMINFO_DIRS" && AC_DEFINE_UNQUOTED(TERMINFO_DIRS,"$TERMINFO_DIRS")
  407. AC_MSG_CHECKING(for default terminfo directory)
  408. CF_WITH_PATH(default-terminfo-dir,
  409. [ --with-default-terminfo-dir=DIR default terminfo directory],
  410. TERMINFO,
  411. DATADIR/terminfo,
  412. ${datadir}/terminfo)
  413. AC_MSG_RESULT($TERMINFO)
  414. AC_DEFINE_UNQUOTED(TERMINFO,"$TERMINFO")
  415. fi
  416. AC_SUBST(TERMINFO)
  417. AC_SUBST(MAKE_TERMINFO)
  418. ### use option --disable-big-core to make tic run on small machines
  419. ### We need 4Mb, check if we can allocate 50% more than that.
  420. AC_MSG_CHECKING(if big-core option selected)
  421. AC_ARG_ENABLE(big-core,
  422. [ --disable-big-core assume machine has little memory],
  423. [with_big_core=$enableval],
  424. [AC_TRY_RUN([
  425. #include <stdlib.h>
  426. #include <string.h>
  427. int main() {
  428. unsigned long n = 6000000L;
  429. char *s = malloc(n);
  430. if (s != 0)
  431. s[0] = s[n-1] = 0;
  432. ${cf_cv_main_return:-return}(s == 0);
  433. }],
  434. [with_big_core=yes],
  435. [with_big_core=no],
  436. [with_big_core=no])])
  437. AC_MSG_RESULT($with_big_core)
  438. test "$with_big_core" = "yes" && AC_DEFINE(HAVE_BIG_CORE)
  439. ### ISO C only guarantees 512-char strings, we have tables which load faster
  440. ### when constructed using "big" strings. More than the C compiler, the awk
  441. ### program is a limit on most vendor UNIX systems. Check that we can build.
  442. AC_MSG_CHECKING(if big-strings option selected)
  443. AC_ARG_ENABLE(big-strings,
  444. [ --disable-big-strings assume compiler has only standard-size strings],
  445. [with_big_strings=$enableval],
  446. [CF_AWK_BIG_PRINTF(12000,with_big_strings)])
  447. AC_MSG_RESULT($with_big_strings)
  448. USE_BIG_STRINGS=0
  449. test "$with_big_strings" = "yes" && USE_BIG_STRINGS=1
  450. AC_SUBST(USE_BIG_STRINGS)
  451. ### use option --enable-termcap to compile in the termcap fallback support
  452. AC_MSG_CHECKING(if you want termcap-fallback support)
  453. AC_ARG_ENABLE(termcap,
  454. [ --enable-termcap compile in termcap fallback support],
  455. [with_termcap=$enableval],
  456. [with_termcap=no])
  457. AC_MSG_RESULT($with_termcap)
  458. if test "$with_termcap" != "yes" ; then
  459. if test "$use_database" = no ; then
  460. if test -z "$with_fallback" ; then
  461. AC_ERROR(You have disabled the database w/o specifying fallbacks)
  462. fi
  463. fi
  464. AC_DEFINE(PURE_TERMINFO)
  465. else
  466. if test "$with_ticlib" != no ; then
  467. AC_ERROR(Options --with-ticlib and --enable-termcap cannot be combined)
  468. fi
  469. AC_DEFINE(USE_TERMCAP)
  470. AC_MSG_CHECKING(for list of termcap files)
  471. CF_WITH_PATHLIST(termpath,
  472. [ --with-termpath=XXX specify list of termcap files],
  473. TERMPATH,
  474. /etc/termcap:/usr/share/misc/termcap)
  475. AC_MSG_RESULT($TERMPATH)
  476. test -n "$TERMPATH" && AC_DEFINE_UNQUOTED(TERMPATH,"$TERMPATH")
  477. ### use option --enable-getcap to use a hacked getcap for reading termcaps
  478. AC_MSG_CHECKING(if fast termcap-loader is needed)
  479. AC_ARG_ENABLE(getcap,
  480. [ --enable-getcap fast termcap load, no xrefs to terminfo],
  481. [with_getcap=$enableval],
  482. [with_getcap=no])
  483. AC_MSG_RESULT($with_getcap)
  484. test "$with_getcap" = "yes" && AC_DEFINE(USE_GETCAP)
  485. AC_MSG_CHECKING(if translated termcaps will be cached in ~/.terminfo)
  486. AC_ARG_ENABLE(getcap-cache,
  487. [ --enable-getcap-cache cache translated termcaps in ~/.terminfo],
  488. [with_getcap_cache=$enableval],
  489. [with_getcap_cache=no])
  490. AC_MSG_RESULT($with_getcap_cache)
  491. test "$with_getcap_cache" = "yes" && AC_DEFINE(USE_GETCAP_CACHE)
  492. fi
  493. ### Use option --disable-home-terminfo to completely remove ~/.terminfo
  494. AC_MSG_CHECKING(if ~/.terminfo is wanted)
  495. AC_ARG_ENABLE(home-terminfo,
  496. [ --disable-home-terminfo drop ~/.terminfo from terminfo search-path],
  497. [with_home_terminfo=$enableval],
  498. [with_home_terminfo=yes])
  499. AC_MSG_RESULT($with_home_terminfo)
  500. test "$with_home_terminfo" = "yes" && AC_DEFINE(USE_HOME_TERMINFO)
  501. AC_MSG_CHECKING(if you want to use restricted environment when running as root)
  502. AC_ARG_ENABLE(root-environ,
  503. [ --disable-root-environ restrict environment when running as root],
  504. [with_root_environ=$enableval],
  505. [with_root_environ=yes])
  506. AC_MSG_RESULT($with_root_environ)
  507. test "$with_root_environ" = yes && AC_DEFINE(USE_ROOT_ENVIRON)
  508. ### Use option --enable-symlinks to make tic use symlinks, not hard links
  509. ### to reduce storage requirements for the terminfo database.
  510. CF_LINK_FUNCS
  511. with_links=no
  512. with_symlinks=no
  513. # soft links (symbolic links) are useful for some systems where hard links do
  514. # not work, or to make it simpler to copy terminfo trees around.
  515. if test "$ac_cv_func_symlink" = yes ; then
  516. AC_MSG_CHECKING(if tic should use symbolic links)
  517. AC_ARG_ENABLE(symlinks,
  518. [ --enable-symlinks make tic use symbolic links not hard links],
  519. [with_symlinks=$enableval],
  520. [with_symlinks=no])
  521. AC_MSG_RESULT($with_symlinks)
  522. fi
  523. # If we have hard links and did not choose to use soft links instead, there is
  524. # no reason to make this choice optional - use the hard links.
  525. if test "$with_symlinks" = no ; then
  526. AC_MSG_CHECKING(if tic should use hard links)
  527. if test "$ac_cv_func_link" = yes ; then
  528. with_links=yes
  529. else
  530. with_links=no
  531. fi
  532. AC_MSG_RESULT($with_links)
  533. fi
  534. test "$with_links" = yes && AC_DEFINE(USE_LINKS)
  535. test "$with_symlinks" = yes && AC_DEFINE(USE_SYMLINKS)
  536. ### use option --enable-broken-linker to force on use of broken-linker support
  537. AC_MSG_CHECKING(if you want broken-linker support code)
  538. AC_ARG_ENABLE(broken_linker,
  539. [ --enable-broken_linker compile with broken-linker support code],
  540. [with_broken_linker=$enableval],
  541. [with_broken_linker=${BROKEN_LINKER-no}])
  542. AC_MSG_RESULT($with_broken_linker)
  543. BROKEN_LINKER=0
  544. if test "$with_broken_linker" = yes ; then
  545. AC_DEFINE(BROKEN_LINKER)
  546. BROKEN_LINKER=1
  547. elif test "$DFT_LWR_MODEL" = shared ; then
  548. case $cf_cv_system_name in #(vi
  549. cygwin*)
  550. AC_DEFINE(BROKEN_LINKER)
  551. BROKEN_LINKER=1
  552. CF_VERBOSE(cygwin linker is broken anyway)
  553. ;;
  554. esac
  555. fi
  556. AC_SUBST(BROKEN_LINKER)
  557. ### use option --enable-bsdpad to have tputs process BSD-style prefix padding
  558. AC_MSG_CHECKING(if tputs should process BSD-style prefix padding)
  559. AC_ARG_ENABLE(bsdpad,
  560. [ --enable-bsdpad recognize BSD-style prefix padding],
  561. [with_bsdpad=$enableval],
  562. [with_bsdpad=no])
  563. AC_MSG_RESULT($with_bsdpad)
  564. test "$with_bsdpad" = yes && AC_DEFINE(BSD_TPUTS)
  565. ### use option --enable-widec to turn on use of wide-character support
  566. NCURSES_CH_T=chtype
  567. NCURSES_LIBUTF8=0
  568. NEED_WCHAR_H=0
  569. NCURSES_MBSTATE_T=0
  570. NCURSES_WCHAR_T=0
  571. NCURSES_WINT_T=0
  572. # Check to define _XOPEN_SOURCE "automatically"
  573. CF_XOPEN_SOURCE
  574. # Work around breakage on OS X
  575. CF_SIGWINCH
  576. # Checks for CODESET support.
  577. AM_LANGINFO_CODESET
  578. # use these variables to work around a defect in gcc's fixincludes.
  579. NCURSES_OK_WCHAR_T=
  580. NCURSES_OK_WINT_T=
  581. AC_MSG_CHECKING(if you want wide-character code)
  582. AC_ARG_ENABLE(widec,
  583. [ --enable-widec compile with wide-char/UTF-8 code],
  584. [with_widec=$enableval],
  585. [with_widec=no])
  586. AC_MSG_RESULT($with_widec)
  587. if test "$with_widec" = yes ; then
  588. LIB_SUFFIX="w${LIB_SUFFIX}"
  589. AC_DEFINE(USE_WIDEC_SUPPORT)
  590. CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED)
  591. # with_overwrite=no
  592. NCURSES_CH_T=cchar_t
  593. AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs)
  594. if test "$ac_cv_func_putwc" != yes ; then
  595. CF_UTF8_LIB
  596. if test "$cf_cv_utf8_lib" != no ; then
  597. NCURSES_LIBUTF8=1
  598. fi
  599. fi
  600. CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T)
  601. CF_WCHAR_TYPE(wchar_t, NCURSES_WCHAR_T, NCURSES_OK_WCHAR_T)
  602. CF_WCHAR_TYPE(wint_t, NCURSES_WINT_T, NCURSES_OK_WINT_T)
  603. if test "$NCURSES_MBSTATE_T" != 0; then
  604. AC_DEFINE(NEED_MBSTATE_T_DEF)
  605. fi
  606. fi
  607. AC_SUBST(NCURSES_CH_T)
  608. AC_SUBST(NCURSES_LIBUTF8)
  609. AC_SUBST(NEED_WCHAR_H)
  610. AC_SUBST(NCURSES_MBSTATE_T)
  611. AC_SUBST(NCURSES_WCHAR_T)
  612. AC_SUBST(NCURSES_WINT_T)
  613. AC_SUBST(NCURSES_OK_WCHAR_T)
  614. AC_SUBST(NCURSES_OK_WINT_T)
  615. ### use option --disable-lp64 to allow long chtype
  616. case $cf_cv_abi_version in
  617. [[345]]*)
  618. default_with_lp64=no
  619. ;;
  620. *)
  621. default_with_lp64=yes
  622. ;;
  623. esac
  624. AC_MSG_CHECKING(whether to enable _LP64 definition in curses.h)
  625. AC_ARG_ENABLE(lp64,
  626. [ --disable-lp64 allow chtype to be long (ignore _LP64)],
  627. [with_lp64=$enableval],
  628. [with_lp64=$default_with_lp64])
  629. AC_MSG_RESULT($with_lp64)
  630. if test "$with_lp64" = yes ; then
  631. cf_cv_enable_lp64=1
  632. else
  633. cf_cv_enable_lp64=0
  634. fi
  635. AC_SUBST(cf_cv_enable_lp64)
  636. CF_LARGEFILE
  637. ### use option --disable-tparm-varargs to make tparm() conform to X/Open
  638. AC_MSG_CHECKING(if you want tparm not to use X/Open fixed-parameter list)
  639. AC_ARG_ENABLE(tparm-varargs,
  640. [ --disable-tparm-varargs compile tparm() without varargs interface],
  641. [with_tparm_varargs=$enableval],
  642. [with_tparm_varargs=yes])
  643. AC_MSG_RESULT($with_tparm_varargs)
  644. NCURSES_TPARM_VARARGS=0
  645. test "$with_tparm_varargs" = yes && NCURSES_TPARM_VARARGS=1
  646. AC_SUBST(NCURSES_TPARM_VARARGS)
  647. ### use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw
  648. if test "$with_ticlib" != no ; then
  649. AC_MSG_CHECKING(if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library)
  650. AC_ARG_ENABLE(tic-depends,
  651. [ --disable-tic-depends link tic library without explicit dependency on ncurses library],
  652. [with_tic_depends=$enableval],
  653. [with_tic_depends=yes])
  654. AC_MSG_RESULT($with_tic_depends)
  655. else
  656. with_tic_depends=no
  657. fi
  658. ### use option --with-bool to override bool's type
  659. AC_MSG_CHECKING(for type of bool)
  660. AC_ARG_WITH(bool,
  661. [ --with-bool=TYPE override fallback type of bool variable],
  662. [NCURSES_BOOL="$withval"],
  663. [NCURSES_BOOL=auto])
  664. AC_MSG_RESULT($NCURSES_BOOL)
  665. AC_SUBST(NCURSES_BOOL)
  666. AC_MSG_CHECKING(for alternate terminal capabilities file)
  667. AC_ARG_WITH(caps,
  668. [ --with-caps=alt compile with alternate Caps file],
  669. [TERMINFO_CAPS=Caps.$withval],
  670. [TERMINFO_CAPS=Caps])
  671. test -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps
  672. AC_MSG_RESULT($TERMINFO_CAPS)
  673. AC_SUBST(TERMINFO_CAPS)
  674. ### use option --with-chtype to override chtype's type
  675. AC_MSG_CHECKING(for type of chtype)
  676. AC_ARG_WITH(chtype,
  677. [ --with-chtype=TYPE override type of chtype],
  678. [NCURSES_CHTYPE="$withval"],
  679. [NCURSES_CHTYPE=auto])
  680. AC_MSG_RESULT($NCURSES_CHTYPE)
  681. ### use option --with-ospeed to override ospeed's type
  682. AC_MSG_CHECKING(for type of ospeed)
  683. AC_ARG_WITH(ospeed,
  684. [ --with-ospeed=TYPE override type of ospeed variable],
  685. [NCURSES_OSPEED="$withval"],
  686. [NCURSES_OSPEED=short])
  687. AC_MSG_RESULT($NCURSES_OSPEED)
  688. AC_SUBST(NCURSES_OSPEED)
  689. ### use option --with-mmask-t to override mmask_t's type
  690. AC_MSG_CHECKING(for type of mmask_t)
  691. AC_ARG_WITH(mmask-t,
  692. [ --with-mmask-t=TYPE override type of mmask_t],
  693. [NCURSES_MMASK_T="$withval"],
  694. [NCURSES_MMASK_T=auto])
  695. AC_MSG_RESULT($NCURSES_MMASK_T)
  696. ### Enable compiling-in rcs id's
  697. AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
  698. AC_ARG_WITH(rcs-ids,
  699. [ --with-rcs-ids compile-in RCS identifiers],
  700. [with_rcs_ids=$withval],
  701. [with_rcs_ids=no])
  702. AC_MSG_RESULT($with_rcs_ids)
  703. test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
  704. ###############################################################################
  705. CF_MAN_PAGES([ captoinfo clear infocmp infotocap tabs tic toe tput tset ])
  706. ###############################################################################
  707. CF_HELP_MESSAGE(Extensions:)
  708. ### Note that some functions (such as const) are normally disabled anyway.
  709. AC_MSG_CHECKING(if you want to build with function extensions)
  710. AC_ARG_ENABLE(ext-funcs,
  711. [ --disable-ext-funcs disable function-extensions],
  712. [with_ext_funcs=$enableval],
  713. [with_ext_funcs=yes])
  714. AC_MSG_RESULT($with_ext_funcs)
  715. if test "$with_ext_funcs" = yes ; then
  716. NCURSES_EXT_FUNCS=1
  717. AC_DEFINE(HAVE_CURSES_VERSION)
  718. AC_DEFINE(HAVE_HAS_KEY)
  719. AC_DEFINE(HAVE_RESIZETERM)
  720. AC_DEFINE(HAVE_RESIZE_TERM)
  721. AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
  722. AC_DEFINE(HAVE_WRESIZE)
  723. AC_DEFINE(NCURSES_EXT_FUNCS)
  724. else
  725. NCURSES_EXT_FUNCS=0
  726. fi
  727. AC_SUBST(NCURSES_EXT_FUNCS)
  728. ### use option --enable-const to turn on use of const beyond that in XSI.
  729. AC_MSG_CHECKING(for extended use of const keyword)
  730. AC_ARG_ENABLE(const,
  731. [ --enable-const compile with extra/non-standard const],
  732. [with_ext_const=$enableval],
  733. [with_ext_const=no])
  734. AC_MSG_RESULT($with_ext_const)
  735. NCURSES_CONST='/*nothing*/'
  736. if test "$with_ext_const" = yes ; then
  737. NCURSES_CONST=const
  738. fi
  739. AC_SUBST(NCURSES_CONST)
  740. ### use option --enable-ext-colors to turn on use of colors beyond 16.
  741. AC_MSG_CHECKING(if you want to use extended colors)
  742. AC_ARG_ENABLE(ext-colors,
  743. [ --enable-ext-colors compile for 256-color support],
  744. [with_ext_colors=$enableval],
  745. [with_ext_colors=no])
  746. AC_MSG_RESULT($with_ext_colors)
  747. NCURSES_EXT_COLORS=0
  748. if test "$with_ext_colors" = yes ; then
  749. if test "$with_widec" != yes ; then
  750. AC_MSG_ERROR(This option applies only to wide-character library)
  751. else
  752. # cannot be ABI 5 since it changes sizeof(cchar_t)
  753. CF_NCURSES_ABI_6
  754. fi
  755. NCURSES_EXT_COLORS=1
  756. AC_DEFINE(NCURSES_EXT_COLORS)
  757. fi
  758. AC_SUBST(NCURSES_EXT_COLORS)
  759. ### use option --enable-ext-mouse to modify coding to support 5-button mice
  760. AC_MSG_CHECKING(if you want to use extended mouse encoding)
  761. AC_ARG_ENABLE(ext-mouse,
  762. [ --enable-ext-mouse compile for extended mouse-encoding],
  763. [with_ext_mouse=$enableval],
  764. [with_ext_mouse=no])
  765. AC_MSG_RESULT($with_ext_mouse)
  766. NCURSES_MOUSE_VERSION=1
  767. if test "$with_ext_mouse" = yes ; then
  768. NCURSES_MOUSE_VERSION=2
  769. CF_NCURSES_ABI_6
  770. fi
  771. AC_SUBST(NCURSES_MOUSE_VERSION)
  772. AC_MSG_CHECKING(if you want \$NCURSES_NO_PADDING code)
  773. AC_ARG_ENABLE(no-padding,
  774. [ --enable-no-padding compile with $NCURSES_NO_PADDING code],
  775. [with_no_padding=$enableval],
  776. [with_no_padding=$with_ext_funcs])
  777. AC_MSG_RESULT($with_no_padding)
  778. test "$with_no_padding" = yes && AC_DEFINE(NCURSES_NO_PADDING)
  779. AC_CHECK_SIZEOF([signed char], 0)
  780. if test "$ac_cv_sizeof_signed_char" = 1 ; then
  781. NCURSES_SBOOL="signed char"
  782. else
  783. NCURSES_SBOOL="char"
  784. fi
  785. AC_MSG_CHECKING(if you want to use signed Boolean array in term.h)
  786. AC_ARG_ENABLE(signed-char,
  787. [ --enable-signed-char compile using signed Boolean's in term.h],
  788. [with_signed_char=$enableval],
  789. [with_signed_char=no])
  790. AC_MSG_RESULT($with_signed_char)
  791. test "$with_signed_char" != yes && NCURSES_SBOOL="char"
  792. AC_SUBST(NCURSES_SBOOL)
  793. ### use option --enable-sigwinch to turn on use of SIGWINCH logic
  794. AC_MSG_CHECKING(if you want SIGWINCH handler)
  795. AC_ARG_ENABLE(sigwinch,
  796. [ --enable-sigwinch compile with SIGWINCH handler],
  797. [with_sigwinch=$enableval],
  798. [with_sigwinch=$with_ext_funcs])
  799. AC_MSG_RESULT($with_sigwinch)
  800. test "$with_sigwinch" = yes && AC_DEFINE(USE_SIGWINCH)
  801. ### use option --enable-tcap-names to allow user to define new capabilities
  802. AC_MSG_CHECKING(if you want user-definable terminal capabilities like termcap)
  803. AC_ARG_ENABLE(tcap-names,
  804. [ --enable-tcap-names compile with user-definable terminal capabilities],
  805. [with_tcap_names=$enableval],
  806. [with_tcap_names=$with_ext_funcs])
  807. AC_MSG_RESULT($with_tcap_names)
  808. NCURSES_XNAMES=0
  809. test "$with_tcap_names" = yes && NCURSES_XNAMES=1
  810. AC_SUBST(NCURSES_XNAMES)
  811. ###############################################################################
  812. # These options are relatively safe to experiment with.
  813. CF_HELP_MESSAGE(Development Code:)
  814. AC_MSG_CHECKING(if you want all development code)
  815. AC_ARG_WITH(develop,
  816. [ --without-develop disable development options],
  817. [with_develop=$withval],
  818. [with_develop=no])
  819. AC_MSG_RESULT($with_develop)
  820. ### use option --enable-hard-tabs to turn on use of hard-tabs optimize
  821. AC_MSG_CHECKING(if you want hard-tabs code)
  822. AC_ARG_ENABLE(hard-tabs,
  823. [ --enable-hard-tabs compile with hard-tabs code],,
  824. [enable_hard_tabs=$with_develop])
  825. AC_MSG_RESULT($enable_hard_tabs)
  826. test "$enable_hard_tabs" = yes && AC_DEFINE(USE_HARD_TABS)
  827. ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
  828. AC_MSG_CHECKING(if you want limited support for xmc)
  829. AC_ARG_ENABLE(xmc-glitch,
  830. [ --enable-xmc-glitch compile with support for xmc (magic-cookie)],,
  831. [enable_xmc_glitch=$with_develop])
  832. AC_MSG_RESULT($enable_xmc_glitch)
  833. test "$enable_xmc_glitch" = yes && AC_DEFINE(USE_XMC_SUPPORT)
  834. ###############################################################################
  835. # These are just experimental, probably should not be in a package:
  836. CF_HELP_MESSAGE(Experimental Code:)
  837. AC_MSG_CHECKING(if you do not want to assume colors are white-on-black)
  838. AC_ARG_ENABLE(assumed-color,
  839. [ --disable-assumed-color do not assume anything about default-colors],
  840. [with_assumed_color=$enableval],
  841. [with_assumed_color=yes])
  842. AC_MSG_RESULT($with_assumed_color)
  843. test "$with_assumed_color" = yes && AC_DEFINE(USE_ASSUMED_COLOR)
  844. ### use option --enable-hashmap to turn on use of hashmap scrolling logic
  845. AC_MSG_CHECKING(if you want hashmap scrolling-optimization code)
  846. AC_ARG_ENABLE(hashmap,
  847. [ --disable-hashmap compile without hashmap scrolling-optimization],
  848. [with_hashmap=$enableval],
  849. [with_hashmap=yes])
  850. AC_MSG_RESULT($with_hashmap)
  851. test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
  852. ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
  853. AC_MSG_CHECKING(if you want colorfgbg code)
  854. AC_ARG_ENABLE(colorfgbg,
  855. [ --enable-colorfgbg compile with $COLORFGBG code],
  856. [with_colorfgbg=$enableval],
  857. [with_colorfgbg=no])
  858. AC_MSG_RESULT($with_colorfgbg)
  859. test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
  860. # This is still experimental (20080329), but should ultimately be moved to
  861. # the script-block --with-normal, etc.
  862. CF_WITH_PTHREAD
  863. AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
  864. AC_ARG_ENABLE(weak-symbols,
  865. [ --enable-weak-symbols enable weak-symbols for pthreads],
  866. [use_weak_symbols=$withval],
  867. [use_weak_symbols=no])
  868. AC_MSG_RESULT($use_weak_symbols)
  869. if test "$use_weak_symbols" = yes ; then
  870. CF_WEAK_SYMBOLS
  871. else
  872. cf_cv_weak_symbols=no
  873. fi
  874. if test $cf_cv_weak_symbols = yes ; then
  875. AC_DEFINE(USE_WEAK_SYMBOLS)
  876. fi
  877. PTHREAD=
  878. if test "$with_pthread" = "yes" ; then
  879. AC_DEFINE(USE_PTHREADS)
  880. enable_reentrant=yes
  881. if test $cf_cv_weak_symbols = yes ; then
  882. PTHREAD=-lpthread
  883. fi
  884. fi
  885. AC_SUBST(PTHREAD)
  886. # Reentrant code has to be opaque; there's little advantage to making ncurses
  887. # opaque outside of that, so there is no --enable-opaque option. We can use
  888. # this option without --with-pthreads, but this will be always set for
  889. # pthreads.
  890. AC_MSG_CHECKING(if you want experimental reentrant code)
  891. AC_ARG_ENABLE(reentrant,
  892. [ --enable-reentrant compile with experimental reentrant code],
  893. [with_reentrant=$enableval],
  894. [with_reentrant=no])
  895. AC_MSG_RESULT($with_reentrant)
  896. if test "$with_reentrant" = yes ; then
  897. cf_cv_enable_reentrant=1
  898. cf_cv_enable_opaque="NCURSES_INTERNALS"
  899. NCURSES_OPAQUE=1
  900. NCURSES_SIZE_T=int
  901. if test $cf_cv_weak_symbols = yes ; then
  902. CF_REMOVE_LIB(LIBS,$LIBS,pthread)
  903. else
  904. LIB_SUFFIX="t${LIB_SUFFIX}"
  905. fi
  906. AC_DEFINE(USE_REENTRANT)
  907. CF_NCURSES_ABI_6
  908. else
  909. cf_cv_enable_reentrant=0
  910. cf_cv_enable_opaque="NCURSES_OPAQUE"
  911. NCURSES_OPAQUE=0
  912. NCURSES_SIZE_T=short
  913. fi
  914. AC_SUBST(cf_cv_enable_reentrant)
  915. AC_SUBST(cf_cv_enable_opaque)
  916. AC_SUBST(NCURSES_OPAQUE)
  917. AC_SUBST(NCURSES_SIZE_T)
  918. AC_MSG_CHECKING(if you want experimental safe-sprintf code)
  919. AC_ARG_ENABLE(safe-sprintf,
  920. [ --enable-safe-sprintf compile with experimental safe-sprintf code],
  921. [with_safe_sprintf=$enableval],
  922. [with_safe_sprintf=no])
  923. AC_MSG_RESULT($with_safe_sprintf)
  924. test "$with_safe_sprintf" = yes && AC_DEFINE(USE_SAFE_SPRINTF)
  925. ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
  926. # when hashmap is used scroll hints are useless
  927. if test "$with_hashmap" = no ; then
  928. AC_MSG_CHECKING(if you want to experiment without scrolling-hints code)
  929. AC_ARG_ENABLE(scroll-hints,
  930. [ --disable-scroll-hints compile without scroll-hints code],
  931. [with_scroll_hints=$enableval],
  932. [with_scroll_hints=yes])
  933. AC_MSG_RESULT($with_scroll_hints)
  934. test "$with_scroll_hints" = yes && AC_DEFINE(USE_SCROLL_HINTS)
  935. fi
  936. AC_MSG_CHECKING(if you want experimental wgetch-events code)
  937. AC_ARG_ENABLE(wgetch-events,
  938. [ --enable-wgetch-events compile with experimental wgetch-events code],
  939. [with_wgetch_events=$enableval],
  940. [with_wgetch_events=no])
  941. AC_MSG_RESULT($with_wgetch_events)
  942. test "$with_wgetch_events" = yes && AC_DEFINE(NCURSES_WGETCH_EVENTS)
  943. ###############################################################################
  944. CF_HELP_MESSAGE(Testing/development Options:)
  945. ### use option --disable-echo to suppress full display compiling commands
  946. AC_MSG_CHECKING(if you want to display full commands during build)
  947. AC_ARG_ENABLE(echo,
  948. [ --enable-echo build: display "compiling" commands (default)],
  949. [with_echo=$enableval],
  950. [with_echo=yes])
  951. if test "$with_echo" = yes; then
  952. ECHO_LINK=
  953. else
  954. ECHO_LINK='@ echo linking $@ ... ;'
  955. test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
  956. test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent"
  957. fi
  958. AC_MSG_RESULT($with_echo)
  959. AC_SUBST(ECHO_LINK)
  960. ### use option --enable-warnings to turn on all gcc warnings
  961. AC_MSG_CHECKING(if you want to see compiler warnings)
  962. AC_ARG_ENABLE(warnings,
  963. [ --enable-warnings build: turn on GCC compiler warnings],
  964. [with_warnings=$enableval])
  965. AC_MSG_RESULT($with_warnings)
  966. if test "x$with_warnings" = "xyes"; then
  967. ADAFLAGS="$ADAFLAGS -gnatg"
  968. CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum)
  969. if test "$cf_with_cxx" = yes ; then
  970. CF_GXX_WARNINGS(Wno-unused)
  971. fi
  972. fi
  973. CF_GCC_ATTRIBUTES
  974. ### use option --enable-assertions to turn on generation of assertion code
  975. AC_MSG_CHECKING(if you want to enable runtime assertions)
  976. AC_ARG_ENABLE(assertions,
  977. [ --enable-assertions test: turn on generation of assertion code],
  978. [with_assertions=$enableval],
  979. [with_assertions=no])
  980. AC_MSG_RESULT($with_assertions)
  981. if test -n "$GCC"
  982. then
  983. if test "$with_assertions" = no
  984. then
  985. AC_DEFINE(NDEBUG)
  986. CPPFLAGS="$CPPFLAGS -DNDEBUG"
  987. else
  988. ADAFLAGS="$ADAFLAGS -gnata"
  989. fi
  990. fi
  991. ### use option --disable-leaks to suppress "permanent" leaks, for testing
  992. CF_DISABLE_LEAKS
  993. AC_DEFINE(HAVE_NC_ALLOC_H)
  994. ### use option --enable-expanded to generate certain macros as functions
  995. AC_ARG_ENABLE(expanded,
  996. [ --enable-expanded test: generate functions for certain macros],
  997. [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
  998. ### use option --disable-macros to suppress macros in favor of functions
  999. AC_ARG_ENABLE(macros,
  1000. [ --disable-macros test: use functions rather than macros],
  1001. [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
  1002. # Normally we only add trace() to the debug-library. Allow this to be
  1003. # extended to all models of the ncurses library:
  1004. cf_all_traces=no
  1005. case "$CFLAGS $CPPFLAGS" in
  1006. *-DTRACE*)
  1007. cf_all_traces=yes
  1008. ;;
  1009. esac
  1010. AC_MSG_CHECKING(whether to add trace feature to all models)
  1011. AC_ARG_WITH(trace,
  1012. [ --with-trace test: add trace() function to all models of ncurses],
  1013. [cf_with_trace=$withval],
  1014. [cf_with_trace=$cf_all_traces])
  1015. AC_MSG_RESULT($cf_with_trace)
  1016. if test "$cf_with_trace" = yes ; then
  1017. LIB_TRACING=all
  1018. ADA_TRACE=TRUE
  1019. CF_ADD_CFLAGS(-DTRACE)
  1020. else
  1021. LIB_TRACING=DEBUG
  1022. ADA_TRACE=FALSE
  1023. fi
  1024. AC_SUBST(ADA_TRACE)
  1025. ### Checks for libraries.
  1026. AC_CHECK_FUNC(gettimeofday,
  1027. AC_DEFINE(HAVE_GETTIMEOFDAY),[
  1028. AC_CHECK_LIB(bsd, gettimeofday,
  1029. AC_DEFINE(HAVE_GETTIMEOFDAY)
  1030. LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
  1031. CF_MATH_LIB(MATH_LIB,sin(x))
  1032. AC_SUBST(MATH_LIB)
  1033. ### Checks for header files.
  1034. AC_STDC_HEADERS
  1035. AC_HEADER_DIRENT
  1036. AC_HEADER_TIME
  1037. CF_REGEX
  1038. dnl These are some other potentially nonportable headers.
  1039. AC_CHECK_HEADERS( \
  1040. fcntl.h \
  1041. getopt.h \
  1042. limits.h \
  1043. locale.h \
  1044. poll.h \
  1045. sys/bsdtypes.h \
  1046. sys/ioctl.h \
  1047. sys/param.h \
  1048. sys/poll.h \
  1049. sys/select.h \
  1050. sys/time.h \
  1051. sys/times.h \
  1052. ttyent.h \
  1053. unistd.h \
  1054. wctype.h \
  1055. )
  1056. # check for ISC (this may also define _POSIX_SOURCE)
  1057. # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
  1058. if test "$ISC" = yes ; then
  1059. AC_CHECK_LIB(cposix,main)
  1060. AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
  1061. fi
  1062. CF_SYS_TIME_SELECT
  1063. ### checks for compiler characteristics
  1064. AC_LANG_C
  1065. AC_C_CONST
  1066. CF_C_INLINE(NCURSES_INLINE,1200)
  1067. CF_SIG_ATOMIC_T
  1068. if test $NCURSES_CHTYPE = auto ; then
  1069. CF_TYPEOF_CHTYPE
  1070. else
  1071. cf_cv_typeof_chtype=$NCURSES_CHTYPE
  1072. fi
  1073. test "$cf_cv_typeof_chtype" = unsigned && cf_cv_typeof_chtype=""
  1074. AC_SUBST(cf_cv_typeof_chtype)
  1075. CF_UNSIGNED_LITERALS
  1076. cf_cv_1UL="1"
  1077. test ".$cf_cv_unsigned_literals" = .yes && cf_cv_1UL="${cf_cv_1UL}U"
  1078. test ".$cf_cv_typeof_chtype" = .long && cf_cv_1UL="${cf_cv_1UL}L"
  1079. AC_SUBST(cf_cv_1UL)
  1080. if test $NCURSES_MMASK_T = auto ; then
  1081. cf_cv_typeof_mmask_t=long
  1082. else
  1083. cf_cv_typeof_mmask_t=$NCURSES_MMASK_T
  1084. fi
  1085. test "$cf_cv_typeof_mmask_t" = unsigned && cf_cv_typeof_mmask_t=""
  1086. AC_SUBST(cf_cv_typeof_mmask_t)
  1087. ### Checks for external-data
  1088. CF_ERRNO
  1089. CF_LINK_DATAONLY
  1090. ### Checks for library functions.
  1091. AC_CHECK_FUNCS( \
  1092. getcwd \
  1093. getegid \
  1094. geteuid \
  1095. getttynam \
  1096. issetugid \
  1097. poll \
  1098. remove \
  1099. select \
  1100. setbuf \
  1101. setbuffer \
  1102. setvbuf \
  1103. sigaction \
  1104. sigvec \
  1105. strdup \
  1106. strstr \
  1107. tcgetpgrp \
  1108. times \
  1109. vsnprintf \
  1110. )
  1111. if test "$with_getcap" = "yes" ; then
  1112. CF_CGETENT
  1113. fi
  1114. CF_ISASCII
  1115. CF_STRUCT_SIGACTION
  1116. CF_FUNC_NANOSLEEP
  1117. CF_FUNC_TERMIOS
  1118. CF_FUNC_VSSCANF
  1119. CF_MKSTEMP
  1120. # setup for prototype of fallback for vsscanf()
  1121. CF_SUBST_IF(["$cf_cv_func_vsscanf" = vsscanf], HAVE_VSSCANF, 1, 0)
  1122. dnl FIXME (may need this) AC_SYS_RESTARTABLE_SYSCALLS
  1123. if test "$cross_compiling" = yes ; then
  1124. AC_MSG_WARN(cross compiling: assume setvbuf params not reversed)
  1125. else
  1126. AC_FUNC_SETVBUF_REVERSED
  1127. fi
  1128. AC_TYPE_SIGNAL
  1129. CF_TYPE_SIGACTION
  1130. CF_SIZECHANGE
  1131. CF_FUNC_MEMMOVE
  1132. CF_FUNC_POLL
  1133. # special check for test/ditto.c
  1134. CF_FUNC_OPENPTY
  1135. if test "$cf_cv_func_openpty" != no ; then
  1136. AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>)
  1137. AC_DEFINE(USE_XTERM_PTY)
  1138. if test "$cf_cv_lib_util" = yes ; then
  1139. TEST_LIBS="-lutil $TEST_LIBS"
  1140. fi
  1141. fi
  1142. AC_SUBST(TEST_LIBS)
  1143. if test "$with_hashed_db" != no ; then
  1144. AC_DEFINE(USE_HASHED_DB)
  1145. CF_HASHED_DB($with_hashed_db)
  1146. fi
  1147. dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
  1148. if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
  1149. CF_STRIP_G_OPT(CFLAGS)
  1150. CF_STRIP_G_OPT(CXXFLAGS)
  1151. fi
  1152. # Just in case, check if the C compiler has a bool type.
  1153. CF_BOOL_DECL(cf_cv_cc_bool_type)
  1154. # Check for C++ compiler characteristics (and ensure that it's there!)
  1155. if test -n "$CXX" ; then
  1156. AC_LANG_CPLUSPLUS
  1157. CF_STDCPP_LIBRARY
  1158. CF_PROG_CC_C_O(CXX)
  1159. case $GXX_VERSION in
  1160. 1*|2.[0-6]*)
  1161. cf_cxx_library=yes
  1162. ;;
  1163. *-2.7*|2.7*)
  1164. CF_GPP_LIBRARY
  1165. ;;
  1166. *)
  1167. cf_cxx_library=no
  1168. ;;
  1169. esac
  1170. AC_CHECK_HEADERS(iostream typeinfo)
  1171. if test x"$ac_cv_header_iostream" = xyes ; then
  1172. AC_MSG_CHECKING(if iostream uses std-namespace)
  1173. AC_TRY_COMPILE([
  1174. #include <iostream>
  1175. using std::endl;
  1176. using std::cerr;],[
  1177. cerr << "testing" << endl;
  1178. ],[cf_iostream_namespace=yes],[cf_iostream_namespace=no])
  1179. AC_MSG_RESULT($cf_iostream_namespace)
  1180. if test "$cf_iostream_namespace" = yes ; then
  1181. AC_DEFINE(IOSTREAM_NAMESPACE)
  1182. fi
  1183. fi
  1184. CF_BOOL_DECL
  1185. CF_BOOL_SIZE
  1186. CF_ETIP_DEFINES
  1187. CF_CPP_PARAM_INIT
  1188. CF_CPP_STATIC_CAST
  1189. CXX_AR='$(AR)'
  1190. CXX_AR_OPTS='$(AR_OPTS)'
  1191. case $cf_cv_system_name in #(vi
  1192. irix*) #(vi
  1193. if test "$GXX" != yes ; then
  1194. CXX_AR='$(CXX)'
  1195. CXX_AR_OPTS='-ar -o'
  1196. fi
  1197. ;;
  1198. sco3.2v5*) #(vi
  1199. CXXLDFLAGS="-u main"
  1200. ;;
  1201. solaris2*)
  1202. if test "$GXX" != yes ; then
  1203. CXX_AR='$(CXX)'
  1204. CXX_AR_OPTS='-xar -o'
  1205. fi
  1206. ;;
  1207. esac
  1208. AC_SUBST(CXXLDFLAGS)
  1209. AC_SUBST(CXX_AR)
  1210. AC_SUBST(CXX_AR_OPTS)
  1211. else
  1212. cf_cxx_library=no
  1213. cf_cv_builtin_bool=1
  1214. # Just because we are not configuring against C++ right now does not
  1215. # mean that a user will not want to use C++. Some distributors disable
  1216. # the C++ portion of this configuration as a shortcut (or just to avoid
  1217. # compiling the demo in the c++ directory). So we need a reasonable
  1218. # default for the 'bool' type.
  1219. #
  1220. # Caveat: since the storage of the bool type is not standardized, it
  1221. # may change.
  1222. if test "$NCURSES_BOOL" != auto ; then
  1223. cf_cv_type_of_bool=$NCURSES_BOOL
  1224. cf_cv_header_stdbool_h=0
  1225. else
  1226. if test "$cf_cv_header_stdbool_h" = 1 ; then
  1227. CF_BOOL_SIZE
  1228. else
  1229. AC_MSG_CHECKING(for fallback type of bool)
  1230. case "$host_cpu" in #(vi
  1231. i?86) cf_cv_type_of_bool=char ;; #(vi
  1232. *) cf_cv_type_of_bool=int ;;
  1233. esac
  1234. AC_MSG_RESULT($cf_cv_type_of_bool)
  1235. fi
  1236. fi
  1237. fi
  1238. AC_SUBST(CXXLIBS)
  1239. # If the C compiler did not declare bool, and we did not determine that the C++
  1240. # compiler does not declare bool, turn on an ifdef in curses.h that makes the
  1241. # ncurses library use the same type as C++ bool. Note that this allows one to
  1242. # specify the type of bool in a configure-script option and postpone
  1243. # integration with the C++ compiler provided that the types are compatible.
  1244. USE_CXX_BOOL=1
  1245. if test $cf_cv_cc_bool_type = 1
  1246. then
  1247. # oops: C has a bool. Unlikely, but C++ could differ.
  1248. USE_CXX_BOOL=0
  1249. elif test $cf_cv_builtin_bool = 0
  1250. then
  1251. # C++ has no bool
  1252. USE_CXX_BOOL=0
  1253. else
  1254. # this is the normal case
  1255. USE_CXX_BOOL='defined(__cplusplus)'
  1256. fi
  1257. AC_SUBST(USE_CXX_BOOL)
  1258. CF_HELP_MESSAGE(Ada95 Binding Options:)
  1259. dnl If the Ada95 source-tree is present, add that to the build unless it will
  1260. dnl not work, or was not requested.
  1261. if test -f "${srcdir}/Ada95/Makefile.in" ; then
  1262. dnl libtool does not know anything about GNAT, though a change made in 1998
  1263. dnl provided for it "someday". Disable the ada subtree if we are using
  1264. dnl libtool -TD 20070714
  1265. if test "$cf_with_ada" != "no" ; then
  1266. if test "$with_libtool" != "no"; then
  1267. AC_MSG_WARN(libtool does not support Ada - disabling feature)
  1268. cf_with_ada=no
  1269. fi
  1270. fi
  1271. dnl Check for availability of GNU Ada Translator (GNAT).
  1272. dnl At the moment we support no other Ada95 compiler.
  1273. if test "$cf_with_ada" != "no" ; then
  1274. cf_ada_make=gnatmake
  1275. AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
  1276. if test "$ac_cv_prog_gnat_exists" = no; then
  1277. cf_ada_make=
  1278. else
  1279. CF_GNAT_VERSION
  1280. AC_CHECK_PROG(M4_exists, m4, yes, no)
  1281. if test "$ac_cv_prog_M4_exists" = no; then
  1282. cf_cv_prog_gnat_correct=no
  1283. echo Ada95 binding required program m4 not found. Ada95 binding disabled.
  1284. fi
  1285. if test "$cf_cv_prog_gnat_correct" = yes; then
  1286. AC_MSG_CHECKING(if GNAT works)
  1287. CF_GNAT_TRY_RUN([procedure conftest;],
  1288. [with Text_IO;
  1289. with GNAT.OS_Lib;
  1290. procedure conftest is
  1291. begin
  1292. Text_IO.Put ("Hello World");
  1293. Text_IO.New_Line;
  1294. GNAT.OS_Lib.OS_Exit (0);
  1295. end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
  1296. AC_MSG_RESULT($cf_cv_prog_gnat_correct)
  1297. fi
  1298. fi
  1299. if test "$cf_cv_prog_gnat_correct" = yes; then
  1300. ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
  1301. AC_MSG_CHECKING(if GNAT pragma Unreferenced works)
  1302. CF_GNAT_TRY_LINK([procedure conftest;],
  1303. [with Text_IO;
  1304. with GNAT.OS_Lib;
  1305. procedure conftest is
  1306. test : Integer;
  1307. pragma Unreferenced (test);
  1308. begin
  1309. test := 1;
  1310. Text_IO.Put ("Hello World");
  1311. Text_IO.New_Line;
  1312. GNAT.OS_Lib.OS_Exit (0);
  1313. end conftest;],[cf_cv_pragma_unreferenced=yes],[cf_cv_pragma_unreferenced=no])
  1314. AC_MSG_RESULT($cf_cv_pragma_unreferenced)
  1315. # if the pragma is supported, use it (needed in the Trace code).
  1316. if test $cf_cv_pragma_unreferenced = yes ; then
  1317. PRAGMA_UNREF=TRUE
  1318. else
  1319. PRAGMA_UNREF=FALSE
  1320. fi
  1321. AC_ARG_WITH(ada-compiler,
  1322. [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
  1323. [cf_ada_compiler=$withval],
  1324. [cf_ada_compiler=gnatmake])
  1325. cf_ada_package=terminal_interface
  1326. AC_SUBST(cf_ada_make)
  1327. AC_SUBST(cf_ada_compiler)
  1328. AC_SUBST(cf_ada_package)
  1329. AC_SUBST(ADAFLAGS)
  1330. AC_SUBST(cf_compile_generics)
  1331. AC_SUBST(cf_generic_objects)
  1332. AC_SUBST(PRAGMA_UNREF)
  1333. CF_WITH_PATH(ada-include,
  1334. [ --with-ada-include=DIR Ada includes are in DIR],
  1335. ADA_INCLUDE,
  1336. PREFIX/lib/ada/adainclude,
  1337. [$]prefix/lib/ada/adainclude)
  1338. AC_SUBST(ADA_INCLUDE)
  1339. CF_WITH_PATH(ada-objects,
  1340. [ --with-ada-objects=DIR Ada objects are in DIR],
  1341. ADA_OBJECTS,
  1342. PREFIX/lib/ada/adalib,
  1343. [$]prefix/lib/ada/adalib)
  1344. AC_SUBST(ADA_OBJECTS)
  1345. fi
  1346. fi
  1347. else
  1348. cf_with_ada=no
  1349. fi
  1350. ### Construct the ncurses library-subsets, if any, from this set of keywords:
  1351. ### none, base, ext_funcs, ext_tinfo, ticlib, termlib, widechar
  1352. ###
  1353. ### ticlib modules may be a separate library, otherwise contained in termlib.
  1354. ### termlib modules may be a separate library, otherwise contained in ncurses.
  1355. ###
  1356. ### The of "+" or " " between the tokens controls the way the script
  1357. ### chooses to split module lists into libraries.
  1358. ###
  1359. ### (see CF_LIB_RULES).
  1360. AC_MSG_CHECKING(for library subsets)
  1361. LIB_SUBSETS=
  1362. if test "$cf_with_progs" = yes || test "$with_ticlib" != no || test "$with_termcap" != no; then
  1363. LIB_SUBSETS="${LIB_SUBSETS}ticlib"
  1364. if test "$with_ticlib" != no ; then
  1365. LIB_SUBSETS="${LIB_SUBSETS} "
  1366. else
  1367. LIB_SUBSETS="${LIB_SUBSETS}+"
  1368. fi
  1369. fi
  1370. LIB_SUBSETS="${LIB_SUBSETS}termlib"
  1371. test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo"
  1372. if test "$with_termlib" != no ; then
  1373. LIB_SUBSETS="${LIB_SUBSETS} "
  1374. else
  1375. LIB_SUBSETS="${LIB_SUBSETS}+"
  1376. fi
  1377. LIB_SUBSETS="${LIB_SUBSETS}base"
  1378. test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
  1379. test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
  1380. AC_MSG_RESULT($LIB_SUBSETS)
  1381. ### Construct the list of include-directories to be generated
  1382. CF_INCLUDE_DIRS
  1383. CF_ADA_INCLUDE_DIRS
  1384. ### Build up pieces for makefile rules
  1385. AC_MSG_CHECKING(default library suffix)
  1386. CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
  1387. AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
  1388. AC_MSG_RESULT($DFT_ARG_SUFFIX)
  1389. AC_MSG_CHECKING(default library-dependency suffix)
  1390. CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl
  1391. AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
  1392. AC_MSG_RESULT($DFT_DEP_SUFFIX)
  1393. AC_MSG_CHECKING(default object directory)
  1394. CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
  1395. AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
  1396. AC_MSG_RESULT($DFT_OBJ_SUBDIR)
  1397. # libtool thinks it can make c++ shared libraries (perhaps only g++)
  1398. if test "$cf_with_cxx" = yes ; then
  1399. AC_MSG_CHECKING(c++ library-dependency suffix)
  1400. if test "$with_libtool" != "no"; then
  1401. CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
  1402. else
  1403. CF_LIB_SUFFIX(normal,CXX_LIB_SUFFIX,CXX_DEP_SUFFIX)dnl we normally make a static library
  1404. fi
  1405. AC_MSG_RESULT($CXX_LIB_SUFFIX)
  1406. AC_SUBST(CXX_LIB_SUFFIX)
  1407. fi
  1408. # do not want -ldl in build except as needed for -lncurses dependency
  1409. if test "$with_dlsym" = yes ; then
  1410. if test $DFT_LWR_MODEL = shared || \
  1411. test $DFT_LWR_MODEL = libtool ; then
  1412. CF_REMOVE_LIB(LIBS,$LIBS,dl)
  1413. fi
  1414. fi
  1415. ### Set up low-level terminfo dependencies for makefiles.
  1416. # TICS_LIST and TINFO_LIST are needed to build libtic.so and libterm.so, but
  1417. # do not need libdl
  1418. TICS_LIST=
  1419. if test "$with_dlsym" = yes ; then
  1420. CF_REMOVE_LIB(TINFO_LIST,$SHLIB_LIST,dl)
  1421. fi
  1422. if test "$with_ticlib" != no ; then
  1423. if test "$with_ticlib" != yes ; then
  1424. TICS_NAME=$with_ticlib
  1425. TICS_ARG_SUFFIX="${with_ticlib}`echo ${DFT_ARG_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
  1426. TICS_DEP_SUFFIX="${with_ticlib}`echo ${DFT_DEP_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
  1427. TICS_LIB_SUFFIX="${with_ticlib}"
  1428. else
  1429. TICS_ARG_SUFFIX="${TICS_NAME}${DFT_ARG_SUFFIX}"
  1430. TICS_DEP_SUFFIX="${TICS_NAME}${DFT_DEP_SUFFIX}"
  1431. TICS_LIB_SUFFIX="${TICS_NAME}${LIB_SUFFIX}"
  1432. fi
  1433. TICS_ARGS="-L${LIB_DIR} -l${TICS_LIB_SUFFIX}"
  1434. else
  1435. TICS_ARGS="-L${LIB_DIR} -l${LIB_NAME}${DFT_ARG_SUFFIX}"
  1436. fi
  1437. AC_SUBST(TICS_ARG_SUFFIX)
  1438. AC_SUBST(TICS_DEP_SUFFIX)
  1439. AC_SUBST(TICS_LIB_SUFFIX)
  1440. AC_SUBST(TICS_ARGS)
  1441. if test "$with_termlib" != no ; then
  1442. if test "$with_termlib" != yes ; then
  1443. TINFO_NAME=$with_termlib
  1444. TINFO_SUFFIX="`echo ${DFT_LIB_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
  1445. TINFO_ARG_SUFFIX="${with_termlib}`echo ${DFT_ARG_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
  1446. TINFO_DEP_SUFFIX="${with_termlib}`echo ${DFT_DEP_SUFFIX}|sed -e "s/^${LIB_SUFFIX}//"`"
  1447. TINFO_LIB_SUFFIX="${with_termlib}"
  1448. else
  1449. TINFO_SUFFIX=${DFT_LIB_SUFFIX}
  1450. TINFO_ARG_SUFFIX="${TINFO_NAME}${DFT_ARG_SUFFIX}"
  1451. TINFO_DEP_SUFFIX="${TINFO_NAME}${DFT_DEP_SUFFIX}"
  1452. TINFO_LIB_SUFFIX="${TINFO_NAME}${LIB_SUFFIX}"
  1453. fi
  1454. TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_DEP_SUFFIX}"
  1455. TEST_DEP2="${LIB_2ND}/${LIB_PREFIX}${TINFO_DEP_SUFFIX}"
  1456. if test "$DFT_LWR_MODEL" = "libtool"; then
  1457. TEST_ARGS="${TEST_DEPS}"
  1458. TEST_ARG2="${TEST_DEP2}"
  1459. TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS"
  1460. else
  1461. TEST_ARGS="-l${TINFO_ARG_SUFFIX}"
  1462. TEST_ARG2="-l${TINFO_ARG_SUFFIX}"
  1463. TICS_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
  1464. TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS"
  1465. SHLIB_LIST="$SHLIB_LIST -l${TINFO_LIB_SUFFIX}"
  1466. fi
  1467. else
  1468. # the next lines are needed for linking libtic over libncurses
  1469. TINFO_NAME=${LIB_NAME}
  1470. TINFO_SUFFIX=${DFT_LIB_SUFFIX}
  1471. TINFO_ARG_SUFFIX=${LIB_NAME}${DFT_ARG_SUFFIX}
  1472. if test "$with_tic_depends" = yes ; then
  1473. TICS_LIST="$SHLIB_LIST -l${LIB_NAME}${DFT_ARG_SUFFIX}"
  1474. else
  1475. TICS_LIST="$SHLIB_LIST"
  1476. fi
  1477. TINFO_ARGS="-L${LIB_DIR} -l${LIB_NAME}${DFT_ARG_SUFFIX}"
  1478. fi
  1479. if test "$DFT_LWR_MODEL" = shared ; then
  1480. case $cf_cv_system_name in #(vi
  1481. cygwin*)
  1482. # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
  1483. TINFO_SUFFIX=.dll
  1484. ;;
  1485. esac
  1486. fi
  1487. AC_SUBST(TINFO_ARG_SUFFIX)
  1488. AC_SUBST(TINFO_DEP_SUFFIX)
  1489. AC_SUBST(TINFO_LIB_SUFFIX)
  1490. AC_SUBST(TINFO_ARGS)
  1491. if test "$with_dlsym" = yes ; then
  1492. CF_REMOVE_LIB(TICS_LIST,$TICS_LIST,dl)
  1493. fi
  1494. if test "$DFT_LWR_MODEL" = "libtool"; then
  1495. OBJEXT=lo
  1496. fi
  1497. # needed for Ada95
  1498. TINFO_ARGS2=`echo "$TINFO_ARGS" | sed -e 's,-L\.\./,-L../../,'`
  1499. AC_SUBST(TINFO_ARGS2)
  1500. case $DFT_LWR_MODEL in
  1501. normal|debug|profile)
  1502. CF_LDFLAGS_STATIC
  1503. ;;
  1504. esac
  1505. AC_MSG_CHECKING(where we will install curses.h)
  1506. test "$with_overwrite" = no && \
  1507. test "x$includedir" = 'x${prefix}/include' && \
  1508. includedir='${prefix}/include/ncurses'${LIB_SUFFIX}
  1509. AC_MSG_RESULT($includedir)
  1510. ### Resolve a conflict between normal and wide-curses by forcing applications
  1511. ### that will need libutf8 to add it to their configure script.
  1512. if test "$with_overwrite" != no ; then
  1513. if test "$NCURSES_LIBUTF8" = 1 ; then
  1514. NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)'
  1515. AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h)
  1516. fi
  1517. fi
  1518. AC_SUBST(WITH_OVERWRITE)
  1519. AC_SUBST(TICS_LIST)
  1520. AC_SUBST(TINFO_LIST)
  1521. AC_SUBST(SHLIB_LIST)
  1522. # used to separate tack out of the tree
  1523. NCURSES_TREE=
  1524. AC_SUBST(NCURSES_TREE)
  1525. ### predefined stuff for the test programs
  1526. AC_DEFINE(HAVE_SLK_COLOR)
  1527. ### Construct the list of subdirectories for which we'll customize makefiles
  1528. ### with the appropriate compile-rules.
  1529. CF_SRC_MODULES($modules_to_build)
  1530. if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then
  1531. SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config"
  1532. fi
  1533. CF_DIRS_TO_MAKE
  1534. AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
  1535. AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}")
  1536. ### Now that we're done running tests, add the compiler-warnings, if any
  1537. CF_ADD_CFLAGS($EXTRA_CFLAGS)
  1538. ### If we're building with rpath, try to link non-standard libs that way too.
  1539. if test "$DFT_LWR_MODEL" = "shared"; then
  1540. CF_RPATH_HACK
  1541. fi
  1542. ### Define substitutions for header files to avoid name-pollution
  1543. CF_SUBST_IF(["$cf_cv_have_tcgetattr" = yes], HAVE_TCGETATTR, 1, 0)
  1544. CF_SUBST_IF(["$ac_cv_header_termio_h" = yes], HAVE_TERMIO_H, 1, 0)
  1545. CF_SUBST_IF(["$ac_cv_header_termios_h" = yes], HAVE_TERMIOS_H, 1, 0)
  1546. ################################################################################
  1547. test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
  1548. SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in"
  1549. AC_OUTPUT( \
  1550. include/MKterm.h.awk \
  1551. include/curses.head:include/curses.h.in \
  1552. include/termcap.h \
  1553. include/unctrl.h \
  1554. $SUB_MAKEFILES \
  1555. Makefile,[
  1556. CF_PRG_RULES([$srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK"], test)
  1557. CF_LIB_RULES($SRC_SUBDIRS)
  1558. ],[
  1559. ### Special initialization commands, used to pass information from the
  1560. ### configuration-run into config.status
  1561. AWK="$AWK"
  1562. DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
  1563. DFT_LWR_MODEL="$DFT_LWR_MODEL"
  1564. ECHO_LINK="$ECHO_LINK"
  1565. LDCONFIG="$LDCONFIG"
  1566. LIB_NAME="$LIB_NAME"
  1567. LIB_SUBSETS="$LIB_SUBSETS"
  1568. LIB_SUFFIX="$LIB_SUFFIX"
  1569. LIB_TRACING="$LIB_TRACING"
  1570. MAKE_TERMINFO="$MAKE_TERMINFO"
  1571. NCURSES_MAJOR="$NCURSES_MAJOR"
  1572. NCURSES_MINOR="$NCURSES_MINOR"
  1573. NCURSES_OSPEED="$NCURSES_OSPEED"
  1574. NCURSES_PATCH="$NCURSES_PATCH"
  1575. SRC_SUBDIRS="$SRC_SUBDIRS"
  1576. TERMINFO="$TERMINFO"
  1577. TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX"
  1578. TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX"
  1579. TINFO_NAME="$TINFO_NAME"
  1580. TINFO_SUFFIX="$TINFO_SUFFIX"
  1581. TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX"
  1582. TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX"
  1583. TICS_NAME="$TICS_NAME"
  1584. WITH_CURSES_H="$with_curses_h"
  1585. WITH_ECHO="$with_echo"
  1586. WITH_OVERWRITE="$with_overwrite"
  1587. cf_LIST_MODELS="$cf_list_models"
  1588. cf_cv_abi_version="$cf_cv_abi_version"
  1589. cf_cv_do_relink="$cf_cv_do_relink"
  1590. cf_cv_do_symlinks="$cf_cv_do_symlinks"
  1591. cf_cv_enable_lp64="$cf_cv_enable_lp64"
  1592. cf_cv_enable_opaque="$cf_cv_enable_opaque"
  1593. cf_cv_prog_CC_c_o=$cf_cv_prog_CC_c_o
  1594. cf_cv_prog_CXX_c_o=$cf_cv_prog_CXX_c_o
  1595. cf_cv_rel_version="$cf_cv_rel_version"
  1596. cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
  1597. cf_cv_shared_soname='$cf_cv_shared_soname'
  1598. cf_cv_shlib_version="$cf_cv_shlib_version"
  1599. cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
  1600. cf_cv_system_name="$cf_cv_system_name"
  1601. cf_with_cxx_binding="$cf_with_cxx_binding"
  1602. cf_with_manpages="$cf_with_manpages"
  1603. host="$host"
  1604. target="$target"
  1605. ],cat)dnl
  1606. ${MAKE-make} preinstall