configure.in
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:13k
源码类别:

通讯编程

开发平台:

Visual C++

  1. #! /bin/bash -norc
  2. # This file is an input file used by the GNU "autoconf" program to
  3. # generate the file "configure", which is run during Tcl installation
  4. # to configure the system for the local environment.
  5. #
  6. # RCS: @(#) $Id: configure.in,v 1.68.2.22 2008/02/06 15:25:28 dgp Exp $
  7. AC_INIT(../generic/tcl.h)
  8. AC_PREREQ(2.13)
  9. TCL_VERSION=8.4
  10. TCL_MAJOR_VERSION=8
  11. TCL_MINOR_VERSION=4
  12. TCL_PATCH_LEVEL=".18"
  13. VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
  14. TCL_DDE_VERSION=1.2
  15. TCL_DDE_MAJOR_VERSION=1
  16. TCL_DDE_MINOR_VERSION=2
  17. DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION
  18. TCL_REG_VERSION=1.1
  19. TCL_REG_MAJOR_VERSION=1
  20. TCL_REG_MINOR_VERSION=1
  21. REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION
  22. #------------------------------------------------------------------------
  23. # Handle the --prefix=... option
  24. #------------------------------------------------------------------------
  25. if test "${prefix}" = "NONE"; then
  26.     prefix=/usr/local
  27. fi
  28. if test "${exec_prefix}" = "NONE"; then
  29.     exec_prefix=$prefix
  30. fi
  31. # libdir must be a fully qualified path (not ${exec_prefix}/lib)
  32. eval libdir="$libdir"
  33. #------------------------------------------------------------------------
  34. # Standard compiler checks
  35. #------------------------------------------------------------------------
  36. # If the user did not set CFLAGS, set it now to keep
  37. # the AC_PROG_CC macro from adding "-g -O2".
  38. if test "${CFLAGS+set}" != "set" ; then
  39.     CFLAGS=""
  40. fi
  41. AC_PROG_CC
  42. # To properly support cross-compilation, one would
  43. # need to use these tool checks instead of
  44. # the ones below and reconfigure with
  45. # autoconf 2.50. You can also just set
  46. # the CC, AR, RANLIB, and RC environment
  47. # variables if you want to cross compile.
  48. dnl AC_CHECK_TOOL(AR, ar)
  49. dnl AC_CHECK_TOOL(RANLIB, ranlib)
  50. dnl AC_CHECK_TOOL(RC, windres)
  51. if test "${GCC}" = "yes" ; then
  52.     AC_CHECK_PROG(AR, ar, ar)
  53.     AC_CHECK_PROG(RANLIB, ranlib, ranlib)
  54.     AC_CHECK_PROG(RC, windres, windres)
  55.     if test "${AR}" = "" ; then
  56. AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
  57.     fi
  58.     if test "${RANLIB}" = "" ; then
  59. AC_MSG_ERROR([Required archive index tool 'ranlib' not found on PATH.])
  60.     fi
  61.     if test "${RC}" = "" ; then
  62. AC_MSG_ERROR([Required resource tool 'windres' not found on PATH.])
  63.     fi
  64. fi
  65. #--------------------------------------------------------------------
  66. # Checks to see if the make progeam sets the $MAKE variable.
  67. #--------------------------------------------------------------------
  68. AC_PROG_MAKE_SET
  69. #--------------------------------------------------------------------
  70. # Perform additinal compiler tests.
  71. #--------------------------------------------------------------------
  72. AC_CYGWIN
  73. if test "$ac_cv_cygwin" = "yes" ; then
  74.     AC_MSG_ERROR([Compiling under Cygwin is not currently supported.
  75. A maintainer for the Cygwin port of Tcl/Tk is needed. See the README
  76. file for information about building with Mingw.])
  77. fi
  78. AC_CACHE_CHECK(for SEH support in compiler,
  79.     tcl_cv_seh,
  80. AC_TRY_RUN([
  81. #define WIN32_LEAN_AND_MEAN
  82. #include <windows.h>
  83. #undef WIN32_LEAN_AND_MEAN
  84. int main(int argc, char** argv) {
  85.     int a, b = 0;
  86.     __try {
  87.         a = 666 / b;
  88.     }
  89.     __except (EXCEPTION_EXECUTE_HANDLER) {
  90.         return 0;
  91.     }
  92.     return 1;
  93. }
  94. ],
  95.         tcl_cv_seh=yes,
  96.         tcl_cv_seh=no,
  97.         tcl_cv_seh=no)
  98. )
  99. if test "$tcl_cv_seh" = "no" ; then
  100.     AC_DEFINE(HAVE_NO_SEH, 1,
  101.             [Defined when mingw does not support SEH])
  102. fi
  103. #
  104. # Check to see if the excpt.h include file provided contains the
  105. # definition for EXCEPTION_DISPOSITION; if not, which is the case
  106. # with Cygwin's version as of 2002-04-10, define it to be int, 
  107. # sufficient for getting the current code to work.
  108. #
  109. AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
  110.     tcl_cv_eh_disposition,
  111. AC_TRY_COMPILE([
  112. #define WIN32_LEAN_AND_MEAN
  113. #include <windows.h>
  114. #undef WIN32_LEAN_AND_MEAN
  115. ],
  116. [
  117.   EXCEPTION_DISPOSITION x;
  118. ],
  119.         tcl_cv_eh_disposition=yes,
  120.         tcl_cv_eh_disposition=no)
  121. )
  122. if test "$tcl_cv_eh_disposition" = "no" ; then
  123.     AC_DEFINE(EXCEPTION_DISPOSITION, int,
  124.             [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
  125. fi
  126. # Check to see if the winsock2.h include file provided contains
  127. # typedefs like LPFN_ACCEPT and friends.
  128. #
  129. AC_CACHE_CHECK(for LPFN_ACCEPT support in winsock2.h,
  130.     tcl_cv_lpfn_decls,
  131. AC_TRY_COMPILE([
  132. #define WIN32_LEAN_AND_MEAN
  133. #include <windows.h>
  134. #undef WIN32_LEAN_AND_MEAN
  135. #include <winsock2.h>
  136. ],
  137. [
  138.   LPFN_ACCEPT accept;
  139. ],
  140.         tcl_cv_lpfn_decls=yes,
  141.         tcl_cv_lpfn_decls=no)
  142. )
  143. if test "$tcl_cv_lpfn_decls" = "no" ; then
  144.     AC_DEFINE(HAVE_NO_LPFN_DECLS, 1,
  145.             [Defined when cygwin/mingw does not support LPFN_ACCEPT and friends.])
  146. fi
  147. # Check to see if winnt.h defines CHAR, SHORT, and LONG
  148. # even if VOID has already been #defined. The win32api
  149. # used by mingw and cygwin is known to do this.
  150. AC_CACHE_CHECK(for winnt.h that ignores VOID define,
  151.     tcl_cv_winnt_ignore_void,
  152. AC_TRY_COMPILE([
  153. #define VOID void
  154. #define WIN32_LEAN_AND_MEAN
  155. #include <windows.h>
  156. #undef WIN32_LEAN_AND_MEAN
  157. ],
  158. [
  159.   CHAR c;
  160.   SHORT s;
  161.   LONG l;
  162. ],
  163.         tcl_cv_winnt_ignore_void=yes,
  164.         tcl_cv_winnt_ignore_void=no)
  165. )
  166. if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
  167.     AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
  168.             [Defined when cygwin/mingw ignores VOID define in winnt.h])
  169. fi
  170. # Check to see if malloc.h is missing the alloca function
  171. # declaration. This is known to be a problem with Mingw.
  172. # If we compiled without the function declaration, it
  173. # would work but we would get a warning message from gcc.
  174. # If we add the function declaration ourselves, it
  175. # would not compile correctly because the _alloca
  176. # function expects the argument to be passed in a
  177. # register and not on the stack. Instead, we just
  178. # call it from inline asm code.
  179. AC_CACHE_CHECK(for alloca declaration in malloc.h,
  180.     tcl_cv_malloc_decl_alloca,
  181. AC_TRY_COMPILE([
  182. #include <malloc.h>
  183. ],
  184. [
  185.   size_t arg = 0;
  186.   void* ptr;
  187.   ptr = alloca;
  188.   ptr = alloca(arg);
  189. ],
  190.         tcl_cv_malloc_decl_alloca=yes,
  191.         tcl_cv_malloc_decl_alloca=no)
  192. )
  193. if test "$tcl_cv_malloc_decl_alloca" = "no" &&
  194.    test "${GCC}" = "yes" ; then
  195.     AC_DEFINE(HAVE_ALLOCA_GCC_INLINE, 1,
  196.             [Defined when gcc should use inline ASM to call alloca.])
  197. fi
  198. # See if the compiler supports casting to a union type.
  199. # This is used to stop gcc from printing a compiler
  200. # warning when initializing a union member.
  201. AC_CACHE_CHECK(for cast to union support,
  202.     tcl_cv_cast_to_union,
  203. AC_TRY_COMPILE([],
  204. [
  205.   union foo { int i; double d; };
  206.   union foo f = (union foo) (int) 0;
  207. ],
  208.         tcl_cv_cast_to_union=yes,
  209.         tcl_cv_cast_to_union=no)
  210. )
  211. if test "$tcl_cv_cast_to_union" = "yes"; then
  212.     AC_DEFINE(HAVE_CAST_TO_UNION, 1,
  213.             [Defined when compiler supports casting to union type.])
  214. fi
  215. #--------------------------------------------------------------------
  216. # Determines the correct binary file extension (.o, .obj, .exe etc.)
  217. #--------------------------------------------------------------------
  218. AC_OBJEXT
  219. AC_EXEEXT
  220. #--------------------------------------------------------------------
  221. # Check whether --enable-threads or --disable-threads was given.
  222. #--------------------------------------------------------------------
  223. SC_ENABLE_THREADS
  224. #--------------------------------------------------------------------
  225. # The statements below define a collection of symbols related to
  226. # building libtcl as a shared library instead of a static library.
  227. #--------------------------------------------------------------------
  228. SC_ENABLE_SHARED
  229. #--------------------------------------------------------------------
  230. # The statements below define a collection of compile flags.  This 
  231. # macro depends on the value of SHARED_BUILD, and should be called
  232. # after SC_ENABLE_SHARED checks the configure switches.
  233. #--------------------------------------------------------------------
  234. SC_CONFIG_CFLAGS
  235. #--------------------------------------------------------------------
  236. # Set the default compiler switches based on the --enable-symbols 
  237. # option.  This macro depends on C flags, and should be called
  238. # after SC_CONFIG_CFLAGS macro is called.
  239. #--------------------------------------------------------------------
  240. SC_ENABLE_SYMBOLS
  241. TCL_DBGX=${DBGX}
  242. #--------------------------------------------------------------------
  243. # man2tcl needs this so that it can use errno.h
  244. #--------------------------------------------------------------------
  245. AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H")
  246. AC_SUBST(MAN2TCLFLAGS)
  247. #------------------------------------------------------------------------
  248. # tclConfig.sh refers to this by a different name
  249. #------------------------------------------------------------------------
  250. TCL_SHARED_BUILD=${SHARED_BUILD}
  251. #--------------------------------------------------------------------
  252. # Perform final evaluations of variables with possible substitutions.
  253. #--------------------------------------------------------------------
  254. TCL_SHARED_LIB_SUFFIX="${NODOT_VERSION}${DLLSUFFIX}"
  255. TCL_UNSHARED_LIB_SUFFIX="${NODOT_VERSION}${LIBSUFFIX}"
  256. TCL_EXPORT_FILE_SUFFIX="${NODOT_VERSION}${LIBSUFFIX}"
  257. eval "TCL_SRC_DIR="`cd $srcdir/..; pwd`""
  258. eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
  259. eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}"
  260. eval "TCL_LIB_FLAG="-ltcl${VER}${LIBFLAGSUFFIX}""
  261. eval "TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}""
  262. eval "TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}""
  263. eval "TCL_STUB_LIB_FILE="${LIBPREFIX}tclstub${VER}${LIBSUFFIX}""
  264. eval "TCL_STUB_LIB_FLAG="-ltclstub${VER}${LIBFLAGSUFFIX}""
  265. eval "TCL_BUILD_STUB_LIB_SPEC="-L`pwd` ${TCL_STUB_LIB_FLAG}""
  266. eval "TCL_STUB_LIB_SPEC="-L${libdir} ${TCL_STUB_LIB_FLAG}""
  267. eval "TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}""
  268. eval "TCL_STUB_LIB_PATH="${libdir}/${TCL_STUB_LIB_FILE}""
  269. # Install time header dir can be set via --includedir
  270. eval "TCL_INCLUDE_SPEC="-I${includedir}""
  271. eval "DLLSUFFIX=${DLLSUFFIX}"
  272. eval "LIBPREFIX=${LIBPREFIX}"
  273. eval "LIBSUFFIX=${LIBSUFFIX}"
  274. eval "EXESUFFIX=${EXESUFFIX}"
  275. CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}
  276. CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}
  277. CFG_TCL_EXPORT_FILE_SUFFIX=${TCL_EXPORT_FILE_SUFFIX}
  278. #--------------------------------------------------------------------
  279. # Adjust the defines for how the resources are built depending
  280. # on symbols and static vs. shared.
  281. #--------------------------------------------------------------------
  282. if test ${SHARED_BUILD} = 0 ; then
  283.     if test "${DBGX}" = "g"; then
  284.         RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
  285.     else
  286.         RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
  287.     fi
  288. else
  289.     if test "${DBGX}" = "g"; then
  290.         RC_DEFINES="${RC_DEFINE} DEBUG"
  291.     else
  292.         RC_DEFINES=""
  293.     fi
  294. fi
  295. #--------------------------------------------------------------------
  296. # The statements below define the symbol TCL_PACKAGE_PATH, which
  297. # gives a list of directories that may contain packages.  The list
  298. # consists of one directory for machine-dependent binaries and
  299. # another for platform-independent scripts.
  300. #--------------------------------------------------------------------
  301. if test "$prefix" != "$exec_prefix"; then
  302.     TCL_PACKAGE_PATH="${libdir} ${prefix}/lib"
  303. else
  304.     TCL_PACKAGE_PATH="${prefix}/lib"
  305. fi
  306. AC_SUBST(TCL_VERSION)
  307. AC_SUBST(TCL_MAJOR_VERSION)
  308. AC_SUBST(TCL_MINOR_VERSION)
  309. AC_SUBST(TCL_PATCH_LEVEL)
  310. AC_SUBST(TCL_LIB_FILE)
  311. AC_SUBST(TCL_LIB_FLAG)
  312. # empty on win
  313. AC_SUBST(TCL_LIB_SPEC)
  314. AC_SUBST(TCL_STUB_LIB_FILE)
  315. AC_SUBST(TCL_STUB_LIB_FLAG)
  316. AC_SUBST(TCL_STUB_LIB_SPEC)
  317. AC_SUBST(TCL_STUB_LIB_PATH)
  318. AC_SUBST(TCL_INCLUDE_SPEC)
  319. AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
  320. AC_SUBST(TCL_BUILD_STUB_LIB_PATH)
  321. AC_SUBST(TCL_DLL_FILE)
  322. AC_SUBST(TCL_SRC_DIR)
  323. AC_SUBST(TCL_BIN_DIR)
  324. AC_SUBST(TCL_DBGX)
  325. AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
  326. AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
  327. AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX)
  328. # win/tcl.m4 doesn't set (CFLAGS)
  329. AC_SUBST(CFLAGS_DEFAULT)
  330. AC_SUBST(EXTRA_CFLAGS)
  331. AC_SUBST(CYGPATH)
  332. AC_SUBST(DEPARG)
  333. AC_SUBST(CC_OBJNAME)
  334. AC_SUBST(CC_EXENAME)
  335. # win/tcl.m4 doesn't set (LDFLAGS)
  336. AC_SUBST(LDFLAGS_DEFAULT)
  337. AC_SUBST(LDFLAGS_DEBUG)
  338. AC_SUBST(LDFLAGS_OPTIMIZE)
  339. AC_SUBST(LDFLAGS_CONSOLE)
  340. AC_SUBST(LDFLAGS_WINDOW)
  341. AC_SUBST(AR)
  342. AC_SUBST(RANLIB)
  343. AC_SUBST(STLIB_LD)
  344. AC_SUBST(SHLIB_LD)
  345. AC_SUBST(SHLIB_LD_LIBS)
  346. AC_SUBST(SHLIB_CFLAGS)
  347. AC_SUBST(SHLIB_SUFFIX)
  348. AC_SUBST(TCL_SHARED_BUILD)
  349. AC_SUBST(LIBS)
  350. AC_SUBST(LIBS_GUI)
  351. AC_SUBST(DLLSUFFIX)
  352. AC_SUBST(LIBPREFIX)
  353. AC_SUBST(LIBSUFFIX)
  354. AC_SUBST(EXESUFFIX)
  355. AC_SUBST(LIBRARIES)
  356. AC_SUBST(MAKE_LIB)
  357. AC_SUBST(POST_MAKE_LIB)
  358. AC_SUBST(MAKE_DLL)
  359. AC_SUBST(MAKE_EXE)
  360. # empty on win, but needs sub'ing
  361. AC_SUBST(TCL_BUILD_LIB_SPEC)
  362. AC_SUBST(TCL_LD_SEARCH_FLAGS)
  363. AC_SUBST(TCL_NEEDS_EXP_FILE)
  364. AC_SUBST(TCL_BUILD_EXP_FILE)
  365. AC_SUBST(TCL_EXP_FILE)
  366. AC_SUBST(DL_LIBS)
  367. AC_SUBST(LIBOBJS)
  368. AC_SUBST(TCL_LIB_VERSIONS_OK)
  369. AC_SUBST(TCL_PACKAGE_PATH)
  370. # win only
  371. AC_SUBST(TCL_DDE_VERSION)
  372. AC_SUBST(TCL_DDE_MAJOR_VERSION)
  373. AC_SUBST(TCL_DDE_MINOR_VERSION)
  374. AC_SUBST(TCL_REG_VERSION)
  375. AC_SUBST(TCL_REG_MAJOR_VERSION)
  376. AC_SUBST(TCL_REG_MINOR_VERSION)
  377. AC_SUBST(RC)
  378. AC_SUBST(RC_OUT)
  379. AC_SUBST(RC_TYPE)
  380. AC_SUBST(RC_INCLUDE)
  381. AC_SUBST(RC_DEFINE)
  382. AC_SUBST(RC_DEFINES)
  383. AC_SUBST(RES)
  384. AC_OUTPUT(Makefile tclConfig.sh tcl.hpj)