Thread: [Tclresource-commits] Source configure, NONE, 1.1 Changes.Log, 1.5, 1.6 Makefile.in, 1.1, 1.2 confi
Status: Beta
Brought to you by:
bdesgraupes
From: Daniel A. S. <da...@us...> - 2007-08-23 11:05:00
|
Update of /cvsroot/tclresource/Source In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv482 Modified Files: Changes.Log Makefile.in configure.ac tclResource.c Added Files: configure Log Message: * Improvements to TEA buildsystem, update to TEA 3.6. * Allow building against CoreServices only (instead of full Carbon). * Fix warnings from gcc. Index: Makefile.in =================================================================== RCS file: /cvsroot/tclresource/Source/Makefile.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.in 5 Jan 2006 09:04:55 -0000 1.1 +++ Makefile.in 23 Aug 2007 11:04:53 -0000 1.2 @@ -1,6 +1,6 @@ # Makefile.in -- # -# This file is a Makefile for Sample TEA Extension. If it has the name +# This file is a Makefile for the Tclresource Extension. If it has the name # "Makefile.in" then it is a template for a Makefile; to generate the # actual Makefile, run "./configure", which is a configuration script # generated by the "autoconf" program (constructs like "@foo@" will get @@ -12,13 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # - -#======================================================================== -# Add additional lines to handle any additional AC_SUBST cases that -# have been added in a customized configure script. -#======================================================================== - -#SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ +# RCS: @(#) $Id$ #======================================================================== # Nothing of the variables below this line should need to be changed. @@ -72,9 +66,10 @@ bindir = @bindir@ libdir = @libdir@ +includedir = @includedir@ +datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ -includedir = @includedir@ DESTDIR = @@ -95,7 +90,6 @@ CC = @CC@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_WARNING = @CFLAGS_WARNING@ -CLEANFILES = @CLEANFILES@ EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ @@ -109,13 +103,8 @@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ -TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ -# This is necessary for packages that use private Tcl headers -#TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ -# Not used, but retained for reference of what libs Tcl required -TCL_LIBS = @TCL_LIBS@ #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our @@ -125,27 +114,25 @@ #======================================================================== EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) +TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ - TCLLIBPATH="$(top_builddir)" + TCLLIBPATH="$(TCLLIBPATH)" + TCLSH_PROG = @TCLSH_PROG@ -TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) +TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) + SHARED_BUILD = @SHARED_BUILD@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ -# TCL_DEFS is not strictly need here, but if you remove it, then you -# must make sure that configure.in checks for the necessary components -# that your library may use. TCL_DEFS can actually be a problem if -# you do not compile with a similar machine setup as the Tcl core was -# compiled with. -#DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) -CONFIG_CLEAN_FILES = Makefile +CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl +CLEANFILES = @CLEANFILES@ CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ @@ -165,7 +152,7 @@ # for the BINARIES that you specified above have already been done. #======================================================================== -all: binaries libraries doc +all: binaries libraries #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix @@ -174,11 +161,10 @@ # of the Makefile, in the "BINARIES" variable. #======================================================================== -binaries: $(BINARIES) pkgIndex.tcl +binaries: $(BINARIES) libraries: - #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the @@ -186,10 +172,6 @@ #======================================================================== doc: - @echo "If you have documentation to create, place the commands to" - @echo "build the docs in the 'doc:' target. For example:" - @echo " xml2nroff sample.xml > sample.n" - @echo " xml2html sample.xml > sample.html" install: all install-binaries install-libraries install-doc @@ -216,7 +198,7 @@ install-doc: doc @mkdir -p $(DESTDIR)$(mandir)/mann @echo "Installing documentation in $(DESTDIR)$(mandir)" - @list='$(srcdir)/doc/*.n'; for i in $$list; do \ + @list='$(srcdir)/../Help/*.n'; for i in $$list; do \ echo "Installing $$i"; \ rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ @@ -274,22 +256,6 @@ $(COMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== -# Create the pkgIndex.tcl file. -# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but -# you may find that you need to customize the package. If so, either -# modify the -hand version, or create a pkgIndex.tcl.in file and have -# the configure script output the pkgIndex.tcl by editing configure.in. -#======================================================================== - -pkgIndex.tcl: - ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH) - -pkgIndex.tcl-hand: - (echo 'package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \ - [list load [file join $$dir $(PKG_LIB_FILE)]]'\ - ) > pkgIndex.tcl - -#======================================================================== # Distribution creation # You may need to tweak this target to make it work correctly. #======================================================================== Index: Changes.Log =================================================================== RCS file: /cvsroot/tclresource/Source/Changes.Log,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Changes.Log 5 Jan 2006 09:08:12 -0000 1.5 +++ Changes.Log 23 Aug 2007 11:04:52 -0000 1.6 @@ -27,9 +27,12 @@ ================================================================================ = 1.1.2 last update: ================================================================================ -¥ Introduced TEA (3.4) support. +¥ Introduced TEA (3.2) support. ¥ Minor modifications in the organisation of the headers. ¥ Fixed potential bug where the interpreter's result was not reset. +¥ Improvements to TEA buildsystem, update to TEA 3.6. +¥ Allow building against CoreServices only (instead of full Carbon). +¥ Fix warnings from gcc. ================================================================================ = 1.1.1 release last update: 2004-09-08 08:53:10 Index: configure.ac =================================================================== RCS file: /cvsroot/tclresource/Source/configure.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- configure.ac 5 Jan 2006 09:04:55 -0000 1.1 +++ configure.ac 23 Aug 2007 11:04:53 -0000 1.2 @@ -8,12 +8,9 @@ # Configuration input file for the Tclresource extension for MacOSX. # This file is based on the configure.in file provided with the Tcl # sampleextension. -# The only places which needed to be modified are marked by the -# string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- -# __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION @@ -23,13 +20,17 @@ AC_INIT([Tclresource], [1.1.2], [http://sourceforge.net/projects/tclresource]) +if test ! -d /System/Library/Frameworks/Carbon.framework; then + AC_MSG_ERROR([Mac OS X with Carbon required!]) +fi + #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- -TEA_INIT([3.4]) +TEA_INIT([3.6]) AC_CONFIG_AUX_DIR(tclconfig) @@ -40,13 +41,6 @@ TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG -#-------------------------------------------------------------------- -# Load the tkConfig.sh file if necessary (Tk extension) -#-------------------------------------------------------------------- - -#TEA_PATH_TKCONFIG -#TEA_LOAD_TKCONFIG - #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. @@ -64,7 +58,6 @@ TEA_SETUP_COMPILER #----------------------------------------------------------------------- -# __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, @@ -76,39 +69,14 @@ TEA_ADD_SOURCES([tclResource.c]) TEA_ADD_HEADERS([]) TEA_ADD_INCLUDES([]) -TEA_ADD_LIBS([/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon]) +TEA_ADD_LIBS([-framework Carbon]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([]) -#-------------------------------------------------------------------- -# __CHANGE__ -# A few miscellaneous platform-specific items: -# -# Define a special symbol for Windows (BUILD_sample in this case) so -# that we create the export library with the dll. -# -# Windows creates a few extra files that need to be cleaned up. -# You can add more files to clean if your extension creates any extra -# files. -# -# TEA_ADD_* any platform specific compiler/build info here. -#-------------------------------------------------------------------- - -if test "${TEA_PLATFORM}" = "windows" ; then - AC_DEFINE(BUILD_sample) - CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" - #TEA_ADD_SOURCES([win/winFile.c]) - #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) -else - CLEANFILES="pkgIndex.tcl" - #TEA_ADD_SOURCES([unix/unixFile.c]) - #TEA_ADD_LIBS([-lsuperfly]) -fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- -# __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without @@ -119,10 +87,6 @@ TEA_PUBLIC_TCL_HEADERS TEA_PRIVATE_TCL_HEADERS -#TEA_PUBLIC_TK_HEADERS -#TEA_PRIVATE_TK_HEADERS -#TEA_PATH_X - #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. @@ -145,6 +109,12 @@ TEA_CONFIG_CFLAGS +# Remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit +# fat builds as Tclresource cannot be built for 64-bit at present. +test "$fat_32_64" = yes && for v in CFLAGS CPPFLAGS LDFLAGS; do + eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' +done + #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- @@ -158,8 +128,7 @@ # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- -AC_DEFINE(USE_TCL_STUBS) -#AC_DEFINE(USE_TK_STUBS) +AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It @@ -170,16 +139,14 @@ TEA_MAKE_LIB #-------------------------------------------------------------------- -# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl -# file during the install process. Don't run the TCLSH_PROG through -# ${CYGPATH} because it's being used directly by make. -# Require that we use a tclsh shell version 8.2 or later since earlier -# versions have bugs in the pkg_mkIndex routine. -# Add WISH as well if this is a Tk extension. +# Determine the name of the tclsh and/or wish executables in the +# Tcl and Tk build directories or the location they were installed +# into. These paths are used to support running test cases only, +# the Makefile should not be making use of these paths to generate +# a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH -#TEA_PROG_WISH #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. @@ -188,4 +155,4 @@ #-------------------------------------------------------------------- AC_CONFIG_FILES([Makefile] [pkgIndex.tcl]) -AC_OUTPUT \ No newline at end of file +AC_OUTPUT Index: tclResource.c =================================================================== RCS file: /cvsroot/tclresource/Source/tclResource.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tclResource.c 5 Jan 2006 09:07:50 -0000 1.1 +++ tclResource.c 23 Aug 2007 11:04:53 -0000 1.2 @@ -14,9 +14,18 @@ #include "tclResource_version.h" +#include <CoreServices/CoreServices.h> +#ifndef TCLRESOURCE_DONT_USE_CARBON #include <Carbon/Carbon.h> +#endif + +#ifdef TCLRESOURCE_USE_FRAMEWORK_INCLUDES #include <Tcl/tcl.h> #include <Tcl/tclInt.h> +#else +#include <tcl.h> +#include <tclInt.h> +#endif #include <fcntl.h> @@ -311,13 +320,13 @@ { OpenResourceFork * resourceRef; int index, result, gotResID, gotValue, length, newValue; - short rsrcId; + short rsrcId = 0; long theLong; short saveRef, theMapAttrs, theRezAttrs; char * resourceName = NULL; char buffer[128]; Handle resourceH = NULL; - OSErr err; + OSErr err = noErr; Str255 theName; OSType rezType; @@ -574,11 +583,11 @@ Tcl_Obj *CONST objv[], // Argument values. Tcl_Obj *resultPtr) // Pointer to store the result. { - OpenResourceFork *resourceRef; + OpenResourceFork *resourceRef = NULL; int index, result, gotResID; int i, limitSearch, length; - short saveRef, resInfo; - short fileRef, rsrcId; + short saveRef = 0, resInfo; + short fileRef, rsrcId = 0; long theLong; char * resourceName = NULL; char buffer[128]; @@ -993,7 +1002,7 @@ OpenResourceFork * resourceRef; Tcl_Obj * objPtr; int i, count, result, limitSearch, onlyID, length; - short id, saveRef; + short id, saveRef = 0; char * string; Handle resourceH = NULL; Str255 theName; @@ -1185,7 +1194,7 @@ char * stringPtr; char * native; char resultStr[256]; - SInt8 macPermision; + SInt8 macPermision = 0; FSSpec fileSpec; FSRef fileFSRef, parentFSRef; OSErr err; @@ -1490,7 +1499,7 @@ Tcl_Obj *CONST objv[], // Argument values. Tcl_Obj *resultPtr) // Pointer to store the result. { - short rsrcId; + short rsrcId = 0; long theLong, size; int length, releaseIt = 0; char * resmapRef; @@ -1567,7 +1576,7 @@ OpenResourceFork * resourceRef; Tcl_Obj * objPtr; int i, count, result, limitSearch; - short saveRef; + short saveRef = 0; OSType rezType; result = TCL_OK; @@ -1700,13 +1709,13 @@ { int index, result, gotResID, releaseIt = 0, force; int i, limitSearch, length; - short rsrcId; + short rsrcId = 0; long theLong; - short saveRef; + short saveRef = 0; char * bytesPtr; char * resourceName = NULL; char errbuf[16]; - OpenResourceFork * resourceRef; + OpenResourceFork * resourceRef = NULL; Handle resourceH = NULL; OSErr err; Str255 theName; @@ -1976,7 +1985,7 @@ OpenResourceFork * resourceRef; Tcl_HashEntry * nameHashPtr; int limitSearch = false; - short saveRef; + short saveRef = 0; Handle resourceH; if (resFileRef != NULL) { @@ -2134,7 +2143,7 @@ // fork list, 0 means at the tail { OpenResourceFork * resourceRef; - Tcl_HashEntry * resourceHashPtr; + Tcl_HashEntry * resourceHashPtr = NULL; Tcl_HashEntry * nameHashPtr; char * resourceId = NULL; int new; @@ -2291,7 +2300,7 @@ Tcl_Obj ** elemPtrs; short fileRef; char * bytes; - int i, match, index, listLen, length, elemLen; + int i, match = 0, index, listLen, length, elemLen; nameHashPtr = Tcl_FindHashEntry(&nameTable, tokenPtr); if (nameHashPtr == NULL) { @@ -2377,14 +2386,15 @@ { FCBPBRec fileRec; char fileName[256]; - char appName[256]; char * s; Tcl_Obj * nameObj; OSErr err; - ProcessSerialNumber psn; - ProcessInfoRec info; FSSpec fileSpec; SInt16 curRefNum, nextRefNum; +#ifndef TCLRESOURCE_DONT_USE_CARBON + char appName[256]; + ProcessSerialNumber psn; + ProcessInfoRec info; // Get the application name, so we can substitute // the token "application" for the application's resource. @@ -2394,6 +2404,7 @@ info.processAppSpec = &fileSpec; GetProcessInformation(&psn, &info); p2cstr((StringPtr) appName); +#endif fileRec.ioCompletion = NULL; fileRec.ioVRefNum = 0; @@ -2420,9 +2431,12 @@ if (s != NULL && strcmp(s+1,"rsrc") == 0) { *s = 0; } +#ifndef TCLRESOURCE_DONT_USE_CARBON if (strcmp(fileName,appName) == 0) { Tcl_SetStringObj(nameObj, "application", -1); - } else { + } else +#endif + { Tcl_SetStringObj(nameObj, fileName, -1); } c2pstr(fileName); --- NEW FILE: configure --- #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for Tclresource 1.1.2. # # Report bugs to <http://sourceforge.net/projects/tclresource>. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. [...10877 lines suppressed...] # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi |