diff options
author | das <das> | 2005-05-23 20:24:56 (GMT) |
---|---|---|
committer | das <das> | 2005-05-23 20:24:56 (GMT) |
commit | b1aaa8a9641695afda195f1e3450c10a4de59670 (patch) | |
tree | 6a75bc6224147be902b9f8707503d0ea3eebc0a9 /unix | |
parent | 3e5059b18e124abb2aacc381e3e3c8c2e95c23c3 (diff) | |
download | tk-b1aaa8a9641695afda195f1e3450c10a4de59670.zip tk-b1aaa8a9641695afda195f1e3450c10a4de59670.tar.gz tk-b1aaa8a9641695afda195f1e3450c10a4de59670.tar.bz2 |
* macosx/Makefile:
* macosx/README:
* macosx/Tk-Info.plist.in (new file):
* macosx/Wish-Info.plist.in (new file):
* unix/Makefile.in:
* unix/configure.in:
* unix/tcl.m4:
* unix/tkUnixInit.c: moved all Darwin framework and TkAqua build
support from macosx/Wish.pbproj and macosx/Makefile into the standard
unix configure/make buildsystem, the project and macosx/Makefile are
no longer required to build Tk.framework and/or TkAqua. TkAqua is now
enabled by the --enable-aqua configure option, and static and
non-framework builds of TkAqua are now available via the standard
configure switches. Tk/X11 can also be built as a framework. The
macosx/Makefile now wraps the unix buildsystem and no longer uses the
projects, embedded builds are still only available via this Makefile,
but for other builds it is not longer required (but its current
functionality is still available for backwards compatibility). The
projects currently do not call through to the Makefile to build
(unlike Tcl.pbproj) so project builds may differ from makefile builds.
Due to issues with spaces in pathnames, 'Wish Shell.app' has been
renamed to 'Wish.app', the macosx/Makefile installs backwards
compatibility symlinks for the old name.
* macosx/tkMacOSXInit.c (TkpInit): added support for Tk resource file
in non-framework and static builds: the resource file is copied into a
__tk_rsrc MachO segment of the library or executable at link time and
extracted into a temporary location at initialization.
* unix/configure: autoconf-2.59
* unix/tkConfig.h.in (new file): autoheader-2.59
Diffstat (limited to 'unix')
-rw-r--r-- | unix/Makefile.in | 454 | ||||
-rwxr-xr-x | unix/configure | 562 | ||||
-rw-r--r-- | unix/configure.in | 264 | ||||
-rw-r--r-- | unix/tcl.m4 | 3 | ||||
-rw-r--r-- | unix/tkConfig.h.in | 244 | ||||
-rw-r--r-- | unix/tkUnixInit.c | 45 |
6 files changed, 1341 insertions, 231 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in index 3cd744b..95f07a4 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -5,12 +5,12 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.102 2005/04/26 00:46:53 das Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.103 2005/05/23 20:24:59 das Exp $ # Current Tk version; used in various names. TCLVERSION = @TCL_VERSION@ -VERSION = @TK_VERSION@ +VERSION = @TK_VERSION@ MAJOR_VERSION = @TK_MAJOR_VERSION@ MINOR_VERSION = @TK_MINOR_VERSION@ PATCH_LEVEL = @TK_PATCH_LEVEL@ @@ -27,7 +27,8 @@ LOCALES = @LOCALES@ # specific files (exec_prefix) and machine-independent files such # as scripts (prefix). The values specified here may be overridden # at configure-time with the --exec-prefix and --prefix options -# to the "configure" script. +# to the "configure" script. The *dir vars are standard configure +# substitutions that are based off prefix and exec_prefix. prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -41,12 +42,12 @@ mandir = @mandir@ # to be different than those used for actually reference files at # run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix # when installing files. -INSTALL_ROOT = +INSTALL_ROOT = $(DESTDIR) # Directory from which applications will reference the library of Tcl # scripts (note: you can set the TK_LIBRARY environment variable at # run-time to override the compiled-in location): -TK_LIBRARY = $(prefix)/lib/tk$(VERSION) +TK_LIBRARY = @TK_LIBRARY@ # Path to use at runtime to refer to LIB_INSTALL_DIR: LIB_RUNTIME_DIR = $(libdir) @@ -57,16 +58,19 @@ BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install the .a or .so binary for the Tk library: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) -# Path name to use when installing library scripts: +# Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY) # Directory in which to install the include file tk.h: INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) +# Path to the private tk header dir: +PRIVATE_INCLUDE_DIR = @PRIVATE_INCLUDE_DIR@ + # Directory in which to (optionally) install the private tk headers: -PRIVATE_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) +PRIVATE_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(PRIVATE_INCLUDE_DIR) -# Top-level directory for manual entries: +# Top-level directory in which to install manual entries: MAN_INSTALL_DIR = $(INSTALL_ROOT)$(mandir) # Directory in which to install manual entry for wish: @@ -80,6 +84,12 @@ MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3 # Tcl commands implemented by Tk: MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann +# Path to the html documentation dir: +HTML_DIR = @HTML_DIR@ + +# Directory in which to install html documentation: +HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR) + # The directory containing the Tcl sources and headers appropriate # for this version of Tk ("srcdir" will be replaced or has already # been replaced by the configure script): @@ -99,8 +109,11 @@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ # Flag, 1: we're building a shared lib, 0 we're not TK_SHARED_BUILD = @TK_SHARED_BUILD@ +# Subdirectory of $(libdir) containing the pkgIndex.tcl file for loadable Tk +TK_PKG_DIR = @TK_PKG_DIR@ + # Directory in which to install the pkgIndex.tcl file for loadable Tk -PKG_INSTALL_DIR = $(LIB_INSTALL_DIR)/tk$(VERSION) +PKG_INSTALL_DIR = $(LIB_INSTALL_DIR)/$(TK_PKG_DIR) # Package index file for loadable Tk PKG_INDEX = $(PKG_INSTALL_DIR)/pkgIndex.tcl @@ -130,6 +143,8 @@ LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@ # include files are accessible via /usr/include). X11_INCLUDES = @XINCLUDES@ +AQUA_INCLUDES = -I$(MAC_OSX_DIR) -I$(XLIB_DIR) + # Linker switch(es) to use to link with the X11 library archive (the # configure script will try to set this value automatically, but you # can override it). @@ -232,7 +247,7 @@ TCL_STUB_FLAGS = @TCL_STUB_FLAGS@ # Libraries to use when linking. This definition is determined by the # configure script. LIBS = @LIBS@ $(X11_LIB_SWITCHES) @TCL_LIBS@ -WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @TCL_LIBS@ +WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @TCL_LIBS@ @EXTRA_WISH_LIBS@ # The symbol below provides support for dynamic loading and shared # libraries. See configure.in for a description of what it means. @@ -252,6 +267,12 @@ LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@ # support for embedded libraries on Darwin / Mac OS X DYLIB_INSTALL_DIR = ${LIB_RUNTIME_DIR} +# support for building the Aqua resource file +TK_RSRC_FILE = @TK_RSRC_FILE@ +WISH_RSRC_FILE = @WISH_RSRC_FILE@ +REZ = @REZ@ +REZ_SWITCHES = @REZ_FLAGS@ -i $(GENERIC_DIR) -i $(TCL_GENERIC_DIR) + # support for Xft: XFT_CFLAGS = @XFT_CFLAGS@ XFT_LIBS = @XFT_LIBS@ @@ -265,12 +286,14 @@ XFT_LIBS = @XFT_LIBS@ AC_FLAGS = @DEFS@ AR = @AR@ RANLIB = @RANLIB@ -SRC_DIR = @srcdir@/.. -TOP_DIR = @srcdir@/.. +SRC_DIR = @srcdir@ +TOP_DIR = $(SRC_DIR)/.. GENERIC_DIR = $(TOP_DIR)/generic -UNIX_DIR = @srcdir@ +UNIX_DIR = $(SRC_DIR) BMAP_DIR = $(TOP_DIR)/bitmaps TOOL_DIR = @TCL_SRC_DIR@/tools +MAC_OSX_DIR = $(TOP_DIR)/macosx +XLIB_DIR = $(TOP_DIR)/xlib #---------------------------------------------------------------- # The information below should be usable as is. The configure @@ -286,59 +309,75 @@ CC = @CC@ CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I${UNIX_DIR} -I${GENERIC_DIR} \ --I${BMAP_DIR} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${X11_INCLUDES} \ +-I${BMAP_DIR} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \ ${AC_FLAGS} ${PROTO_FLAGS} \ -${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS} +${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@ CC_SWITCHES = ${CC_SWITCHES_NO_STUBS} ${TCL_STUB_FLAGS} DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \ -I${BMAP_DIR} \ --I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${X11_INCLUDES} \ +-I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \ ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \ -${KEYSYM_FLAGS} +${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@ WISH_OBJS = tkAppInit.o TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o -WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \ +WIDG_OBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \ tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o \ tkPanedWindow.o tkScale.o tkScrollbar.o -CANVOBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \ +CANV_OBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \ tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o \ tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o -IMAGEOBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o +IMAGE_OBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o -TEXTOBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \ +TEXT_OBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \ tkTextMark.o tkTextTag.o tkTextWind.o # either tkUnixFont.o (default) or tkUnixRFont.o (if --enable-xft) # -FONTOBJS = @UNIX_FONT_OBJS@ +FONT_OBJS = @UNIX_FONT_OBJS@ -UNIXOBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ - tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \ - tkUnixFocus.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ - tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \ - tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o tkStubLib.o +GENERIC_OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o \ + tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o \ + tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o \ + tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ + tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o + +STUB_OBJS = tkStubInit.o tkStubLib.o STUB_LIB_OBJS = tkStubLib.o tkStubImg.o -OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o \ - tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o \ - tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o \ - tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ - tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o \ - $(UNIXOBJS) $(FONTOBJS) $(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS) +X11_OBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ + tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \ + tkUnixFocus.o $(FONT_OBJS) tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ + tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \ + tkUnixSend.o tkUnixWm.o tkUnixXId.o + +AQUA_OBJS = tkMacOSXBitmap.o tkMacOSXButton.o tkMacOSXClipboard.o \ + tkMacOSXColor.o tkMacOSXConfig.o tkMacOSXCursor.o tkMacOSXDebug.o \ + tkMacOSXDialog.o tkMacOSXDraw.o tkMacOSXEmbed.o tkMacOSXEntry.o \ + tkMacOSXEvent.o tkMacOSXFont.o tkMacOSXHLEvents.o tkMacOSXInit.o \ + tkMacOSXKeyboard.o tkMacOSXKeyEvent.o tkMacOSXMenu.o \ + tkMacOSXMenubutton.o tkMacOSXMenus.o tkMacOSXMouseEvent.o \ + tkMacOSXNotify.o tkMacOSXRegion.o tkMacOSXScrlbr.o tkMacOSXSend.o \ + tkMacOSXSubwindows.o tkMacOSXTest.o tkMacOSXWindowEvent.o \ + tkMacOSXWm.o tkMacOSXXStubs.o tkMacOSXCarbonEvents.o \ + tkFileFilter.o tkMacWinMenu.o tkPointer.o tkUnix3d.o tkUnixScale.o \ + xcolors.o xdraw.o xgc.o ximage.o xutil.o + +OBJS = $(GENERIC_OBJS) $(WIDG_OBJS) $(CANV_OBJS) $(IMAGE_OBJS) $(TEXT_OBJS) \ + $(STUB_OBJS) $(@TK_WINDOWINGSYSTEM@_OBJS) @PLAT_OBJS@ TK_DECLS = \ $(GENERIC_DIR)/tk.decls \ $(GENERIC_DIR)/tkInt.decls -SRCS = \ +GENERIC_SRCS = \ $(GENERIC_DIR)/tk3d.c $(GENERIC_DIR)/tkArgv.c \ $(GENERIC_DIR)/tkAtom.c $(GENERIC_DIR)/tkBind.c \ $(GENERIC_DIR)/tkBitmap.c $(GENERIC_DIR)/tkClipboard.c \ @@ -376,7 +415,9 @@ SRCS = \ $(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \ $(GENERIC_DIR)/tkOldConfig.c \ $(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \ - $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c \ + $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c + +X11_SRCS = \ $(UNIX_DIR)/tkAppInit.c $(UNIX_DIR)/tkUnix.c \ $(UNIX_DIR)/tkUnix3d.c \ $(UNIX_DIR)/tkUnixButton.c $(UNIX_DIR)/tkUnixColor.c \ @@ -394,6 +435,43 @@ SRCS = \ $(UNIX_DIR)/tkUnixSend.c $(UNIX_DIR)/tkUnixWm.c \ $(UNIX_DIR)/tkUnixXId.c +AQUA_SRCS = \ + $(MAC_OSX_DIR)/tkMacOSXBitmap.c $(MAC_OSX_DIR)/tkMacOSXButton.c \ + $(MAC_OSX_DIR)/tkMacOSXClipboard.c $(MAC_OSX_DIR)/tkMacOSXColor.c \ + $(MAC_OSX_DIR)/tkMacOSXConfig.c $(MAC_OSX_DIR)/tkMacOSXCursor.c \ + $(MAC_OSX_DIR)/tkMacOSXDebug.c $(MAC_OSX_DIR)/tkMacOSXDialog.c \ + $(MAC_OSX_DIR)/tkMacOSXDraw.c $(MAC_OSX_DIR)/tkMacOSXEmbed.c \ + $(MAC_OSX_DIR)/tkMacOSXEntry.c $(MAC_OSX_DIR)/tkMacOSXEvent.c \ + $(MAC_OSX_DIR)/tkMacOSXFont.c $(MAC_OSX_DIR)/tkMacOSXHLEvents.c \ + $(MAC_OSX_DIR)/tkMacOSXInit.c $(MAC_OSX_DIR)/tkMacOSXKeyboard.c \ + $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c $(MAC_OSX_DIR)/tkMacOSXMenu.c \ + $(MAC_OSX_DIR)/tkMacOSXMenubutton.c $(MAC_OSX_DIR)/tkMacOSXMenus.c \ + $(MAC_OSX_DIR)/tkMacOSXMouseEvent.c $(MAC_OSX_DIR)/tkMacOSXNotify.c \ + $(MAC_OSX_DIR)/tkMacOSXRegion.c $(MAC_OSX_DIR)/tkMacOSXScrlbr.c \ + $(MAC_OSX_DIR)/tkMacOSXSend.c $(MAC_OSX_DIR)/tkMacOSXSubwindows.c \ + $(MAC_OSX_DIR)/tkMacOSXTest.c $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c \ + $(MAC_OSX_DIR)/tkMacOSXWm.c $(MAC_OSX_DIR)/tkMacOSXXStubs.c \ + $(MAC_OSX_DIR)/tkMacOSXCarbonEvents.c \ + $(GENERIC_DIR)/tkFileFilter.c $(GENERIC_DIR)/tkMacWinMenu.c \ + $(GENERIC_DIR)/tkPointer.c $(UNIX_DIR)/tkUnix3d.c \ + $(UNIX_DIR)/tkUnixScale.c $(XLIB_DIR)/xcolors.c $(XLIB_DIR)/xdraw.c \ + $(XLIB_DIR)/xgc.c $(XLIB_DIR)/ximage.c $(XLIB_DIR)/xutil.c + +SRCS = $(GENERIC_SRCS) $(@TK_WINDOWINGSYSTEM@_SRCS) @PLAT_SRCS@ + +AQUA_RESOURCES = \ + $(MAC_OSX_DIR)/tkAboutDlg.r $(MAC_OSX_DIR)/tkMacOSXCursors.r \ + $(MAC_OSX_DIR)/tkMacOSXMenu.r $(MAC_OSX_DIR)/tkMacOSXXCursors.r + +AQUA_WISH_RESOURCES = $(MAC_OSX_DIR)/tkMacOSXAETE.r + +AQUA_HDRS = $(MAC_OSX_DIR)/tkMacOSX.h $(GENERIC_DIR)/tkIntXlibDecls.h + +AQUA_XLIB_HDRS = $(XLIB_DIR)/X11/*.h $(XLIB_DIR)/xbytes.h + +AQUA_PRIVATE_HDRS = $(MAC_OSX_DIR)/tkMacOSXPort.h $(MAC_OSX_DIR)/tkMacOSXInt.h + +X11_PRIVATE_HDRS = $(UNIX_DIR)/tkUnixPort.h $(UNIX_DIR)/tkUnixInt.h HDRS = bltList.h \ default.h ks_names.h tkPatch.h tk.h tkButton.h tkCanvas.h tkInt.h \ @@ -407,15 +485,15 @@ binaries: ${LIB_FILE} ${STUB_LIB_FILE} wish libraries: -$(SRC_DIR)/doc/man.macros: +$(TOP_DIR)/doc/man.macros: chmod +x $(UNIX_DIR)/install-sh - $(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(SRC_DIR)/doc/man.macros + $(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(TOP_DIR)/doc/man.macros -doc: $(SRC_DIR)/doc/man.macros +doc: $(TOP_DIR)/doc/man.macros # The following target is configured by autoconf to generate either # a shared library or non-shared library for Tk. -${LIB_FILE}: ${OBJS} +${LIB_FILE}: ${OBJS} ${STUB_LIB_FILE} @LIB_RSRC_FILE@ rm -f $@ @MAKE_LIB@ @@ -423,18 +501,28 @@ ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} rm -f $@ @MAKE_STUB_LIB@ +# Build Aqua resource files +${TK_RSRC_FILE}: $(AQUA_RESOURCES) + rm -f $@ + if test "$(REZ)" != ""; then \ + $(REZ) -o $@ $(REZ_SWITCHES) $(AQUA_RESOURCES); fi + +${WISH_RSRC_FILE}: $(AQUA_WISH_RESOURCES) + rm -f $@ + if test "$(REZ)" != ""; then \ + $(REZ) -o $@ $(REZ_SWITCHES) $(AQUA_WISH_RESOURCES); fi + # Make target which outputs the list of the .o contained in the Tk lib # usefull to build a single big shared library containing Tcl/Tk and other # extensions. used for the Tcl Plugin. -- dl tkLibObjs: @echo ${OBJS} - # This targets actually build the objects needed for the lib in the above # case objs: ${OBJS} -wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) +wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ $(CC) $(LDFLAGS) $(WISH_OBJS) \ @TK_BUILD_LIB_SPEC@ \ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o wish @@ -449,8 +537,7 @@ tktest: $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR=`pwd`:$(TCL_BIN_DIR) tktest-real: - ${CC} $(LDFLAGS) $(TKTEST_OBJS) \ - @TK_BUILD_LIB_SPEC@ \ + ${CC} $(LDFLAGS) $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ \ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest # FIXME: This xttest rule seems to be broken in a number of ways. @@ -470,7 +557,7 @@ xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) # % make test TESTFLAGS="-verbose bps -file fileName.test" test: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -479,7 +566,7 @@ test: tktest # Tests with different languages testlang: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -492,7 +579,7 @@ testlang: tktest # Useful target to launch a built tktest with the proper path,... runtest: tktest - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -501,7 +588,7 @@ runtest: tktest # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` shell: wish - @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \ + @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}; \ export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \ @@ -509,16 +596,18 @@ shell: wish # This target can be used to run wish inside either gdb or insight gdb: wish - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run @echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run gdb ./wish --command=gdb.run rm gdb.run -install: all install-binaries install-libraries install-demos install-doc +INSTALL_TARGETS = install-binaries install-libraries install-demos install-doc @EXTRA_INSTALL@ + +install: $(INSTALL_TARGETS) install-strip: - $(MAKE) install \ + $(MAKE) $(INSTALL_TARGETS) \ INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" \ INSTALL_LIBRARY="$(INSTALL_LIBRARY) ${INSTALL_STRIP_LIBRARY}" @@ -536,8 +625,8 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish else true; \ fi; \ done; - @if test ! -x $(UNIX_DIR)/install-sh; then \ - chmod +x $(UNIX_DIR)/install-sh; \ + @if test ! -x $(SRC_DIR)/install-sh; then \ + chmod +x $(SRC_DIR)/install-sh; \ fi @if test "x$(TK_SHARED_BUILD)" = "x1"; then \ echo "Creating package index $(PKG_INDEX)"; \ @@ -545,29 +634,33 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish (\ echo "if {[package vcompare [package provide Tcl]\ $(TCLVERSION)] != 0} { return }";\ - echo "package ifneeded Tk $(VERSION)\ - [list load [file join \$$dir .. $(TK_LIB_FILE)] Tk]";\ + relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)\ + [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ ) > $(PKG_INDEX); \ fi @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/" @@INSTALL_LIB@ @chmod 555 $(LIB_INSTALL_DIR)/$(LIB_FILE) - @echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)" - @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION) - @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/" - @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh @if test "$(TK_BUILD_EXP_FILE)" != ""; then \ echo "Installing $(TK_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \ $(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \ $(LIB_INSTALL_DIR)/$(TK_EXP_FILE); \ - fi + fi + @echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)" + @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION) + @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/" + @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ fi + @EXTRA_INSTALL_BINARIES@ -install-libraries: - @for i in $(INCLUDE_INSTALL_DIR) \ +install-libraries: libraries + @if test "$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)" != ""; then \ + XLIB_INCLUDE_INSTALL_DIR=$(INCLUDE_INSTALL_DIR)/X11; fi; \ + for i in $(INCLUDE_INSTALL_DIR) $${XLIB_INCLUDE_INSTALL_DIR} \ $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images \ $(SCRIPT_INSTALL_DIR)/msgs; \ do \ @@ -578,30 +671,34 @@ install-libraries: else true; \ fi; \ done; - @if test ! -x $(UNIX_DIR)/install-sh; then \ - chmod +x $(UNIX_DIR)/install-sh; \ + @if test ! -x $(SRC_DIR)/install-sh; then \ + chmod +x $(SRC_DIR)/install-sh; \ fi @echo "Installing header files"; @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \ - $(GENERIC_DIR)/tkPlatDecls.h ; \ + $(GENERIC_DIR)/tkPlatDecls.h $(@TK_WINDOWINGSYSTEM@_HDRS) ; \ do \ $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ done; + @for i in $(@TK_WINDOWINGSYSTEM@_XLIB_HDRS) ; \ + do \ + $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR)/X11; \ + done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; - @for i in $(SRC_DIR)/library/*.tcl $(GENERIC_DIR)/prolog.ps \ - $(SRC_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \ + @for i in $(TOP_DIR)/library/*.tcl $(GENERIC_DIR)/prolog.ps \ + $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \ do \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \ done; @echo "Installing library images directory"; - @for i in $(SRC_DIR)/library/images/*; \ + @for i in $(TOP_DIR)/library/images/*; \ do \ if [ -f $$i ] ; then \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/images; \ fi; \ done; @echo "Installing translation directory"; - @for i in $(SRC_DIR)/library/msgs/*.msg; \ + @for i in $(TOP_DIR)/library/msgs/*.msg; \ do \ if [ -f $$i ] ; then \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/msgs; \ @@ -621,7 +718,7 @@ install-demos: fi; \ done; @echo "Installing demos to $(SCRIPT_INSTALL_DIR)/demos/"; - @for i in $(SRC_DIR)/library/demos/*; \ + @for i in $(TOP_DIR)/library/demos/*; \ do \ if [ -f $$i ] ; then \ sed -e '3 s|exec wish|exec wish$(VERSION)|' \ @@ -633,7 +730,7 @@ install-demos: chmod 755 $(SCRIPT_INSTALL_DIR)/demos/$$i; \ done; @echo "Installing demo images"; - @for i in $(SRC_DIR)/library/demos/images/*; \ + @for i in $(TOP_DIR)/library/demos/images/*; \ do \ if [ -f $$i ] ; then \ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/demos/images; \ @@ -669,7 +766,7 @@ install-doc: done # Optional target to install private headers -install-private-headers: +install-private-headers: libraries @for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \ do \ if [ ! -d $$i ] ; then \ @@ -679,27 +776,32 @@ install-private-headers: else true; \ fi; \ done; - @if test ! -x $(UNIX_DIR)/install-sh; then \ - chmod +x $(UNIX_DIR)/install-sh; \ + @if test ! -x $(SRC_DIR)/install-sh; then \ + chmod +x $(SRC_DIR)/install-sh; \ fi @echo "Installing private header files"; @for i in $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \ $(GENERIC_DIR)/tkIntPlatDecls.h $(GENERIC_DIR)/tkPort.h \ - $(UNIX_DIR)/tkUnixPort.h $(UNIX_DIR)/tkUnixInt.h ; \ + $(@TK_WINDOWINGSYSTEM@_PRIVATE_HDRS); \ do \ $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \ done; + @if test -f tkConfig.h; then\ + $(INSTALL_DATA) tkConfig.h $(PRIVATE_INCLUDE_INSTALL_DIR); \ + fi; Makefile: $(UNIX_DIR)/Makefile.in $(SHELL) config.status +#tkConfig.h: $(UNIX_DIR)/tkConfig.h.in +# $(SHELL) config.status clean: - rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out errors \ - tktest wish config.info lib.exp + rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ + errors wish tktest lib.exp Tk *.rsrc distclean: clean - rm -f Makefile config.status config.cache config.log tkConfig.sh \ - $(PACKAGE).* prototype + rm -rf Makefile config.status config.cache config.log tkConfig.sh \ + $(PACKAGE).* prototype tkConfig.h *.plist Tk.framework depend: makedepend -- $(DEPEND_SWITCHES) -- $(SRCS) @@ -1013,27 +1115,131 @@ tkUnixWm.o: $(UNIX_DIR)/tkUnixWm.c tkUnixXId.o: $(UNIX_DIR)/tkUnixXId.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixXId.c -.c.o: - $(CC) -c $(CC_SWITCHES) $< +tkMacOSXBitmap.o: $(MAC_OSX_DIR)/tkMacOSXBitmap.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXBitmap.c -# -# Target to check for proper usage of UCHAR macro. -# +tkMacOSXButton.o: $(MAC_OSX_DIR)/tkMacOSXButton.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXButton.c -checkuchar: - -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR +tkMacOSXCarbonEvents.o: $(MAC_OSX_DIR)/tkMacOSXCarbonEvents.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXCarbonEvents.c -# -# Target to make sure that only symbols with "Tk" prefixes are -# exported. -# +tkMacOSXClipboard.o: $(MAC_OSX_DIR)/tkMacOSXClipboard.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXClipboard.c -checkexports: $(TK_LIB_FILE) - -nm -p $(TK_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k' +tkMacOSXColor.o: $(MAC_OSX_DIR)/tkMacOSXColor.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXColor.c + +tkMacOSXConfig.o: $(MAC_OSX_DIR)/tkMacOSXConfig.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXConfig.c + +tkMacOSXCursor.o: $(MAC_OSX_DIR)/tkMacOSXCursor.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXCursor.c + +tkMacOSXDebug.o: $(MAC_OSX_DIR)/tkMacOSXDebug.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXDebug.c +tkMacOSXDialog.o: $(MAC_OSX_DIR)/tkMacOSXDialog.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXDialog.c + +tkMacOSXDraw.o: $(MAC_OSX_DIR)/tkMacOSXDraw.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXDraw.c + +tkMacOSXEmbed.o: $(MAC_OSX_DIR)/tkMacOSXEmbed.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXEmbed.c + +tkMacOSXEntry.o: $(MAC_OSX_DIR)/tkMacOSXEntry.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXEntry.c + +tkMacOSXEvent.o: $(MAC_OSX_DIR)/tkMacOSXEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXEvent.c + +tkMacOSXFont.o: $(MAC_OSX_DIR)/tkMacOSXFont.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXFont.c + +tkMacOSXHLEvents.o: $(MAC_OSX_DIR)/tkMacOSXHLEvents.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXHLEvents.c + +tkMacOSXInit.o: $(MAC_OSX_DIR)/tkMacOSXInit.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXInit.c + +tkMacOSXKeyboard.o: $(MAC_OSX_DIR)/tkMacOSXKeyboard.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXKeyboard.c + +tkMacOSXKeyEvent.o: $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c + +tkMacOSXMenu.o: $(MAC_OSX_DIR)/tkMacOSXMenu.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMenu.c + +tkMacOSXMenubutton.o: $(MAC_OSX_DIR)/tkMacOSXMenubutton.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMenubutton.c + +tkMacOSXMenus.o: $(MAC_OSX_DIR)/tkMacOSXMenus.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMenus.c + +tkMacOSXMouseEvent.o: $(MAC_OSX_DIR)/tkMacOSXMouseEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXMouseEvent.c + +tkMacOSXNotify.o: $(MAC_OSX_DIR)/tkMacOSXNotify.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXNotify.c + +tkMacOSXRegion.o: $(MAC_OSX_DIR)/tkMacOSXRegion.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXRegion.c + +tkMacOSXScale.o: $(MAC_OSX_DIR)/tkMacOSXScale.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXScale.c + +tkMacOSXScrlbr.o: $(MAC_OSX_DIR)/tkMacOSXScrlbr.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXScrlbr.c + +tkMacOSXSend.o: $(MAC_OSX_DIR)/tkMacOSXSend.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXSend.c + +tkMacOSXSubwindows.o: $(MAC_OSX_DIR)/tkMacOSXSubwindows.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXSubwindows.c + +tkMacOSXTest.o: $(MAC_OSX_DIR)/tkMacOSXTest.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXTest.c + +tkMacOSXWindowEvent.o: $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c + +tkMacOSXWm.o: $(MAC_OSX_DIR)/tkMacOSXWm.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXWm.c + +tkMacOSXXStubs.o: $(MAC_OSX_DIR)/tkMacOSXXStubs.c + $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXXStubs.c + +tkFileFilter.o: $(GENERIC_DIR)/tkFileFilter.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkFileFilter.c + +tkMacWinMenu.o: $(GENERIC_DIR)/tkMacWinMenu.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMacWinMenu.c + +tkPointer.o: $(GENERIC_DIR)/tkPointer.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPointer.c + +xcolors.o: $(XLIB_DIR)/xcolors.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xcolors.c + +xdraw.o: $(XLIB_DIR)/xdraw.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xdraw.c + +xgc.o: $(XLIB_DIR)/xgc.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xgc.c + +ximage.o: $(XLIB_DIR)/ximage.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/ximage.c + +xutil.o: $(XLIB_DIR)/xutil.c + $(CC) -c $(CC_SWITCHES) $(XLIB_DIR)/xutil.c + +.c.o: + $(CC) -c $(CC_SWITCHES) $< # -# Regenerate the stubs files. +# Target to regenerate header files and stub files from the *.decls tables. # $(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \ @@ -1063,6 +1269,20 @@ checkstubs: if [ $$match -eq 0 ]; then echo $$i; fi \ done +# +# Target to check for proper usage of UCHAR macro. +# + +checkuchar: + -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR + +# +# Target to make sure that only symbols with "Tk" prefixes are +# exported. +# + +checkexports: $(TK_LIB_FILE) + -nm -p $(TK_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k' # # Target to create a Tk RPM for Linux. Requires that you be on a Linux @@ -1086,17 +1306,18 @@ rpm: all /bin/rpm # DISTROOT = /tmp/dist -DISTNAME = tk${VERSION}${PATCH_LEVEL} -ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip -DISTDIR = $(DISTROOT)/$(DISTNAME) -TCLDIR = @TCL_SRC_DIR@ -$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in - autoconf $(UNIX_DIR)/configure.in > $(UNIX_DIR)/configure +DISTNAME = tk${VERSION}${PATCH_LEVEL} +ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip +DISTDIR = $(DISTROOT)/$(DISTNAME) +TCLDIR = @TCL_SRC_DIR@ +$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in $(UNIX_DIR)/tcl.m4 + cd $(UNIX_DIR); autoconf +$(UNIX_DIR)/tkConfig.h.in: $(UNIX_DIR)/configure.in $(UNIX_DIR)/tcl.m4 + cd $(UNIX_DIR); autoheader dist: $(UNIX_DIR)/configure rm -rf $(DISTDIR) - mkdir -p $(DISTDIR) - mkdir $(DISTDIR)/unix + mkdir -p $(DISTDIR)/unix cp -p $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix cp $(TOP_DIR)/license.terms $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix chmod 664 $(DISTDIR)/unix/Makefile.in @@ -1147,7 +1368,7 @@ dist: $(UNIX_DIR)/configure $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/wish.exe.manifest mkdir $(DISTDIR)/macosx cp -p $(TOP_DIR)/macosx/Makefile $(TOP_DIR)/macosx/Wish.icns \ - $(TOP_DIR)/macosx/*.c $(TOP_DIR)/macosx/*.h \ + $(TOP_DIR)/macosx/*.c $(TOP_DIR)/macosx/*.h $(TOP_DIR)/macosx/*.in \ $(TOP_DIR)/macosx/*.r $(TOP_DIR)/macosx/*.tcl $(DISTDIR)/macosx mkdir $(DISTDIR)/macosx/Wish.pbproj cp -p $(TOP_DIR)/macosx/Wish.pbproj/*.pbx* \ @@ -1219,8 +1440,8 @@ alldist: dist # The target below is similar to "alldist" except it works for patch # releases. It is needed because patch releases are peculiar: the # patch designation appears in the name of the compressed file -# (e.g. tcl8.0p1.tar.gz) but the extracted source directory doesn't -# include the patch designation (e.g. tcl8.0). +# (e.g. tk8.0p1.tar.gz) but the extracted source directory doesn't +# include the patch designation (e.g. tk8.0). # allpatch: dist @@ -1233,6 +1454,33 @@ allpatch: dist mv $(DISTROOT)/old $(DISTROOT)/tk${VERSION} # +# This target creates the HTML folder for Tcl & Tk and places it +# in DISTDIR/html. It uses the tcltk-man2html.tcl tool from +# the Tcl group's tool workspace. It depends on the Tcl & Tk being +# in directories called tcl8.3 & tk8.3 up two directories from the +# TOOL_DIR. +# + +html: + $(BUILD_HTML) + @EXTRA_BUILD_HTML@ +html-tcl: + $(BUILD_HTML) --tcl + @EXTRA_BUILD_HTML@ +html-tk: + $(BUILD_HTML) --tk + @EXTRA_BUILD_HTML@ + +BUILD_HTML = \ + @if test -f $(TCL_BIN_DIR)/tclsh; then \ + @LD_LIBRARY_PATH_VAR@=$(TCL_BIN_DIR):$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \ + TCLSH="$(TCL_BIN_DIR)/tclsh"; else \ + TCLSH="$(TCL_EXE)"; fi ;\ + $${TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \ + --srcdir=$(TOP_DIR)/.. + +# # Targets to build Solaris package of the distribution for the current # architecture. To build stream packages for both sun4 and i86pc # architectures: diff --git a/unix/configure b/unix/configure index 0aa68c2..c6516b9 100755 --- a/unix/configure +++ b/unix/configure @@ -308,7 +308,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_STUB_LIB_PATH TK_STUB_FLAGS TK_BUILD_EXP_FILE TK_EXP_FILE TCL_STUB_FLAGS LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_INCLUDE_SPEC TK_SRC_DIR XINCLUDES XLIBSW TK_SHARED_BUILD LOCALES LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TK_BUILD_EXP_FILE TK_EXP_FILE TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -858,7 +858,9 @@ Optional Features: --enable-corefoundation use CoreFoundation API --enable-corefoundation --disable-load disallow dynamic loading and "load" command --enable-symbols build with debugging symbols --disable-symbols + --enable-aqua enable Aqua windowingsystem on Mac OS X --disable-aqua --enable-xft Use freetype/fontconfig/xft --disable-xft + --enable-framework package shared libraries in MacOSX frameworks --disable-framework Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1325,6 +1327,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 @@ -1518,8 +1521,6 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi -# libdir must be a fully qualified path and (not ${exec_prefix}/lib) -eval libdir="$libdir" # Make sure srcdir is fully qualified! srcdir=`cd $srcdir ; pwd` TK_SRC_DIR=`cd $srcdir/..; pwd` @@ -3166,10 +3167,10 @@ fi done -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ if test -z "$no_pipe"; then if test -n "$GCC"; then @@ -4059,10 +4060,6 @@ echo "${ECHO_T}no (default)" >&6 # Add the threads support libraries LIBS="$LIBS$THREADS_LIBS" -#-------------------------------------------------------------------- -# Recompute the necessary flags to run the compiler -#-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 @@ -4097,6 +4094,12 @@ _ACEOF fi +#-------------------------------------------------------------------- +# The statements below define a collection of compile flags. This +# macro depends on the value of SHARED_BUILD, and should be called +# after SC_ENABLE_SHARED checks the configure switches. +#-------------------------------------------------------------------- + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -5758,8 +5761,6 @@ echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' - TCL_SHLIB_LD_EXTRAS='-compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE} -seg1addr 0xa000000' - TK_SHLIB_LD_EXTRAS=' -compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' echo "$as_me:$LINENO: checking whether to use CoreFoundation" >&5 echo $ECHO_N "checking whether to use CoreFoundation... $ECHO_C" >&6 # Check whether --enable-corefoundation or --disable-corefoundation was given. @@ -6111,6 +6112,11 @@ cat >>confdefs.h <<\_ACEOF #define MODULE_SCOPE __private_extern__ _ACEOF + +cat >>confdefs.h <<\_ACEOF +#define TCL_LOAD_FROM_MEMORY 1 +_ACEOF + # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232: echo "$as_me:$LINENO: checking for realpath" >&5 @@ -8595,14 +8601,153 @@ _ACEOF fi #-------------------------------------------------------------------- -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. +# On Mac OS X, we can build either with X11 or with Aqua #-------------------------------------------------------------------- +if test "`uname -s`" = "Darwin" ; then + # Check whether --enable-aqua or --disable-aqua was given. +if test "${enable_aqua+set}" = set; then + enableval="$enable_aqua" + tk_aqua=$enableval +else + tk_aqua=no +fi; + if test $tk_aqua = yes; then + if test $tcl_corefoundation = no; then + { echo "$as_me:$LINENO: WARNING: \"Aqua can only be used when CoreFoundation is available\"" >&5 +echo "$as_me: WARNING: \"Aqua can only be used when CoreFoundation is available\"" >&2;} + tk_aqua=no + elif test ! -d /System/Library/Frameworks/Carbon.framework; then + { echo "$as_me:$LINENO: WARNING: \"Aqua can only be used when Carbon is available\"" >&5 +echo "$as_me: WARNING: \"Aqua can only be used when Carbon is available\"" >&2;} + tk_aqua=no + fi + fi +else + tk_aqua=no +fi + +if test $tk_aqua = yes; then + +cat >>confdefs.h <<\_ACEOF +#define MAC_OSX_TK 1 +_ACEOF + + LIBS="$LIBS -framework Carbon" + CFLAGS="$CFLAGS -fpascal-strings" + +for ac_func in _dyld_get_image_header_containing_address +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + TK_WINDOWINGSYSTEM=AQUA +else + #-------------------------------------------------------------------- + # Locate the X11 header files and the X11 library archive. Try + # the ac_path_x macro first, but if it doesn't find the X stuff + # (e.g. because there's no xmkmf program) then check through + # a list of possible directories. Under some conditions the + # autoconf macro will return an include directory that contains + # no include files, so double-check its result just to be safe. + #-------------------------------------------------------------------- + echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 @@ -9039,6 +9184,8 @@ echo "${ECHO_T}couldn't find any! Using -lX11." >&6 XLIBSW=-lX11 fi + TK_WINDOWINGSYSTEM=X11 +fi #-------------------------------------------------------------------- # Various manipulations on the search path used at runtime to @@ -9537,74 +9684,211 @@ _ACEOF # building libtk as a shared library instead of a static library. #-------------------------------------------------------------------- -eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" +eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +eval "TK_LIB_FILE=libtk${LIB_SUFFIX}" + +# tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed +# since on some platforms TK_LIB_FILE contains shell escapes. + +eval "TK_LIB_FILE=${TK_LIB_FILE}" if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_STUB_LIB_SPEC}" TCL_STUB_FLAGS="-DUSE_TCL_STUBS" -else - TCL_STUB_FLAGS="" fi -TK_LIB_FILE=libtk${LIB_SUFFIX} -eval "TK_LIB_FILE=${TK_LIB_FILE}" + +TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' +PRIVATE_INCLUDE_DIR='$(includedir)' +HTML_DIR='$(DISTDIR)/html' +TK_PKG_DIR='tk$(VERSION)' +TK_RSRC_FILE='tk$(VERSION).rsrc' +WISH_RSRC_FILE='wish$(VERSION).rsrc' # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. -if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then - if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval TK_LIB_FLAG="-ltk${VERSION}" +if test "`uname -s`" = "Darwin" ; then + + echo "$as_me:$LINENO: checking how to package libraries" >&5 +echo $ECHO_N "checking how to package libraries... $ECHO_C" >&6 + # Check whether --enable-framework or --disable-framework was given. +if test "${enable_framework+set}" = set; then + enableval="$enable_framework" + tcl_ok=$enableval +else + tcl_ok=no +fi; + + if test "${enable_framework+set}" = set; then + enableval="$enable_framework" + tcl_ok=$enableval else - eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`" + tcl_ok=no fi - TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" - TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" - TK_BUILD_EXP_FILE="" - TK_EXP_FILE="" -else - TK_BUILD_EXP_FILE="lib.exp" - eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" - if test "$GCC" = "yes" ; then - TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" - TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + if test "$tcl_ok" = "yes" ; then + echo "$as_me:$LINENO: result: framework" >&5 +echo "${ECHO_T}framework" >&6 + FRAMEWORK_BUILD=1 + if test "${SHARED_BUILD}" = "0" ; then + { echo "$as_me:$LINENO: WARNING: \"Frameworks can only be built if --enable-shared is yes\"" >&5 +echo "$as_me: WARNING: \"Frameworks can only be built if --enable-shared is yes\"" >&2;} + FRAMEWORK_BUILD=0 + fi + if test $tcl_corefoundation = no; then + { echo "$as_me:$LINENO: WARNING: \"Frameworks can only be used when CoreFoundation is available\"" >&5 +echo "$as_me: WARNING: \"Frameworks can only be used when CoreFoundation is available\"" >&2;} + FRAMEWORK_BUILD=0 + fi else - TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" - TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + echo "$as_me:$LINENO: result: standard shared library" >&5 +echo "${ECHO_T}standard shared library" >&6 + FRAMEWORK_BUILD=0 + fi + + TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' +fi + +if test "$FRAMEWORK_BUILD" = "1" ; then + +cat >>confdefs.h <<\_ACEOF +#define TK_FRAMEWORK 1 +_ACEOF + + ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in" + + # Construct a fake local framework structure to make linking with + # '-framework Tk' and running of tktest work + ac_config_commands="$ac_config_commands Tk.framework" + + LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" + if test "$libdir" = '${exec_prefix}/lib'; then + # override libdir default + libdir="/Library/Frameworks" + fi + TK_LIB_FILE="Tk" + TK_LIB_FLAG="-framework Tk" + TK_BUILD_LIB_SPEC="-F`pwd` -framework Tk" + TK_LIB_SPEC="-F${libdir} -framework Tk" + libdir="$libdir/Tk.framework/Versions/\${VERSION}" + TK_LIBRARY="$libdir/Resources/Scripts" + TK_PKG_DIR="Resources/Scripts" + TK_RSRC_FILE="Tk.rsrc" + WISH_RSRC_FILE="Wish.rsrc" + includedir="$libdir/Headers" + PRIVATE_INCLUDE_DIR="$libdir/PrivateHeaders" + HTML_DIR="$libdir/Resources/Documentation/Reference/Tk" + EXTRA_INSTALL="install-private-headers html-tk" + EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TkTOC.html' + EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' + if test $tk_aqua = yes; then + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' + bindir="$libdir/Resources/Wish.app/Contents/MacOS" + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' + fi + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" "$(STUB_LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done' + TK_YEAR="`date +%Y`" + # Don't use AC_DEFINE for the following as the framework version define + # needs to go into the Makefile even when using autoheader, so that we + # can pick up a potential make override of VERSION. Also, don't put this + # into CFLAGS as it should not go into tkConfig.sh + EXTRA_CC_SWITCHES='-DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' +else + # libdir must be a fully qualified path and not ${exec_prefix}/lib + eval libdir="$libdir" + if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then + if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + TK_LIB_FLAG="-ltk${TK_VERSION}" + else + TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" + fi + TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" + TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" + else + TK_BUILD_EXP_FILE="lib.exp" + eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" + + if test "$GCC" = "yes" ; then + TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" + TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + else + TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" + TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + fi + fi +fi + +# Support for building the Aqua resource files +if test $tk_aqua = yes; then + ac_config_files="$ac_config_files Wish-Info.plist:../macosx/Wish-Info.plist.in" + + EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' + LIB_RSRC_FILE='${TK_RSRC_FILE}' + APP_RSRC_FILE='${WISH_RSRC_FILE}' + REZ=/Developer/Tools/Rez + REZ_FLAGS='-d "SystemSevenOrLater=1" -useDF' + if test "$SHARED_BUILD" = 0; then + EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)" && $(INSTALL_DATA) $(TK_RSRC_FILE) $(LIB_INSTALL_DIR)' + TK_BUILD_LIB_SPEC="$TK_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd`/\${TK_RSRC_FILE}" + TK_LIB_SPEC="$TK_LIB_SPEC -sectcreate __TEXT __tk_rsrc ${libdir}/\${TK_RSRC_FILE}" + elif test "$FRAMEWORK_BUILD" = "0"; then + TK_SHLIB_LD_EXTRAS="$TK_SHLIB_LD_EXTRAS -sectcreate __TEXT __tk_rsrc \${TK_RSRC_FILE}" fi fi -TK_SHARED_BUILD=${SHARED_BUILD} #-------------------------------------------------------------------- -# The statements below define various symbols relating to creating -# the stub'd version of the Tk library -# -# For now, linking to Tcl stubs is not supported with Tk. It causes -# too many problems with linking. When Tk is a fully loadable -# extension, linking the the Tcl stubs will be supported. +# The statements below define various symbols relating to Tk +# stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" +eval "TK_STUB_LIB_DIR=${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" + TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" else - eval TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" + TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" fi TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" -TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" +TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" -TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" +TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" # Install time header dir can be set via --includedir eval "TK_INCLUDE_SPEC=\"-I${includedir}\"" -eval "TK_LIB_FILE=${TK_LIB_FILE}" +#------------------------------------------------------------------------ +# tkConfig.sh refers to this by a different name +#------------------------------------------------------------------------ + +TK_SHARED_BUILD=${SHARED_BUILD} + + + + + + + + + + + + + + + + + + @@ -9639,6 +9923,7 @@ eval "TK_LIB_FILE=${TK_LIB_FILE}" ac_config_files="$ac_config_files Makefile tkConfig.sh" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -10082,6 +10367,9 @@ Usage: $0 [OPTIONS] [FILE]... Configuration files: $config_files +Configuration commands: +$config_commands + Report bugs to <bug-autoconf@gnu.org>." _ACEOF @@ -10180,7 +10468,14 @@ fi _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +VERSION=${TK_VERSION} && tk_aqua=${tk_aqua} +_ACEOF @@ -10189,8 +10484,11 @@ for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. + "Tk-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;; + "Wish-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tkConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tkConfig.sh" ;; + "Tk.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; @@ -10203,6 +10501,7 @@ done # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -10330,27 +10629,43 @@ s,@TK_VERSION@,$TK_VERSION,;t t s,@TK_MAJOR_VERSION@,$TK_MAJOR_VERSION,;t t s,@TK_MINOR_VERSION@,$TK_MINOR_VERSION,;t t s,@TK_PATCH_LEVEL@,$TK_PATCH_LEVEL,;t t +s,@TK_YEAR@,$TK_YEAR,;t t +s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t +s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t +s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t -s,@TK_BUILD_STUB_LIB_SPEC@,$TK_BUILD_STUB_LIB_SPEC,;t t s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t -s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t s,@TK_STUB_LIB_PATH@,$TK_STUB_LIB_PATH,;t t -s,@TK_STUB_FLAGS@,$TK_STUB_FLAGS,;t t +s,@TK_INCLUDE_SPEC@,$TK_INCLUDE_SPEC,;t t +s,@TK_BUILD_STUB_LIB_SPEC@,$TK_BUILD_STUB_LIB_SPEC,;t t +s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t +s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t +s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t +s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t +s,@TK_BUILD_LIB_SPEC@,$TK_BUILD_LIB_SPEC,;t t s,@TK_BUILD_EXP_FILE@,$TK_BUILD_EXP_FILE,;t t s,@TK_EXP_FILE@,$TK_EXP_FILE,;t t s,@TCL_STUB_FLAGS@,$TCL_STUB_FLAGS,;t t -s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t -s,@TK_BUILD_LIB_SPEC@,$TK_BUILD_LIB_SPEC,;t t -s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t -s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t -s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t -s,@TK_INCLUDE_SPEC@,$TK_INCLUDE_SPEC,;t t -s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t s,@XINCLUDES@,$XINCLUDES,;t t s,@XLIBSW@,$XLIBSW,;t t -s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t s,@LOCALES@,$LOCALES,;t t +s,@TK_WINDOWINGSYSTEM@,$TK_WINDOWINGSYSTEM,;t t +s,@TK_PKG_DIR@,$TK_PKG_DIR,;t t +s,@TK_LIBRARY@,$TK_LIBRARY,;t t +s,@PRIVATE_INCLUDE_DIR@,$PRIVATE_INCLUDE_DIR,;t t +s,@HTML_DIR@,$HTML_DIR,;t t +s,@EXTRA_CC_SWITCHES@,$EXTRA_CC_SWITCHES,;t t +s,@EXTRA_INSTALL@,$EXTRA_INSTALL,;t t +s,@EXTRA_INSTALL_BINARIES@,$EXTRA_INSTALL_BINARIES,;t t +s,@EXTRA_BUILD_HTML@,$EXTRA_BUILD_HTML,;t t +s,@EXTRA_WISH_LIBS@,$EXTRA_WISH_LIBS,;t t +s,@TK_RSRC_FILE@,$TK_RSRC_FILE,;t t +s,@WISH_RSRC_FILE@,$WISH_RSRC_FILE,;t t +s,@LIB_RSRC_FILE@,$LIB_RSRC_FILE,;t t +s,@APP_RSRC_FILE@,$APP_RSRC_FILE,;t t +s,@REZ@,$REZ,;t t +s,@REZ_FLAGS@,$REZ_FLAGS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF @@ -10585,6 +10900,131 @@ s,@abs_top_builddir@,$ac_abs_top_builddir,;t t done _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + Tk.framework ) n=Tk && + f=$n.framework && v=Versions/$VERSION && + rm -rf $f && mkdir -p $f/$v/Resources && + ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && + ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && + if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && + unset n f v + ;; + esac +done +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF diff --git a/unix/configure.in b/unix/configure.in index e9d1c63..b949c5c 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,11 +3,17 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.101 2005/05/07 00:35:40 hobbs Exp $ +# RCS: @(#) $Id: configure.in,v 1.102 2005/05/23 20:25:03 das Exp $ AC_INIT([tk],[8.5]) AC_PREREQ(2.57) +dnl AC_CONFIG_HEADERS([tkConfig.h]) +dnl AC_CONFIG_COMMANDS_PRE([DEFS="-DHAVE_TK_CONFIG_H -imacros tkConfig.h"]) +dnl AH_TOP([#ifndef _TKCONFIG +dnl #define _TKCONFIG]) +dnl AH_BOTTOM([#endif /* _TKCONFIG */]) + TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 @@ -38,8 +44,6 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi -# libdir must be a fully qualified path and (not ${exec_prefix}/lib) -eval libdir="$libdir" # Make sure srcdir is fully qualified! srcdir=`cd $srcdir ; pwd` TK_SRC_DIR=`cd $srcdir/..; pwd` @@ -65,10 +69,10 @@ AC_PROG_CC # an autoconf bug that throws errors on configure AC_HAVE_HEADERS([limits.h]) -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) -#------------------------------------------------------------------------------ +#------------------------------------------------------------------------ if test -z "$no_pipe"; then if test -n "$GCC"; then @@ -91,12 +95,14 @@ SC_ENABLE_THREADS # Add the threads support libraries LIBS="$LIBS$THREADS_LIBS" +SC_ENABLE_SHARED + #-------------------------------------------------------------------- -# Recompute the necessary flags to run the compiler +# The statements below define a collection of compile flags. This +# macro depends on the value of SHARED_BUILD, and should be called +# after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- -SC_ENABLE_SHARED - SC_CONFIG_CFLAGS SC_ENABLE_SYMBOLS @@ -200,15 +206,44 @@ if test $tk_ok = yes; then fi #-------------------------------------------------------------------- -# Locate the X11 header files and the X11 library archive. Try -# the ac_path_x macro first, but if it doesn't find the X stuff -# (e.g. because there's no xmkmf program) then check through -# a list of possible directories. Under some conditions the -# autoconf macro will return an include directory that contains -# no include files, so double-check its result just to be safe. +# On Mac OS X, we can build either with X11 or with Aqua #-------------------------------------------------------------------- -SC_PATH_X +if test "`uname -s`" = "Darwin" ; then + AC_ARG_ENABLE(aqua, [ --enable-aqua enable Aqua windowingsystem on Mac OS X [--disable-aqua]], + [tk_aqua=$enableval], [tk_aqua=no]) + if test $tk_aqua = yes; then + if test $tcl_corefoundation = no; then + AC_MSG_WARN("Aqua can only be used when CoreFoundation is available") + tk_aqua=no + elif test ! -d /System/Library/Frameworks/Carbon.framework; then + AC_MSG_WARN("Aqua can only be used when Carbon is available") + tk_aqua=no + fi + fi +else + tk_aqua=no +fi + +if test $tk_aqua = yes; then + AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?]) + LIBS="$LIBS -framework Carbon" + CFLAGS="$CFLAGS -fpascal-strings" + AC_CHECK_FUNCS(_dyld_get_image_header_containing_address) + TK_WINDOWINGSYSTEM=AQUA +else + #-------------------------------------------------------------------- + # Locate the X11 header files and the X11 library archive. Try + # the ac_path_x macro first, but if it doesn't find the X stuff + # (e.g. because there's no xmkmf program) then check through + # a list of possible directories. Under some conditions the + # autoconf macro will return an include directory that contains + # no include files, so double-check its result just to be safe. + #-------------------------------------------------------------------- + + SC_PATH_X + TK_WINDOWINGSYSTEM=X11 +fi #-------------------------------------------------------------------- # Various manipulations on the search path used at runtime to @@ -346,105 +381,206 @@ SC_BUGGY_STRTOD # building libtk as a shared library instead of a static library. #-------------------------------------------------------------------- -eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" +eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +eval "TK_LIB_FILE=libtk${LIB_SUFFIX}" + +# tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed +# since on some platforms TK_LIB_FILE contains shell escapes. + +eval "TK_LIB_FILE=${TK_LIB_FILE}" if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_STUB_LIB_SPEC}" TCL_STUB_FLAGS="-DUSE_TCL_STUBS" -else - TCL_STUB_FLAGS="" fi -TK_LIB_FILE=libtk${LIB_SUFFIX} -eval "TK_LIB_FILE=${TK_LIB_FILE}" + +TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' +PRIVATE_INCLUDE_DIR='$(includedir)' +HTML_DIR='$(DISTDIR)/html' +TK_PKG_DIR='tk$(VERSION)' +TK_RSRC_FILE='tk$(VERSION).rsrc' +WISH_RSRC_FILE='wish$(VERSION).rsrc' # Note: in the following variable, it's important to use the absolute # path name of the Tcl directory rather than "..": this is because # AIX remembers this path and will attempt to use it at run-time to look # up the Tcl library. -if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then - if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval TK_LIB_FLAG="-ltk${VERSION}" - else - eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`" +if test "`uname -s`" = "Darwin" ; then + SC_ENABLE_FRAMEWORK + TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' +fi + +if test "$FRAMEWORK_BUILD" = "1" ; then + AC_DEFINE(TK_FRAMEWORK, 1, [Is Tk built as a framework?]) + AC_CONFIG_FILES([Tk-Info.plist:../macosx/Tk-Info.plist.in]) + # Construct a fake local framework structure to make linking with + # '-framework Tk' and running of tktest work + AC_CONFIG_COMMANDS([Tk.framework], [n=Tk && + f=$n.framework && v=Versions/$VERSION && + rm -rf $f && mkdir -p $f/$v/Resources && + ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && + ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist && + if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && + unset n f v + ], VERSION=${TK_VERSION} && tk_aqua=${tk_aqua}) + LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" + if test "$libdir" = '${exec_prefix}/lib'; then + # override libdir default + libdir="/Library/Frameworks" fi - TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" - TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" - TK_BUILD_EXP_FILE="" - TK_EXP_FILE="" + TK_LIB_FILE="Tk" + TK_LIB_FLAG="-framework Tk" + TK_BUILD_LIB_SPEC="-F`pwd` -framework Tk" + TK_LIB_SPEC="-F${libdir} -framework Tk" + libdir="$libdir/Tk.framework/Versions/\${VERSION}" + TK_LIBRARY="$libdir/Resources/Scripts" + TK_PKG_DIR="Resources/Scripts" + TK_RSRC_FILE="Tk.rsrc" + WISH_RSRC_FILE="Wish.rsrc" + includedir="$libdir/Headers" + PRIVATE_INCLUDE_DIR="$libdir/PrivateHeaders" + HTML_DIR="$libdir/Resources/Documentation/Reference/Tk" + EXTRA_INSTALL="install-private-headers html-tk" + EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TkTOC.html' + EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' + if test $tk_aqua = yes; then + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' + bindir="$libdir/Resources/Wish.app/Contents/MacOS" + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' + fi + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" "$(STUB_LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done' + TK_YEAR="`date +%Y`" + # Don't use AC_DEFINE for the following as the framework version define + # needs to go into the Makefile even when using autoheader, so that we + # can pick up a potential make override of VERSION. Also, don't put this + # into CFLAGS as it should not go into tkConfig.sh + EXTRA_CC_SWITCHES='-DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' else - TK_BUILD_EXP_FILE="lib.exp" - eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" - - if test "$GCC" = "yes" ; then - TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" - TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + # libdir must be a fully qualified path and not ${exec_prefix}/lib + eval libdir="$libdir" + if test "$SHARED_BUILD" = "0" || test "$TCL_NEEDS_EXP_FILE" = "0"; then + if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + TK_LIB_FLAG="-ltk${TK_VERSION}" + else + TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" + fi + TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" + TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" else - TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" - TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + TK_BUILD_EXP_FILE="lib.exp" + eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}" + + if test "$GCC" = "yes" ; then + TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`" + TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`" + else + TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}" + TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}" + fi + fi +fi + +# Support for building the Aqua resource files +if test $tk_aqua = yes; then + AC_CONFIG_FILES([Wish-Info.plist:../macosx/Wish-Info.plist.in]) + EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' + LIB_RSRC_FILE='${TK_RSRC_FILE}' + APP_RSRC_FILE='${WISH_RSRC_FILE}' + REZ=/Developer/Tools/Rez + REZ_FLAGS='-d "SystemSevenOrLater=1" -useDF' + if test "$SHARED_BUILD" = 0; then + EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)" && $(INSTALL_DATA) $(TK_RSRC_FILE) $(LIB_INSTALL_DIR)' + TK_BUILD_LIB_SPEC="$TK_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd`/\${TK_RSRC_FILE}" + TK_LIB_SPEC="$TK_LIB_SPEC -sectcreate __TEXT __tk_rsrc ${libdir}/\${TK_RSRC_FILE}" + elif test "$FRAMEWORK_BUILD" = "0"; then + TK_SHLIB_LD_EXTRAS="$TK_SHLIB_LD_EXTRAS -sectcreate __TEXT __tk_rsrc \${TK_RSRC_FILE}" fi fi -TK_SHARED_BUILD=${SHARED_BUILD} #-------------------------------------------------------------------- -# The statements below define various symbols relating to creating -# the stub'd version of the Tk library -# -# For now, linking to Tcl stubs is not supported with Tk. It causes -# too many problems with linking. When Tk is a fully loadable -# extension, linking the the Tcl stubs will be supported. +# The statements below define various symbols relating to Tk +# stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" +eval "TK_STUB_LIB_DIR=${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then - eval TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" + TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" else - eval TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" + TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" fi TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" -TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" +TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" -TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" +TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}" # Install time header dir can be set via --includedir eval "TK_INCLUDE_SPEC=\"-I${includedir}\"" -eval "TK_LIB_FILE=${TK_LIB_FILE}" +#------------------------------------------------------------------------ +# tkConfig.sh refers to this by a different name +#------------------------------------------------------------------------ + +TK_SHARED_BUILD=${SHARED_BUILD} AC_SUBST(TK_VERSION) AC_SUBST(TK_MAJOR_VERSION) AC_SUBST(TK_MINOR_VERSION) AC_SUBST(TK_PATCH_LEVEL) +AC_SUBST(TK_YEAR) +AC_SUBST(TK_LIB_FILE) +AC_SUBST(TK_LIB_FLAG) +AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) -AC_SUBST(TK_BUILD_STUB_LIB_SPEC) AC_SUBST(TK_STUB_LIB_SPEC) -AC_SUBST(TK_BUILD_STUB_LIB_PATH) AC_SUBST(TK_STUB_LIB_PATH) -AC_SUBST(TK_STUB_FLAGS) -AC_SUBST(TK_BUILD_EXP_FILE) -AC_SUBST(TK_EXP_FILE) +AC_SUBST(TK_INCLUDE_SPEC) +AC_SUBST(TK_BUILD_STUB_LIB_SPEC) +AC_SUBST(TK_BUILD_STUB_LIB_PATH) -AC_SUBST(TCL_STUB_FLAGS) -AC_SUBST(TK_BUILD_EXP_FILE) -AC_SUBST(TK_EXP_FILE) +AC_SUBST(TK_SRC_DIR) +AC_SUBST(TK_SHARED_BUILD) AC_SUBST(LD_LIBRARY_PATH_VAR) AC_SUBST(TK_BUILD_LIB_SPEC) -AC_SUBST(TK_LIB_FILE) -AC_SUBST(TK_LIB_FLAG) -AC_SUBST(TK_LIB_SPEC) -AC_SUBST(TK_INCLUDE_SPEC) -AC_SUBST(TK_SRC_DIR) +AC_SUBST(TK_BUILD_EXP_FILE) +AC_SUBST(TK_EXP_FILE) + +AC_SUBST(TCL_STUB_FLAGS) AC_SUBST(XINCLUDES) AC_SUBST(XLIBSW) -AC_SUBST(TK_SHARED_BUILD) AC_SUBST(LOCALES) -AC_OUTPUT([Makefile tkConfig.sh]) +AC_SUBST(TK_WINDOWINGSYSTEM) +AC_SUBST(TK_PKG_DIR) +AC_SUBST(TK_LIBRARY) +AC_SUBST(PRIVATE_INCLUDE_DIR) +AC_SUBST(HTML_DIR) + +AC_SUBST(EXTRA_CC_SWITCHES) +AC_SUBST(EXTRA_INSTALL) +AC_SUBST(EXTRA_INSTALL_BINARIES) +AC_SUBST(EXTRA_BUILD_HTML) +AC_SUBST(EXTRA_WISH_LIBS) + +AC_SUBST(TK_RSRC_FILE) +AC_SUBST(WISH_RSRC_FILE) +AC_SUBST(LIB_RSRC_FILE) +AC_SUBST(APP_RSRC_FILE) +AC_SUBST(REZ) +AC_SUBST(REZ_FLAGS) + +AC_CONFIG_FILES([Makefile tkConfig.sh]) +AC_OUTPUT diff --git a/unix/tcl.m4 b/unix/tcl.m4 index fc4247f..ee19532 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1412,8 +1412,6 @@ dnl AC_CHECK_TOOL(AR, ar) LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' - TCL_SHLIB_LD_EXTRAS='-compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE} -seg1addr 0xa000000' - TK_SHLIB_LD_EXTRAS=' -compatibility_version ${VERSION} -current_version ${VERSION} -install_name ${DYLIB_INSTALL_DIR}/${TK_LIB_FILE} -seg1addr 0xb000000 -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp $(TCL_BIN_DIR)/$(TCL_STUB_LIB_FILE) | tail +3 > $$f && echo $$f)' AC_MSG_CHECKING([whether to use CoreFoundation]) AC_ARG_ENABLE(corefoundation, [ --enable-corefoundation use CoreFoundation API [--enable-corefoundation]], [tcl_corefoundation=$enableval], [tcl_corefoundation=yes]) @@ -1439,6 +1437,7 @@ dnl AC_CHECK_TOOL(AR, ar) AC_DEFINE(TCL_DEFAULT_ENCODING,"utf-8", [Are we to override what our default encoding is?]) AC_DEFINE(MODULE_SCOPE, __private_extern__, [Linker support for module scope symbols]) + AC_DEFINE(TCL_LOAD_FROM_MEMORY, 1, [Can this platform load code from memory?]) # prior to Darwin 7, realpath is not threadsafe, so don't # use it when threads are enabled, c.f. bug # 711232: AC_CHECK_FUNC(realpath) diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in new file mode 100644 index 0000000..7eaf365 --- /dev/null +++ b/unix/tkConfig.h.in @@ -0,0 +1,244 @@ +/* tkConfig.h.in. Generated from configure.in by autoheader. */ + +#ifndef _TKCONFIG +#define _TKCONFIG + +/* Is pthread_attr_get_np() declared in <pthread.h>? */ +#undef ATTRGETNP_NOT_DECLARED + +/* Is pthread_getattr_np declared in <pthread.h>? */ +#undef GETATTRNP_NOT_DECLARED + +/* Do we have access to Darwin CoreFoundation.framework ? */ +#undef HAVE_COREFOUNDATION + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the <libkern/OSAtomic.h> header file. */ +#undef HAVE_LIBKERN_OSATOMIC_H + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `lseek64' function. */ +#undef HAVE_LSEEK64 + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `open64' function. */ +#undef HAVE_OPEN64 + +/* Define to 1 if you have the `OSSpinLockLock' function. */ +#undef HAVE_OSSPINLOCKLOCK + +/* Do we want a BSD-like thread-attribute interface? */ +#undef HAVE_PTHREAD_ATTR_GET_NP + +/* Define to 1 if you have the `pthread_attr_setstacksize' function. */ +#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE + +/* Do we want a Linux-like thread-attribute interface? */ +#undef HAVE_PTHREAD_GETATTR_NP + +/* Does struct password have a pw_gecos field? */ +#undef HAVE_PW_GECOS + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Is 'struct dirent64' in <sys/types.h>? */ +#undef HAVE_STRUCT_DIRENT64 + +/* Is 'struct stat64' in <sys/stat.h>? */ +#undef HAVE_STRUCT_STAT64 + +/* Should we include <sys/select.h>? */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Is off64_t in <sys/types.h>? */ +#undef HAVE_TYPE_OFF64_T + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Have we turned on XFT (antialiased fonts)? */ +#undef HAVE_XFT + +/* Define to 1 if you have the `_dyld_get_image_header_containing_address' + function. */ +#undef HAVE__DYLD_GET_IMAGE_HEADER_CONTAINING_ADDRESS + +/* Is this a Mac I see before me? */ +#undef MAC_OSX_TCL + +/* Are we building TkAqua? */ +#undef MAC_OSX_TK + +/* Linker support for module scope symbols */ +#undef MODULE_SCOPE + +/* Do we have access to the fd_set type? */ +#undef NO_FD_SET + +/* Do we have a working <stdlib.h> to include? */ +#undef NO_STDLIB_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* May we use XIM peeking safely? */ +#undef PEEK_XCLOSEIM + +/* Is this a static build? */ +#undef STATIC_BUILD + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Is debugging enabled? */ +#undef TCL_CFG_DEBUG + +/* Is this a 64-bit build? */ +#undef TCL_CFG_DO64BIT + +/* Is this an optimized build? */ +#undef TCL_CFG_OPTIMIZED + +/* Is bytecode debugging enabled? */ +#undef TCL_COMPILE_DEBUG + +/* Are bytecode statistics enabled? */ +#undef TCL_COMPILE_STATS + +/* Are we to override what our default encoding is? */ +#undef TCL_DEFAULT_ENCODING + +/* Can this platform load code from memory? */ +#undef TCL_LOAD_FROM_MEMORY + +/* Is memory debugging enabled? */ +#undef TCL_MEM_DEBUG + +/* What is the default extension for shared libraries? */ +#undef TCL_SHLIB_EXT + +/* Are we building with threads enabled? */ +#undef TCL_THREADS + +/* Are wide integers to be implemented with C 'long's? */ +#undef TCL_WIDE_INT_IS_LONG + +/* What type should be used to define wide integers? */ +#undef TCL_WIDE_INT_TYPE + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Is Tk built as a framework? */ +#undef TK_FRAMEWORK + +/* Should we use <a.out.h> when doing dynamic loading? */ +#undef USE_A_OUT_H + +/* Do we need a special AIX hack for timezones? */ +#undef USE_DELTA_FOR_TZ + +/* Should we use <sys/exec_aout.h> when doing dynamic loading? */ +#undef USE_SYS_EXEC_AOUT_H + +/* Should we use <sys/exec.h> when doing dynamic loading? */ +#undef USE_SYS_EXEC_H + +/* Do we want to use the threaded memory allocator? */ +#undef USE_THREAD_ALLOC + +/* Use the generic thread storage subsystem? */ +#undef USE_THREAD_STORAGE + +/* Should we use vfork() instead of fork()? */ +#undef USE_VFORK + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Add the _ISOC99_SOURCE flag when building */ +#undef _ISOC99_SOURCE + +/* Add the _LARGEFILE64_SOURCE flag when building */ +#undef _LARGEFILE64_SOURCE + +/* # needed in sys/socket.h Should OS/390 do the right thing with sockets? */ +#undef _OE_SOCKETS + +/* Do we really want to follow the standard? Yes we do! */ +#undef _POSIX_PTHREAD_SEMANTICS + +/* Do we want the reentrant OS API? */ +#undef _REENTRANT + +/* Do we want the thread-safe OS API? */ +#undef _THREAD_SAFE + +/* Do we want to use the XOPEN network library? */ +#undef _XOPEN_SOURCE + +/* Do we want to use the XOPEN network library? */ +#undef _XOPEN_SOURCE_EXTENDED + +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +# undef __CHAR_UNSIGNED__ +#endif + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef gid_t + +/* Define to `int' if <sys/types.h> does not define. */ +#undef mode_t + +/* Define to `int' if <sys/types.h> does not define. */ +#undef pid_t + +/* Define to `unsigned' if <sys/types.h> does not define. */ +#undef size_t + +/* Do we want to use the strtod() in compat? */ +#undef strtod + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef uid_t + +#endif /* _TKCONFIG */ diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c index 825b0c1..05dcc49 100644 --- a/unix/tkUnixInit.c +++ b/unix/tkUnixInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixInit.c,v 1.5 2002/01/25 21:09:37 dgp Exp $ + * RCS: @(#) $Id: tkUnixInit.c,v 1.6 2005/05/23 20:25:04 das Exp $ */ #include "tkInt.h" @@ -21,6 +21,11 @@ */ #include "tkInitScript.h" +#ifdef HAVE_COREFOUNDATION +static int MacOSXGetLibraryPath _ANSI_ARGS_(( + Tcl_Interp *interp)); +#endif /* HAVE_COREFOUNDATION */ + /* *---------------------------------------------------------------------- @@ -45,6 +50,9 @@ TkpInit(interp) Tcl_Interp *interp; { TkCreateXEventSource(); +#ifdef HAVE_COREFOUNDATION + MacOSXGetLibraryPath(interp); +#endif /* HAVE_COREFOUNDATION */ return Tcl_Eval(interp, initScript); } @@ -115,3 +123,38 @@ TkpDisplayWarning(msg, title) Tcl_WriteChars(errChannel, "\n", 1); } } + +/* + *---------------------------------------------------------------------- + * + * MacOSXGetLibraryPath -- + * + * If we have a bundle structure for the Tk installation, + * then check there first to see if we can find the libraries + * there. + * + * Results: + * TCL_OK if we have found the tk library; TCL_ERROR otherwise. + * + * Side effects: + * Same as for Tcl_MacOSXOpenVersionedBundleResources. + * + *---------------------------------------------------------------------- + */ + +#ifdef HAVE_COREFOUNDATION +static int +MacOSXGetLibraryPath(Tcl_Interp *interp) +{ + int foundInFramework = TCL_ERROR; +#ifdef TK_FRAMEWORK + char tkLibPath[PATH_MAX + 1]; + foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp, + "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX, tkLibPath); + if (tkLibPath[0] != '\0') { + Tcl_SetVar(interp, "tk_library", tkLibPath, TCL_GLOBAL_ONLY); + } +#endif + return foundInFramework; +} +#endif /* HAVE_COREFOUNDATION */ |