configure
来自「tcl是工具命令语言」· 代码 · 共 2,244 行 · 第 1/5 页
TXT
2,244 行
fiEXEEXT=""test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}echo "$ac_t""${ac_cv_exeext}" 1>&6ac_exeext=$EXEEXT#--------------------------------------------------------------------# Check whether --enable-threads or --disable-threads was given.#-------------------------------------------------------------------- echo $ac_n "checking for building with threads""... $ac_c" 1>&6echo "configure:1363: checking for building with threads" >&5 # Check whether --enable-threads or --disable-threads was given.if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enablevalelse tcl_ok=nofi if test "$tcl_ok" = "yes"; then echo "$ac_t""yes" 1>&6 TCL_THREADS=1 cat >> confdefs.h <<\EOF#define TCL_THREADS 1EOF # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention cat >> confdefs.h <<\EOF#define USE_THREAD_ALLOC 1EOF else TCL_THREADS=0 echo "$ac_t""no (default)" 1>&6 fi #--------------------------------------------------------------------# The statements below define a collection of symbols related to# building libtcl as a shared library instead of a static library.#-------------------------------------------------------------------- echo $ac_n "checking how to build libraries""... $ac_c" 1>&6echo "configure:1400: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given.if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enablevalelse tcl_ok=yesfi if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$ac_t""shared" 1>&6 SHARED_BUILD=1 else echo "$ac_t""static" 1>&6 SHARED_BUILD=0 cat >> confdefs.h <<\EOF#define STATIC_BUILD 1EOF fi#--------------------------------------------------------------------# The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called# after SC_ENABLE_SHARED checks the configure switches.#-------------------------------------------------------------------- # Step 0: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6echo "configure:1441: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given.if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enablevalelse do64bit=nofi echo "$ac_t""$do64bit" 1>&6 # Set some defaults (may get changed below) EXTRA_CFLAGS="" # Extract the first word of "cygpath", so it can be a program name with args.set dummy cygpath; ac_word=$2echo $ac_n "checking for $ac_word""... $ac_c" 1>&6echo "configure:1458: checking for $ac_word" >&5if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CYGPATH="cygpath -w" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"fifiCYGPATH="$ac_cv_prog_CYGPATH"if test -n "$CYGPATH"; then echo "$ac_t""$CYGPATH" 1>&6else echo "$ac_t""no" 1>&6fi SHLIB_SUFFIX=".dll" # Check for a bug in gcc's windres that causes the # compile to fail when a Windows native path is # passed into windres. The mingw toolchain requires # Windows native paths while Cygwin should work # with both. Avoid the bug by passing a POSIX # path when using the Cygwin toolchain. if test "$GCC" = "yes" && test "$CYGPATH" != "echo" ; then conftest=/tmp/conftest.rc echo "STRINGTABLE BEGIN" > $conftest echo "101 \"name\"" >> $conftest echo "END" >> $conftest echo $ac_n "checking for Windows native path bug in windres""... $ac_c" 1>&6echo "configure:1502: checking for Windows native path bug in windres" >&5 cyg_conftest=`$CYGPATH $conftest` if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 CYGPATH=echo fi conftest= cyg_conftest= fi if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then DEPARG='"$<"' else DEPARG='"$(shell $(CYGPATH) $<)"' fi # set various compiler flags depending on whether we are using gcc or cl echo $ac_n "checking compiler flags""... $ac_c" 1>&6echo "configure:1523: checking compiler flags" >&5 if test "${GCC}" = "yes" ; then if test "$do64bit" = "yes" ; then echo "configure: warning: "64bit mode not supported with GCC on Windows"" 1>&2 fi SHLIB_LD="" SHLIB_LD_LIBS="" LIBS="" LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32" STLIB_LD='${AR} cr' RC_OUT=-o RC_TYPE= RC_INCLUDE=--include RC_DEFINE=--define RES=res.o MAKE_LIB="\${STLIB_LD} \$@" POST_MAKE_LIB="\${RANLIB} \$@" MAKE_EXE="\${CC} -o \$@" LIBPREFIX="lib" #if test "$ac_cv_cygwin" = "yes"; then # extra_cflags="-mno-cygwin" # extra_ldflags="-mno-cygwin" #else # extra_cflags="" # extra_ldflags="" #fi if test "$ac_cv_cygwin" = "yes"; then touch ac$$.c if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then case "$extra_cflags" in *-mwin32*) ;; *) extra_cflags="-mwin32 $extra_cflags" ;; esac case "$extra_ldflags" in *-mwin32*) ;; *) extra_ldflags="-mwin32 $extra_ldflags" ;; esac fi rm -f ac$$.o ac$$.c else extra_cflags='' extra_ldflags='' fi if test "${SHARED_BUILD}" = "0" ; then # static echo "$ac_t""using static flags" 1>&6 runtime= MAKE_DLL="echo " LIBSUFFIX="s\${DBGX}.a" LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s\${DBGX}.exe" else # dynamic echo "$ac_t""using shared flags" 1>&6 # ad-hoc check to see if CC supports -shared. if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then { echo "configure: error: ${CC} does not support the -shared option. You will need to upgrade to a newer version of the toolchain." 1>&2; exit 1; } fi runtime= # Link with gcc since ld does not link to default libs like # -luser32 and -lmsvcrt by default. Make sure CFLAGS is # included so -mno-cygwin passed the correct libs to the linker. SHLIB_LD='${CC} -shared ${CFLAGS}' SHLIB_LD_LIBS='${LIBS}' # Add SHLIB_LD_LIBS to the Make rule, not here. MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \$@ ${extra_ldflags} \ -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\$@)" LIBSUFFIX="\${DBGX}.a" EXESUFFIX="\${DBGX}.exe" LIBRARIES="\${SHARED_LIBRARIES}" fi # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. DLLSUFFIX="\${DBGX}.dll" SHLIB_SUFFIX=.dll EXTRA_CFLAGS="${extra_cflags}" CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="-Wall -Wconversion" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= # Specify the CC output file names based on the target name CC_OBJNAME="-o \$@" CC_EXENAME="-o \$@" # Specify linker flags depending on the type of app being # built -- Console vs. Window. # # ORIGINAL COMMENT: # We need to pass -e _WinMain@16 so that ld will use # WinMain() instead of main() as the entry point. We can't # use autoconf to check for this case since it would need # to run an executable and that does not work when # cross compiling. Remove this -e workaround once we # require a gcc that does not have this bug. # # MK NOTE: Tk should use a different mechanism. This causes # interesting problems, such as wish dying at startup. #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}" LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}" LDFLAGS_WINDOW="-mwindows ${extra_ldflags}" else if test "${SHARED_BUILD}" = "0" ; then # static echo "$ac_t""using static flags" 1>&6 runtime=-MT MAKE_DLL="echo " LIBSUFFIX="s\${DBGX}.lib" LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s\${DBGX}.exe" SHLIB_LD_LIBS="" else # dynamic echo "$ac_t""using shared flags" 1>&6 runtime=-MD # Add SHLIB_LD_LIBS to the Make rule, not here. MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\$@" LIBSUFFIX="\${DBGX}.lib" EXESUFFIX="\${DBGX}.exe" LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' fi # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. DLLSUFFIX="\${DBGX}.dll" # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. if test "$do64bit" = "yes" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft SDK" fi # In order to work in the tortured autoconf environment, # we need to ensure that this path has no spaces MSSDK=$(cygpath -w -s "$MSSDK" | sed -e 's!\\!/!g') if test ! -d "${MSSDK}/bin/win64" ; then echo "configure: warning: "could not find 64-bit SDK to enable 64bit mode"" 1>&2 do64bit="no" fi fi if test "$do64bit" = "yes" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="${MSSDK}/Bin/Win64/cl.exe \ -I${MSSDK}/Include/prerelease \ -I${MSSDK}/Include/Win64/crt \ -I${MSSDK}/Include/Win64/crt/sys \ -I${MSSDK}/Include" RC="${MSSDK}/bin/rc.exe" CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -Gs ${runtime}" lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \ -LIBPATH:${MSSDK}/Lib/Prerelease/IA64" STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}" LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}" else RC="rc" CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}" STLIB_LD="lib -nologo" LINKBIN="link -link50compat" fi SHLIB_LD="${LINKBIN} -dll -nologo -incremental:no" LIBS="user32.lib advapi32.lib" LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib" RC_OUT=-fo RC_TYPE=-r RC_INCLUDE=-i RC_DEFINE=-d RES=res MAKE_LIB="\${STLIB_LD} -out:\$@" POST_MAKE_LIB= MAKE_EXE="\${CC} -Fe\$@" LIBPREFIX="" EXTRA_CFLAGS="-YX" CFLAGS_WARNING="-W3" LDFLAGS_DEBUG="-debug:full -debugtype:both" LDFLAGS_OPTIMIZE="-release" # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\$@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\$@')\"" # Specify linker flags depending on the type of app being # built -- Console vs. Window. LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi # DL_LIBS is empty, but then we match the Unix version #--------------------------------------------------------------------# Set the default compiler switches based on the --enable-symbols # option. This macro depends on C flags, and should be called# after SC_CONFIG_CFLAGS macro is called.#-------------------------------------------------------------------- echo $ac_n "checking for build with symbols""... $ac_c" 1>&6echo "configure:1739: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given.if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enablevalelse tcl_ok=nofi# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" echo "$ac_t""no" 1>&6 else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' DBGX=g if test "$tcl_ok" = "yes"; then echo "$ac_t""yes (standard debugging)" 1>&6 fi fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >> confdefs.h <<\EOF#define TCL_MEM_DEBUG 1EOF fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then cat >> confdefs.h <<\EOF#define TCL_COMPILE_DEBUG 1EOF cat >> confdefs.h <<\EOF#define TCL_COMPILE_STATS 1EOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then echo "$ac_t""enabled symbols mem compile debugging" 1>&6 else echo "$ac_t""enabled $tcl_ok debugging" 1>&6 fi fiTCL_DBGX=${DBGX}#--------------------------------------------------------------------# man2tcl needs this so that it can use errno.h#--------------------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?