*** unix/configure.orig	Wed Dec 15 05:00:19 1999
--- unix/configure	Sun Jan 16 17:43:01 2000
***************
*** 22,32 ****
  ac_help="$ac_help
    --disable-load          disallow dynamic loading and "load" command"
  ac_help="$ac_help
!   --enable-symbols        build with debugging symbols [--disable-symbols]"
  ac_help="$ac_help
    --with-x                use the X Window System"
  ac_help="$ac_help
!   --enable-shared         build and link with shared libraries [--enable-shared]"
  
  # Initialize some variables set by options.
  # The variables have the same names as the options, with
--- 22,32 ----
  ac_help="$ac_help
    --disable-load          disallow dynamic loading and "load" command"
  ac_help="$ac_help
!   --enable-symbols        build with debugging symbols [--enable-symbols]"
  ac_help="$ac_help
    --with-x                use the X Window System"
  ac_help="$ac_help
!   --disable-shared        build and link without shared libraries [--disable-shared]"
  
  # Initialize some variables set by options.
  # The variables have the same names as the options, with
***************
*** 1257,1263 ****
  #------------------------------------------------------------------------
  
  if test "${GCC}" = "yes" ; then
!     CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
  else
      CFLAGS_WARNING=""
  fi
--- 1257,1263 ----
  #------------------------------------------------------------------------
  
  if test "${GCC}" = "yes" ; then
!     CFLAGS_WARNING="-Wall -Wno-implicit-int"
  else
      CFLAGS_WARNING=""
  fi
***************
*** 1525,1535 ****
      case $system in
  	AIX-4.[2-9])
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD=$TCL_SHLIB_LD
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
! 	    DL_LIBS="-ldl ${TCL_BUILD_LIB_SPEC}"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
--- 1525,1535 ----
      case $system in
  	AIX-4.[2-9])
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
! 	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
***************
*** 1537,1548 ****
  	    ;;
  	AIX-*)
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD=$TCL_SHLIB_LD
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    LIBOBJS="$LIBOBJS tclLoadAix.o"
! 	    DL_LIBS="-lld ${TCL_BUILD_LIB_SPEC}"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
--- 1537,1548 ----
  	    ;;
  	AIX-*)
  	    SHLIB_CFLAGS=""
! 	    SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    LIBOBJS="$LIBOBJS tclLoadAix.o"
! 	    DL_LIBS="-lld"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
  	    TCL_NEEDS_EXP_FILE=1
***************
*** 1553,1559 ****
  	    SHLIB_LD="shlicc -r"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
--- 1553,1559 ----
  	    SHLIB_LD="shlicc -r"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
***************
*** 1563,1569 ****
  	    SHLIB_LD="cc -shared"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS="-export-dynamic"
  	    LD_SEARCH_FLAGS=""
--- 1563,1569 ----
  	    SHLIB_LD="cc -shared"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS="-export-dynamic"
  	    LD_SEARCH_FLAGS=""
***************
*** 1573,1579 ****
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
--- 1573,1579 ----
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
***************
*** 1645,1653 ****
  	IRIX-5.*|IRIX-6.*|IRIX64-6.5*)
  	    SHLIB_CFLAGS=""
  	    SHLIB_LD="ld -n32 -shared -rdata_shared"
! 	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  	    if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
--- 1645,1653 ----
  	IRIX-5.*|IRIX-6.*|IRIX64-6.5*)
  	    SHLIB_CFLAGS=""
  	    SHLIB_LD="ld -n32 -shared -rdata_shared"
! 	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
  	    if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
***************
*** 1671,1677 ****
  	    SHLIB_LD="ld -32 -shared -rdata_shared"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
--- 1671,1677 ----
  	    SHLIB_LD="ld -32 -shared -rdata_shared"
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
***************
*** 1689,1695 ****
  
  	    if test "$have_dl" = yes; then
  		SHLIB_LD="${CC} -shared"
! 		DL_OBJS="tclLoadDl.o"
  		DL_LIBS="-ldl"
  		LDFLAGS="-rdynamic"
  		LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
