Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -1,6 +1,5 @@ -aclocal aclocal.m4 autom4te.cache configure config.guess config.log Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -1,10 +1,10 @@ CC = @CC@ AR = @AR@ RANLIB = @RANLIB@ CFLAGS = @CFLAGS@ @SHOBJFLAGS@ -CPPFLAGS = @CPPFLAGS@ -I@srcdir@ -I. @DEFS@ +CPPFLAGS = @CPPFLAGS@ -I@srcdir@ -I. @DEFS@ @TCL_DEFS@ LDFLAGS = @LDFLAGS@ @SHOBJLDFLAGS@ LIBS = @LIBS@ INSTALL = @INSTALL@ PACKAGE_VERSION = @PACKAGE_VERSION@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ ADDED aclocal/shobj.m4 Index: aclocal/shobj.m4 ================================================================== --- /dev/null +++ aclocal/shobj.m4 @@ -0,0 +1,199 @@ +dnl Usage: +dnl DC_TEST_SHOBJFLAGS(shobjflags, shobjldflags, action-if-not-found) +dnl +AC_DEFUN([DC_TEST_SHOBJFLAGS], [ + AC_SUBST(SHOBJFLAGS) + AC_SUBST(SHOBJCPPFLAGS) + AC_SUBST(SHOBJLDFLAGS) + + OLD_LDFLAGS="$LDFLAGS" + OLD_CFLAGS="$CFLAGS" + OLD_CPPFLAGS="$CPPFLAGS" + + SHOBJFLAGS="" + SHOBJCPPFLAGS="" + SHOBJLDFLAGS="" + + CFLAGS="$OLD_CFLAGS $1" + CPPFLAGS="$OLD_CPPFLAGS $2" + LDFLAGS="$OLD_LDFLAGS $3" + + AC_TRY_LINK([#include +int unrestst(void);], [ printf("okay\n"); unrestst(); return(0); ], [ SHOBJFLAGS="$1"; SHOBJCPPFLAGS="$2"; SHOBJLDFLAGS="$3" ], [ + LDFLAGS="$OLD_LDFLAGS" + CFLAGS="$OLD_CFLAGS" + CPPFLAGS="$OLD_CPPFLAGS" + $4 + ]) + + LDFLAGS="$OLD_LDFLAGS" + CFLAGS="$OLD_CFLAGS" + CPPFLAGS="$OLD_CPPFLAGS" +]) + +AC_DEFUN([DC_GET_SHOBJFLAGS], [ + AC_SUBST(SHOBJFLAGS) + AC_SUBST(SHOBJCPPFLAGS) + AC_SUBST(SHOBJLDFLAGS) + + DC_CHK_OS_INFO + + AC_MSG_CHECKING(how to create shared objects) + + if test -z "$SHOBJFLAGS" -a -z "$SHOBJLDFLAGS" -a -z "$SHOBJCPPFLAGS"; then + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared -rdynamic], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared -rdynamic -mimpure-text], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared -mimpure-text], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared -rdynamic -Wl,-G,-z,textoff], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared -Wl,-G], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared -dynamiclib -flat_namespace -undefined suppress -bind_at_load], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-dynamiclib -flat_namespace -undefined suppress -bind_at_load], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-Wl,-dynamiclib -Wl,-flat_namespace -Wl,-undefined,suppress -Wl,-bind_at_load], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-dynamiclib -flat_namespace -undefined suppress], [ + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-dynamiclib], [ + AC_MSG_RESULT(cant) + AC_MSG_ERROR([We are unable to make shared objects.]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + fi + + AC_MSG_RESULT($SHOBJCPPFLAGS $SHOBJFLAGS $SHOBJLDFLAGS) + + DC_SYNC_SHLIBOBJS +]) + +AC_DEFUN([DC_SYNC_SHLIBOBJS], [ + AC_SUBST(SHLIBOBJS) + SHLIBOBJS="" + for obj in $LIB@&t@OBJS; do + SHLIBOBJS="$SHLIBOBJS `echo $obj | sed 's/\.o$/_shr.o/g'`" + done +]) + +AC_DEFUN([DC_SYNC_RPATH], [ + OLD_LDFLAGS="$LDFLAGS" + + for tryrpath in "-Wl,-rpath" "-Wl,--rpath" "-Wl,-R"; do + LDFLAGS="$OLD_LDFLAGS $tryrpath -Wl,/tmp" + AC_LINK_IFELSE(AC_LANG_PROGRAM([], [ return(0); ]), [ + rpathldflags="$tryrpath" + break + ]) + done + unset tryrpath + + LDFLAGS="$OLD_LDFLAGS" + unset OLD_LDFLAGS + + ADDLDFLAGS="" + for opt in $LDFLAGS; do + if echo "$opt" | grep '^-L' >/dev/null; then + rpathdir=`echo "$opt" | sed 's@^-L *@@'` + ADDLDFLAGS="$ADDLDFLAGS $rpathldflags -Wl,$rpathdir" + fi + done + unset opt rpathldflags + + LDFLAGS="$LDFLAGS $ADDLDFLAGS" + + unset ADDLDFLAGS +]) + +AC_DEFUN([DC_CHK_OS_INFO], [ + AC_CANONICAL_HOST + AC_SUBST(SHOBJEXT) + AC_SUBST(SHOBJFLAGS) + AC_SUBST(SHOBJCPPFLAGS) + AC_SUBST(SHOBJLDFLAGS) + AC_SUBST(CFLAGS) + AC_SUBST(CPPFLAGS) + AC_SUBST(AREXT) + + if test "$dc_cv_dc_chk_os_info_called" != '1'; then + dc_cv_dc_chk_os_info_called='1' + + AC_MSG_CHECKING(host operating system) + AC_MSG_RESULT($host_os) + + SHOBJEXT="so" + AREXT="a" + + case $host_os in + darwin*) + SHOBJEXT="dylib" + ;; + hpux*) + case "$host_cpu" in + ia64) + SHOBJEXT="so" + ;; + *) + SHOBJEXT="sl" + ;; + esac + ;; + aix[0-9].*) + SHOBJEXT="a" + ;; + mingw32|mingw32msvc*) + SHOBJEXT="dll" + CFLAGS="$CFLAGS -mms-bitfields" + CPPFLAGS="$CPPFLAGS -mms-bitfields" + SHOBJCPPFLAGS="-DPIC" + SHOBJLDFLAGS='-shared -Wl,--dll -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a' + ;; + msvc) + SHOBJEXT="dll" + CFLAGS="$CFLAGS -nologo" + SHOBJCPPFLAGS='-DPIC' + SHOBJLDFLAGS='/LD /LINK /NODEFAULTLIB:MSVCRT' + ;; + cygwin*) + SHOBJEXT="dll" + SHOBJFLAGS="-fPIC" + SHOBJCPPFLAGS="-DPIC" + CFLAGS="$CFLAGS -mms-bitfields" + CPPFLAGS="$CPPFLAGS -mms-bitfields" + SHOBJLDFLAGS='-shared -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a' + ;; + esac + fi +]) + +AC_DEFUN([SHOBJ_SET_SONAME], [ + SAVE_LDFLAGS="$LDFLAGS" + + AC_MSG_CHECKING([how to specify soname]) + + for try in "-Wl,--soname,$1" "Wl,-install_name,$1" '__fail__'; do + LDFLAGS="$SAVE_LDFLAGS" + + if test "${try}" = '__fail__'; then + AC_MSG_RESULT([can't]) + + break + fi + + LDFLAGS="${LDFLAGS} ${try}" + AC_TRY_LINK([void TestTest(void) { return; }], [], [ + LDFLAGS="${SAVE_LDFLAGS}" + SHOBJLDFLAGS="${SHOBJLDFLAGS} ${try}" + + AC_MSG_RESULT([$try]) + + break + ]) + done + + AC_SUBST(SHOBJLDFLAGS) +]) ADDED aclocal/tcl.m4 Index: aclocal/tcl.m4 ================================================================== --- /dev/null +++ aclocal/tcl.m4 @@ -0,0 +1,161 @@ +dnl Tcl M4 Routines + +dnl Find a runnable Tcl +AC_DEFUN([TCLEXT_FIND_TCLSH_PROG], [ + AC_CACHE_CHECK([runnable tclsh], [tcl_cv_tclsh_native_path], [ + dnl Try to find a runnable tclsh + if test -z "$TCLCONFIGPATH"; then + TCLCONFIGPATH=/dev/null/null + fi + + for try_tclsh in "$TCLSH_NATIVE" "$TCLCONFIGPATH/../bin/tclsh" \ + "$TCLCONFIGPATH/../bin/tclsh8.6" \ + "$TCLCONFIGPATH/../bin/tclsh8.5" \ + "$TCLCONFIGPATH/../bin/tclsh8.4" \ + `which tclsh 2>/dev/null` \ + `which tclsh8.6 2>/dev/null` \ + `which tclsh8.5 2>/dev/null` \ + `which tclsh8.4 2>/dev/null` \ + tclsh; do + if test -z "$try_tclsh"; then + continue + fi + if test -x "$try_tclsh"; then + if echo 'exit 0' | "$try_tclsh" 2>/dev/null >/dev/null; then + tcl_cv_tclsh_native_path="$try_tclsh" + + break + fi + fi + done + + if test "$TCLCONFIGPATH" = '/dev/null/null'; then + unset TCLCONFIGPATH + fi + ]) + + TCLSH_PROG="${tcl_cv_tclsh_native_path}" + AC_SUBST(TCLSH_PROG) +]) + + +dnl Must call AC_CANONICAL_HOST before calling us +AC_DEFUN([TCLEXT_FIND_TCLCONFIG], [ + + TCLCONFIGPATH="" + AC_ARG_WITH([tcl], AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), [ + if test "x$withval" = "xno"; then + AC_MSG_ERROR([cant build without tcl]) + fi + + TCLCONFIGPATH="$withval" + ], [ + if test "$cross_compiling" = 'no'; then + TCLEXT_FIND_TCLSH_PROG + tclConfigCheckDir="`echo 'puts [[tcl::pkgconfig get libdir,runtime]]' | "$TCLSH_PROG"`" + else + tclConfigCheckDir=/dev/null/null + fi + + if test "$cross_compiling" = 'no'; then + dirs="/usr/$host_alias/lib /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64" + else + dirs='' + fi + + for dir in "$tclConfigCheckDir" $dirs; do + if test -f "$dir/tclConfig.sh"; then + TCLCONFIGPATH="$dir" + + break + fi + done + ]) + + AC_MSG_CHECKING([for path to tclConfig.sh]) + + if test -z "$TCLCONFIGPATH"; then + AC_MSG_ERROR([unable to locate tclConfig.sh. Try --with-tcl.]) + fi + + AC_SUBST(TCLCONFIGPATH) + + AC_MSG_RESULT([$TCLCONFIGPATH]) + + dnl Find Tcl if we haven't already + if test -z "$TCLSH_PROG"; then + TCLEXT_FIND_TCLSH_PROG + fi +]) + +dnl Must define TCLCONFIGPATH before calling us (i.e., by TCLEXT_FIND_TCLCONFIG) +AC_DEFUN([TCLEXT_LOAD_TCLCONFIG], [ + AC_MSG_CHECKING([for working tclConfig.sh]) + + if test -f "$TCLCONFIGPATH/tclConfig.sh"; then + . "$TCLCONFIGPATH/tclConfig.sh" + else + AC_MSG_ERROR([unable to load tclConfig.sh]) + fi + + + AC_MSG_RESULT([found]) +]) + +AC_DEFUN([TCLEXT_INIT], [ + AC_CANONICAL_HOST + + TCLEXT_FIND_TCLCONFIG + TCLEXT_LOAD_TCLCONFIG + + AC_DEFINE_UNQUOTED([MODULE_SCOPE], [static], [Define how to declare a function should only be visible to the current module]) + + TCLEXT_BUILD='shared' + AC_ARG_ENABLE([static], AS_HELP_STRING([--enable-static], [enable a static build]), [ + if test "$enableval" = "yes"; then + TCLEXT_BUILD='static' + TCL_SUPPORTS_STUBS=0 + fi + ]) + + AC_ARG_ENABLE([stubs], AS_HELP_STRING([--disable-stubs], [disable use of Tcl stubs]), [ + if test "$enableval" = "no"; then + TCL_SUPPORTS_STUBS=0 + else + TCL_SUPPORTS_STUBS=1 + fi + ]) + + if test "$TCL_SUPPORTS_STUBS" = "1"; then + AC_DEFINE([USE_TCL_STUBS], [1], [Define if you are using the Tcl Stubs Mechanism]) + + TCL_STUB_LIB_SPEC="`eval echo "${TCL_STUB_LIB_SPEC}"`" + LIBS="${LIBS} ${TCL_STUB_LIB_SPEC}" + else + TCL_LIB_SPEC="`eval echo "${TCL_LIB_SPEC}"`" + LIBS="${LIBS} ${TCL_LIB_SPEC}" + fi + + TCL_INCLUDE_SPEC="`eval echo "${TCL_INCLUDE_SPEC}"`" + + CFLAGS="${CFLAGS} ${TCL_INCLUDE_SPEC}" + CPPFLAGS="${CPPFLAGS} ${TCL_INCLUDE_SPEC}" + TCL_DEFS_TCL_ONLY=`( + eval "set -- ${TCL_DEFS}" + for flag in "[$]@"; do + case "${flag}" in + -DTCL_*) + AS_ECHO_N("${flag} ") + ;; + esac + done + )` + TCL_DEFS="${TCL_DEFS_TCL_ONLY}" + AC_SUBST(TCL_DEFS) + + dnl Needed for package installation + TCL_PACKAGE_PATH="`echo "${TCL_PACKAGE_PATH}" | sed 's@ *$''@@' | awk '{ print [$]1 }'`" + AC_SUBST(TCL_PACKAGE_PATH) + + AC_SUBST(LIBS) +]) ADDED aclocal/versionscript.m4 Index: aclocal/versionscript.m4 ================================================================== --- /dev/null +++ aclocal/versionscript.m4 @@ -0,0 +1,85 @@ +AC_DEFUN([DC_SETUP_STABLE_API], [ + VERSIONSCRIPT="$1" + SYMFILE="$2" + + DC_FIND_STRIP_AND_REMOVESYMS([$SYMFILE]) + DC_SETVERSIONSCRIPT([$VERSIONSCRIPT], [$SYMFILE]) +]) + + +AC_DEFUN([DC_SETVERSIONSCRIPT], [ + VERSIONSCRIPT="$1" + SYMFILE="$2" + TMPSYMFILE="${SYMFILE}.tmp" + TMPVERSIONSCRIPT="${VERSIONSCRIPT}.tmp" + + echo "${SYMPREFIX}Test_Symbol" > "${TMPSYMFILE}" + + echo '{' > "${TMPVERSIONSCRIPT}" + echo ' local:' >> "${TMPVERSIONSCRIPT}" + echo " ${SYMPREFIX}Test_Symbol;" >> "${TMPVERSIONSCRIPT}" + echo '};' >> "${TMPVERSIONSCRIPT}" + + SAVE_LDFLAGS="${LDFLAGS}" + + AC_MSG_CHECKING([for how to set version script]) + + for tryaddldflags in "-Wl,--version-script,${TMPVERSIONSCRIPT}" "-Wl,-exported_symbols_list,${TMPSYMFILE}"; do + LDFLAGS="${SAVE_LDFLAGS} ${tryaddldflags}" + AC_TRY_LINK([void Test_Symbol(void) { return; }], [], [ + addldflags="`echo "${tryaddldflags}" | sed 's/\.tmp$//'`" + + break + ]) + done + + rm -f "${TMPSYMFILE}" + rm -f "${TMPVERSIONSCRIPT}" + + LDFLAGS="${SAVE_LDFLAGS}" + + if test -n "${addldflags}"; then + SHOBJLDFLAGS="${SHOBJLDFLAGS} ${addldflags}" + + AC_MSG_RESULT($addldflags) + else + AC_MSG_RESULT([don't know]) + fi + + AC_SUBST(SHOBJLDFLAGS) +]) + +AC_DEFUN([DC_FIND_STRIP_AND_REMOVESYMS], [ + SYMFILE="$1" + + dnl Determine how to strip executables + AC_CHECK_TOOLS(OBJCOPY, objcopy gobjcopy, [false]) + AC_CHECK_TOOLS(STRIP, strip gstrip, [false]) + + if test "x${STRIP}" = "xfalse"; then + STRIP="${OBJCOPY}" + fi + + WEAKENSYMS='true' + REMOVESYMS='true' + SYMPREFIX='' + + case $host_os in + darwin*) + SYMPREFIX="_" + REMOVESYMS="${STRIP} -u -x" + ;; + *) + if test "x${OBJCOPY}" != "xfalse"; then + WEAKENSYMS="${OBJCOPY} --keep-global-symbols=${SYMFILE}" + REMOVESYMS="${OBJCOPY} --discard-all" + elif test "x${STRIP}" != "xfalse"; then + REMOVESYMS="${STRIP} -x" + fi + ;; + esac + + AC_SUBST(WEAKENSYMS) + AC_SUBST(REMOVESYMS) + AC_SUBST(SYMPREFIX) +])