diff options
author | dgp <dgp@users.sourceforge.net> | 2007-09-17 15:22:00 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-09-17 15:22:00 (GMT) |
commit | 777a2a880ff0c83299ac2489cc3bf941f94bbfe3 (patch) | |
tree | c860ea7524851d3cc00ac79e998ecd4e70c96d0e | |
parent | e751f8d3399b9be3df5d5e8bc5aabb15a354713a (diff) | |
download | tk-777a2a880ff0c83299ac2489cc3bf941f94bbfe3.zip tk-777a2a880ff0c83299ac2489cc3bf941f94bbfe3.tar.gz tk-777a2a880ff0c83299ac2489cc3bf941f94bbfe3.tar.bz2 |
merge updates from HEAD
-rw-r--r-- | ChangeLog | 28 | ||||
-rw-r--r-- | generic/tk.h | 6 | ||||
-rw-r--r-- | generic/tkConsole.c | 4 | ||||
-rw-r--r-- | generic/tkMain.c | 4 | ||||
-rw-r--r-- | generic/tkStubLib.c | 22 | ||||
-rw-r--r-- | generic/tkWindow.c | 50 | ||||
-rw-r--r-- | library/ttk/combobox.tcl | 105 | ||||
-rwxr-xr-x | unix/configure | 69 | ||||
-rw-r--r-- | unix/tcl.m4 | 85 |
9 files changed, 248 insertions, 125 deletions
@@ -1,3 +1,31 @@ +2007-09-17 Don Porter <dgp@users.sourceforge.net> + + * generic/tkConsole.c: Revised callers of Tcl_InitStubs() to account + * generic/tkMain.c: for restored compatible support for the call + * generic/tkWindow.c: Tcl_InitStubs(interp, TCL_VERSION, 1). Also + revised Tcl_PkgRequire() call for Tcl so that, for example, a Tk + library built against Tcl 8.5.1 headers will not refuse to [load] + into a Tcl 8.5.0 interpreter. [Tcl Bug 1578344]. + + * generic/tk.h: Revised Tk_InitStubs() to restore Tk 8.4 + * generic/tkStubLib.c: source compatibility with callers of + * generic/tkWindow.c: Tk_InitStubs(interp, TK_VERSION, 1). + +2007-09-17 Joe English <jenglish@users.sourceforge.net> + + * library/ttk/combobox.tcl: Try to improve combobox appearance + on OSX + Tk 8.5 [#1780286]. + +2007-09-15 Daniel Steffen <das@users.sourceforge.net> + + * unix/tcl.m4: replace all direct references to compiler by ${CC} to + enable CC overriding at configure & make time; run + check for visibility "hidden" with all compilers; + quoting fixes from TEA tcl.m4. + (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by + 'cc' compiler driver. + * unix/configure: autoconf-2.59 + 2007-09-14 Daniel Steffen <das@users.sourceforge.net> * macosx/Wish-Common.xcconfig: enable Tcl DTrace support. diff --git a/generic/tk.h b/generic/tk.h index 7a9355e..422e985 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.98.2.2 2007/05/30 18:31:47 dgp Exp $ + * RCS: @(#) $Id: tk.h,v 1.98.2.3 2007/09/17 15:22:00 dgp Exp $ */ #ifndef _TK @@ -1486,11 +1486,13 @@ typedef struct Tk_ElementSpec { const char * Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, const char *version, int exact)); +const char * Tk_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp, + const char *version, int exact)); #ifndef USE_TK_STUBS #define Tk_InitStubs(interp, version, exact) \ - Tcl_PkgRequire(interp, "Tk", version, exact) + Tk_PkgInitStubsCheck(interp, version, exact) #endif diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 43140de..94b4482 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConsole.c,v 1.31.2.1 2007/09/11 18:32:35 dgp Exp $ + * RCS: @(#) $Id: tkConsole.c,v 1.31.2.2 2007/09/17 15:22:00 dgp Exp $ */ #include "tk.h" @@ -233,7 +233,7 @@ Tk_InitConsoleChannels( * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_PATCH_LEVEL, 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { return; } diff --git a/generic/tkMain.c b/generic/tkMain.c index ad8d37a..c959877 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMain.c,v 1.23.2.2 2007/09/11 18:32:35 dgp Exp $ + * RCS: @(#) $Id: tkMain.c,v 1.23.2.3 2007/09/17 15:22:00 dgp Exp $ */ #include <ctype.h> @@ -110,7 +110,7 @@ Tk_MainEx( * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_PATCH_LEVEL, 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { abort(); } diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index 74cab2f..fc1995a 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubLib.c,v 1.14.2.1 2007/09/07 01:25:36 dgp Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.14.2.2 2007/09/17 15:22:01 dgp Exp $ */ /* @@ -85,11 +85,29 @@ Tk_InitStubs( CONST char *actualVersion; TkStubs **stubsPtrPtr = &tkStubsPtr; /* squelch warning */ - actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact, + actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0, (ClientData *) stubsPtrPtr); if (!actualVersion) { return NULL; } + if (exact) { + CONST char *p = version; + int count = 0; + + while (*p) { + count += !isdigit(*p++); + } + if (count == 1) { + if (0 != strncmp(version, actualVersion, strlen(version))) { + return NULL; + } + } else { + actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL); + if (actualVersion == NULL) { + return NULL; + } + } + } if (!tkStubsPtr) { Tcl_SetResult(interp, diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 2478846..b80f8ca 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.80.2.2 2007/09/11 18:32:35 dgp Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.80.2.3 2007/09/17 15:22:01 dgp Exp $ */ #include "tkInt.h" @@ -2948,7 +2948,7 @@ Initialize( * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_PATCH_LEVEL, 0) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { return TCL_ERROR; } @@ -3181,7 +3181,7 @@ Initialize( geometry = NULL; } - if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, 0) == NULL) { + if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) { code = TCL_ERROR; goto done; } @@ -3273,6 +3273,50 @@ tkInit"); } /* + *---------------------------------------------------------------------- + * + * Tk_PkgInitStubsCheck -- + * + * This is a replacement routine for Tk_InitStubs() that is called + * from code where -DUSE_TK_STUBS has not been enabled. + * + * Results: + * Returns the version of a conforming Tk stubs table, or NULL, if + * the table version doesn't satisfy the requested requirements, + * according to historical practice. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +CONST char * +Tk_PkgInitStubsCheck( + Tcl_Interp *interp, + CONST char * version, + int exact) +{ + CONST char *actualVersion = Tcl_PkgRequire(interp, "Tk", version, 0); + + if (exact && actualVersion) { + CONST char *p = version; + int count = 0; + + while (*p) { + count += !isdigit(*p++); + } + if (count == 1) { + if (0 != strncmp(version, actualVersion, strlen(version))) { + return NULL; + } + } else { + return Tcl_PkgPresent(interp, "Tk", version, 1); + } + } + return actualVersion; +} +/* * Local Variables: * mode: c * c-basic-offset: 4 diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 5af7a2d..2757832 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -1,7 +1,7 @@ # -# $Id: combobox.tcl,v 1.3 2006/12/17 21:09:46 jenglish Exp $ +# $Id: combobox.tcl,v 1.3.2.1 2007/09/17 15:22:01 dgp Exp $ # -# Ttk widget set: combobox bindings. +# Combobox bindings. # # Each combobox $cb has a child $cb.popdown, which contains # a listbox $cb.popdown.l and a scrollbar. The listbox -listvariable @@ -60,9 +60,9 @@ bind ComboboxListbox <Motion> { # but on Windows and OSX that doesn't prevent the user from interacting # with other applications. We need to popdown the listbox when this happens. # -# On OSX, the listbox gets a <Deactivate> event. This doesn't happen +# On OSX, the listbox gets a <Deactivate> event. This doesn't happen # on Windows or X11, but it does get a <FocusOut> event. However on OSX -# in Tk 8.5, the listbox gets spurious <FocusOut> events when the listbox +# in Tk 8.5, the listbox gets spurious <FocusOut> events when the listbox # is posted (see #1349811). # # The following seems to work: @@ -80,19 +80,25 @@ switch -- [tk windowingsystem] { ### Option database settings. # -if {[tk windowingsystem] eq "x11"} { - option add *TCombobox*Listbox.background white -} +option add *TCombobox*Listbox.font TkTextFont +option add *TCombobox*Listbox.relief flat +option add *TCombobox*Listbox.highlightThickness 0 -# The following ensures that the popdown listbox uses the same font -# as the combobox entry field (at least for the standard Ttk themes). +## Platform-specific settings. # -option add *TCombobox*Listbox.font TkTextFont +switch -- [tk windowingsystem] { + x11 { + option add *TCombobox*Listbox.background white + } + aqua { + option add *TCombobox*Listbox.borderWidth 0 + } +} ### Binding procedures. # -## combobox::Press $mode $x $y -- +## Press $mode $x $y -- # ButtonPress binding for comboboxes. # Either post/unpost the listbox, or perform Entry widget binding, # depending on widget state and location of button press. @@ -104,8 +110,8 @@ proc ttk::combobox::Press {mode w x y} { && [string match *textarea [$w identify $x $y]] }] + focus $w if {$State(entryPress)} { - focus $w switch -- $mode { s { ttk::entry::Shift-Press $w $x ; # Shift } 2 { ttk::entry::Select $w $x word ; # Double click} @@ -118,7 +124,7 @@ proc ttk::combobox::Press {mode w x y} { } } -## combobox::Drag -- +## Drag -- # B1-Motion binding for comboboxes. # If the initial ButtonPress event was handled by Entry binding, # perform Entry widget drag binding; otherwise nothing. @@ -134,13 +140,13 @@ proc ttk::combobox::Drag {w x} { # For editable comboboxes, set the selection and insert cursor. # proc ttk::combobox::TraverseIn {w} { - $w instate {!readonly !disabled} { + $w instate {!readonly !disabled} { $w selection range 0 end $w icursor end } } -## SelectEntry $cb $index -- +## SelectEntry $cb $index -- # Set the combobox selection in response to a user action. # proc ttk::combobox::SelectEntry {cb index} { @@ -184,7 +190,7 @@ proc ttk::combobox::LBCancel {lb} { } ## LBTab -- -# Tab key binding for combobox listbox: +# Tab key binding for combobox listbox: # Set the selection, and navigate to next/prev widget. # proc ttk::combobox::LBTab {lb dir} { @@ -196,40 +202,36 @@ proc ttk::combobox::LBTab {lb dir} { if {$newFocus ne ""} { LBSelected $lb - # The [grab release] call in [Unpost] queues events that later + # The [grab release] call in [Unpost] queues events that later # re-set the focus. [update] to make sure these get processed first: update tk::TabToWindow $newFocus } } -## PopdownShell -- -# Returns the popdown shell widget associated with a combobox, +namespace eval ::ttk::combobox { + # @@@ Until we have a proper native scrollbar on Aqua, use + # @@@ the regular Tk one. Use ttk::scrollbar on other platforms. + if {[tk windowingsystem] ne "aqua"} { + namespace import -force ::ttk::scrollbar + } +} + +## PopdownWindow -- +# Returns the popdown widget associated with a combobox, # creating it if necessary. # -proc ttk::combobox::PopdownShell {cb} { +proc ttk::combobox::PopdownWindow {cb} { if {![winfo exists $cb.popdown]} { - set popdown [toplevel $cb.popdown -relief solid -bd 1] - wm withdraw $popdown - wm overrideredirect $popdown 1 - wm transient $popdown [winfo toplevel $cb] - - # XXX Until we have a proper native scrollbar on Aqua, use - # XXX the regular Tk one - if {[tk windowingsystem] eq "aqua"} { - scrollbar $popdown.sb -orient vertical \ - -command [list $popdown.l yview] - } else { - ttk::scrollbar $popdown.sb -orient vertical \ - -command [list $popdown.l yview] - } + set popdown [PopdownToplevel $cb.popdown] + + scrollbar $popdown.sb \ + -orient vertical -command [list $popdown.l yview] listbox $popdown.l \ -listvariable ttk::combobox::Values($cb) \ -yscrollcommand [list $popdown.sb set] \ -exportselection false \ -selectmode browse \ - -borderwidth 2 -relief flat \ - -highlightthickness 0 \ -activestyle none \ ; @@ -243,7 +245,30 @@ proc ttk::combobox::PopdownShell {cb} { return $cb.popdown } -## combobox::Post $cb -- +## PopdownToplevel -- Create toplevel window for the combobox popdown +# +proc ttk::combobox::PopdownToplevel {w} { + toplevel $w -class Popdown + wm withdraw $w + wm overrideredirect $w true + wm transient $w [winfo toplevel [winfo parent $w]] + switch -- [tk windowingsystem] { + default - + x11 { + $w configure -relief solid -borderwidth 1 + } + win32 { + $w configure -relief solid -borderwidth 1 + } + aqua { + $w configure -relief solid -borderwidth 0 + # @@@ tk::unsupported::MacWindowStyle style $w help none + } + } + return $w +} + +## Post $cb -- # Pop down the associated listbox. # proc ttk::combobox::Post {cb} { @@ -262,7 +287,7 @@ proc ttk::combobox::Post {cb} { # $cb state pressed - set popdown [PopdownShell $cb] + set popdown [PopdownWindow $cb] set values [$cb cget -values] set current [$cb current] if {$current < 0} { @@ -320,7 +345,7 @@ proc ttk::combobox::Post {cb} { focus $popdown.l } -## combobox::Unpost $cb -- +## Unpost $cb -- # Unpost the listbox, restore focus to combobox widget. # proc ttk::combobox::Unpost {cb} { @@ -332,7 +357,7 @@ proc ttk::combobox::Unpost {cb} { focus $cb } -## combobox::TogglePost $cb -- +## TogglePost $cb -- # Post the listbox if unposted, unpost otherwise. # proc ttk::combobox::TogglePost {cb} { diff --git a/unix/configure b/unix/configure index 49f2b44..9f34a00 100755 --- a/unix/configure +++ b/unix/configure @@ -1491,7 +1491,7 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. - if test -f ${TCL_BIN_DIR}/Makefile ; then + if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} @@ -1501,7 +1501,7 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) - if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then @@ -1510,7 +1510,7 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi done fi - if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi @@ -4624,26 +4624,25 @@ echo "${ECHO_T}$do64bitVIS" >&6 do64bit=yes fi - # Step 0.c: Check if gcc visibility support is available. Do this here so + # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. - if test "$GCC" = "yes" ; then - echo "$as_me:$LINENO: checking if gcc supports visibility \"hidden\"" >&5 -echo $ECHO_N "checking if gcc supports visibility \"hidden\"... $ECHO_C" >&6 + echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 +echo $ECHO_N "checking if compiler supports visibility \"hidden\"... $ECHO_C" >&6 if test "${tcl_cv_cc_visibility_hidden+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat >conftest.$ac_ext <<_ACEOF + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - extern __attribute__((__visibility__("hidden"))) void f(void); - void f(void) {} + extern __attribute__((__visibility__("hidden"))) void f(void); + void f(void) {} int main () { @@ -4683,17 +4682,16 @@ tcl_cv_cc_visibility_hidden=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$hold_cflags + CFLAGS=$hold_cflags fi echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6 - if test $tcl_cv_cc_visibility_hidden = yes; then + if test $tcl_cv_cc_visibility_hidden = yes; then cat >>confdefs.h <<\_ACEOF #define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) _ACEOF - fi fi # Step 1: set the variable "system" to hold the name and version number @@ -4931,7 +4929,7 @@ echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" + SHLIB_LD='${CC} -shared' else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi @@ -5049,7 +5047,7 @@ _ACEOF ;; BeOS*) SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" + SHLIB_LD='${CC} -nostart' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5141,7 +5139,7 @@ fi ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" + SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5152,7 +5150,7 @@ fi ;; dgux*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5261,7 +5259,7 @@ fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" + SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi @@ -5277,7 +5275,7 @@ fi hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes - SHLIB_LD="${CC} -shared" + SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} @@ -5442,7 +5440,7 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-O2 + CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. @@ -5546,7 +5544,7 @@ _ACEOF SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - SHLIB_LD="${CC} -shared" + SHLIB_LD='${CC} -shared' DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" @@ -5561,7 +5559,7 @@ _ACEOF SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " + SHLIB_LD='${CC} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" @@ -5570,7 +5568,7 @@ _ACEOF ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5580,7 +5578,7 @@ _ACEOF ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5647,7 +5645,7 @@ echo "${ECHO_T}$tcl_cv_ld_elf" >&6 *) SHLIB_CFLAGS="-fpic";; esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -6182,7 +6180,7 @@ _ACEOF ;; NEXTSTEP-*) SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" + SHLIB_LD='${CC} -nostdlib -r' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" @@ -6292,7 +6290,7 @@ _ACEOF ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -6346,7 +6344,7 @@ _ACEOF DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" + SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else @@ -6377,7 +6375,7 @@ _ACEOF arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt "3" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else @@ -6421,7 +6419,7 @@ echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" + SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = "yes" ; then @@ -6434,14 +6432,19 @@ echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" fi else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" + case $system in + SunOS-5.[1-9][0-9]*) + SHLIB_LD='${CC} -G -z text';; + *) + SHLIB_LD='/usr/ccs/bin/ld -G -z text';; + esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3b3dcad..6844843 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -297,7 +297,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. - if test -f ${TCL_BIN_DIR}/Makefile ; then + if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} @@ -307,7 +307,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) - if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then + if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then @@ -316,7 +316,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ fi done fi - if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then + if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi @@ -365,7 +365,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) - . ${TK_BIN_DIR}/tkConfig.sh + . "${TK_BIN_DIR}/tkConfig.sh" else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi @@ -380,7 +380,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. - if test -f ${TK_BIN_DIR}/Makefile ; then + if test -f "${TK_BIN_DIR}/Makefile" ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} @@ -390,7 +390,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ # against Tk.framework installed in an arbitary location. case ${TK_DEFS} in *TK_FRAMEWORK*) - if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then + if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then for i in "`cd ${TK_BIN_DIR}; pwd`" \ "`cd ${TK_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then @@ -399,7 +399,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ fi done fi - if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then + if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi @@ -1086,23 +1086,21 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ do64bit=yes fi - # Step 0.c: Check if gcc visibility support is available. Do this here so + # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. - if test "$GCC" = "yes" ; then - AC_CACHE_CHECK([if gcc supports visibility "hidden"], - tcl_cv_cc_visibility_hidden, [ - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - AC_TRY_LINK([ - extern __attribute__((__visibility__("hidden"))) void f(void); - void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes, - tcl_cv_cc_visibility_hidden=no) - CFLAGS=$hold_cflags]) - if test $tcl_cv_cc_visibility_hidden = yes; then - AC_DEFINE(MODULE_SCOPE, - [extern __attribute__((__visibility__("hidden")))], - [Compiler support for module scope symbols]) - fi + AC_CACHE_CHECK([if compiler supports visibility "hidden"], + tcl_cv_cc_visibility_hidden, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" + AC_TRY_LINK([ + extern __attribute__((__visibility__("hidden"))) void f(void); + void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes, + tcl_cv_cc_visibility_hidden=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_visibility_hidden = yes; then + AC_DEFINE(MODULE_SCOPE, + [extern __attribute__((__visibility__("hidden")))], + [Compiler support for module scope symbols]) fi # Step 1: set the variable "system" to hold the name and version number @@ -1203,7 +1201,7 @@ dnl AC_CHECK_TOOL(AR, ar) LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" + SHLIB_LD='${CC} -shared' else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi @@ -1241,7 +1239,7 @@ dnl AC_CHECK_TOOL(AR, ar) ;; BeOS*) SHLIB_CFLAGS="-fPIC" - SHLIB_LD="${CC} -nostart" + SHLIB_LD='${CC} -nostart' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -1266,7 +1264,7 @@ dnl AC_CHECK_TOOL(AR, ar) ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" - SHLIB_LD="cc -shared" + SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -1277,7 +1275,7 @@ dnl AC_CHECK_TOOL(AR, ar) ;; dgux*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -1309,7 +1307,7 @@ dnl AC_CHECK_TOOL(AR, ar) LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then - SHLIB_LD="gcc -shared" + SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi @@ -1325,7 +1323,7 @@ dnl AC_CHECK_TOOL(AR, ar) hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes - SHLIB_LD="${CC} -shared" + SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} @@ -1419,7 +1417,7 @@ dnl AC_CHECK_TOOL(AR, ar) SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - CFLAGS_OPTIMIZE=-O2 + CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. @@ -1466,7 +1464,7 @@ dnl AC_CHECK_TOOL(AR, ar) SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - SHLIB_LD="${CC} -shared" + SHLIB_LD='${CC} -shared' DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" @@ -1481,7 +1479,7 @@ dnl AC_CHECK_TOOL(AR, ar) SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 - SHLIB_LD="${CC} -shared " + SHLIB_LD='${CC} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" @@ -1490,7 +1488,7 @@ dnl AC_CHECK_TOOL(AR, ar) ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -1500,7 +1498,7 @@ dnl AC_CHECK_TOOL(AR, ar) ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -1544,7 +1542,7 @@ dnl AC_CHECK_TOOL(AR, ar) *) SHLIB_CFLAGS="-fpic";; esac - SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}" + SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -1727,7 +1725,7 @@ dnl AC_CHECK_TOOL(AR, ar) ;; NEXTSTEP-*) SHLIB_CFLAGS="" - SHLIB_LD="cc -nostdlib -r" + SHLIB_LD='${CC} -nostdlib -r' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" @@ -1834,7 +1832,7 @@ dnl AC_CHECK_TOOL(AR, ar) ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -1881,7 +1879,7 @@ dnl AC_CHECK_TOOL(AR, ar) DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" + SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else @@ -1905,7 +1903,7 @@ dnl AC_CHECK_TOOL(AR, ar) arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then - if test "`gcc -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then + if test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt "3" ; then AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) else do64bit_ok=yes @@ -1946,7 +1944,7 @@ dnl AC_CHECK_TOOL(AR, ar) DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then - SHLIB_LD="$CC -shared" + SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = "yes" ; then @@ -1959,14 +1957,19 @@ dnl AC_CHECK_TOOL(AR, ar) #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" fi else - SHLIB_LD="/usr/ccs/bin/ld -G -z text" + case $system in + SunOS-5.[[1-9]][[0-9]]*) + SHLIB_LD='${CC} -G -z text';; + *) + SHLIB_LD='/usr/ccs/bin/ld -G -z text';; + esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" - SHLIB_LD="cc -G" + SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" |