--- 1689,1695 ----
  
  	    if test "$have_dl" = yes; then
  		SHLIB_LD="${CC} -shared"
! 		DL_OBJS=""
  		DL_LIBS="-ldl"
  		LDFLAGS="-rdynamic"
  		LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
***************
*** 1742,1748 ****
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
--- 1742,1748 ----
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
***************
*** 1752,1763 ****
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS="-Wl,-Bexport"
  	    LD_SEARCH_FLAGS=""
  	    ;;
! 	NetBSD-*|FreeBSD-[1-2].*|OpenBSD-*)
  	    # Not available on all versions:  check for include file.
  	    ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
--- 1752,1763 ----
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS="-Wl,-Bexport"
  	    LD_SEARCH_FLAGS=""
  	    ;;
! 	NetBSD-*|FreeBSD-[12].*|OpenBSD-*)
  	    # Not available on all versions:  check for include file.
  	    ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
***************
*** 1792,1798 ****
  		SHLIB_LD="ld -Bshareable -x"
  		SHLIB_LD_LIBS=""
  		SHLIB_SUFFIX=".so"
! 		DL_OBJS="tclLoadDl.o"
  		DL_LIBS=""
  		LDFLAGS=""
  		LD_SEARCH_FLAGS=""
--- 1792,1798 ----
  		SHLIB_LD="ld -Bshareable -x"
  		SHLIB_LD_LIBS=""
  		SHLIB_SUFFIX=".so"
! 		DL_OBJS=""
  		DL_LIBS=""
  		LDFLAGS=""
  		LD_SEARCH_FLAGS=""
***************
*** 1825,1831 ****
  	    SHLIB_LD="ld -Bshareable -x"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
--- 1825,1831 ----
  	    SHLIB_LD="ld -Bshareable -x"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
***************
*** 1865,1871 ****
  	    SHLIB_LD="ld -shared"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
--- 1865,1871 ----
  	    SHLIB_LD="ld -shared"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
***************
*** 1876,1882 ****
  	    SHLIB_LD='ld -shared -expect_unresolved "*"'
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
--- 1876,1882 ----
  	    SHLIB_LD='ld -shared -expect_unresolved "*"'
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS=""
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
***************
*** 1899,1905 ****
  	    SHLIB_LD="ld -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS=""
  	    LDFLAGS="-belf -Wl,-Bexport"
  	    LD_SEARCH_FLAGS=""
--- 1899,1905 ----
  	    SHLIB_LD="ld -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS=""
  	    LDFLAGS="-belf -Wl,-Bexport"
  	    LD_SEARCH_FLAGS=""
***************
*** 1909,1915 ****
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
--- 1909,1915 ----
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS=""
***************
*** 1919,1925 ****
  	    SHLIB_LD="ld"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
--- 1919,1925 ----
  	    SHLIB_LD="ld"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
***************
*** 1942,1948 ****
  
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
--- 1942,1948 ----
  
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    LDFLAGS=""
  	    LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
***************
*** 1973,1979 ****
  
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  		LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
--- 1973,1979 ----
  
  	    SHLIB_LD_LIBS='${LIBS}'
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
  		LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
***************
*** 1996,2002 ****
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS="tclLoadDl.o"
  	    DL_LIBS="-ldl"
  	    # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
  	    # that don't grok the -Bexport option.  Test that it does.
--- 1996,2002 ----
  	    SHLIB_LD="cc -G"
  	    SHLIB_LD_LIBS=""
  	    SHLIB_SUFFIX=".so"
! 	    DL_OBJS=""
  	    DL_LIBS="-ldl"
  	    # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
  	    # that don't grok the -Bexport option.  Test that it does.
***************
*** 2191,2197 ****
  	DL_OBJS=""
      fi
  
!     if test "x$DL_OBJS" != "x" ; then
  	BUILD_DLTEST="\$(DLTEST_TARGETS)"
      else
  	echo "Can't figure out how to do dynamic loading or shared libraries"
--- 2191,2197 ----
  	DL_OBJS=""
      fi
  
!     if test "x$SHLIB_LD" != "x" ; then
  	BUILD_DLTEST="\$(DLTEST_TARGETS)"
      else
  	echo "Can't figure out how to do dynamic loading or shared libraries"
