Index: aclocal/shobj.m4 ================================================================== --- aclocal/shobj.m4 +++ aclocal/shobj.m4 @@ -39,32 +39,28 @@ 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.]) - ]) - ]) - ]) - ]) - ]) - ]) - ]) - ]) - ]) + DC_TEST_SHOBJFLAGS([-fPIC], [-DPIC], [-shared], [ + 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) @@ -116,22 +112,24 @@ ]) LDFLAGS="$OLD_LDFLAGS" unset OLD_LDFLAGS - ADDLDFLAGS="" - for opt in $LDFLAGS $LIBS; do - if echo "$opt" | grep '^-L' >/dev/null; then - rpathdir="`echo "$opt" | sed 's@^-L *@@'`" - ADDLDFLAGS="$ADDLDFLAGS $rsk_cv_link_set_rpath -Wl,$rpathdir" - fi - done - unset opt - - LDFLAGS="$LDFLAGS $ADDLDFLAGS" - - unset ADDLDFLAGS + if test -n "$rsk_cv_link_set_rpath"; then + ADDLDFLAGS="" + for opt in $LDFLAGS $LIBS; do + if echo "$opt" | grep '^-L' >/dev/null; then + rpathdir="`echo "$opt" | sed 's@^-L *@@'`" + ADDLDFLAGS="$ADDLDFLAGS $rsk_cv_link_set_rpath -Wl,$rpathdir" + fi + done + unset opt + + LDFLAGS="$LDFLAGS $ADDLDFLAGS" + + unset ADDLDFLAGS + fi fi ]) AC_DEFUN([DC_CHK_OS_INFO], [ AC_CANONICAL_HOST @@ -166,11 +164,10 @@ ;; esac ;; mingw32|mingw32msvc*) SHOBJEXT="dll" - AREXT='lib' 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' ;; Index: aclocal/tcl.m4 ================================================================== --- aclocal/tcl.m4 +++ aclocal/tcl.m4 @@ -1,10 +1,10 @@ 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], [ + AC_CACHE_CHECK([for runnable tclsh], [tcl_cv_tclsh_native_path], [ dnl Try to find a runnable tclsh if test -z "$TCLCONFIGPATH"; then TCLCONFIGPATH=/dev/null/null fi @@ -50,22 +50,24 @@ TCLCONFIGPATH="$withval" ], [ if test "$cross_compiling" = 'no'; then TCLEXT_FIND_TCLSH_PROG - tclConfigCheckDir="`echo 'puts [[tcl::pkgconfig get libdir,runtime]]' | "$TCLSH_PROG" 2>/dev/null`" + tclConfigCheckDir0="`echo 'puts [[tcl::pkgconfig get libdir,runtime]]' | "$TCLSH_PROG" 2>/dev/null`" + tclConfigCheckDir1="`echo 'puts [[tcl::pkgconfig get scriptdir,runtime]]' | "$TCLSH_PROG" 2>/dev/null`" else - tclConfigCheckDir=/dev/null/null + tclConfigCheckDir0=/dev/null/null + tclConfigCheckDir1=/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 + for dir in "$tclConfigCheckDir0" "$tclConfigCheckDir1" $dirs; do if test -f "$dir/tclConfig.sh"; then TCLCONFIGPATH="$dir" break fi @@ -109,10 +111,17 @@ 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([shared], AS_HELP_STRING([--disable-shared], [disable the shared build (same as --enable-static)]), [ + if test "$enableval" = "no"; then + TCLEXT_BUILD='static' + TCL_SUPPORTS_STUBS=0 + fi + ]) + 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 @@ -152,10 +161,14 @@ )` 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 }'`" + if test "$prefix" = 'NONE' -a "$exec_prefix" = 'NONE' -a "${libdir}" = '${exec_prefix}/lib'; then + TCL_PACKAGE_PATH="`echo "${TCL_PACKAGE_PATH}" | sed 's@ *$''@@' | awk '{ print [$]1 }'`" + else + TCL_PACKAGE_PATH='${libdir}' + fi AC_SUBST(TCL_PACKAGE_PATH) AC_SUBST(LIBS) ])