*** unix/configure.in.orig	Wed Dec 15 05:00:19 1999
--- unix/configure.in	Sun Jan 16 17:43:01 2000
***************
*** 40,46 ****
  #------------------------------------------------------------------------
  
  if test "${GCC}" = "yes" ; then
!     CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
  else
      CFLAGS_WARNING=""
  fi
--- 40,46 ----
  #------------------------------------------------------------------------
  
  if test "${GCC}" = "yes" ; then
!     CFLAGS_WARNING="-Wall -Wno-implicit-int"
  else
      CFLAGS_WARNING=""
  fi
***************
*** 333,338 ****
--- 333,339 ----
  
  SC_ENABLE_SHARED
  
+ TK_SHARED_BUILD=${SHARED_BUILD}
  eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
  eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
  
***************
*** 342,352 ****
  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}
--- 343,352 ----
  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}
***************
*** 381,386 ****
--- 381,493 ----
  fi
  
  #--------------------------------------------------------------------
+ #	Checking X lib for i18n related things.
+ #--------------------------------------------------------------------
+ 
+ X11_IMAKE_FLAGS=""
+ tk_oldCflags=$CFLAGS
+ tk_oldLibs=$LIBS
+ CFLAGS="$CFLAGS $XINCLUDES"
+ LIBS="$XLIBSW $LIBS"
+ 
+ AC_MSG_CHECKING([XRegisterIMInstantiateCallback])
+ AC_TRY_LINK([
+ #include <X11/Xlib.h>
+ ], [
+ XRegisterIMInstantiateCallback(0, 0, 0, 0, 0, 0);
+ ], [
+ AC_MSG_RESULT(yes)
+ X11_IMAKE_FLAGS="-DHAVE_XIMREGINSTCB"
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+ 
+ AC_MSG_CHECKING([XIDProc])
+ AC_TRY_COMPILE([
+ #include <X11/Xlib.h>
+ ], [
+ XIDProc *a;
+ ], [
+ AC_MSG_RESULT(yes)
+ ], [
+ AC_MSG_RESULT(no)
+ X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS -DNO_XIDPROC"
+ ])
+ 
+ HAVE_XMKMF=""
+ AC_PATH_PROG(HAVE_XMKMF, xmkmf, "", /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)
+ 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
+         AC_MSG_RESULT(Add these flags for proper compile: $IMAKE_FLAGS)
+         X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS $IMAKE_FLAGS"
+     fi
+     rm -rf ImakeCheck
+ fi
+ 
+ # At last check FreeBSD and have -lxpg4.
+ AC_MSG_CHECKING([system version (for additional locale library)])
+ 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"
+ 	AC_TRY_COMPILE([
+ #include <locale.h>
+ ], [
+ (void)setlocale(LC_ALL, "");
+ ], [
+ AC_MSG_RESULT(use xpg4 library.)
+ XLIBSW="$XLIBSW -lxpg4"
+ ], [
+ AC_MSG_RESULT(no need other libraries.)
+ ])
+ 	;;
+     *)
+ 	AC_MSG_RESULT(No additional library is needed.)
+ 	;;
+ esac
+ 
+ CFLAGS=$tk_oldCflags
+ LIBS=$tk_oldLibs
+ 
+ #--------------------------------------------------------------------
  # The statements below define various symbols relating to creating
  # the stub'd version of the Tk library
  #
***************
*** 410,415 ****
--- 517,523 ----
  AC_SUBST(STUB_LIB_FILE)
  
  AC_SUBST(TK_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
  AC_SUBST(TK_STUB_LIB_FLAG)
  AC_SUBST(TK_BUILD_STUB_LIB_SPEC)
  AC_SUBST(TK_STUB_LIB_SPEC)
***************
*** 444,452 ****
  AC_SUBST(SHLIB_VERSION)
  AC_SUBST(TCL_BIN_DIR)
  AC_SUBST(TCL_LIB_SPEC)
  AC_SUBST(TCL_LIB_FLAG)
! #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
! #AC_SUBST(TCL_BUILD_LIB_SPEC)
  AC_SUBST(TCL_DBGX)
  AC_SUBST(TCL_LIB_FLAG)
  AC_SUBST(TCL_SRC_DIR)
--- 552,561 ----
  AC_SUBST(SHLIB_VERSION)
  AC_SUBST(TCL_BIN_DIR)
  AC_SUBST(TCL_LIB_SPEC)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
  AC_SUBST(TCL_LIB_FLAG)
! AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
! AC_SUBST(TCL_BUILD_LIB_SPEC)
  AC_SUBST(TCL_DBGX)
  AC_SUBST(TCL_LIB_FLAG)
  AC_SUBST(TCL_SRC_DIR)
***************
*** 454,459 ****
--- 563,569 ----
  AC_SUBST(TK_BUILD_LIB_SPEC)
  AC_SUBST(TK_CC_SEARCH_FLAGS)
  AC_SUBST(TK_LD_SEARCH_FLAGS)
+ AC_SUBST(TK_SHARED_LIB_FILE)
  AC_SUBST(TK_LIB_FILE)
  AC_SUBST(TK_LIB_FLAG)
  AC_SUBST(TK_LIB_SPEC)
***************
*** 465,469 ****
  AC_SUBST(XINCLUDES)
  AC_SUBST(XLIBSW)
  AC_SUBST(TK_SHARED_BUILD)
! 
! AC_OUTPUT(Makefile tkConfig.sh)
--- 575,579 ----
  AC_SUBST(XINCLUDES)
  AC_SUBST(XLIBSW)
  AC_SUBST(TK_SHARED_BUILD)
! AC_SUBST(X11_IMAKE_FLAGS)
! AC_OUTPUT(Makefile tkConfig.sh pkgIndex.tcl)