***************
*** 2256,2268 ****
  fi
  
      if test "$tcl_ok" = "yes"; then
! 	CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
! 	LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
  	DBGX=g
  	echo "$ac_t""yes" 1>&6
      else
! 	CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
! 	LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
  	DBGX=""
  	echo "$ac_t""no" 1>&6
      fi
--- 2256,2268 ----
  fi
  
      if test "$tcl_ok" = "yes"; then
! 	CFLAGS_DEFAULT='${CFLAGS_DEBUG}'
! 	LDFLAGS_DEFAULT='${LDFLAGS_DEBUG}'
  	DBGX=g
  	echo "$ac_t""yes" 1>&6
      else
! 	CFLAGS_DEFAULT='${CFLAGS_OPTIMIZE}'
! 	LDFLAGS_DEFAULT='${LDFLAGS_OPTIMIZE}'
  	DBGX=""
  	echo "$ac_t""no" 1>&6
      fi
***************
*** 3959,3964 ****
--- 3959,3965 ----
      fi
  
  
+ TK_SHARED_BUILD=${SHARED_BUILD}
  eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
  eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
  
***************
*** 3968,3978 ****
  if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
      TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
      TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX}
!     MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${LIBS}"
      RANLIB=":"
  
! #    TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
!     TCL_STUB_FLAGS=""
  else
      TK_SHLIB_CFLAGS=""
      TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX}
--- 3969,3978 ----
  if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
      TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
      TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX}
!     MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) \${TCL_STUB_LIB_SPEC} \${LIBS}"
      RANLIB=":"
  
!     TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
  else
      TK_SHLIB_CFLAGS=""
      TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX}
***************
*** 4007,4012 ****
--- 4007,4208 ----
  fi
  
  #--------------------------------------------------------------------
