/src/configure.in

https://bitbucket.org/ultra_iter/vim-qt · Autoconf · 3806 lines · 2900 code · 341 blank · 565 comment · 519 complexity · 3055817faa3ce25a05873cf8685f5136 MD5 · raw file

Large files are truncated click here to view the full file

  1. dnl configure.in: autoconf script for Vim
  2. dnl Process this file with autoconf 2.12 or 2.13 to produce "configure".
  3. dnl Should also work with autoconf 2.54 and later.
  4. AC_INIT(vim.h)
  5. AC_CONFIG_HEADER(auto/config.h:config.h.in)
  6. dnl Being able to run configure means the system is Unix (compatible).
  7. AC_DEFINE(UNIX)
  8. AC_PROG_MAKE_SET
  9. dnl Checks for programs.
  10. AC_PROG_CC dnl required by almost everything
  11. AC_PROG_CPP dnl required by header file checks
  12. AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
  13. AC_ISC_POSIX dnl required by AC_C_CROSS
  14. AC_PROG_AWK dnl required for "make html" in ../doc
  15. dnl Don't strip if we don't have it
  16. AC_CHECK_PROG(STRIP, strip, strip, :)
  17. dnl Check for extension of executables
  18. AC_EXEEXT
  19. dnl Check for standard headers. We don't use this in Vim but other stuff
  20. dnl in autoconf needs it, where it uses STDC_HEADERS.
  21. AC_HEADER_STDC
  22. AC_HEADER_SYS_WAIT
  23. dnl Check for the flag that fails if stuff are missing.
  24. AC_MSG_CHECKING(--enable-fail-if-missing argument)
  25. AC_ARG_ENABLE(fail_if_missing,
  26. [ --enable-fail-if-missing Fail if dependencies on additional features
  27. specified on the command line are missing.],
  28. [fail_if_missing="yes"],
  29. [fail_if_missing="no"])
  30. AC_MSG_RESULT($fail_if_missing)
  31. dnl Set default value for CFLAGS if none is defined or it's empty
  32. if test -z "$CFLAGS"; then
  33. CFLAGS="-O"
  34. test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
  35. fi
  36. if test "$GCC" = yes; then
  37. dnl method that should work for nearly all versions
  38. gccversion=`"$CC" -dumpversion`
  39. if test "x$gccversion" = "x"; then
  40. dnl old method; fall-back for when -dumpversion doesn't work
  41. gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
  42. fi
  43. dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki
  44. if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
  45. echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
  46. CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
  47. else
  48. if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
  49. echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
  50. CFLAGS="$CFLAGS -fno-strength-reduce"
  51. fi
  52. fi
  53. fi
  54. dnl If configure thinks we are cross compiling, there might be something
  55. dnl wrong with the CC or CFLAGS settings, give a useful warning message
  56. if test "$cross_compiling" = yes; then
  57. AC_MSG_RESULT([cannot compile a simple program; if not cross compiling check CC and CFLAGS])
  58. fi
  59. dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies.
  60. dnl But gcc 3.1 changed the meaning! See near the end.
  61. test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
  62. if test -f ./toolcheck; then
  63. AC_CHECKING(for buggy tools)
  64. sh ./toolcheck 1>&AC_FD_MSG
  65. fi
  66. OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
  67. dnl Check for BeOS, which needs an extra source file
  68. AC_MSG_CHECKING(for BeOS)
  69. case `uname` in
  70. BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o
  71. BEOS=yes; AC_MSG_RESULT(yes);;
  72. *) BEOS=no; AC_MSG_RESULT(no);;
  73. esac
  74. dnl If QNX is found, assume we don't want to use Xphoton
  75. dnl unless it was specifically asked for (--with-x)
  76. AC_MSG_CHECKING(for QNX)
  77. case `uname` in
  78. QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
  79. test -z "$with_x" && with_x=no
  80. QNX=yes; AC_MSG_RESULT(yes);;
  81. *) QNX=no; AC_MSG_RESULT(no);;
  82. esac
  83. dnl Check for Darwin and MacOS X
  84. dnl We do a check for MacOS X in the very beginning because there
  85. dnl are a lot of other things we need to change besides GUI stuff
  86. AC_MSG_CHECKING([for Darwin (Mac OS X)])
  87. if test "`(uname) 2>/dev/null`" = Darwin; then
  88. AC_MSG_RESULT(yes)
  89. AC_MSG_CHECKING(--disable-darwin argument)
  90. AC_ARG_ENABLE(darwin,
  91. [ --disable-darwin Disable Darwin (Mac OS X) support.],
  92. , [enable_darwin="yes"])
  93. if test "$enable_darwin" = "yes"; then
  94. AC_MSG_RESULT(no)
  95. AC_MSG_CHECKING(if Darwin files are there)
  96. if test -f os_macosx.m; then
  97. AC_MSG_RESULT(yes)
  98. else
  99. AC_MSG_RESULT([no, Darwin support disabled])
  100. enable_darwin=no
  101. fi
  102. else
  103. AC_MSG_RESULT([yes, Darwin support excluded])
  104. fi
  105. AC_MSG_CHECKING(--with-mac-arch argument)
  106. AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both],
  107. MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
  108. MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
  109. AC_MSG_CHECKING(--with-developer-dir argument)
  110. AC_ARG_WITH(developer-dir, [ --with-developer-dir=PATH use PATH as location for Xcode developer tools],
  111. DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR),
  112. DEVELOPER_DIR=""; AC_MSG_RESULT(not present))
  113. if test "x$DEVELOPER_DIR" = "x"; then
  114. AC_PATH_PROG(XCODE_SELECT, xcode-select)
  115. if test "x$XCODE_SELECT" != "x"; then
  116. AC_MSG_CHECKING(for developer dir using xcode-select)
  117. DEVELOPER_DIR=`$XCODE_SELECT -print-path`
  118. AC_MSG_RESULT([$DEVELOPER_DIR])
  119. else
  120. DEVELOPER_DIR=/Developer
  121. fi
  122. fi
  123. if test "x$MACARCH" = "xboth"; then
  124. AC_MSG_CHECKING(for 10.4 universal SDK)
  125. dnl There is a terrible inconsistency (but we appear to get away with it):
  126. dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
  127. dnl doesn't, because "gcc -E" doesn't grok it. That means the configure
  128. dnl tests using the preprocessor are actually done with the wrong header
  129. dnl files. $LDFLAGS is set at the end, because configure uses it together
  130. dnl with $CFLAGS and we can only have one -sysroot argument.
  131. save_cppflags="$CPPFLAGS"
  132. save_cflags="$CFLAGS"
  133. save_ldflags="$LDFLAGS"
  134. CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
  135. AC_TRY_LINK([ ], [ ],
  136. AC_MSG_RESULT(found, will make universal binary),
  137. AC_MSG_RESULT(not found)
  138. CFLAGS="$save_cflags"
  139. AC_MSG_CHECKING(if Intel architecture is supported)
  140. CPPFLAGS="$CPPFLAGS -arch i386"
  141. LDFLAGS="$save_ldflags -arch i386"
  142. AC_TRY_LINK([ ], [ ],
  143. AC_MSG_RESULT(yes); MACARCH="intel",
  144. AC_MSG_RESULT(no, using PowerPC)
  145. MACARCH="ppc"
  146. CPPFLAGS="$save_cppflags -arch ppc"
  147. LDFLAGS="$save_ldflags -arch ppc"))
  148. elif test "x$MACARCH" = "xintel"; then
  149. CPPFLAGS="$CPPFLAGS -arch intel"
  150. LDFLAGS="$LDFLAGS -arch intel"
  151. elif test "x$MACARCH" = "xppc"; then
  152. CPPFLAGS="$CPPFLAGS -arch ppc"
  153. LDFLAGS="$LDFLAGS -arch ppc"
  154. fi
  155. if test "$enable_darwin" = "yes"; then
  156. MACOSX=yes
  157. OS_EXTRA_SRC="os_macosx.m os_mac_conv.c";
  158. OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
  159. dnl TODO: use -arch i386 on Intel machines
  160. CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
  161. dnl If Carbon is found, assume we don't want X11
  162. dnl unless it was specifically asked for (--with-x)
  163. dnl or Motif, Athena or GTK GUI is used.
  164. AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
  165. if test "x$CARBON" = "xyes"; then
  166. if test -z "$with_x" -a "X$enable_gui" != Xmotif -a "X$enable_gui" != Xathena -a "X$enable_gui" != Xgtk2; then
  167. with_x=no
  168. fi
  169. fi
  170. fi
  171. dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double
  172. dnl free. This happens in expand_filename(), because the optimizer swaps
  173. dnl two blocks of code, both using "repl", that can't be swapped.
  174. if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
  175. CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
  176. fi
  177. else
  178. AC_MSG_RESULT(no)
  179. fi
  180. AC_SUBST(OS_EXTRA_SRC)
  181. AC_SUBST(OS_EXTRA_OBJ)
  182. dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
  183. dnl Only when the directory exists and it wasn't there yet.
  184. dnl For gcc don't do this when it is already in the default search path.
  185. dnl Skip all of this when cross-compiling.
  186. if test "$cross_compiling" = no; then
  187. AC_MSG_CHECKING(--with-local-dir argument)
  188. have_local_include=''
  189. have_local_lib=''
  190. AC_ARG_WITH([local-dir], [ --with-local-dir=PATH search PATH instead of /usr/local for local libraries.
  191. --without-local-dir do not search /usr/local for local libraries.], [
  192. local_dir="$withval"
  193. case "$withval" in
  194. */*) ;;
  195. no)
  196. # avoid adding local dir to LDFLAGS and CPPFLAGS
  197. have_local_include=yes
  198. have_local_lib=yes
  199. ;;
  200. *) AC_MSG_ERROR(must pass path argument to --with-local-dir) ;;
  201. esac
  202. AC_MSG_RESULT($local_dir)
  203. ], [
  204. local_dir=/usr/local
  205. AC_MSG_RESULT(Defaulting to $local_dir)
  206. ])
  207. if test "$GCC" = yes -a "$local_dir" != no; then
  208. echo 'void f(){}' > conftest.c
  209. dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler)
  210. have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep "${local_dir}/include"`
  211. have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep "${local_dir}/lib"`
  212. rm -f conftest.c conftest.o
  213. fi
  214. if test -z "$have_local_lib" -a -d "${local_dir}/lib"; then
  215. tt=`echo "$LDFLAGS" | sed -e "s+-L${local_dir}/lib ++g" -e "s+-L${local_dir}/lib$++g"`
  216. if test "$tt" = "$LDFLAGS"; then
  217. LDFLAGS="$LDFLAGS -L${local_dir}/lib"
  218. fi
  219. fi
  220. if test -z "$have_local_include" -a -d "${local_dir}/include"; then
  221. tt=`echo "$CPPFLAGS" | sed -e "s+-I${local_dir}/include ++g" -e "s+-I${local_dir}/include$++g"`
  222. if test "$tt" = "$CPPFLAGS"; then
  223. CPPFLAGS="$CPPFLAGS -I${local_dir}/include"
  224. fi
  225. fi
  226. fi
  227. AC_MSG_CHECKING(--with-vim-name argument)
  228. AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable],
  229. VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME),
  230. VIMNAME="vim"; AC_MSG_RESULT(Defaulting to $VIMNAME))
  231. AC_SUBST(VIMNAME)
  232. AC_MSG_CHECKING(--with-ex-name argument)
  233. AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable],
  234. EXNAME="$withval"; AC_MSG_RESULT($EXNAME),
  235. EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex))
  236. AC_SUBST(EXNAME)
  237. AC_MSG_CHECKING(--with-view-name argument)
  238. AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable],
  239. VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME),
  240. VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view))
  241. AC_SUBST(VIEWNAME)
  242. AC_MSG_CHECKING(--with-global-runtime argument)
  243. AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'],
  244. AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
  245. AC_MSG_RESULT(no))
  246. AC_MSG_CHECKING(--with-modified-by argument)
  247. AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
  248. AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
  249. AC_MSG_RESULT(no))
  250. dnl Check for EBCDIC stolen from the LYNX port to z/OS Unix
  251. AC_MSG_CHECKING(if character set is EBCDIC)
  252. AC_TRY_COMPILE([ ],
  253. [ /* TryCompile function for CharSet.
  254. Treat any failure as ASCII for compatibility with existing art.
  255. Use compile-time rather than run-time tests for cross-compiler
  256. tolerance. */
  257. #if '0'!=240
  258. make an error "Character set is not EBCDIC"
  259. #endif ],
  260. [ # TryCompile action if true
  261. cf_cv_ebcdic=yes ],
  262. [ # TryCompile action if false
  263. cf_cv_ebcdic=no])
  264. # end of TryCompile ])
  265. # end of CacheVal CvEbcdic
  266. AC_MSG_RESULT($cf_cv_ebcdic)
  267. case "$cf_cv_ebcdic" in #(vi
  268. yes) AC_DEFINE(EBCDIC)
  269. line_break='"\\n"'
  270. ;;
  271. *) line_break='"\\012"';;
  272. esac
  273. AC_SUBST(line_break)
  274. if test "$cf_cv_ebcdic" = "yes"; then
  275. dnl If we have EBCDIC we most likley have z/OS Unix, let's test it!
  276. AC_MSG_CHECKING(for z/OS Unix)
  277. case `uname` in
  278. OS/390) zOSUnix="yes";
  279. dnl If using cc the environment variable _CC_CCMODE must be
  280. dnl set to "1", so that some compiler extensions are enabled.
  281. dnl If using c89 the environment variable is named _CC_C89MODE.
  282. dnl Note: compile with c89 never tested.
  283. if test "$CC" = "cc"; then
  284. ccm="$_CC_CCMODE"
  285. ccn="CC"
  286. else
  287. if test "$CC" = "c89"; then
  288. ccm="$_CC_C89MODE"
  289. ccn="C89"
  290. else
  291. ccm=1
  292. fi
  293. fi
  294. if test "$ccm" != "1"; then
  295. echo ""
  296. echo "------------------------------------------"
  297. echo " On z/OS Unix, the environment variable"
  298. echo " __CC_${ccn}MODE must be set to \"1\"!"
  299. echo " Do:"
  300. echo " export _CC_${ccn}MODE=1"
  301. echo " and then call configure again."
  302. echo "------------------------------------------"
  303. exit 1
  304. fi
  305. CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float\\(IEEE\\)";
  306. LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
  307. AC_MSG_RESULT(yes)
  308. ;;
  309. *) zOSUnix="no";
  310. AC_MSG_RESULT(no)
  311. ;;
  312. esac
  313. fi
  314. dnl Set QUOTESED. Needs additional backslashes on zOS
  315. if test "$zOSUnix" = "yes"; then
  316. QUOTESED="sed -e 's/[[\\\\\"]]/\\\\\\\\&/g' -e 's/\\\\\\\\\"/\"/' -e 's/\\\\\\\\\";\$\$/\";/'"
  317. else
  318. QUOTESED="sed -e 's/[[\\\\\"]]/\\\\&/g' -e 's/\\\\\"/\"/' -e 's/\\\\\";\$\$/\";/'"
  319. fi
  320. AC_SUBST(QUOTESED)
  321. dnl Link with -lselinux for SELinux stuff; if not found
  322. AC_MSG_CHECKING(--disable-selinux argument)
  323. AC_ARG_ENABLE(selinux,
  324. [ --disable-selinux Don't check for SELinux support.],
  325. , enable_selinux="yes")
  326. if test "$enable_selinux" = "yes"; then
  327. AC_MSG_RESULT(no)
  328. AC_CHECK_LIB(selinux, is_selinux_enabled,
  329. [LIBS="$LIBS -lselinux"
  330. AC_DEFINE(HAVE_SELINUX)])
  331. else
  332. AC_MSG_RESULT(yes)
  333. fi
  334. dnl Check user requested features.
  335. AC_MSG_CHECKING(--with-features argument)
  336. AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: normal)],
  337. features="$withval"; AC_MSG_RESULT($features),
  338. features="normal"; AC_MSG_RESULT(Defaulting to normal))
  339. dovimdiff=""
  340. dogvimdiff=""
  341. case "$features" in
  342. tiny) AC_DEFINE(FEAT_TINY) ;;
  343. small) AC_DEFINE(FEAT_SMALL) ;;
  344. normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
  345. dogvimdiff="installgvimdiff" ;;
  346. big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff";
  347. dogvimdiff="installgvimdiff" ;;
  348. huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff";
  349. dogvimdiff="installgvimdiff" ;;
  350. *) AC_MSG_RESULT([Sorry, $features is not supported]) ;;
  351. esac
  352. AC_SUBST(dovimdiff)
  353. AC_SUBST(dogvimdiff)
  354. AC_MSG_CHECKING(--with-compiledby argument)
  355. AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message],
  356. compiledby="$withval"; AC_MSG_RESULT($withval),
  357. compiledby=""; AC_MSG_RESULT(no))
  358. AC_SUBST(compiledby)
  359. AC_MSG_CHECKING(--disable-xsmp argument)
  360. AC_ARG_ENABLE(xsmp,
  361. [ --disable-xsmp Disable XSMP session management],
  362. , enable_xsmp="yes")
  363. if test "$enable_xsmp" = "yes"; then
  364. AC_MSG_RESULT(no)
  365. AC_MSG_CHECKING(--disable-xsmp-interact argument)
  366. AC_ARG_ENABLE(xsmp-interact,
  367. [ --disable-xsmp-interact Disable XSMP interaction],
  368. , enable_xsmp_interact="yes")
  369. if test "$enable_xsmp_interact" = "yes"; then
  370. AC_MSG_RESULT(no)
  371. AC_DEFINE(USE_XSMP_INTERACT)
  372. else
  373. AC_MSG_RESULT(yes)
  374. fi
  375. else
  376. AC_MSG_RESULT(yes)
  377. fi
  378. dnl Check for Lua feature.
  379. AC_MSG_CHECKING(--enable-luainterp argument)
  380. AC_ARG_ENABLE(luainterp,
  381. [ --enable-luainterp[=OPTS] Include Lua interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
  382. [enable_luainterp="no"])
  383. AC_MSG_RESULT($enable_luainterp)
  384. if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
  385. dnl -- find the lua executable
  386. AC_SUBST(vi_cv_path_lua)
  387. AC_MSG_CHECKING(--with-lua-prefix argument)
  388. AC_ARG_WITH(lua_prefix,
  389. [ --with-lua-prefix=PFX Prefix where Lua is installed.],
  390. with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix),
  391. with_lua_prefix="";AC_MSG_RESULT(no))
  392. if test "X$with_lua_prefix" != "X"; then
  393. vi_cv_path_lua_pfx="$with_lua_prefix"
  394. else
  395. AC_MSG_CHECKING(LUA_PREFIX environment var)
  396. if test "X$LUA_PREFIX" != "X"; then
  397. AC_MSG_RESULT("$LUA_PREFIX")
  398. vi_cv_path_lua_pfx="$LUA_PREFIX"
  399. else
  400. AC_MSG_RESULT([not set, default to /usr])
  401. vi_cv_path_lua_pfx="/usr"
  402. fi
  403. fi
  404. LUA_INC=
  405. if test "X$vi_cv_path_lua_pfx" != "X"; then
  406. AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
  407. if test -f $vi_cv_path_lua_pfx/include/lua.h; then
  408. AC_MSG_RESULT(yes)
  409. else
  410. AC_MSG_RESULT(no)
  411. dnl -- try to find Lua executable
  412. AC_PATH_PROG(vi_cv_path_lua, lua)
  413. if test "X$vi_cv_path_lua" != "X"; then
  414. dnl -- find Lua version
  415. AC_CACHE_CHECK(Lua version, vi_cv_version_lua,
  416. [ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
  417. AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
  418. if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
  419. AC_MSG_RESULT(yes)
  420. LUA_INC=/lua$vi_cv_version_lua
  421. else
  422. AC_MSG_RESULT(no)
  423. vi_cv_path_lua_pfx=
  424. fi
  425. fi
  426. fi
  427. fi
  428. if test "X$vi_cv_path_lua_pfx" != "X"; then
  429. if test "X$vi_cv_version_lua" != "X"; then
  430. dnl Test alternate location using version
  431. LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua"
  432. else
  433. LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua"
  434. fi
  435. LUA_CFLAGS="-I${vi_cv_path_lua_pfx}/include${LUA_INC}"
  436. LUA_SRC="if_lua.c"
  437. LUA_OBJ="objects/if_lua.o"
  438. LUA_PRO="if_lua.pro"
  439. AC_DEFINE(FEAT_LUA)
  440. if test "$enable_luainterp" = "dynamic"; then
  441. dnl Determine the SONAME for the current version, but fallback to
  442. dnl liblua${vi_cv_version_lua}.so if no SONAME-versioned file is found.
  443. for i in 0 1 2 3 4 5 6 7 8 9; do
  444. if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
  445. LUA_SONAME=".$i"
  446. break
  447. fi
  448. done
  449. AC_DEFINE(DYNAMIC_LUA)
  450. LUA_LIBS=""
  451. LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS"
  452. fi
  453. fi
  454. if test "$fail_if_missing" = "yes" -a -z "$LUA_SRC"; then
  455. AC_MSG_ERROR([could not configure lua])
  456. fi
  457. AC_SUBST(LUA_SRC)
  458. AC_SUBST(LUA_OBJ)
  459. AC_SUBST(LUA_PRO)
  460. AC_SUBST(LUA_LIBS)
  461. AC_SUBST(LUA_CFLAGS)
  462. fi
  463. dnl Check for MzScheme feature.
  464. AC_MSG_CHECKING(--enable-mzschemeinterp argument)
  465. AC_ARG_ENABLE(mzschemeinterp,
  466. [ --enable-mzschemeinterp Include MzScheme interpreter.], ,
  467. [enable_mzschemeinterp="no"])
  468. AC_MSG_RESULT($enable_mzschemeinterp)
  469. if test "$enable_mzschemeinterp" = "yes"; then
  470. dnl -- find the mzscheme executable
  471. AC_SUBST(vi_cv_path_mzscheme)
  472. AC_MSG_CHECKING(--with-plthome argument)
  473. AC_ARG_WITH(plthome,
  474. [ --with-plthome=PLTHOME Use PLTHOME.],
  475. with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
  476. with_plthome="";AC_MSG_RESULT("no"))
  477. if test "X$with_plthome" != "X"; then
  478. vi_cv_path_mzscheme_pfx="$with_plthome"
  479. else
  480. AC_MSG_CHECKING(PLTHOME environment var)
  481. if test "X$PLTHOME" != "X"; then
  482. AC_MSG_RESULT("$PLTHOME")
  483. vi_cv_path_mzscheme_pfx="$PLTHOME"
  484. else
  485. AC_MSG_RESULT(not set)
  486. dnl -- try to find MzScheme executable
  487. AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
  488. dnl resolve symbolic link, the executable is often elsewhere and there
  489. dnl are no links for the include files.
  490. if test "X$vi_cv_path_mzscheme" != "X"; then
  491. lsout=`ls -l $vi_cv_path_mzscheme`
  492. if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
  493. vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
  494. fi
  495. fi
  496. if test "X$vi_cv_path_mzscheme" != "X"; then
  497. dnl -- find where MzScheme thinks it was installed
  498. AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
  499. dnl different versions of MzScheme differ in command line processing
  500. dnl use universal approach
  501. echo "(display (simplify-path \
  502. (build-path (call-with-values \
  503. (lambda () (split-path (find-system-path (quote exec-file)))) \
  504. (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm
  505. dnl Remove a trailing slash
  506. [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \
  507. sed -e 's+/$++'` ])
  508. rm -f mzdirs.scm
  509. fi
  510. fi
  511. fi
  512. SCHEME_INC=
  513. if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
  514. AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
  515. if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
  516. SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
  517. AC_MSG_RESULT(yes)
  518. else
  519. AC_MSG_RESULT(no)
  520. AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
  521. if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
  522. AC_MSG_RESULT(yes)
  523. SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
  524. else
  525. AC_MSG_RESULT(no)
  526. AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/racket)
  527. if test -f $vi_cv_path_mzscheme_pfx/include/racket/scheme.h; then
  528. AC_MSG_RESULT(yes)
  529. SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/racket
  530. else
  531. AC_MSG_RESULT(no)
  532. AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
  533. if test -f /usr/include/plt/scheme.h; then
  534. AC_MSG_RESULT(yes)
  535. SCHEME_INC=/usr/include/plt
  536. else
  537. AC_MSG_RESULT(no)
  538. AC_MSG_CHECKING(if scheme.h can be found in /usr/include/racket/)
  539. if test -f /usr/include/racket/scheme.h; then
  540. AC_MSG_RESULT(yes)
  541. SCHEME_INC=/usr/include/racket
  542. else
  543. AC_MSG_RESULT(no)
  544. vi_cv_path_mzscheme_pfx=
  545. fi
  546. fi
  547. fi
  548. fi
  549. fi
  550. fi
  551. if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
  552. if test "x$MACOSX" = "xyes"; then
  553. MZSCHEME_LIBS="-framework PLT_MzScheme"
  554. elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
  555. MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"
  556. MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
  557. elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then
  558. MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"
  559. MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
  560. elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.a"; then
  561. MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libracket.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
  562. elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a"; then
  563. MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
  564. else
  565. dnl Using shared objects
  566. if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then
  567. MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m"
  568. MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
  569. elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.so"; then
  570. MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket3m"
  571. MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
  572. elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket.so"; then
  573. MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lracket -lmzgc"
  574. else
  575. MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
  576. fi
  577. if test "$GCC" = yes; then
  578. dnl Make Vim remember the path to the library. For when it's not in
  579. dnl $LD_LIBRARY_PATH.
  580. MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
  581. elif test "`(uname) 2>/dev/null`" = SunOS &&
  582. uname -r | grep '^5' >/dev/null; then
  583. MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib"
  584. fi
  585. fi
  586. if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
  587. SCHEME_COLLECTS=lib/plt/
  588. else
  589. if test -d $vi_cv_path_mzscheme_pfx/lib/racket/collects; then
  590. SCHEME_COLLECTS=lib/racket/
  591. fi
  592. fi
  593. if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then
  594. MZSCHEME_EXTRA="mzscheme_base.c"
  595. else
  596. if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.rkt" ; then
  597. MZSCHEME_EXTRA="mzscheme_base.c"
  598. fi
  599. fi
  600. if test "X$MZSCHEME_EXTRA" != "X" ; then
  601. dnl need to generate bytecode for MzScheme base
  602. MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
  603. MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
  604. fi
  605. MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
  606. -DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'"
  607. MZSCHEME_SRC="if_mzsch.c"
  608. MZSCHEME_OBJ="objects/if_mzsch.o"
  609. MZSCHEME_PRO="if_mzsch.pro"
  610. AC_DEFINE(FEAT_MZSCHEME)
  611. fi
  612. AC_SUBST(MZSCHEME_SRC)
  613. AC_SUBST(MZSCHEME_OBJ)
  614. AC_SUBST(MZSCHEME_PRO)
  615. AC_SUBST(MZSCHEME_LIBS)
  616. AC_SUBST(MZSCHEME_CFLAGS)
  617. AC_SUBST(MZSCHEME_EXTRA)
  618. AC_SUBST(MZSCHEME_MZC)
  619. fi
  620. AC_MSG_CHECKING(--enable-perlinterp argument)
  621. AC_ARG_ENABLE(perlinterp,
  622. [ --enable-perlinterp[=OPTS] Include Perl interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
  623. [enable_perlinterp="no"])
  624. AC_MSG_RESULT($enable_perlinterp)
  625. if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
  626. AC_SUBST(vi_cv_path_perl)
  627. AC_PATH_PROG(vi_cv_path_perl, perl)
  628. if test "X$vi_cv_path_perl" != "X"; then
  629. AC_MSG_CHECKING(Perl version)
  630. if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then
  631. eval `$vi_cv_path_perl -V:usethreads`
  632. eval `$vi_cv_path_perl -V:libperl`
  633. if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then
  634. badthreads=no
  635. else
  636. if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then
  637. eval `$vi_cv_path_perl -V:use5005threads`
  638. if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then
  639. badthreads=no
  640. else
  641. badthreads=yes
  642. AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<)
  643. fi
  644. else
  645. badthreads=yes
  646. AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<)
  647. fi
  648. fi
  649. if test $badthreads = no; then
  650. AC_MSG_RESULT(OK)
  651. eval `$vi_cv_path_perl -V:shrpenv`
  652. if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04
  653. shrpenv=""
  654. fi
  655. vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
  656. AC_SUBST(vi_cv_perllib)
  657. dnl Remove "-fno-something", it breaks using cproto.
  658. perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
  659. -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`
  660. dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
  661. perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
  662. sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
  663. -e 's/-bE:perl.exp//' -e 's/-lc //'`
  664. dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH
  665. dnl a test in configure may fail because of that.
  666. perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
  667. -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
  668. dnl check that compiling a simple program still works with the flags
  669. dnl added for Perl.
  670. AC_MSG_CHECKING([if compile and link flags for Perl are sane])
  671. cflags_save=$CFLAGS
  672. libs_save=$LIBS
  673. ldflags_save=$LDFLAGS
  674. CFLAGS="$CFLAGS $perlcppflags"
  675. LIBS="$LIBS $perllibs"
  676. LDFLAGS="$perlldflags $LDFLAGS"
  677. AC_TRY_LINK(,[ ],
  678. AC_MSG_RESULT(yes); perl_ok=yes,
  679. AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no)
  680. CFLAGS=$cflags_save
  681. LIBS=$libs_save
  682. LDFLAGS=$ldflags_save
  683. if test $perl_ok = yes; then
  684. if test "X$perlcppflags" != "X"; then
  685. dnl remove -pipe and -Wxxx, it confuses cproto
  686. PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'`
  687. fi
  688. if test "X$perlldflags" != "X"; then
  689. LDFLAGS="$perlldflags $LDFLAGS"
  690. fi
  691. PERL_LIBS=$perllibs
  692. PERL_SRC="auto/if_perl.c if_perlsfio.c"
  693. PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
  694. PERL_PRO="if_perl.pro if_perlsfio.pro"
  695. AC_DEFINE(FEAT_PERL)
  696. fi
  697. fi
  698. else
  699. AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<)
  700. fi
  701. fi
  702. if test "x$MACOSX" = "xyes"; then
  703. dnl Mac OS X 10.2 or later
  704. dir=/System/Library/Perl
  705. darwindir=$dir/darwin
  706. if test -d $darwindir; then
  707. PERL=/usr/bin/perl
  708. else
  709. dnl Mac OS X 10.3
  710. dir=/System/Library/Perl/5.8.1
  711. darwindir=$dir/darwin-thread-multi-2level
  712. if test -d $darwindir; then
  713. PERL=/usr/bin/perl
  714. fi
  715. fi
  716. if test -n "$PERL"; then
  717. PERL_DIR="$dir"
  718. PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
  719. PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
  720. PERL_LIBS="-L$darwindir/CORE -lperl"
  721. fi
  722. dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only
  723. dnl be included if requested by passing --with-mac-arch to
  724. dnl configure, so strip these flags first (if present)
  725. PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
  726. PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
  727. fi
  728. if test "$enable_perlinterp" = "dynamic"; then
  729. if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then
  730. AC_DEFINE(DYNAMIC_PERL)
  731. PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS"
  732. fi
  733. fi
  734. if test "$fail_if_missing" = "yes" -a "$perl_ok" != "yes"; then
  735. AC_MSG_ERROR([could not configure perl])
  736. fi
  737. fi
  738. AC_SUBST(shrpenv)
  739. AC_SUBST(PERL_SRC)
  740. AC_SUBST(PERL_OBJ)
  741. AC_SUBST(PERL_PRO)
  742. AC_SUBST(PERL_CFLAGS)
  743. AC_SUBST(PERL_LIBS)
  744. AC_MSG_CHECKING(--enable-pythoninterp argument)
  745. AC_ARG_ENABLE(pythoninterp,
  746. [ --enable-pythoninterp[=OPTS] Include Python interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
  747. [enable_pythoninterp="no"])
  748. AC_MSG_RESULT($enable_pythoninterp)
  749. if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
  750. dnl -- find the python executable
  751. AC_PATH_PROG(vi_cv_path_python, python)
  752. if test "X$vi_cv_path_python" != "X"; then
  753. dnl -- get its version number
  754. AC_CACHE_CHECK(Python version,vi_cv_var_python_version,
  755. [[vi_cv_var_python_version=`
  756. ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
  757. ]])
  758. dnl -- it must be at least version 1.4
  759. AC_MSG_CHECKING(Python is 1.4 or better)
  760. if ${vi_cv_path_python} -c \
  761. "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
  762. then
  763. AC_MSG_RESULT(yep)
  764. dnl -- find where python thinks it was installed
  765. AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx,
  766. [ vi_cv_path_python_pfx=`
  767. ${vi_cv_path_python} -c \
  768. "import sys; print sys.prefix"` ])
  769. dnl -- and where it thinks it runs
  770. AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx,
  771. [ vi_cv_path_python_epfx=`
  772. ${vi_cv_path_python} -c \
  773. "import sys; print sys.exec_prefix"` ])
  774. dnl -- python's internal library path
  775. AC_CACHE_VAL(vi_cv_path_pythonpath,
  776. [ vi_cv_path_pythonpath=`
  777. unset PYTHONPATH;
  778. ${vi_cv_path_python} -c \
  779. "import sys, string; print string.join(sys.path,':')"` ])
  780. dnl -- where the Python implementation library archives are
  781. AC_ARG_WITH(python-config-dir,
  782. [ --with-python-config-dir=PATH Python's config directory],
  783. [ vi_cv_path_python_conf="${withval}" ] )
  784. AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
  785. [
  786. vi_cv_path_python_conf=
  787. for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
  788. for subdir in lib64 lib share; do
  789. d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
  790. if test -d "$d" && test -f "$d/config.c"; then
  791. vi_cv_path_python_conf="$d"
  792. fi
  793. done
  794. done
  795. ])
  796. PYTHON_CONFDIR="${vi_cv_path_python_conf}"
  797. if test "X$PYTHON_CONFDIR" = "X"; then
  798. AC_MSG_RESULT([can't find it!])
  799. else
  800. dnl -- we need to examine Python's config/Makefile too
  801. dnl see what the interpreter is built from
  802. AC_CACHE_VAL(vi_cv_path_python_plibs,
  803. [
  804. pwd=`pwd`
  805. tmp_mkf="$pwd/config-PyMake$$"
  806. cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
  807. __:
  808. @echo "python_BASEMODLIBS='$(BASEMODLIBS)'"
  809. @echo "python_LIBS='$(LIBS)'"
  810. @echo "python_SYSLIBS='$(SYSLIBS)'"
  811. @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
  812. @echo "python_INSTSONAME='$(INSTSONAME)'"
  813. eof
  814. dnl -- delete the lines from make about Entering/Leaving directory
  815. eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
  816. rm -f -- "${tmp_mkf}"
  817. if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
  818. "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
  819. vi_cv_path_python_plibs="-framework Python"
  820. else
  821. if test "${vi_cv_var_python_version}" = "1.4"; then
  822. vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
  823. else
  824. vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
  825. fi
  826. vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
  827. dnl remove -ltermcap, it can conflict with an earlier -lncurses
  828. vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
  829. fi
  830. ])
  831. PYTHON_LIBS="${vi_cv_path_python_plibs}"
  832. if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
  833. PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
  834. else
  835. PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
  836. fi
  837. PYTHON_SRC="if_python.c"
  838. dnl For Mac OSX 10.2 config.o is included in the Python library.
  839. if test "x$MACOSX" = "xyes"; then
  840. PYTHON_OBJ="objects/if_python.o"
  841. else
  842. PYTHON_OBJ="objects/if_python.o objects/py_config.o"
  843. fi
  844. if test "${vi_cv_var_python_version}" = "1.4"; then
  845. PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
  846. fi
  847. PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
  848. dnl On FreeBSD linking with "-pthread" is required to use threads.
  849. dnl _THREAD_SAFE must be used for compiling then.
  850. dnl The "-pthread" is added to $LIBS, so that the following check for
  851. dnl sigaltstack() will look in libc_r (it's there in libc!).
  852. dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
  853. dnl will then define target-specific defines, e.g., -D_REENTRANT.
  854. dnl Don't do this for Mac OSX, -pthread will generate a warning.
  855. AC_MSG_CHECKING([if -pthread should be used])
  856. threadsafe_flag=
  857. thread_lib=
  858. dnl if test "x$MACOSX" != "xyes"; then
  859. if test "`(uname) 2>/dev/null`" != Darwin; then
  860. test "$GCC" = yes && threadsafe_flag="-pthread"
  861. if test "`(uname) 2>/dev/null`" = FreeBSD; then
  862. threadsafe_flag="-D_THREAD_SAFE"
  863. thread_lib="-pthread"
  864. fi
  865. fi
  866. libs_save_old=$LIBS
  867. if test -n "$threadsafe_flag"; then
  868. cflags_save=$CFLAGS
  869. CFLAGS="$CFLAGS $threadsafe_flag"
  870. LIBS="$LIBS $thread_lib"
  871. AC_TRY_LINK(,[ ],
  872. AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag",
  873. AC_MSG_RESULT(no); LIBS=$libs_save_old
  874. )
  875. CFLAGS=$cflags_save
  876. else
  877. AC_MSG_RESULT(no)
  878. fi
  879. dnl Check that compiling a simple program still works with the flags
  880. dnl added for Python.
  881. AC_MSG_CHECKING([if compile and link flags for Python are sane])
  882. cflags_save=$CFLAGS
  883. libs_save=$LIBS
  884. CFLAGS="$CFLAGS $PYTHON_CFLAGS"
  885. LIBS="$LIBS $PYTHON_LIBS"
  886. AC_TRY_LINK(,[ ],
  887. AC_MSG_RESULT(yes); python_ok=yes,
  888. AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no)
  889. CFLAGS=$cflags_save
  890. LIBS=$libs_save
  891. if test $python_ok = yes; then
  892. AC_DEFINE(FEAT_PYTHON)
  893. else
  894. LIBS=$libs_save_old
  895. PYTHON_SRC=
  896. PYTHON_OBJ=
  897. PYTHON_LIBS=
  898. PYTHON_CFLAGS=
  899. fi
  900. fi
  901. else
  902. AC_MSG_RESULT(too old)
  903. fi
  904. fi
  905. if test "$fail_if_missing" = "yes" -a "$python_ok" != "yes"; then
  906. AC_MSG_ERROR([could not configure python])
  907. fi
  908. fi
  909. AC_SUBST(PYTHON_CONFDIR)
  910. AC_SUBST(PYTHON_LIBS)
  911. AC_SUBST(PYTHON_GETPATH_CFLAGS)
  912. AC_SUBST(PYTHON_CFLAGS)
  913. AC_SUBST(PYTHON_SRC)
  914. AC_SUBST(PYTHON_OBJ)
  915. AC_MSG_CHECKING(--enable-python3interp argument)
  916. AC_ARG_ENABLE(python3interp,
  917. [ --enable-python3interp[=OPTS] Include Python3 interpreter. [default=no] [OPTS=no/yes/dynamic]], ,
  918. [enable_python3interp="no"])
  919. AC_MSG_RESULT($enable_python3interp)
  920. if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
  921. dnl -- find the python3 executable
  922. AC_PATH_PROG(vi_cv_path_python3, python3)
  923. if test "X$vi_cv_path_python3" != "X"; then
  924. dnl -- get its version number
  925. AC_CACHE_CHECK(Python version,vi_cv_var_python3_version,
  926. [[vi_cv_var_python3_version=`
  927. ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'`
  928. ]])
  929. dnl -- get abiflags for python 3.2 or higher (PEP 3149)
  930. AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags,
  931. [
  932. vi_cv_var_python3_abiflags=
  933. if ${vi_cv_path_python3} -c \
  934. "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)"
  935. then
  936. vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \
  937. "import sys; print(sys.abiflags)"`
  938. fi ])
  939. dnl -- find where python3 thinks it was installed
  940. AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx,
  941. [ vi_cv_path_python3_pfx=`
  942. ${vi_cv_path_python3} -c \
  943. "import sys; print(sys.prefix)"` ])
  944. dnl -- and where it thinks it runs
  945. AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx,
  946. [ vi_cv_path_python3_epfx=`
  947. ${vi_cv_path_python3} -c \
  948. "import sys; print(sys.exec_prefix)"` ])
  949. dnl -- python3's internal library path
  950. AC_CACHE_VAL(vi_cv_path_python3path,
  951. [ vi_cv_path_python3path=`
  952. unset PYTHONPATH;
  953. ${vi_cv_path_python3} -c \
  954. "import sys, string; print(':'.join(sys.path))"` ])
  955. dnl -- where the Python implementation library archives are
  956. AC_ARG_WITH(python3-config-dir,
  957. [ --with-python3-config-dir=PATH Python's config directory],
  958. [ vi_cv_path_python3_conf="${withval}" ] )
  959. AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
  960. [
  961. vi_cv_path_python3_conf=
  962. config_dir="config"
  963. if test "${vi_cv_var_python3_abiflags}" != ""; then
  964. config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
  965. fi
  966. for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do
  967. for subdir in lib64 lib share; do
  968. d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}"
  969. if test -d "$d" && test -f "$d/config.c"; then
  970. vi_cv_path_python3_conf="$d"
  971. fi
  972. done
  973. done
  974. ])
  975. PYTHON3_CONFDIR="${vi_cv_path_python3_conf}"
  976. if test "X$PYTHON3_CONFDIR" = "X"; then
  977. AC_MSG_RESULT([can't find it!])
  978. else
  979. dnl -- we need to examine Python's config/Makefile too
  980. dnl see what the interpreter is built from
  981. AC_CACHE_VAL(vi_cv_path_python3_plibs,
  982. [
  983. pwd=`pwd`
  984. tmp_mkf="$pwd/config-PyMake$$"
  985. cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}"
  986. __:
  987. @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'"
  988. @echo "python3_LIBS='$(LIBS)'"
  989. @echo "python3_SYSLIBS='$(SYSLIBS)'"
  990. @echo "python3_INSTSONAME='$(INSTSONAME)'"
  991. eof
  992. dnl -- delete the lines from make about Entering/Leaving directory
  993. eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
  994. rm -f -- "${tmp_mkf}"
  995. vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}"
  996. vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}"
  997. dnl remove -ltermcap, it can conflict with an earlier -lncurses
  998. vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//`
  999. vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
  1000. ])
  1001. PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
  1002. if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
  1003. PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
  1004. else
  1005. PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
  1006. fi
  1007. PYTHON3_SRC="if_python3.c"
  1008. dnl For Mac OSX 10.2 config.o is included in the Python library.
  1009. if test "x$MACOSX" = "xyes"; then
  1010. PYTHON3_OBJ="objects/if_python3.o"
  1011. else
  1012. PYTHON3_OBJ="objects/if_python3.o objects/py3_config.o"
  1013. fi
  1014. dnl On FreeBSD linking with "-pthread" is required to use threads.
  1015. dnl _THREAD_SAFE must be used for compiling then.
  1016. dnl The "-pthread" is added to $LIBS, so that the following check for
  1017. dnl sigaltstack() will look in libc_r (it's there in libc!).
  1018. dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
  1019. dnl will then define target-specific defines, e.g., -D_REENTRANT.
  1020. dnl Don't do this for Mac OSX, -pthread will generate a warning.
  1021. AC_MSG_CHECKING([if -pthread should be used])
  1022. threadsafe_flag=
  1023. thread_lib=
  1024. dnl if test "x$MACOSX" != "xyes"; then
  1025. if test "`(uname) 2>/dev/null`" != Darwin; then
  1026. test "$GCC" = yes && threadsafe_flag="-pthread"
  1027. if test "`(uname) 2>/dev/null`" = FreeBSD; then
  1028. threadsafe_flag="-D_THREAD_SAFE"
  1029. thread_lib="-pthread"
  1030. fi
  1031. fi
  1032. libs_save_old=$LIBS
  1033. if test -n "$threadsafe_flag"; then
  1034. cflags_save=$CFLAGS
  1035. CFLAGS="$CFLAGS $threadsafe_flag"
  1036. LIBS="$LIBS $thread_lib"
  1037. AC_TRY_LINK(,[ ],
  1038. AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag",
  1039. AC_MSG_RESULT(no); LIBS=$libs_save_old
  1040. )
  1041. CFLAGS=$cflags_save
  1042. else
  1043. AC_MSG_RESULT(no)
  1044. fi
  1045. dnl check that compiling a simple program still works with the flags
  1046. dnl added for Python.
  1047. AC_MSG_CHECKING([if compile and link flags for Python 3 are sane])
  1048. cflags_save=$CFLAGS
  1049. libs_save=$LIBS
  1050. CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
  1051. LIBS="$LIBS $PYTHON3_LIBS"
  1052. AC_TRY_LINK(,[ ],
  1053. AC_MSG_RESULT(yes); python3_ok=yes,
  1054. AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no)
  1055. CFLAGS=$cflags_save
  1056. LIBS=$libs_save
  1057. if test "$python3_ok" = yes; then
  1058. AC_DEFINE(FEAT_PYTHON3)
  1059. else
  1060. LIBS=$libs_save_old
  1061. PYTHON3_SRC=
  1062. PYTHON3_OBJ=
  1063. PYTHON3_LIBS=
  1064. PYTHON3_CFLAGS=
  1065. fi
  1066. fi
  1067. fi
  1068. fi
  1069. AC_SUBST(PYTHON3_CONFDIR)
  1070. AC_SUBST(PYTHON3_LIBS)
  1071. AC_SUBST(PYTHON3_CFLAGS)
  1072. AC_SUBST(PYTHON3_SRC)
  1073. AC_SUBST(PYTHON3_OBJ)
  1074. dnl if python2.x and python3.x are enabled one can only link in code
  1075. dnl with dlopen(), dlsym(), dlclose()
  1076. if test "$python_ok" = yes && test "$python3_ok" = yes; then
  1077. AC_DEFINE(DYNAMIC_PYTHON)
  1078. AC_DEFINE(DYNAMIC_PYTHON3)
  1079. AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python)
  1080. cflags_save=$CFLAGS
  1081. CFLAGS="$CFLAGS $PYTHON_CFLAGS"
  1082. ldflags_save=$LDFLAGS
  1083. dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
  1084. LDFLAGS="-ldl $LDFLAGS"
  1085. AC_RUN_IFELSE([
  1086. #include <dlfcn.h>
  1087. /* If this program fails, then RTLD_GLOBAL is needed.
  1088. * RTLD_GLOBAL will be used and then it is not possible to
  1089. * have both python versions enabled in the same vim instance.
  1090. * Only the first pyhton version used will be switched on.
  1091. */
  1092. int no_rtl_global_needed_for(char *python_instsoname, char *prefix)
  1093. {
  1094. int needed = 0;
  1095. void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  1096. if (pylib != 0)
  1097. {
  1098. void (*pfx)(char *home) = dlsym(pylib, "Py_SetPythonHome");
  1099. void (*init)(void) = dlsym(pylib, "Py_Initialize");
  1100. int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  1101. void (*final)(void) = dlsym(pylib, "Py_Finalize");
  1102. (*pfx)(prefix);
  1103. (*init)();
  1104. needed = (*simple)("import termios") == -1;
  1105. (*final)();
  1106. dlclose(pylib);
  1107. }
  1108. return !needed;
  1109. }
  1110. int main(int argc, char** argv)
  1111. {
  1112. int not_needed = 0;
  1113. if (no_rtl_global_needed_for("${python_INSTSONAME}", "${vi_cv_path_python_pfx}"))
  1114. not_needed = 1;
  1115. return !not_needed;
  1116. }],
  1117. [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
  1118. CFLAGS=$cflags_save
  1119. LDFLAGS=$ldflags_save
  1120. AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3)
  1121. cflags_save=$CFLAGS
  1122. CFLAGS="$CFLAGS $PYTHON3_CFLAGS"
  1123. ldflags_save=$LDFLAGS
  1124. dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
  1125. LDFLAGS="-ldl $LDFLAGS"
  1126. AC_RUN_IFELSE([
  1127. #include <dlfcn.h>
  1128. #include <wchar.h>
  1129. /* If this program fails, then RTLD_GLOBAL is needed.
  1130. * RTLD_GLOBAL will be used and then it is not possible to
  1131. * have both python versions enabled in the same vim instance.
  1132. * Only the first pyhton version used will be switched on.
  1133. */
  1134. int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix)
  1135. {
  1136. int needed = 0;
  1137. void* pylib = dlopen(python_instsoname, RTLD_LAZY);
  1138. if (pylib != 0)
  1139. {
  1140. void (*pfx)(wchar_t *home) = dlsym(pylib, "Py_SetPythonHome");
  1141. void (*init)(void) = dlsym(pylib, "Py_Initialize");
  1142. int (*simple)(char*) = dlsym(pylib, "PyRun_SimpleString");
  1143. void (*final)(void) = dlsym(pylib, "Py_Finalize");
  1144. (*pfx)(prefix);
  1145. (*init)();
  1146. needed = (*simple)("import termios") == -1;
  1147. (*final)();
  1148. dlclose(pylib);
  1149. }
  1150. return !needed;
  1151. }
  1152. int main(int argc, char** argv)
  1153. {
  1154. int not_needed = 0;
  1155. if (no_rtl_global_needed_for("${python3_INSTSONAME}", L"${vi_cv_path_python3_pfx}"))
  1156. not_needed = 1;
  1157. return !not_needed;
  1158. }],
  1159. [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)])
  1160. CFLAGS=$cflags_save
  1161. LDFLAGS=$ldflags_save
  1162. PYTHON_SRC="if_python.c"
  1163. PYTHON_OBJ="objects/if_python.o"
  1164. PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
  1165. PYTHON_LIBS=
  1166. PYTHON3_SRC="if_python3.c"
  1167. PYTHON3_OBJ="objects/if_python3.o"
  1168. PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${python3_INSTSONAME}\\\""
  1169. PYTHON3_LIBS=
  1170. elif test "$python_ok" = yes && test "$enable_pythoninterp" = "dynamic"; then
  1171. AC_DEFINE(DYNAMIC_PYTHON)
  1172. PYTHON_SRC="if_python.c"
  1173. PYTHON_OBJ="objects/if_python.o"
  1174. PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\""
  1175. PYTHON_LIBS=
  1176. elif test "$python3_ok" = yes && test "$enable_python3interp" = "dynamic"; then
  1177. AC_DEFINE(DYNAMIC_PYTHON3)
  1178. PYTHON3_SRC="if_python3.c"
  1179. PYTHON3_OBJ="objects/if_python3.o"
  1180. PYTHON3_CFLAGS="$PYTHON3_CFLAGS -DDYNAMIC_PYTHON3_DLL=\\\"${python3_INSTSONAME}\\\""
  1181. PYTHON3_LIBS=
  1182. fi
  1183. AC_MSG_CHECKING(--enable-tclinterp argument)
  1184. AC_ARG_ENABLE(tclinterp,
  1185. [ --enable-tclinterp Include Tcl interpreter.], ,
  1186. [enable_tclinterp="no"])
  1187. AC_MSG_RESULT($enable_tclinterp)
  1188. if test "$enable_tclinterp" = "yes"; then
  1189. dnl on FreeBSD tclsh is a silly script, look for tclsh8.[5420]
  1190. AC_MSG_CHECKING(--with-tclsh argument)
  1191. AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)],
  1192. tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name),
  1193. tclsh_name="tclsh8.5"; AC_MSG_RESULT(no))
  1194. AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
  1195. AC_SUBST(vi_cv_path_tcl)
  1196. dnl when no specific version specified, also try 8.4, 8.2 and 8.0
  1197. if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.5"; then
  1198. tclsh_name="tclsh8.4"
  1199. AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
  1200. fi
  1201. if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.4"; then
  1202. tclsh_name="tclsh8.2"
  1203. AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
  1204. fi
  1205. if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.2"; then
  1206. tclsh_name="tclsh8.0"
  1207. AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
  1208. fi
  1209. dnl still didn't find it, try without version number
  1210. if test "X$vi_cv_path_tcl" = "X"; then
  1211. tclsh_name="tclsh"
  1212. AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
  1213. fi
  1214. if test "X$vi_cv_path_tcl" != "X"; then
  1215. AC_MSG_CHECKING(Tcl version)
  1216. if echo 'exit [[expr [info tclversion] < 8.0]]' | $vi_cv_path_tcl - ; then
  1217. tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -`
  1218. AC_MSG_RESULT($tclver - OK);
  1219. tclloc=`echo 'set l [[info library]];set i [[string last lib $l]];incr i -2;puts [[string range $l 0 $i]]' | $vi_cv_path_tcl -`
  1220. AC_MSG_CHECKING(for location of Tcl include)
  1221. if test "x$MACOSX" != "xyes"; then
  1222. tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
  1223. else
  1224. dnl For Mac OS X 10.3, use the OS-provided framework location
  1225. tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
  1226. fi
  1227. TCL_INC=
  1228. for try in $tclinc; do
  1229. if test -f "$try/tcl.h"; then
  1230. AC_MSG_RESULT($try/tcl.h)
  1231. TCL_INC=$try
  1232. break
  1233. fi
  1234. done
  1235. if test -z "$TCL_INC"; then
  1236. AC_MSG_RESULT(<not found>)
  1237. SKIP_TCL=YES
  1238. fi
  1239. if test -z "$SKIP_TCL"; then
  1240. AC_MSG_CHECKING(for location of tclConfig.sh script)
  1241. if test "x$MACOSX" != "xyes"; then
  1242. tclcnf=`echo $tclinc | sed s/include/lib/g`
  1243. tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
  1244. else
  1245. dnl For Mac OS X 10.3, use the OS-provided framework location
  1246. tclcnf="/System/Library/Frameworks/Tcl.framework"
  1247. fi
  1248. for try in $tclcnf; do
  1249. if test -f $try/tclConfig.sh; then
  1250. AC_MSG_RESULT($try/tclConfig.sh)
  1251. . $try/tclConfig.sh
  1252. dnl use eval, because tcl 8.2 includes ${TCL_DBGX}
  1253. TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
  1254. dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the
  1255. dnl "-D_ABC" items. Watch out for -DFOO=long\ long.
  1256. TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^[[^-]]/d' -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'`
  1257. break
  1258. fi
  1259. done
  1260. if test -z "$TCL_LIBS"; then
  1261. AC_MSG_RESULT(<not found>)
  1262. AC_MSG_CHECKING(for Tcl library by myself)
  1263. tcllib=`echo $tclinc | sed s/include/lib/g`
  1264. tclli