+ #	Checking X lib for i18n related things.
+ #--------------------------------------------------------------------
+ 
+ X11_IMAKE_FLAGS=""
+ tk_oldCflags=$CFLAGS
+ tk_oldLibs=$LIBS
+ CFLAGS="$CFLAGS $XINCLUDES"
+ LIBS="$XLIBSW $LIBS"
+ 
+ echo $ac_n "checking XRegisterIMInstantiateCallback""... $ac_c" 1>&6
+ echo "configure:4020: checking XRegisterIMInstantiateCallback" >&5
+ cat > conftest.$ac_ext <<EOF
+ #line 4022 "configure"
+ #include "confdefs.h"
+ 
+ #include <X11/Xlib.h>
+ 
+ int main() {
+ 
+ XRegisterIMInstantiateCallback(0, 0, 0, 0, 0, 0);
+ 
+ ; return 0; }
+ EOF
+ if { (eval echo configure:4033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   rm -rf conftest*
+   
+ echo "$ac_t""yes" 1>&6
+ X11_IMAKE_FLAGS="-DHAVE_XIMREGINSTCB"
+ 
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   
+ echo "$ac_t""no" 1>&6
+ 
+ fi
+ rm -f conftest*
+ 
+ echo $ac_n "checking XIDProc""... $ac_c" 1>&6
+ echo "configure:4050: checking XIDProc" >&5
+ cat > conftest.$ac_ext <<EOF
+ #line 4052 "configure"
+ #include "confdefs.h"
+ 
+ #include <X11/Xlib.h>
+ 
+ int main() {
+ 
+ XIDProc *a;
+ 
+ ; return 0; }
+ EOF
+ if { (eval echo configure:4063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   rm -rf conftest*
+   
+ echo "$ac_t""yes" 1>&6
+ 
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   
+ echo "$ac_t""no" 1>&6
+ X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS -DNO_XIDPROC"
+ 
+ fi
+ rm -f conftest*
+ 
+ HAVE_XMKMF=""
+ # Extract the first word of "xmkmf", so it can be a program name with args.
+ set dummy xmkmf; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+ echo "configure:4083: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_path_HAVE_XMKMF'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   case "$HAVE_XMKMF" in
+   /*)
+   ac_cv_path_HAVE_XMKMF="$HAVE_XMKMF" # Let the user override the test with a path.
+   ;;
+   ?:/*)			 
+   ac_cv_path_HAVE_XMKMF="$HAVE_XMKMF" # Let the user override the test with a dos path.
+   ;;
+   *)
+   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+   ac_dummy="/usr/X11R6/bin /usr/X11R5/bin /usr/local/X11R6/bin /usr/local/X11R5/bin /usr/openwin/bin /usr/X11/bin /usr/X386/bin /usr/sww/bin /usr/unsupported/bin"
+   for ac_dir in $ac_dummy; do 
+     test -z "$ac_dir" && ac_dir=.
+     if test -f $ac_dir/$ac_word; then
+       ac_cv_path_HAVE_XMKMF="$ac_dir/$ac_word"
+       break
+     fi
+   done
+   IFS="$ac_save_ifs"
+   test -z "$ac_cv_path_HAVE_XMKMF" && ac_cv_path_HAVE_XMKMF=""""
+   ;;
+ esac
+ fi
+ HAVE_XMKMF="$ac_cv_path_HAVE_XMKMF"
+ if test -n "$HAVE_XMKMF"; then
+   echo "$ac_t""$HAVE_XMKMF" 1>&6
+ else
+   echo "$ac_t""no" 1>&6
+ fi
+ 
+ if test "X$HAVE_XMKMF" != "X"; then
+     IMAKE_FLAGS=""
+     if test -d ImakeCheck; then
+         rm -rf ImakeCheck
+     fi
+     mkdir ImakeCheck
+     cat << EOF > ImakeCheck/Imakefile
+ SRCS = dummy.c
+ OBJS = dummy.o
+ 
+ ComplexProgramTarget(dummy)
+ EOF
+     cat << EOF > ImakeCheck/dummy.c
+ static int justAnInt = 0;
+ EOF
+     (cd ./ImakeCheck; rm -f Makefile Makefile.*; eval $HAVE_XMKMF) > /dev/null 2>&1
+     for i in `(cd ./ImakeCheck; make -n dummy.o)`
+     do
+         case $i in -D*) IMAKE_FLAGS="$IMAKE_FLAGS $i";; esac
+     done
+     if test "X$IMAKE_FLAGS" != "X"; then
+         echo "$ac_t""Add these flags for proper compile: $IMAKE_FLAGS" 1>&6
+         X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS $IMAKE_FLAGS"
+     fi
+     rm -rf ImakeCheck
+ fi
+ 
+ # At last check FreeBSD and have -lxpg4.
+ echo $ac_n "checking system version (for additional locale library)""... $ac_c" 1>&6
+ echo "configure:4145: checking system version (for additional locale library)" >&5
+ if test -f /usr/lib/NextStep/software_version; then
+     system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
+ else
+     system=`uname -s`-`uname -r`
+     if test "$?" -ne 0 ; then
+         system=unknown
+     else
+         # Special check for weird MP-RAS system (uname returns weird
+         # results, and the version is kept in special file).
+     
+         if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+             system=MP-RAS-`awk '{print $3}' /etc/.relid'`
+         fi
+         if test "`uname -s`" = "AIX" ; then
+             system=AIX-`uname -v`.`uname -r`
+         fi
+     fi
+ fi
+ 
+ case $system in
+     FreeBSD-*)
+ 	LIBS="$XLIBSW -lxpg4 $tk_oldLibs"
+ 	CFLAGS="$CFLAGS $X11_IMAKE_FLAGS"
+ 	cat > conftest.$ac_ext <<EOF
+ #line 4170 "configure"
+ #include "confdefs.h"
+ 
+ #include <locale.h>
+ 
+ int main() {
+ 
+ (void)setlocale(LC_ALL, "");
+ 
+ ; return 0; }
+ EOF
+ if { (eval echo configure:4181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   rm -rf conftest*
+   
+ echo "$ac_t""use xpg4 library." 1>&6
+ XLIBSW="$XLIBSW -lxpg4"
+ 
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   
+ echo "$ac_t""no need other libraries." 1>&6
+ 
+ fi
+ rm -f conftest*
+ 	;;
+     *)
+ 	echo "$ac_t""No additional library is needed." 1>&6
+ 	;;
+ esac
+ 
+ CFLAGS=$tk_oldCflags
+ LIBS=$tk_oldLibs
+ 
+ #--------------------------------------------------------------------
  # The statements below define various symbols relating to creating
  # the stub'd version of the Tk library
  #
***************
*** 4046,4051 ****
--- 4242,4248 ----
  
  
  
+ 
  eval "TK_LIB_FILE=${TK_LIB_FILE}"
  
  
***************
*** 4071,4078 ****
  
  
  
! #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
! #AC_SUBST(TCL_BUILD_LIB_SPEC)
  
  
  
--- 4268,4277 ----
  
  
  
! 
! 
! 
! 
  
  
  
***************
*** 4204,4210 ****
  
  ac_given_srcdir=$srcdir
  
! trap 'rm -fr `echo "Makefile tkConfig.sh" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
  cat >> $CONFIG_STATUS <<EOF
  
--- 4403,4409 ----
  
  ac_given_srcdir=$srcdir
  
! trap 'rm -fr `echo "Makefile tkConfig.sh pkgIndex.tcl" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
  cat >> $CONFIG_STATUS <<EOF
  
***************
*** 4245,4252 ****
--- 4444,4453 ----
  s%@DL_LIBS@%$DL_LIBS%g
  s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g
  s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g
+ s%@HAVE_XMKMF@%$HAVE_XMKMF%g
  s%@STUB_LIB_FILE@%$STUB_LIB_FILE%g
  s%@TK_STUB_LIB_FILE@%$TK_STUB_LIB_FILE%g
+ s%@TCL_STUB_LIB_FLAG@%$TCL_STUB_LIB_FLAG%g
  s%@TK_STUB_LIB_FLAG@%$TK_STUB_LIB_FLAG%g
  s%@TK_BUILD_STUB_LIB_SPEC@%$TK_BUILD_STUB_LIB_SPEC%g
  s%@TK_STUB_LIB_SPEC@%$TK_STUB_LIB_SPEC%g
***************
*** 4271,4282 ****
--- 4472,4487 ----
  s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
  s%@SHLIB_VERSION@%$SHLIB_VERSION%g
  s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
+ s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g
  s%@TCL_LIB_FLAG@%$TCL_LIB_FLAG%g
+ s%@TCL_BUILD_STUB_LIB_SPEC@%$TCL_BUILD_STUB_LIB_SPEC%g
+ s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
  s%@TCL_DBGX@%$TCL_DBGX%g
  s%@TCL_VERSION@%$TCL_VERSION%g
  s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g
  s%@TK_CC_SEARCH_FLAGS@%$TK_CC_SEARCH_FLAGS%g
  s%@TK_LD_SEARCH_FLAGS@%$TK_LD_SEARCH_FLAGS%g
+ s%@TK_SHARED_LIB_FILE@%$TK_SHARED_LIB_FILE%g
  s%@TK_LIB_FILE@%$TK_LIB_FILE%g
  s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g
  s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
***************
*** 4288,4293 ****
--- 4493,4499 ----
  s%@XINCLUDES@%$XINCLUDES%g
  s%@XLIBSW@%$XLIBSW%g
  s%@TK_SHARED_BUILD@%$TK_SHARED_BUILD%g
+ s%@X11_IMAKE_FLAGS@%$X11_IMAKE_FLAGS%g
  
  CEOF
  EOF
***************
*** 4329,4335 ****
  
  cat >> $CONFIG_STATUS <<EOF
  
! CONFIG_FILES=\${CONFIG_FILES-"Makefile tkConfig.sh"}
  EOF
  cat >> $CONFIG_STATUS <<\EOF
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
--- 4535,4541 ----
  
  cat >> $CONFIG_STATUS <<EOF
  
! CONFIG_FILES=\${CONFIG_FILES-"Makefile tkConfig.sh pkgIndex.tcl"}
  EOF
  cat >> $CONFIG_STATUS <<\EOF
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
