├── README.MacOSX ├── README.Debian ├── pkgIndex.tcl.in ├── README.FreeBSD ├── .gitignore ├── aclocal.m4 ├── tclconfig ├── README.txt ├── install-sh └── ChangeLog ├── .github └── workflows │ ├── mac-ci.yaml │ └── linux-ci.yml ├── LICENSE ├── license.terms ├── tcllauncher.tcl ├── README.md ├── ChangeLog ├── README ├── unix └── tclAppInit.c ├── doc ├── tcllauncher.txt ├── tcllauncher.man └── tcllauncher.n ├── tcllauncher-support.tcl.in ├── configure.in └── Makefile.in /README.MacOSX: -------------------------------------------------------------------------------- 1 | ./configure --with-tcl=/usr/lib --prefix=/usr/local --exec-prefix=/usr/local 2 | -------------------------------------------------------------------------------- /README.Debian: -------------------------------------------------------------------------------- 1 | # 2 | # tcllauncher configure command for Debain 3 | # 4 | # --enable-symbols 5 | # 6 | ./configure --with-tcl=/usr/lib/tcl8.6 7 | -------------------------------------------------------------------------------- /pkgIndex.tcl.in: -------------------------------------------------------------------------------- 1 | # 2 | # Tcl package index file 3 | # 4 | package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \ 5 | [list source [file join $dir tcllauncher-support.tcl]] 6 | -------------------------------------------------------------------------------- /README.FreeBSD: -------------------------------------------------------------------------------- 1 | # 2 | # configure arguments for FreeBSD machines with standard, ports-installed tcl86 3 | # 4 | 5 | autoconf 6 | ./configure --with-tcl=/usr/local/lib/tcl8.6 --mandir=/usr/local/man 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | autom4te.cache/ 3 | config.log 4 | config.status 5 | pkgIndex.tcl 6 | *.o 7 | *.so 8 | *.dylib 9 | tcllauncher 10 | tcllauncher-support.tcl 11 | libTcllauncher.so* 12 | .*.swp 13 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # 2 | # Include the TEA standard macro set 3 | # 4 | 5 | builtin(include,tclconfig/tcl.m4) 6 | 7 | # 8 | # Add here whatever m4 macros you want to define for your package 9 | # 10 | 11 | #------------------------------------------------------------------------- 12 | # TEA_PROG_DTPLITE 13 | # 14 | # Do we have a usable dtplite program to use in document generation? 15 | # 16 | # Results 17 | # Sets up DTPLITE 18 | # 19 | #------------------------------------------------------------------------- 20 | 21 | AC_DEFUN(TEA_PROG_DTPLITE, [ 22 | AC_PATH_TOOL([DTPLITE], [dtplite], [:]) 23 | ]) 24 | 25 | -------------------------------------------------------------------------------- /tclconfig/README.txt: -------------------------------------------------------------------------------- 1 | These files comprise the basic building blocks for a Tcl Extension 2 | Architecture (TEA) extension. For more information on TEA see: 3 | 4 | http://www.tcl.tk/doc/tea/ 5 | 6 | This package is part of the Tcl project at SourceForge, and latest 7 | sources should be available there: 8 | 9 | http://tcl.sourceforge.net/ 10 | 11 | This package is a freely available open source package. You can do 12 | virtually anything you like with it, such as modifying it, redistributing 13 | it, and selling it either in whole or in part. 14 | 15 | CONTENTS 16 | ======== 17 | The following is a short description of the files you will find in 18 | the sample extension. 19 | 20 | README.txt This file 21 | 22 | install-sh Program used for copying binaries and script files 23 | to their install locations. 24 | 25 | tcl.m4 Collection of Tcl autoconf macros. Included by a package's 26 | aclocal.m4 to define TEA_* macros. 27 | -------------------------------------------------------------------------------- /.github/workflows/mac-ci.yaml: -------------------------------------------------------------------------------- 1 | name: Mac CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: macos-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Install dependencies 17 | run: | 18 | brew update 19 | brew install tcl-tk || true 20 | sudo mkdir -p /usr/local 21 | sudo ln -sf /usr/local/opt/tcl-tk/include /usr/local/include/tcl8.6 22 | sudo cp /usr/local/opt/tcl-tk/lib/libtcl* /usr/local/lib 23 | sudo ln -sf /usr/local/opt/tcl-tk/bin/tclsh8.6 /usr/local/bin/tclsh 24 | sudo ln -sf /usr/local/opt/tcl-tk/bin/tclsh8.6 /usr/local/bin/tclsh8.6 25 | - name: configure 26 | run: | 27 | autoreconf -vi 28 | ./configure --with-tcl=/usr/local/opt/tcl-tk/lib --prefix=/usr/local 29 | - name: make 30 | run: make 31 | - name: install 32 | run: sudo make install 33 | -------------------------------------------------------------------------------- /.github/workflows/linux-ci.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: Linux CI 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | jobs: 14 | build: 15 | 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Install dependencies 21 | run: | 22 | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 23 | sudo apt-get update -qq 24 | sudo apt-get install -y gcc-7 g++-7 25 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 26 | sudo apt-get install -y tcl8.6-dev tcllib 27 | - name: configure 28 | run: | 29 | autoreconf -vi 30 | ./configure --with-tcl=/usr/lib/tcl8.6 31 | - name: make 32 | run: make 33 | - name: install 34 | run: sudo make install 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2008-2018, FlightAware 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /license.terms: -------------------------------------------------------------------------------- 1 | This software is copyrighted by FlightAware LLC, the Scriptics 2 | Corporation, and other parties. The following terms apply to all 3 | files associated with the software unless explicitly disclaimed in 4 | individual files. 5 | 6 | The authors hereby grant permission to use, copy, modify, distribute, 7 | and license this software and its documentation for any purpose, provided 8 | that existing copyright notices are retained in all copies and that this 9 | notice is included verbatim in any distributions. No written agreement, 10 | license, or royalty fee is required for any of the authorized uses. 11 | Modifications to this software may be copyrighted by their authors 12 | and need not follow the licensing terms described here, provided that 13 | the new terms are clearly indicated on the first page of each file where 14 | they apply. 15 | 16 | IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY 17 | FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 18 | ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY 19 | DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE 20 | POSSIBILITY OF SUCH DAMAGE. 21 | 22 | THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE 25 | IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE 26 | NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 27 | MODIFICATIONS. 28 | 29 | GOVERNMENT USE: If you are acquiring this software on behalf of the 30 | U.S. government, the Government shall have only "Restricted Rights" 31 | in the software and related documentation as defined in the Federal 32 | Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you 33 | are acquiring the software on behalf of the Department of Defense, the 34 | software shall be classified as "Commercial Computer Software" and the 35 | Government shall have only "Restricted Rights" as defined in Clause 36 | 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the 37 | authors grant the U.S. Government and others acting in its behalf 38 | permission to use and distribute the software in accordance with the 39 | terms specified in this license. 40 | -------------------------------------------------------------------------------- /tcllauncher.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # tcllauncher.tcl - tcl code that tcllauncher uses to do its thing 3 | # 4 | 5 | package require Tclx 6 | 7 | # 8 | # this is the code that gets called when Tcl launches because the 9 | # tcllauncher "version" of Tcl jimmies the command line to make it 10 | # so. 11 | # 12 | # this routine must now figure out what to do to launch the app 13 | # 14 | # 15 | proc main {{argv ""}} { 16 | set prog [info nameofexecutable] 17 | 18 | # have we been invoked as a shell? If so, prog is empty, get it from 19 | # the SHELL environment variable 20 | if {$prog == ""} { 21 | set prog $::env(SHELL) 22 | } 23 | 24 | set path [file split $prog] 25 | set shortName [lindex $path end] 26 | 27 | # 28 | # tcllauncher cannot be invoked directly as "tcllauncher" -- it must be 29 | # aliased to some other name 30 | # 31 | if {$shortName == "tcllauncher"} { 32 | puts stderr "tcllauncher cannot be invoked as \"tcllauncher\"; it must be copied or linked as some other name" 33 | exit 255 34 | } 35 | 36 | # if the last dir in the chain is "bin", swap in "lib/tcllauncher" in 37 | # its place and tag a ".tcl" onto the end of the path name. 38 | # 39 | # otherwise just look in the same directory where the instance of the 40 | # tcllauncher was found. 41 | # 42 | 43 | #puts stderr "path '$path', prog '$prog', shortName '$shortName'" 44 | 45 | if {[lindex $path end-1] == "bin"} { 46 | # this version looks for ../lib/tcllauncher/$shortName.tcl` 47 | #set path [eval file join [lreplace $path end-1 end-1 lib tcllauncher]] 48 | 49 | # this version looks for ../lib/$shortName/main.tcl 50 | 51 | set ::launchdir [eval file join [lreplace $path end-1 end lib $shortName]] 52 | set path [eval file join $::launchdir main.tcl] 53 | } else { 54 | set path $prog.tcl 55 | } 56 | 57 | if {![file readable $path]} { 58 | puts stderr "$shortName: can't read '$path' (tcllauncher)" 59 | exit 254 60 | } 61 | 62 | set ::argv0 $shortName 63 | set initialArgv $argv 64 | 65 | # ok now source in the file we (tcllauncher) figured out is the one 66 | 67 | if {[catch {uplevel #0 source $path} catchResult] == 1} { 68 | append ::errorInfo "\n from tcllauncher running \"[string trim "$::argv0 $initialArgv"]\"" 69 | puts stderr $::errorInfo 70 | exit 255 71 | } 72 | 73 | exit 0 74 | } 75 | 76 | if {!$tcl_interactive} { 77 | main $argv 78 | } 79 | 80 | # vim: set ts=8 sw=4 sts=4 noet : 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Linux CI](https://github.com/flightaware/tcllauncher/actions/workflows/linux-ci.yml/badge.svg)](https://github.com/flightaware/tcllauncher/actions/workflows/linux-ci.yml) 2 | [![Mac CI](https://github.com/flightaware/tcllauncher/actions/workflows/mac-ci.yaml/badge.svg)](https://github.com/flightaware/tcllauncher/actions/workflows/mac-ci.yaml) 3 | # tcllauncher, a launcher program for Tcl applications. 4 | 5 | tcllauncher is a way to have Tcl programs run out of /usr/local/bin under their own name, be installed in one place with their support files, and provides commands to facilitate server-oriented application execution. 6 | 7 | While there is another wrapper system that also does this, that system produces a single executable that contains all the code and support files within a built-in virtual filesystem wrapped inside the executable. Tcllauncher keeps the support files distinct, typically in a subdirectory of /usr/local/lib that's named after the application. 8 | 9 | This package is a freely available open source released under the liberal Berkeley copyright. You can do virtually anything you like with it, such as modifying it, redistributing it, and selling it either in whole or in part. See the file "license.terms" for complete information. 10 | 11 | ## UNIX Build 12 | 13 | Building under most UNIX systems is easy, just run the configure script and then run make. For more information about the build process, see the tcl/unix/README file in the Tcl src dist. The following minimal example will install the extension in the /opt/tcl directory. 14 | 15 | $ cd tcllauncher 16 | $ autoconf 17 | $ ./configure --prefix=/opt/tcl 18 | $ make 19 | $ make install 20 | 21 | ## Hint 22 | 23 | Beware it building against the source dirs instead of installed dirs and then not being able to find stuff. If, for instace, you're building in /usr/fa, use something like 24 | 25 | ./configure --prefix=/usr/fa --with-tcl=/usr/fa/lib 26 | 27 | The --with-tcl is important! Otherwise it will probably find the Tcl source in a parallel directory and build against that instead and cause problems later. 28 | 29 | ## Installation 30 | 31 | The installation of a TEA package is structure like so: 32 | 33 | $exec_prefix 34 | / \ 35 | lib bin 36 | | | 37 | PACKAGEx.y (dependent .dll files on Windows) 38 | | 39 | pkgIndex.tcl (.so|.dll files) 40 | 41 | The main .so|.dll library file gets installed in the versioned PACKAGE directory, which is OK on all platforms because it will be directly referenced with by 'load' in the pkgIndex.tcl file. Dependent DLL files on Windows must go in the bin directory (or other directory on the user's PATH) in order for them to be found. 42 | 43 | FlightAware 44 | --- 45 | FlightAware has released over a dozen applications (under the free and liberal BSD license) into the open source community. FlightAware's repositories are available on GitHub for public use, discussion, bug reports, and contribution. Read more at https://flightaware.com/about/code/ 46 | 47 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | ChangeLog 2 | 3 | version 1.6 / 17-Aug-2015 4 | 5 | * tcllauncher::demonize when invoked with the -noclose option will still 6 | redirect any stdio files (stdin, stdout, stderr) to/from /dev/null if 7 | the corresponding stdio handle does not exist. 8 | 9 | * clean and distclean make targets fixed/improved 10 | 11 | * configure script now included in distribution 12 | 13 | * remove all reference to Windows 14 | 15 | version 1.5 / 3-Oct-2014 16 | 17 | * tcllauncher no longer generates or references a shared library. 18 | 19 | * tcllauncher now is linked against the thread library to avoid 20 | deadlocking if Tcl is built with threads 21 | 22 | * Sync Makefile.in with TEA 3.9; clean up the generation of the object 23 | file and the executable 24 | 25 | * tcllauncher-support.tcl is now macro-substituted from 26 | tcllauncher-support.tcl.in to get package and version right every time 27 | 28 | version 1.4 / 2-Sep-2014 29 | 30 | * reassert lock on pidfile during pidfile_write 31 | 32 | The documented usage of pidfile_open and pidfile_write did not actually work 33 | because the flock on the pidfile would not survive the daemonize call to fork 34 | to a background process. Now we re-assert the lock on the pidfile when calling 35 | pidfile_write (aborting if the lock cannot be obtained) so that the pidfile can 36 | be reliably used as a lockfile as documented. 37 | 38 | * Updated build instructions for Debian. 39 | 40 | * Corrected unclear pidfile_open documentation. 41 | 42 | * manual page rendering improvements. 43 | 44 | * Update README and license and remove superfluous stuff from launcher.h 45 | 46 | * Support for Tcl 8.6 47 | 48 | * In pid_open properly handle the case of specifying the path to the pid 49 | file. Also properly support the file mode argument. 50 | 51 | version 1.3 / 26-Nov-2012 52 | 53 | * Catch the sourcing of the app's main.tcl file and if there is an error, 54 | customize the error message to include that it's a tcllauncher app and 55 | the command line arguments, then write it to stderr and exit with a 56 | nonzero exit status. 57 | 58 | * Change the name of the startup routine to the more standard "main". 59 | 60 | version 1.2 / 18-Jan-2011 61 | 62 | * Upgrade to Tcl Extension Architecture (TEA) 3.8. 63 | 64 | * Add aclocal.m4 to create a rule for finding the path to dtplite and modify 65 | configure.in to use that rule. 66 | 67 | * Merge daemonize.tcl and pidfile.tcl into tcllauncher.tcl 68 | 69 | * Reference Tcl 8.5 in docs and whatnot. 70 | 71 | * Add support for Mac OS X 72 | 73 | version 1.1 / 11-Jun-2009 74 | 75 | * Alter Makefile.in to have rules for building the tcllauncher.n 76 | manpage using dtplite based on the tcllauncher.man Tcl doctools file. 77 | 78 | * Deploy pidfile_* and daemonize functions. 79 | 80 | * Document pidfile functions. 81 | 82 | * Builds cleanly on Debian. Added README.Debin with configure instructions. 83 | 84 | * Upgrade to Tcl Extension Architecture (TEA) 3.7 85 | 86 | version 1.0 / 18-Mar-2008 87 | 88 | * Create a global variable, launchdir, containing the directory that 89 | the main.tcl is being run out of, if the path to the executable 90 | is .../bin/programName, else set that variable to "." This provides 91 | a way for programs to find other files they installed alongside 92 | their main.tcl. 93 | 94 | * When invoked as a shell, [info nameofexecutable] returns nothing. 95 | Detect that condition and, if so, use the SHELL environment variable to 96 | form the basis of what we do. For instance, if the shell is /usr/local/bin/farsh, 97 | we'll run /usr/local/lib/farsh/main.tcl. 98 | 99 | * Make sure tcllauncher gets installed into the bin directory. 100 | 101 | * When allocating memory to fiddle command line arguments before 102 | invoking Tcl_Main, use malloc instead of ckalloc because whatever 103 | ckalloc needs hasn't necessarily been initialized yet. 104 | 105 | * Using $(COMPILE) instead of $(CC) for compiling the main routine 106 | makes it work on FreeBSD as well as the Mac. 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is tcllauncher, a launcher program for Tcl applications. 2 | 3 | This package is a freely available open source package. You can do 4 | virtually anything you like with it, such as modifying it, redistributing 5 | it, and selling it either in whole or in part. See the file 6 | "license.terms" for complete information. 7 | 8 | 9 | CONTENTS 10 | ======== 11 | The following is a short description of the files you will find in 12 | the sample extension. 13 | 14 | Makefile.in Makefile template. The configure script uses this file to 15 | produce the final Makefile. 16 | 17 | README This file 18 | 19 | aclocal.m4 Generated file. Do not edit. Autoconf uses this as input 20 | when generating the final configure script. See "tcl.m4" 21 | below. 22 | 23 | configure Generated file. Do not edit. This must be regenerated 24 | anytime configure.in or tclconfig/tcl.m4 changes. 25 | 26 | configure.in Configure script template. Autoconf uses this file as input 27 | to produce the final configure script. 28 | 29 | pkgIndex.tcl.in Package index template. The configure script will use 30 | this file as input to create pkgIndex.tcl. 31 | 32 | launcher.c Nothing. 33 | 34 | launcher.h Nothing. 35 | 36 | tcllauncher.c Nothing. 37 | 38 | tclAppInit.c A slightly modified copy of TclAppInit.c from the Tcl 39 | source code. 40 | 41 | tclconfig/ This directory contains various template files that build 42 | the configure script. They should not need modification. 43 | 44 | install-sh Program used for copying binaries and script files 45 | to their install locations. 46 | 47 | tcl.m4 Collection of Tcl autoconf macros. Included by 48 | aclocal.m4 to define SC_* macros. 49 | 50 | UNIX BUILD 51 | ========== 52 | 53 | Building under most UNIX systems is easy, just run the configure script 54 | and then run make. For more information about the build process, see 55 | the tcl/unix/README file in the Tcl src dist. The following minimal 56 | example will install the extension in the /opt/tcl directory. 57 | 58 | $ cd tcllauncher 59 | $ autoconf 60 | $ ./configure --prefix=/opt/tcl 61 | $ make 62 | $ make install 63 | 64 | HINT 65 | ==== 66 | 67 | Beware it building against the source dirs instead of installed dirs and 68 | then not being able to find stuff. If, for instace, you're building in 69 | /usr/fa, use something like 70 | 71 | ./configure --prefix=/usr/fa --with-tcl=/usr/fa/lib 72 | 73 | The --with-tcl is important! Otherwise it will probably find the Tcl 74 | source in a parallel directory and build against that instead and 75 | cause problems later. 76 | 77 | WINDOWS BUILD 78 | ============= 79 | 80 | The recommended method to build extensions under windows is to use the 81 | Msys + Mingw build process. This provides a Unix-style build while 82 | generating native Windows binaries. Using the Msys + Mingw build tools 83 | means that you can use the same configure script as per the Unix build 84 | to create a Makefile. See the tcl/win/README file for the URL of 85 | the Msys + Mingw download. 86 | 87 | If you have VC++ then you may wish to use the files in the win 88 | subdirectory and build the extension using just VC++. These files have 89 | been designed to be as generic as possible but will require some 90 | additional maintenance by the project developer to synchronise with 91 | the TEA configure.in and Makefile.in files. Instructions for using the 92 | VC++ makefile are written in the first part of the Makefile.vc 93 | file. 94 | 95 | INSTALLATION 96 | ============ 97 | 98 | The installation of a TEA package is structure like so: 99 | 100 | $exec_prefix 101 | / \ 102 | lib bin 103 | | | 104 | PACKAGEx.y (dependent .dll files on Windows) 105 | | 106 | pkgIndex.tcl (.so|.dll files) 107 | 108 | The main .so|.dll library file gets installed in the versioned PACKAGE 109 | directory, which is OK on all platforms because it will be directly 110 | referenced with by 'load' in the pkgIndex.tcl file. Dependent DLL files on 111 | Windows must go in the bin directory (or other directory on the user's 112 | PATH) in order for them to be found. 113 | -------------------------------------------------------------------------------- /unix/tclAppInit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * tclAppInit.c -- 3 | * 4 | * Provides a default version of the main program and Tcl_AppInit 5 | * procedure for Tcl applications (without Tk). 6 | * 7 | * Copyright (c) 1993 The Regents of the University of California. 8 | * Copyright (c) 1994-1997 Sun Microsystems, Inc. 9 | * Copyright (c) 1998-1999 by Scriptics Corporation. 10 | * 11 | * See the file "license.terms" for information on usage and redistribution 12 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 13 | * 14 | * RCS: @(#) $Id: tclAppInit.c,v 1.7 2008-11-12 22:12:51 karl Exp $ 15 | */ 16 | 17 | #include "tcl.h" 18 | #include 19 | 20 | #ifdef HAVE_SETPROCTITLE_INIT 21 | #include 22 | #endif 23 | 24 | #define TCL_LOCAL_MAIN_HOOK launcher_main_hook 25 | 26 | 27 | /* 28 | *---------------------------------------------------------------------- 29 | * 30 | * launcher_main_hook -- 31 | * 32 | * This is the launcher's main hook that gets called just before 33 | * tcl_main. 34 | * 35 | * Results: 36 | * Rewrites the program's main's argv and argc to stuff a tcl 37 | * filename in as argv[1]. 38 | * 39 | * Side effects: 40 | * Whatever the application does. 41 | * 42 | *---------------------------------------------------------------------- 43 | */ 44 | int launcher_main_hook (int *argcPtr, char ***argvPtr) { 45 | char **newArgv; 46 | int newArgc = *argcPtr + 1; 47 | int i; 48 | 49 | newArgv = malloc (sizeof(char *) * newArgc); 50 | newArgv[0] = **argvPtr; 51 | newArgv[1] = TCLLAUNCHER_FILE; 52 | 53 | for (i = 2; i < newArgc; i++) { 54 | newArgv[i] = *(*argvPtr + i - 1); 55 | } 56 | 57 | *argvPtr = newArgv; 58 | *argcPtr = newArgc; 59 | 60 | return 0; 61 | } 62 | 63 | 64 | /* 65 | *---------------------------------------------------------------------- 66 | * 67 | * main -- 68 | * 69 | * This is the main program for the application. 70 | * 71 | * Results: 72 | * None: Tcl_Main never returns here, so this procedure never 73 | * returns either. 74 | * 75 | * Side effects: 76 | * Whatever the application does. 77 | * 78 | *---------------------------------------------------------------------- 79 | */ 80 | 81 | int 82 | main(argc, argv) 83 | int argc; /* Number of command-line arguments. */ 84 | char **argv; /* Values of command-line arguments. */ 85 | { 86 | #ifdef HAVE_SETPROCTITLE_INIT 87 | /* 88 | * On linux for libbsd we have to call setproctitle_init to setup the library. 89 | */ 90 | extern char **environ; 91 | setproctitle_init(argc, argv, environ); 92 | #endif 93 | 94 | /* 95 | * The following #if block allows you to change the AppInit 96 | * function by using a #define of TCL_LOCAL_APPINIT instead 97 | * of rewriting this entire file. The #if checks for that 98 | * #define and uses Tcl_AppInit if it doesn't exist. 99 | */ 100 | 101 | #ifndef TCL_LOCAL_APPINIT 102 | #define TCL_LOCAL_APPINIT Tcl_AppInit 103 | #endif 104 | extern int TCL_LOCAL_APPINIT (Tcl_Interp *interp); 105 | 106 | /* 107 | * The following #if block allows you to change how Tcl finds the startup 108 | * script, prime the library or encoding paths, fiddle with the argv, 109 | * etc., without needing to rewrite Tcl_Main() 110 | */ 111 | 112 | #ifdef TCL_LOCAL_MAIN_HOOK 113 | extern int TCL_LOCAL_MAIN_HOOK (int *argc, char ***argv); 114 | #endif 115 | 116 | #ifdef TCL_LOCAL_MAIN_HOOK 117 | TCL_LOCAL_MAIN_HOOK(&argc, &argv); 118 | #endif 119 | 120 | Tcl_Main(argc, argv, TCL_LOCAL_APPINIT); 121 | 122 | return 0; /* Needed only to prevent compiler warning. */ 123 | } 124 | 125 | /* 126 | *---------------------------------------------------------------------- 127 | * 128 | * Tcl_AppInit -- 129 | * 130 | * This procedure performs application-specific initialization. 131 | * Most applications, especially those that incorporate additional 132 | * packages, will have their own version of this procedure. 133 | * 134 | * Results: 135 | * Returns a standard Tcl completion code, and leaves an error 136 | * message in the interp's result if an error occurs. 137 | * 138 | * Side effects: 139 | * Depends on the startup script. 140 | * 141 | *---------------------------------------------------------------------- 142 | */ 143 | 144 | int 145 | Tcl_AppInit(interp) 146 | Tcl_Interp *interp; /* Interpreter for application. */ 147 | { 148 | if ((Tcl_Init)(interp) == TCL_ERROR) { 149 | return TCL_ERROR; 150 | } 151 | 152 | if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { 153 | return TCL_ERROR; 154 | } 155 | if (Tcl_PkgRequire(interp, "Tcl", "8.1", 0) == NULL) { 156 | return TCL_ERROR; 157 | } 158 | 159 | /* 160 | * package require the tcllauncher package so that the helper routines 161 | * will get loaded via the normal package mechanism. doing it this 162 | * way then tcllauncher apps don't have to package require tcllauncher 163 | */ 164 | if (Tcl_PkgRequire (interp, PACKAGE_NAME, PACKAGE_VERSION, 1) == NULL) { 165 | return TCL_ERROR; 166 | } 167 | 168 | /* 169 | * Call Tcl_CreateCommand for application-specific commands, if 170 | * they weren't already created by the init procedures called above. 171 | */ 172 | 173 | /* 174 | * Specify a user-specific startup file to invoke if the application 175 | * is run interactively. Typically the startup file is "~/.apprc" 176 | * where "app" is the name of the application. If this line is deleted 177 | * then no user-specific startup file will be run under any conditions. 178 | */ 179 | 180 | #ifdef DJGPP 181 | Tcl_SetVar(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY); 182 | #else 183 | Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY); 184 | #endif 185 | return TCL_OK; 186 | } 187 | -------------------------------------------------------------------------------- /doc/tcllauncher.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | $Id: tcllauncher.txt,v 1.1 2008-04-10 07:28:21 karl Exp $ 4 | 5 | tcllauncher 6 | 7 | tcllauncher is a way to have Tcl programs run out of /usr/local/bin, or 8 | wherever. 9 | 10 | Now you might think, why bother? I'll just put my script in there and 11 | do a #! thing to invoke Tcl. 12 | 13 | Well, OK, but this has certain problems: 14 | 15 | o everything will show in "ps" as tclsh 16 | 17 | o everything will show in "top" as tclsh 18 | 19 | o if there are any files you want to pull in that aren't in a package, 20 | you have to invent your own place to install and locate them. 21 | 22 | You'd like to be able to have stuff show up as its script name. 23 | 24 | You could just copy or even link tclsh to the name of your program. 25 | Say, for instance, trackserver. 26 | 27 | But then you have to invoke trackserver with arguments and do stuff to 28 | prep it, like: 29 | 30 | cd ...somewhere... 31 | /usr/local/bin/trackserver main.tcl 32 | 33 | 34 | That's the original purpose for tcllauncher, just to make that reasonable. 35 | 36 | cp /usr/local/bin/tcllauncher /usr/local/bin/trackserver 37 | 38 | trackserver 39 | 40 | 41 | How does it find its files? It cd's to the corresponding lib directory and 42 | a directory underneath that of the same name as the application, and sources 43 | main.tcl with tcl_interactive set to 0. 44 | 45 | run 46 | 47 | trackserver 48 | 49 | what happens 50 | 51 | /usr/local/bin/trackserver, a copy of /usr/local/bin/tcllauncher, 52 | sources in /usr/local/lib/trackserver/main.tcl. 53 | 54 | Also, a global variable called launchdir is set containing the "launch 55 | directory." In the above example, /usr/local/lib/trackserver. 56 | 57 | WHAT DIRECTORY 58 | 59 | Tcllauncher doesn't change your directory behind your back, so wherever you 60 | are at when you run it, you're still in that directory. 61 | 62 | But a lot of times you want to go to your application directory, so you 63 | can just 64 | 65 | cd $::launchdir 66 | 67 | Then you can source in all of your various files and stuff like that. 68 | 69 | PROCESS GROUP 70 | 71 | If you are going to fork off children, exec them, or whatever, you should 72 | probably become your own process group so hopefully your children might 73 | inherit your signals and Do The Right Thing. 74 | 75 | package require Tclx 76 | id process group set 77 | 78 | PID FILE 79 | 80 | Lots of apps write a file with the server's process ID in it. Upon relaunch, 81 | the program can come along and look in its own pid file to see if it's already 82 | alive or not, and also to potentially kill it. 83 | 84 | Our pidfile support is a studied Tcl-based copy of BSD's pidfile C library. 85 | 86 | ::tcllauncher::pidfile_open 87 | 88 | Given an optional path to a filename and optional permissions, 89 | pidfile_open opens (or creates) a file specified by the path 90 | and locks it with TclX's interface to the flock system call. 91 | 92 | If the file cannot be locked, the PID of an already running daemon is 93 | returned. 94 | 95 | Otherwise zero is returned and you've got the lock. You can now call 96 | pidfile_write to get your pid into the lock file. 97 | 98 | This function does not write your process' PID into the file, 99 | so it can be used before forking if needed. 100 | 101 | If the path is empty, /var/run/$::argv0.pid is used. If the mode 102 | isn't specified, a mode of 0600 (read and write for the owner, no 103 | access from group or other). 104 | 105 | ::tcllauncher::pidfile_write 106 | 107 | Writes your pid into the pid file previously opened by pidfile_open. 108 | 109 | ::tcllauncher::pidfile_mtime 110 | 111 | Return the mtime of the pidfile. Can be used after a successful or unsuccessful 112 | call to pidfile_open. Considered useful after pidfile_open fails due to another 113 | process holding the lock to examine when the owner process got the lock. 114 | 115 | ::tcllauncher::pidfile_close 116 | 117 | Close a pidfile. It should be used after your daemon forks to start 118 | a child process. 119 | 120 | ::tcllauncher::pidfile_remove 121 | 122 | Close and remove a pidfile. 123 | 124 | EXAMPLE 125 | 126 | set pid [::tcllauncher::pidfile_open "/var/run/daemon.pid" 0600] 127 | if {$pid > 0} { 128 | puts stderr "pid $pid already has the lock" 129 | exit 1 130 | } 131 | 132 | ::tcllauncher::daemonize 133 | 134 | ::tcllauncher::pidfile_write 135 | 136 | ...do work... 137 | 138 | ::tcllauncher::pidfile_remove 139 | exit 140 | 141 | 142 | DAEMONIZE 143 | 144 | Sometimes you want your program to spawn itself off into the background in 145 | a way that when you logout it doesn't kill the process, etc. 146 | 147 | To daemonize a tcllauncher app, 148 | 149 | ::tcllauncher::daemonize 150 | 151 | By default this forks off a child and exits the parent. In the child, it 152 | changes the current directory to /, and redirects stdin, stdout and stderr 153 | to/from /dev/null. 154 | 155 | Optional arguments are -noclose, which prevents the closing and redirecting 156 | of stdin, stdout and stderr, and -nochdir, which prevents the changing of 157 | the working dir to /. 158 | 159 | ::tcllauncher::daemonize -nochdir 160 | 161 | This is a rough copy of BSD 4.4's daemon library routine. 162 | 163 | USER AND GROUP ID MANAGEMENT 164 | 165 | If a program needs to be run as a certain use, it can invoke 166 | 167 | ::tcllauncher::require_user fred 168 | 169 | This requires the program to either be run as fred or as root or something 170 | like that, a user that has permissions to become fred. 171 | 172 | If the program is running as user fred or can change the user id (suid) to 173 | fred, it continues, else it aborts. 174 | 175 | ::tcllauncher::require_group does for groups what require_user does for 176 | users. 177 | 178 | Note that if you require user first then require group, the process may have 179 | lost the privileges necessary to change groups after changing users. Either 180 | require the group ID first or use ::tcllauncher::require_user_and_group 181 | to do both. 182 | 183 | 184 | -------------------------------------------------------------------------------- /tcllauncher-support.tcl.in: -------------------------------------------------------------------------------- 1 | # 2 | # tcllauncher-support.tcl - support and standalone routines for tcllauncher 3 | # 4 | 5 | # 6 | # NB if editing file file make sure you edit tcllauncher-support.tcl.in 7 | # 8 | 9 | package require Tclx 10 | 11 | namespace eval ::tcllauncher { 12 | 13 | # 14 | # require_group - require a certain group ID, exit with message to stderr if not 15 | # 16 | proc require_group {group} { 17 | if {[id group] == $group} { 18 | return 19 | } 20 | 21 | # see if we can set to that group, maybe we're root? 22 | if {[catch {id group $group} result] == 1} { 23 | puts stderr "requires and can't set to group '$group': $result" 24 | exit 254 25 | } 26 | 27 | return 28 | } 29 | 30 | # 31 | # require_user - require a certain user ID, exit with message to stderr if not 32 | # 33 | proc require_user {user} { 34 | if {[id user] == $user} { 35 | return 36 | } 37 | 38 | # see if we can set to that group, maybe we're root? 39 | if {[catch {id user $user} result] == 1} { 40 | puts stderr "requires and can't set to user '$user': $result" 41 | exit 253 42 | } 43 | 44 | return 45 | } 46 | 47 | # 48 | # require_user_and_group - require the invoker to either be of a certain 49 | # user and group or if they're superuser or some kind of equivalent, 50 | # force this process to have the specified user (uid) and group (gid) 51 | # 52 | proc require_user_and_group {user group} { 53 | 54 | # try group first because if we're root we might not be after setting 55 | # user 56 | 57 | require_group $group 58 | 59 | require_user $user 60 | } 61 | 62 | # 63 | # daemonize - rough tclx-based copy of BSD 4.4's "daemon" library routine 64 | # 65 | # usage: daemonize ?-noclose? ?-nochdir? 66 | # 67 | # detaches the process from the controlling terminal by forking, having 68 | # the child become a process group leader, changing directory to / (by 69 | # default) and closing and reopening stdin, stdout and stderr to and 70 | # from /dev/null. 71 | # 72 | proc daemonize {args} { 73 | set doClose 1 74 | set doChdir 1 75 | 76 | foreach arg $args { 77 | switch $arg { 78 | "-noclose" { 79 | set doClose 0 80 | } 81 | 82 | "-nochdir" { 83 | set doChdir 0 84 | } 85 | 86 | default { 87 | error "unrecognized option: $arg" 88 | } 89 | } 90 | } 91 | 92 | set pid [fork] 93 | 94 | if {$pid != 0} { 95 | exit 0 96 | } 97 | 98 | id process group set 99 | 100 | if {$doChdir} { 101 | cd "/" 102 | } 103 | 104 | if {$doClose} { 105 | # they didn't say -noclose so close stdin, stdout, stderr and 106 | # repoint to /dev/null 107 | set fp [open /dev/null RDWR] 108 | dup $fp stdin 109 | dup $fp stdout 110 | dup $fp stderr 111 | close $fp 112 | } else { 113 | # they set -noclose but let's make sure stdin, stdout and stderr 114 | # exist and if they don't, let's gin them up from /dev/null 115 | if {[llength [file channels std*]] == 3} { 116 | # they all exist, we're good 117 | return 118 | } 119 | 120 | set fp [open /dev/null RDWR] 121 | # regenerate the list of standard handles because the fp file we 122 | # just opened will have become one of them by opening it 123 | set stdHandles [file channels std*] 124 | 125 | # for all the stdio handles that don't have some kind of file 126 | # or socket or device associated with them, associate /dev/null 127 | foreach handle [list stdin stdout stderr] { 128 | # if the handle doesn't exist... 129 | if {[lsearch $stdHandles $handle] < 0} { 130 | dup $fp $handle 131 | } 132 | } 133 | close $fp 134 | } 135 | 136 | return 137 | } 138 | 139 | # 140 | # pidfile_verify - insane checks of pid file 141 | # 142 | proc pidfile_verify {} { 143 | variable pfh 144 | 145 | if {[catch {fstat $pfh(fp)} stat] == 1} { 146 | error "programming error: $stat" 147 | } 148 | 149 | set dev [keylget stat dev] 150 | set ino [keylget stat ino] 151 | 152 | if {$dev != $pfh(dev) || $ino != $pfh(ino)} { 153 | error "programming error: pidfile dev $dev ino $ino doesn't match prior dev $pfh(dev) ino $pfh(ino)" 154 | } 155 | 156 | return 0 157 | } 158 | 159 | # 160 | # pidfile_read - given a path and the name of a pid variable, set the 161 | # PID into the variable 162 | # 163 | proc pidfile_read {path _pid} { 164 | variable pfh 165 | 166 | upvar $_pid pid 167 | 168 | set fp [open $path "RDONLY"] 169 | set pid [read -nonewline $fp] 170 | close $fp 171 | 172 | set pfh(path) $path 173 | } 174 | 175 | # 176 | # pidfile_open - given an optional path to a file and optional permissions, 177 | # open the file, try to lock it, get its contents. Return the pid contained 178 | # therein if there is one and the lock failed. (Somebody's already got the 179 | # pid.) 180 | # 181 | # else you've got the lock and call pidfile_write to get your pid in there 182 | # 183 | proc pidfile_open {{path ""} {mode 0600}} { 184 | variable pfh 185 | 186 | if {$path == ""} { 187 | set pidfile /var/run/$::argv0.pid 188 | } else { 189 | set pidfile $path 190 | } 191 | 192 | set pfh(path) $pidfile 193 | 194 | # Open the PID file and obtain exclusive lock. 195 | # We truncate PID file here only to remove old PID immediately, 196 | # PID file will be truncated again in pidfile_write(), so 197 | # pidfile_write() can be called multiple times. 198 | 199 | set fp [open $pidfile "RDWR CREAT" $mode] 200 | 201 | # try to lock the file 202 | 203 | if {![flock -write -nowait $fp]} { 204 | # failed to lock the file, read it for the pid of the owner 205 | set pid [read -nonewline $fp] 206 | 207 | # if we can get an integer out of it, return that 208 | if {[scan $pid %d pid] > 0} { 209 | close $fp 210 | return $pid 211 | } 212 | } 213 | 214 | # i got the lock 215 | 216 | # can fstat really fail on a file i have open? 217 | set stat [fstat $fp] 218 | 219 | set pfh(fp) $fp 220 | set pfh(dev) [keylget stat dev] 221 | set pfh(ino) [keylget stat ino] 222 | 223 | return 0 224 | } 225 | 226 | # 227 | # pidfile_mtime - return the mtime of the pidfile, returns -1 if 228 | # "file mtime" failed. 229 | # 230 | proc pidfile_mtime {} { 231 | variable pfh 232 | 233 | if {[catch {file mtime $pfh(path)} catchResult] == 1} { 234 | # some kind of error statting the file 235 | return -1 236 | } 237 | 238 | # catchResult is the mtime of the file 239 | return $catchResult 240 | } 241 | 242 | # 243 | # pidfile_write - write my pid into the pid file 244 | # 245 | proc pidfile_write {} { 246 | variable pfh 247 | 248 | pidfile_verify 249 | 250 | set fp $pfh(fp) 251 | 252 | if {![flock -write -nowait $fp]} { 253 | puts stderr "Unable to obtain lock on pidfile '$pfh(path)' for pidfile_write" 254 | exit 252 255 | } 256 | 257 | ftruncate -fileid $fp 0 258 | 259 | puts $fp [pid] 260 | flush $fp 261 | } 262 | 263 | # 264 | # pidfile_close - close the pid file 265 | # 266 | proc pidfile_close {} { 267 | variable pfh 268 | 269 | pidfile_verify 270 | 271 | close $pfh(fp) 272 | } 273 | 274 | # 275 | # pidfile_remove - remove the pidfile, unlock the lock, and close it 276 | # 277 | proc pidfile_remove {} { 278 | variable pfh 279 | 280 | pidfile_verify 281 | 282 | file delete $pfh(path) 283 | funlock $pfh(fp) 284 | 285 | close $pfh(fp) 286 | } 287 | 288 | } ;# namespace tcllauncher 289 | 290 | package provide @PACKAGE_NAME@ @PACKAGE_VERSION@ 291 | 292 | # vim: set ts=8 sw=4 sts=4 noet : 293 | -------------------------------------------------------------------------------- /doc/tcllauncher.man: -------------------------------------------------------------------------------- 1 | [manpage_begin tcllauncher n 1.1] 2 | [moddesc {Tcl application launcher for servers}] 3 | [copyright {2007-2014 FlightAware LLC (BSD Liscense)}] 4 | [titledesc {Tcl application launcher}] 5 | [description] 6 | [para] 7 | 8 | tcllauncher is a way to have Tcl programs run out of /usr/local/bin under 9 | their own name, be installed in one place with their support files, and 10 | provides commands to facilitate server-oriented application execution. 11 | 12 | [para] 13 | 14 | 15 | Now you might think, why bother? I'll just put my script in there and 16 | do a #! thing to invoke Tcl. 17 | 18 | [para] 19 | 20 | Well, OK, but this has certain problems: 21 | [list_begin item] 22 | [item] All your Tcl programs will show in "ps" as tclsh 23 | [item] All your Tcl programs will show in "top" as tclsh 24 | [item] if there are any files you want to pull in that aren't in a package, 25 | you have to invent your own place to install and locate them. 26 | [list_end] 27 | 28 | [para] 29 | 30 | You'd like to be able to have stuff show up as its script name. 31 | 32 | [para] 33 | 34 | You could just copy or even link tclsh to the name of your program. 35 | Say, for instance, trackserver. 36 | 37 | [para] 38 | 39 | But then you have to invoke trackserver with arguments and do stuff to 40 | prep it, like: 41 | 42 | [example_begin] 43 | cd ...somewhere... 44 | /usr/local/bin/trackserver main.tcl 45 | [example_end] 46 | 47 | That's the original purpose for tcllauncher, just to make that reasonable. 48 | 49 | [example_begin] 50 | cp /usr/local/bin/tcllauncher /usr/local/bin/trackserver 51 | 52 | trackserver 53 | [example_end] 54 | 55 | How does it find its files? It cd's to the corresponding lib directory and 56 | a directory underneath that of the same name as the application, and sources 57 | [file main.tcl] with [var tcl_interactive] set to 0. 58 | 59 | [para] 60 | 61 | So when [file tcllauncher] is installed as [file trackserver] and you run trackserver, what happens [file /usr/local/bin/trackserver] starts up like the 62 | Tcl shell, except that it sources in [file /usr/local/lib/trackserver/main.tcl]. 63 | 64 | Also, a global variable called [var launchdir] is set containing the "launch 65 | directory," i.e. the directory where main.tcl was loaded from. 66 | ( In the above example, [file /usr/local/lib/trackserver.]) 67 | 68 | [section {WHAT DIRECTORY}] 69 | 70 | Tcllauncher doesn't change your directory behind your back, so wherever you 71 | are at when you run it, you're still in that directory. 72 | 73 | [para] 74 | 75 | But a lot of times you want to go to your application directory, so you 76 | can just 77 | 78 | [example_begin] 79 | cd $::launchdir 80 | [example_end] 81 | 82 | Then you can source in all of your various files and stuff like that. 83 | 84 | [section {PROCESS GROUP}] 85 | 86 | If you are going to fork off children, exec them, or whatever, you should 87 | probably become your own process group so hopefully your children might 88 | inherit your signals and Do The Right Thing. 89 | 90 | [example_begin] 91 | id process group set 92 | [example_end] 93 | 94 | The [cmd id] command is from the TclX extension. 95 | 96 | [section {PID FILE}] 97 | 98 | Lots of apps write a file with the server's process ID in it. Upon relaunch, 99 | the program can come along and look in its own pid file to see if it's already 100 | alive or not, and also to potentially kill it. 101 | 102 | [para] 103 | 104 | Our pidfile support is a studied Tcl-based copy of BSD's pidfile C library. 105 | 106 | [para] 107 | 108 | [list_begin definitions] 109 | [call [cmd ::tcllauncher::pidfile_open] \ 110 | [opt "[arg filename]"] \ 111 | [opt "[arg mode]"]] 112 | 113 | Given an optional path to a pid filename and optional permissions, 114 | pidfile_open opens (or creates) a file specified by the path 115 | and locks it with TclX's interface to the [cmd flock] system call. 116 | 117 | [para] 118 | 119 | If the file cannot be locked, the PID of an already running daemon is 120 | returned. 121 | 122 | Otherwise zero is returned and you've got the lock. You can now call 123 | [cmd pidfile_write] to get your pid into the lock file. 124 | 125 | [para] 126 | 127 | This function does not write your process' PID into the file, 128 | so it can be used before forking if needed. 129 | 130 | [para] 131 | If path is not specified (empty string), [file /var/run/\$::argv0.pid] is used, and if mode is not specified, 0600 is used. 132 | 133 | [call [cmd ::tcllauncher::pidfile_write]] 134 | 135 | Writes your pid into the pid file previously opened by [cmd pidfile_open]. 136 | 137 | [call [cmd ::tcllauncher::pidfile_mtime]] 138 | 139 | Return the mtime of the pidfile. 140 | 141 | [para] 142 | 143 | Can be used after a successful or unsuccessful 144 | call to pidfile_open. Considered useful after pidfile_open fails due to another 145 | process holding the lock to examine when the owner process got the lock. 146 | 147 | [call [cmd ::tcllauncher::pidfile_close ]] 148 | 149 | Close a pidfile. It should be used after your daemon forks to start 150 | a child process. 151 | 152 | [call [cmd ::tcllauncher::pidfile_remove]] 153 | 154 | Close and remove a pidfile. 155 | 156 | [list_end] 157 | [section {EXAMPLE}] 158 | 159 | [example_begin] 160 | set pid [lb]::tcllauncher::pidfile_open "/var/run/daemon.pid" 0600[rb] 161 | if {$pid > 0} { 162 | puts stderr "pid $pid already has the lock" 163 | exit 1 164 | } 165 | 166 | ::tcllauncher::daemonize 167 | 168 | ::tcllauncher::pidfile_write 169 | 170 | ...do work... 171 | 172 | ::tcllauncher::pidfile_remove 173 | exit 174 | [example_end] 175 | 176 | [section {DAEMONIZE}] 177 | 178 | Sometimes you want your program to spawn itself off into the background in 179 | a way that when you logout it doesn't kill the process, etc. 180 | 181 | To daemonize a tcllauncher app, 182 | 183 | [list_begin definitions] 184 | [call [cmd ::tcllauncher::daemonize] \ 185 | [opt "[arg -noclose]"] \ 186 | [opt "[arg -nochdir]"]] 187 | 188 | By default this forks off a child and exits the parent. In the child, it 189 | changes the current directory to [file /], and redirects stdin, stdout and 190 | stderr to/from [file /dev/null]. 191 | 192 | [para] 193 | Specifying [arg -noclose] prevents the closing and redirecting of stdin, 194 | stdout and stderr, while [arg -nochdir] prevents the changing of the working 195 | dir to [file /] 196 | 197 | [para] 198 | This is a rough copy of BSD 4.4's [cmd daemon] library routine. 199 | [list_end] 200 | 201 | [section {USER AND GROUP ID MANAGEMENT}] 202 | 203 | If a program needs to be run as a certain use, it can invoke 204 | 205 | [list_begin definitions] 206 | [call [cmd ::tcllauncher::require_user] \ 207 | [arg userName]] 208 | 209 | This requires the program to either be run as fred or as root or something 210 | like that, by a user that has permissions to become fred. 211 | 212 | [para] 213 | 214 | If the program is running as user fred or can change the user id (suid) to 215 | fred, it continues, else it aborts. 216 | 217 | [para] 218 | 219 | This means if the superuser invokes the program, it will change user to the correct user. If the correct user invokes the program, it will correctly do nothing and proceed. Handy. 220 | 221 | [call [cmd ::tcllauncher::require_group] \ 222 | [arg groupName]] does for groups what require_user does for 223 | users. 224 | 225 | [call [cmd ::tcllauncher::require_user_and_group] \ 226 | [arg userName] \ 227 | [arg groupName]] 228 | combines changing the group and user into a single procedure. 229 | 230 | [list_end] 231 | [para] 232 | 233 | Note that if you require user first then require group, the process may have 234 | lost the privileges necessary to change groups after changing users. Either 235 | require the group ID first or use [cmd ::tcllauncher::require_user_and_group] 236 | to do both. 237 | 238 | [keywords tcllauncher daemon daemonize background] 239 | [manpage_end] 240 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash -norc 2 | dnl This file is an input file used by the GNU "autoconf" program to 3 | dnl generate the file "configure", which is run during Tcl installation 4 | dnl to configure the system for the local environment. 5 | # 6 | # RCS: @(#) $Id: configure.in,v 1.5 2008-11-18 22:32:07 karl Exp $ 7 | 8 | #----------------------------------------------------------------------- 9 | # launcher configure.in for Tcl Extensions. The only places you should 10 | # need to modify this file are marked by the string __CHANGE__ 11 | #----------------------------------------------------------------------- 12 | 13 | #----------------------------------------------------------------------- 14 | # __CHANGE__ 15 | # Set your package name and version numbers here. 16 | # 17 | # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION 18 | # set as provided. These will also be added as -D defs in your Makefile 19 | # so you can encode the package version directly into the source files. 20 | #----------------------------------------------------------------------- 21 | 22 | AC_INIT([Tcllauncher],[1.10]) 23 | 24 | #-------------------------------------------------------------------- 25 | # Call TEA_INIT as the first TEA_ macro to set up initial vars. 26 | # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" 27 | # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. 28 | #-------------------------------------------------------------------- 29 | 30 | TEA_INIT([3.9]) 31 | 32 | AC_CONFIG_AUX_DIR(tclconfig) 33 | 34 | #-------------------------------------------------------------------- 35 | # Load the tclConfig.sh file 36 | #-------------------------------------------------------------------- 37 | 38 | TEA_PATH_TCLCONFIG 39 | TEA_LOAD_TCLCONFIG 40 | 41 | #-------------------------------------------------------------------- 42 | # Load the tkConfig.sh file if necessary (Tk extension) 43 | #-------------------------------------------------------------------- 44 | 45 | #TEA_PATH_TKCONFIG 46 | #TEA_LOAD_TKCONFIG 47 | 48 | #----------------------------------------------------------------------- 49 | # Handle the --prefix=... option by defaulting to what Tcl gave. 50 | # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. 51 | #----------------------------------------------------------------------- 52 | 53 | TEA_PREFIX 54 | 55 | #----------------------------------------------------------------------- 56 | # Standard compiler checks. 57 | # This sets up CC by using the CC env var, or looks for gcc otherwise. 58 | # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create 59 | # the basic setup necessary to compile executables. 60 | #----------------------------------------------------------------------- 61 | 62 | TEA_SETUP_COMPILER 63 | 64 | #----------------------------------------------------------------------- 65 | # __CHANGE__ 66 | # Specify the C source files to compile in TEA_ADD_SOURCES, 67 | # public headers that need to be installed in TEA_ADD_HEADERS, 68 | # stub library C source files to compile in TEA_ADD_STUB_SOURCES, 69 | # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. 70 | # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS 71 | # and PKG_TCL_SOURCES. 72 | #----------------------------------------------------------------------- 73 | 74 | TEA_ADD_SOURCES([]) 75 | TEA_ADD_HEADERS([]) 76 | TEA_ADD_INCLUDES([-I${srcdir}/generic]) 77 | TEA_ADD_LIBS([]) 78 | TEA_ADD_CFLAGS([]) 79 | TEA_ADD_STUB_SOURCES([]) 80 | TEA_ADD_TCL_SOURCES([tcllauncher.tcl]) 81 | 82 | #-------------------------------------------------------------------- 83 | # __CHANGE__ 84 | # A few miscellaneous platform-specific items: 85 | # 86 | # Define a special symbol for Windows (BUILD_launcher in this case) so 87 | # that we create the export library with the dll. 88 | # 89 | # Windows creates a few extra files that need to be cleaned up. 90 | # You can add more files to clean if your extension creates any extra 91 | # files. 92 | # 93 | # TEA_ADD_* any platform specific compiler/build info here. 94 | #-------------------------------------------------------------------- 95 | 96 | # Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure 97 | # and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var. 98 | CLEANFILES="" 99 | if test "${TEA_PLATFORM}" = "windows" ; then 100 | AC_DEFINE(BUILD_launcher, 1, [Build windows export dll]) 101 | CLEANFILES="$CLEANFILES *.lib *.dll *.exp *.ilk *.pdb vc*.pch" 102 | #TEA_ADD_SOURCES([win/winFile.c]) 103 | #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) 104 | else 105 | # Ensure no empty else clauses 106 | : 107 | #TEA_ADD_SOURCES([unix/unixFile.c]) 108 | #TEA_ADD_LIBS([-lsuperfly]) 109 | fi 110 | AC_SUBST(CLEANFILES) 111 | 112 | #-------------------------------------------------------------------- 113 | # __CHANGE__ 114 | # Choose which headers you need. Extension authors should try very 115 | # hard to only rely on the Tcl public header files. Internal headers 116 | # contain private data structures and are subject to change without 117 | # notice. 118 | # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG 119 | #-------------------------------------------------------------------- 120 | 121 | TEA_PUBLIC_TCL_HEADERS 122 | #TEA_PRIVATE_TCL_HEADERS 123 | 124 | #TEA_PUBLIC_TK_HEADERS 125 | #TEA_PRIVATE_TK_HEADERS 126 | #TEA_PATH_X 127 | 128 | #-------------------------------------------------------------------- 129 | # Check whether --enable-threads or --disable-threads was given. 130 | # This auto-enables if Tcl was compiled threaded. 131 | #-------------------------------------------------------------------- 132 | 133 | TEA_ENABLE_THREADS 134 | 135 | #-------------------------------------------------------------------- 136 | # The statement below defines a collection of symbols related to 137 | # building as a shared library instead of a static library. 138 | #-------------------------------------------------------------------- 139 | 140 | TEA_ENABLE_SHARED 141 | 142 | #-------------------------------------------------------------------- 143 | # This macro figures out what flags to use with the compiler/linker 144 | # when building shared/static debug/optimized objects. This information 145 | # can be taken from the tclConfig.sh file, but this figures it all out. 146 | #-------------------------------------------------------------------- 147 | 148 | TEA_CONFIG_CFLAGS 149 | 150 | #-------------------------------------------------------------------- 151 | # Set the default compiler switches based on the --enable-symbols option. 152 | #-------------------------------------------------------------------- 153 | 154 | TEA_ENABLE_SYMBOLS 155 | 156 | #-------------------------------------------------------------------- 157 | # Everyone should be linking against the Tcl stub library. If you 158 | # can't for some reason, remove this definition. If you aren't using 159 | # stubs, you also need to modify the SHLIB_LD_LIBS setting below to 160 | # link against the non-stubbed Tcl library. Add Tk too if necessary. 161 | #-------------------------------------------------------------------- 162 | 163 | AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) 164 | #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) 165 | 166 | #-------------------------------------------------------------------- 167 | # This macro generates a line to use when building a library. It 168 | # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, 169 | # and TEA_LOAD_TCLCONFIG macros above. 170 | #-------------------------------------------------------------------- 171 | 172 | #TEA_MAKE_LIB 173 | 174 | #-------------------------------------------------------------------- 175 | # Determine the name of the tclsh and/or wish executables in the 176 | # Tcl and Tk build directories or the location they were installed 177 | # into. These paths are used to support running test cases only, 178 | # the Makefile should not be making use of these paths to generate 179 | # a pkgIndex.tcl file or anything else at extension build time. 180 | #-------------------------------------------------------------------- 181 | 182 | TEA_PROG_TCLSH 183 | #TEA_PROG_WISH 184 | 185 | # ------------------------------------------------------------------- 186 | # Find a usable dtplite (from tcllib) to use in document generation. 187 | # ------------------------------------------------------------------- 188 | 189 | TEA_PROG_DTPLITE 190 | 191 | # TCLLAUNCHER needs some stuff since it makes a tclsh-like executable 192 | # that isn't normally substituted. Make configure substitute that stuff 193 | # too! 194 | AC_SUBST(LIB_RUNTIME_DIR) 195 | AC_SUBST(LD_SEARCH_FLAGS) 196 | AC_SUBST(CC_SEARCH_FLAGS) 197 | AC_SUBST(THREADS_LIBS) 198 | 199 | # On Linux look for setproctitle support in libbsd 200 | AC_SEARCH_LIBS([setproctitle_init], [bsd], [], []) 201 | AC_CHECK_FUNCS(setproctitle_init) 202 | 203 | AC_MSG_CHECKING([if swiftc linker is requested]) 204 | AC_ARG_ENABLE(swiftc-linker, 205 | AC_HELP_STRING([--enable-swiftc-linker], [use swiftc for linker (default: no)]), 206 | [swiftlinker=$enableval], [swiftlinker=no]) 207 | AC_MSG_RESULT([$swiftlinker]) 208 | 209 | # Change linker arguments for rpath 210 | if test "${swiftlinker}" = "yes" ; then 211 | AC_SUBST(LINK_CC, ["swiftc -emit-executable"]) 212 | CC_SEARCH_FLAGS='-Xlinker -rpath=${LIB_RUNTIME_DIR}' 213 | else 214 | AC_SUBST(LINK_CC, [$CC]) 215 | fi 216 | AC_SUBST(CC_SEARCH_FLAGS) 217 | 218 | #-------------------------------------------------------------------- 219 | # Finally, substitute all of the various values into the Makefile. 220 | # You may alternatively have a special pkgIndex.tcl.in or other files 221 | # which require substituting th AC variables in. Include these here. 222 | #-------------------------------------------------------------------- 223 | 224 | AC_CONFIG_FILES([Makefile pkgIndex.tcl tcllauncher-support.tcl]) 225 | AC_OUTPUT 226 | -------------------------------------------------------------------------------- /doc/tcllauncher.n: -------------------------------------------------------------------------------- 1 | '\" 2 | '\" Generated from file 'tcllauncher\&.man' by tcllib/doctools with format 'nroff' 3 | '\" Copyright (c) 2007-2014 FlightAware LLC (BSD Liscense) 4 | '\" 5 | .TH "tcllauncher" n 1\&.1 tcllauncher "Tcl application launcher for servers" 6 | .\" The -*- nroff -*- definitions below are for supplemental macros used 7 | .\" in Tcl/Tk manual entries. 8 | .\" 9 | .\" .AP type name in/out ?indent? 10 | .\" Start paragraph describing an argument to a library procedure. 11 | .\" type is type of argument (int, etc.), in/out is either "in", "out", 12 | .\" or "in/out" to describe whether procedure reads or modifies arg, 13 | .\" and indent is equivalent to second arg of .IP (shouldn't ever be 14 | .\" needed; use .AS below instead) 15 | .\" 16 | .\" .AS ?type? ?name? 17 | .\" Give maximum sizes of arguments for setting tab stops. Type and 18 | .\" name are examples of largest possible arguments that will be passed 19 | .\" to .AP later. If args are omitted, default tab stops are used. 20 | .\" 21 | .\" .BS 22 | .\" Start box enclosure. From here until next .BE, everything will be 23 | .\" enclosed in one large box. 24 | .\" 25 | .\" .BE 26 | .\" End of box enclosure. 27 | .\" 28 | .\" .CS 29 | .\" Begin code excerpt. 30 | .\" 31 | .\" .CE 32 | .\" End code excerpt. 33 | .\" 34 | .\" .VS ?version? ?br? 35 | .\" Begin vertical sidebar, for use in marking newly-changed parts 36 | .\" of man pages. The first argument is ignored and used for recording 37 | .\" the version when the .VS was added, so that the sidebars can be 38 | .\" found and removed when they reach a certain age. If another argument 39 | .\" is present, then a line break is forced before starting the sidebar. 40 | .\" 41 | .\" .VE 42 | .\" End of vertical sidebar. 43 | .\" 44 | .\" .DS 45 | .\" Begin an indented unfilled display. 46 | .\" 47 | .\" .DE 48 | .\" End of indented unfilled display. 49 | .\" 50 | .\" .SO ?manpage? 51 | .\" Start of list of standard options for a Tk widget. The manpage 52 | .\" argument defines where to look up the standard options; if 53 | .\" omitted, defaults to "options". The options follow on successive 54 | .\" lines, in three columns separated by tabs. 55 | .\" 56 | .\" .SE 57 | .\" End of list of standard options for a Tk widget. 58 | .\" 59 | .\" .OP cmdName dbName dbClass 60 | .\" Start of description of a specific option. cmdName gives the 61 | .\" option's name as specified in the class command, dbName gives 62 | .\" the option's name in the option database, and dbClass gives 63 | .\" the option's class in the option database. 64 | .\" 65 | .\" .UL arg1 arg2 66 | .\" Print arg1 underlined, then print arg2 normally. 67 | .\" 68 | .\" .QW arg1 ?arg2? 69 | .\" Print arg1 in quotes, then arg2 normally (for trailing punctuation). 70 | .\" 71 | .\" .PQ arg1 ?arg2? 72 | .\" Print an open parenthesis, arg1 in quotes, then arg2 normally 73 | .\" (for trailing punctuation) and then a closing parenthesis. 74 | .\" 75 | .\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. 76 | .if t .wh -1.3i ^B 77 | .nr ^l \n(.l 78 | .ad b 79 | .\" # Start an argument description 80 | .de AP 81 | .ie !"\\$4"" .TP \\$4 82 | .el \{\ 83 | . ie !"\\$2"" .TP \\n()Cu 84 | . el .TP 15 85 | .\} 86 | .ta \\n()Au \\n()Bu 87 | .ie !"\\$3"" \{\ 88 | \&\\$1 \\fI\\$2\\fP (\\$3) 89 | .\".b 90 | .\} 91 | .el \{\ 92 | .br 93 | .ie !"\\$2"" \{\ 94 | \&\\$1 \\fI\\$2\\fP 95 | .\} 96 | .el \{\ 97 | \&\\fI\\$1\\fP 98 | .\} 99 | .\} 100 | .. 101 | .\" # define tabbing values for .AP 102 | .de AS 103 | .nr )A 10n 104 | .if !"\\$1"" .nr )A \\w'\\$1'u+3n 105 | .nr )B \\n()Au+15n 106 | .\" 107 | .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n 108 | .nr )C \\n()Bu+\\w'(in/out)'u+2n 109 | .. 110 | .AS Tcl_Interp Tcl_CreateInterp in/out 111 | .\" # BS - start boxed text 112 | .\" # ^y = starting y location 113 | .\" # ^b = 1 114 | .de BS 115 | .br 116 | .mk ^y 117 | .nr ^b 1u 118 | .if n .nf 119 | .if n .ti 0 120 | .if n \l'\\n(.lu\(ul' 121 | .if n .fi 122 | .. 123 | .\" # BE - end boxed text (draw box now) 124 | .de BE 125 | .nf 126 | .ti 0 127 | .mk ^t 128 | .ie n \l'\\n(^lu\(ul' 129 | .el \{\ 130 | .\" Draw four-sided box normally, but don't draw top of 131 | .\" box if the box started on an earlier page. 132 | .ie !\\n(^b-1 \{\ 133 | \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' 134 | .\} 135 | .el \}\ 136 | \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' 137 | .\} 138 | .\} 139 | .fi 140 | .br 141 | .nr ^b 0 142 | .. 143 | .\" # VS - start vertical sidebar 144 | .\" # ^Y = starting y location 145 | .\" # ^v = 1 (for troff; for nroff this doesn't matter) 146 | .de VS 147 | .if !"\\$2"" .br 148 | .mk ^Y 149 | .ie n 'mc \s12\(br\s0 150 | .el .nr ^v 1u 151 | .. 152 | .\" # VE - end of vertical sidebar 153 | .de VE 154 | .ie n 'mc 155 | .el \{\ 156 | .ev 2 157 | .nf 158 | .ti 0 159 | .mk ^t 160 | \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' 161 | .sp -1 162 | .fi 163 | .ev 164 | .\} 165 | .nr ^v 0 166 | .. 167 | .\" # Special macro to handle page bottom: finish off current 168 | .\" # box/sidebar if in box/sidebar mode, then invoked standard 169 | .\" # page bottom macro. 170 | .de ^B 171 | .ev 2 172 | 'ti 0 173 | 'nf 174 | .mk ^t 175 | .if \\n(^b \{\ 176 | .\" Draw three-sided box if this is the box's first page, 177 | .\" draw two sides but no top otherwise. 178 | .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c 179 | .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c 180 | .\} 181 | .if \\n(^v \{\ 182 | .nr ^x \\n(^tu+1v-\\n(^Yu 183 | \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c 184 | .\} 185 | .bp 186 | 'fi 187 | .ev 188 | .if \\n(^b \{\ 189 | .mk ^y 190 | .nr ^b 2 191 | .\} 192 | .if \\n(^v \{\ 193 | .mk ^Y 194 | .\} 195 | .. 196 | .\" # DS - begin display 197 | .de DS 198 | .RS 199 | .nf 200 | .sp 201 | .. 202 | .\" # DE - end display 203 | .de DE 204 | .fi 205 | .RE 206 | .sp 207 | .. 208 | .\" # SO - start of list of standard options 209 | .de SO 210 | 'ie '\\$1'' .ds So \\fBoptions\\fR 211 | 'el .ds So \\fB\\$1\\fR 212 | .SH "STANDARD OPTIONS" 213 | .LP 214 | .nf 215 | .ta 5.5c 11c 216 | .ft B 217 | .. 218 | .\" # SE - end of list of standard options 219 | .de SE 220 | .fi 221 | .ft R 222 | .LP 223 | See the \\*(So manual entry for details on the standard options. 224 | .. 225 | .\" # OP - start of full description for a single option 226 | .de OP 227 | .LP 228 | .nf 229 | .ta 4c 230 | Command-Line Name: \\fB\\$1\\fR 231 | Database Name: \\fB\\$2\\fR 232 | Database Class: \\fB\\$3\\fR 233 | .fi 234 | .IP 235 | .. 236 | .\" # CS - begin code excerpt 237 | .de CS 238 | .RS 239 | .nf 240 | .ta .25i .5i .75i 1i 241 | .. 242 | .\" # CE - end code excerpt 243 | .de CE 244 | .fi 245 | .RE 246 | .. 247 | .\" # UL - underline word 248 | .de UL 249 | \\$1\l'|0\(ul'\\$2 250 | .. 251 | .\" # QW - apply quotation marks to word 252 | .de QW 253 | .ie '\\*(lq'"' ``\\$1''\\$2 254 | .\"" fix emacs highlighting 255 | .el \\*(lq\\$1\\*(rq\\$2 256 | .. 257 | .\" # PQ - apply parens and quotation marks to word 258 | .de PQ 259 | .ie '\\*(lq'"' (``\\$1''\\$2)\\$3 260 | .\"" fix emacs highlighting 261 | .el (\\*(lq\\$1\\*(rq\\$2)\\$3 262 | .. 263 | .\" # QR - quoted range 264 | .de QR 265 | .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3 266 | .\"" fix emacs highlighting 267 | .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3 268 | .. 269 | .\" # MT - "empty" string 270 | .de MT 271 | .QW "" 272 | .. 273 | .BS 274 | .SH NAME 275 | tcllauncher \- Tcl application launcher 276 | .SH SYNOPSIS 277 | \fB::tcllauncher::pidfile_open\fR ?\fIfilename\fR? ?\fImode\fR? 278 | .sp 279 | \fB::tcllauncher::pidfile_write\fR 280 | .sp 281 | \fB::tcllauncher::pidfile_mtime\fR 282 | .sp 283 | \fB::tcllauncher::pidfile_close\fR 284 | .sp 285 | \fB::tcllauncher::pidfile_remove\fR 286 | .sp 287 | \fB::tcllauncher::daemonize\fR ?\fI-noclose\fR? ?\fI-nochdir\fR? 288 | .sp 289 | \fB::tcllauncher::require_user\fR \fIuserName\fR 290 | .sp 291 | \fB::tcllauncher::require_group\fR \fIgroupName\fR 292 | .sp 293 | \fB::tcllauncher::require_user_and_group\fR \fIuserName\fR \fIgroupName\fR 294 | .sp 295 | .BE 296 | .SH DESCRIPTION 297 | .PP 298 | tcllauncher is a way to have Tcl programs run out of /usr/local/bin under 299 | their own name, be installed in one place with their support files, and 300 | provides commands to facilitate server-oriented application execution\&. 301 | .PP 302 | Now you might think, why bother? I'll just put my script in there and 303 | do a #! thing to invoke Tcl\&. 304 | .PP 305 | Well, OK, but this has certain problems: 306 | .IP \(bu 307 | All your Tcl programs will show in "ps" as tclsh 308 | .IP \(bu 309 | All your Tcl programs will show in "top" as tclsh 310 | .IP \(bu 311 | if there are any files you want to pull in that aren't in a package, 312 | you have to invent your own place to install and locate them\&. 313 | .PP 314 | .PP 315 | You'd like to be able to have stuff show up as its script name\&. 316 | .PP 317 | You could just copy or even link tclsh to the name of your program\&. 318 | Say, for instance, trackserver\&. 319 | .PP 320 | But then you have to invoke trackserver with arguments and do stuff to 321 | prep it, like: 322 | .CS 323 | 324 | 325 | cd \&.\&.\&.somewhere\&.\&.\&. 326 | /usr/local/bin/trackserver main\&.tcl 327 | 328 | .CE 329 | That's the original purpose for tcllauncher, just to make that reasonable\&. 330 | .CS 331 | 332 | 333 | cp /usr/local/bin/tcllauncher /usr/local/bin/trackserver 334 | 335 | trackserver 336 | 337 | .CE 338 | How does it find its files? It cd's to the corresponding lib directory and 339 | a directory underneath that of the same name as the application, and sources 340 | "\fImain\&.tcl\fR" with \fBtcl_interactive\fR set to 0\&. 341 | .PP 342 | So when "\fItcllauncher\fR" is installed as "\fItrackserver\fR" and you run trackserver, what happens "\fI/usr/local/bin/trackserver\fR" starts up like the 343 | Tcl shell, except that it sources in "\fI/usr/local/lib/trackserver/main\&.tcl\fR"\&. 344 | Also, a global variable called \fBlaunchdir\fR is set containing the "launch 345 | directory," i\&.e\&. the directory where main\&.tcl was loaded from\&. 346 | ( In the above example, "\fI/usr/local/lib/trackserver\&.\fR") 347 | .SH "WHAT DIRECTORY" 348 | Tcllauncher doesn't change your directory behind your back, so wherever you 349 | are at when you run it, you're still in that directory\&. 350 | .PP 351 | But a lot of times you want to go to your application directory, so you 352 | can just 353 | .CS 354 | 355 | 356 | cd $::launchdir 357 | 358 | .CE 359 | Then you can source in all of your various files and stuff like that\&. 360 | .SH "PROCESS GROUP" 361 | If you are going to fork off children, exec them, or whatever, you should 362 | probably become your own process group so hopefully your children might 363 | inherit your signals and Do The Right Thing\&. 364 | .CS 365 | 366 | 367 | id process group set 368 | 369 | .CE 370 | The \fBid\fR command is from the TclX extension\&. 371 | .SH "PID FILE" 372 | Lots of apps write a file with the server's process ID in it\&. Upon relaunch, 373 | the program can come along and look in its own pid file to see if it's already 374 | alive or not, and also to potentially kill it\&. 375 | .PP 376 | Our pidfile support is a studied Tcl-based copy of BSD's pidfile C library\&. 377 | .PP 378 | .TP 379 | \fB::tcllauncher::pidfile_open\fR ?\fIfilename\fR? ?\fImode\fR? 380 | Given an optional path to a pid filename and optional permissions, 381 | pidfile_open opens (or creates) a file specified by the path 382 | and locks it with TclX's interface to the \fBflock\fR system call\&. 383 | .sp 384 | If the file cannot be locked, the PID of an already running daemon is 385 | returned\&. 386 | Otherwise zero is returned and you've got the lock\&. You can now call 387 | \fBpidfile_write\fR to get your pid into the lock file\&. 388 | .sp 389 | This function does not write your process' PID into the file, 390 | so it can be used before forking if needed\&. 391 | .sp 392 | If path is not specified (empty string), "\fI/var/run/$::argv0\&.pid\fR" is used, and if mode is not specified, 0600 is used\&. 393 | .TP 394 | \fB::tcllauncher::pidfile_write\fR 395 | Writes your pid into the pid file previously opened by \fBpidfile_open\fR\&. 396 | .TP 397 | \fB::tcllauncher::pidfile_mtime\fR 398 | Return the mtime of the pidfile\&. 399 | .sp 400 | Can be used after a successful or unsuccessful 401 | call to pidfile_open\&. Considered useful after pidfile_open fails due to another 402 | process holding the lock to examine when the owner process got the lock\&. 403 | .TP 404 | \fB::tcllauncher::pidfile_close\fR 405 | Close a pidfile\&. It should be used after your daemon forks to start 406 | a child process\&. 407 | .TP 408 | \fB::tcllauncher::pidfile_remove\fR 409 | Close and remove a pidfile\&. 410 | .PP 411 | .SH EXAMPLE 412 | .CS 413 | 414 | 415 | set pid [::tcllauncher::pidfile_open "/var/run/daemon\&.pid" 0600] 416 | if {$pid > 0} { 417 | puts stderr "pid $pid already has the lock" 418 | exit 1 419 | } 420 | 421 | ::tcllauncher::daemonize 422 | 423 | ::tcllauncher::pidfile_write 424 | 425 | \&.\&.\&.do work\&.\&.\&. 426 | 427 | ::tcllauncher::pidfile_remove 428 | exit 429 | 430 | .CE 431 | .SH DAEMONIZE 432 | Sometimes you want your program to spawn itself off into the background in 433 | a way that when you logout it doesn't kill the process, etc\&. 434 | To daemonize a tcllauncher app, 435 | .TP 436 | \fB::tcllauncher::daemonize\fR ?\fI-noclose\fR? ?\fI-nochdir\fR? 437 | By default this forks off a child and exits the parent\&. In the child, it 438 | changes the current directory to "\fI/\fR", and redirects stdin, stdout and 439 | stderr to/from "\fI/dev/null\fR"\&. 440 | .sp 441 | Specifying \fI-noclose\fR prevents the closing and redirecting of stdin, 442 | stdout and stderr, while \fI-nochdir\fR prevents the changing of the working 443 | dir to "\fI/\fR" 444 | .sp 445 | This is a rough copy of BSD 4\&.4's \fBdaemon\fR library routine\&. 446 | .PP 447 | .SH "USER AND GROUP ID MANAGEMENT" 448 | If a program needs to be run as a certain use, it can invoke 449 | .TP 450 | \fB::tcllauncher::require_user\fR \fIuserName\fR 451 | This requires the program to either be run as fred or as root or something 452 | like that, by a user that has permissions to become fred\&. 453 | .sp 454 | If the program is running as user fred or can change the user id (suid) to 455 | fred, it continues, else it aborts\&. 456 | .sp 457 | This means if the superuser invokes the program, it will change user to the correct user\&. If the correct user invokes the program, it will correctly do nothing and proceed\&. Handy\&. 458 | .TP 459 | \fB::tcllauncher::require_group\fR \fIgroupName\fR 460 | does for groups what require_user does for 461 | users\&. 462 | .TP 463 | \fB::tcllauncher::require_user_and_group\fR \fIuserName\fR \fIgroupName\fR 464 | combines changing the group and user into a single procedure\&. 465 | .PP 466 | .PP 467 | Note that if you require user first then require group, the process may have 468 | lost the privileges necessary to change groups after changing users\&. Either 469 | require the group ID first or use \fB::tcllauncher::require_user_and_group\fR 470 | to do both\&. 471 | .SH KEYWORDS 472 | background, daemon, daemonize, tcllauncher 473 | .SH COPYRIGHT 474 | .nf 475 | Copyright (c) 2007-2014 FlightAware LLC (BSD Liscense) 476 | 477 | .fi -------------------------------------------------------------------------------- /tclconfig/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2011-04-20.01; # UTC 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. 43 | 44 | nl=' 45 | ' 46 | IFS=" "" $nl" 47 | 48 | # set DOITPROG to echo to test this script 49 | 50 | # Don't use :- since 4.3BSD and earlier shells don't like it. 51 | doit=${DOITPROG-} 52 | if test -z "$doit"; then 53 | doit_exec=exec 54 | else 55 | doit_exec=$doit 56 | fi 57 | 58 | # Put in absolute file names if you don't have them in your path; 59 | # or use environment vars. 60 | 61 | chgrpprog=${CHGRPPROG-chgrp} 62 | chmodprog=${CHMODPROG-chmod} 63 | chownprog=${CHOWNPROG-chown} 64 | cmpprog=${CMPPROG-cmp} 65 | cpprog=${CPPROG-cp} 66 | mkdirprog=${MKDIRPROG-mkdir} 67 | mvprog=${MVPROG-mv} 68 | rmprog=${RMPROG-rm} 69 | stripprog=${STRIPPROG-strip} 70 | 71 | posix_glob='?' 72 | initialize_posix_glob=' 73 | test "$posix_glob" != "?" || { 74 | if (set -f) 2>/dev/null; then 75 | posix_glob= 76 | else 77 | posix_glob=: 78 | fi 79 | } 80 | ' 81 | 82 | posix_mkdir= 83 | 84 | # Desired mode of installed file. 85 | mode=0755 86 | 87 | chgrpcmd= 88 | chmodcmd=$chmodprog 89 | chowncmd= 90 | mvcmd=$mvprog 91 | rmcmd="$rmprog -f" 92 | stripcmd= 93 | 94 | src= 95 | dst= 96 | dir_arg= 97 | dst_arg= 98 | 99 | copy_on_change=false 100 | no_target_directory= 101 | 102 | usage="\ 103 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 104 | or: $0 [OPTION]... SRCFILES... DIRECTORY 105 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 106 | or: $0 [OPTION]... -d DIRECTORIES... 107 | 108 | In the 1st form, copy SRCFILE to DSTFILE. 109 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 110 | In the 4th, create DIRECTORIES. 111 | 112 | Options: 113 | --help display this help and exit. 114 | --version display version info and exit. 115 | 116 | -c (ignored) 117 | -C install only if different (preserve the last data modification time) 118 | -d create directories instead of installing files. 119 | -g GROUP $chgrpprog installed files to GROUP. 120 | -m MODE $chmodprog installed files to MODE. 121 | -o USER $chownprog installed files to USER. 122 | -s $stripprog installed files. 123 | -S $stripprog installed files. 124 | -t DIRECTORY install into DIRECTORY. 125 | -T report an error if DSTFILE is a directory. 126 | 127 | Environment variables override the default commands: 128 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 129 | RMPROG STRIPPROG 130 | " 131 | 132 | while test $# -ne 0; do 133 | case $1 in 134 | -c) ;; 135 | 136 | -C) copy_on_change=true;; 137 | 138 | -d) dir_arg=true;; 139 | 140 | -g) chgrpcmd="$chgrpprog $2" 141 | shift;; 142 | 143 | --help) echo "$usage"; exit $?;; 144 | 145 | -m) mode=$2 146 | case $mode in 147 | *' '* | *' '* | *' 148 | '* | *'*'* | *'?'* | *'['*) 149 | echo "$0: invalid mode: $mode" >&2 150 | exit 1;; 151 | esac 152 | shift;; 153 | 154 | -o) chowncmd="$chownprog $2" 155 | shift;; 156 | 157 | -s) stripcmd=$stripprog;; 158 | 159 | -S) stripcmd="$stripprog $2" 160 | shift;; 161 | 162 | -t) dst_arg=$2 163 | shift;; 164 | 165 | -T) no_target_directory=true;; 166 | 167 | --version) echo "$0 $scriptversion"; exit $?;; 168 | 169 | --) shift 170 | break;; 171 | 172 | -*) echo "$0: invalid option: $1" >&2 173 | exit 1;; 174 | 175 | *) break;; 176 | esac 177 | shift 178 | done 179 | 180 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 181 | # When -d is used, all remaining arguments are directories to create. 182 | # When -t is used, the destination is already specified. 183 | # Otherwise, the last argument is the destination. Remove it from $@. 184 | for arg 185 | do 186 | if test -n "$dst_arg"; then 187 | # $@ is not empty: it contains at least $arg. 188 | set fnord "$@" "$dst_arg" 189 | shift # fnord 190 | fi 191 | shift # arg 192 | dst_arg=$arg 193 | done 194 | fi 195 | 196 | if test $# -eq 0; then 197 | if test -z "$dir_arg"; then 198 | echo "$0: no input file specified." >&2 199 | exit 1 200 | fi 201 | # It's OK to call `install-sh -d' without argument. 202 | # This can happen when creating conditional directories. 203 | exit 0 204 | fi 205 | 206 | if test -z "$dir_arg"; then 207 | do_exit='(exit $ret); exit $ret' 208 | trap "ret=129; $do_exit" 1 209 | trap "ret=130; $do_exit" 2 210 | trap "ret=141; $do_exit" 13 211 | trap "ret=143; $do_exit" 15 212 | 213 | # Set umask so as not to create temps with too-generous modes. 214 | # However, 'strip' requires both read and write access to temps. 215 | case $mode in 216 | # Optimize common cases. 217 | *644) cp_umask=133;; 218 | *755) cp_umask=22;; 219 | 220 | *[0-7]) 221 | if test -z "$stripcmd"; then 222 | u_plus_rw= 223 | else 224 | u_plus_rw='% 200' 225 | fi 226 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 227 | *) 228 | if test -z "$stripcmd"; then 229 | u_plus_rw= 230 | else 231 | u_plus_rw=,u+rw 232 | fi 233 | cp_umask=$mode$u_plus_rw;; 234 | esac 235 | fi 236 | 237 | for src 238 | do 239 | # Protect names starting with `-'. 240 | case $src in 241 | -*) src=./$src;; 242 | esac 243 | 244 | if test -n "$dir_arg"; then 245 | dst=$src 246 | dstdir=$dst 247 | test -d "$dstdir" 248 | dstdir_status=$? 249 | else 250 | 251 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 252 | # might cause directories to be created, which would be especially bad 253 | # if $src (and thus $dsttmp) contains '*'. 254 | if test ! -f "$src" && test ! -d "$src"; then 255 | echo "$0: $src does not exist." >&2 256 | exit 1 257 | fi 258 | 259 | if test -z "$dst_arg"; then 260 | echo "$0: no destination specified." >&2 261 | exit 1 262 | fi 263 | 264 | dst=$dst_arg 265 | # Protect names starting with `-'. 266 | case $dst in 267 | -*) dst=./$dst;; 268 | esac 269 | 270 | # If destination is a directory, append the input filename; won't work 271 | # if double slashes aren't ignored. 272 | if test -d "$dst"; then 273 | if test -n "$no_target_directory"; then 274 | echo "$0: $dst_arg: Is a directory" >&2 275 | exit 1 276 | fi 277 | dstdir=$dst 278 | dst=$dstdir/`basename "$src"` 279 | dstdir_status=0 280 | else 281 | # Prefer dirname, but fall back on a substitute if dirname fails. 282 | dstdir=` 283 | (dirname "$dst") 2>/dev/null || 284 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 285 | X"$dst" : 'X\(//\)[^/]' \| \ 286 | X"$dst" : 'X\(//\)$' \| \ 287 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 288 | echo X"$dst" | 289 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 290 | s//\1/ 291 | q 292 | } 293 | /^X\(\/\/\)[^/].*/{ 294 | s//\1/ 295 | q 296 | } 297 | /^X\(\/\/\)$/{ 298 | s//\1/ 299 | q 300 | } 301 | /^X\(\/\).*/{ 302 | s//\1/ 303 | q 304 | } 305 | s/.*/./; q' 306 | ` 307 | 308 | test -d "$dstdir" 309 | dstdir_status=$? 310 | fi 311 | fi 312 | 313 | obsolete_mkdir_used=false 314 | 315 | if test $dstdir_status != 0; then 316 | case $posix_mkdir in 317 | '') 318 | # Create intermediate dirs using mode 755 as modified by the umask. 319 | # This is like FreeBSD 'install' as of 1997-10-28. 320 | umask=`umask` 321 | case $stripcmd.$umask in 322 | # Optimize common cases. 323 | *[2367][2367]) mkdir_umask=$umask;; 324 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 325 | 326 | *[0-7]) 327 | mkdir_umask=`expr $umask + 22 \ 328 | - $umask % 100 % 40 + $umask % 20 \ 329 | - $umask % 10 % 4 + $umask % 2 330 | `;; 331 | *) mkdir_umask=$umask,go-w;; 332 | esac 333 | 334 | # With -d, create the new directory with the user-specified mode. 335 | # Otherwise, rely on $mkdir_umask. 336 | if test -n "$dir_arg"; then 337 | mkdir_mode=-m$mode 338 | else 339 | mkdir_mode= 340 | fi 341 | 342 | posix_mkdir=false 343 | case $umask in 344 | *[123567][0-7][0-7]) 345 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 346 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 347 | ;; 348 | *) 349 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 350 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 351 | 352 | if (umask $mkdir_umask && 353 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 354 | then 355 | if test -z "$dir_arg" || { 356 | # Check for POSIX incompatibilities with -m. 357 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 358 | # other-writeable bit of parent directory when it shouldn't. 359 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 360 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 361 | case $ls_ld_tmpdir in 362 | d????-?r-*) different_mode=700;; 363 | d????-?--*) different_mode=755;; 364 | *) false;; 365 | esac && 366 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 367 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 368 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 369 | } 370 | } 371 | then posix_mkdir=: 372 | fi 373 | rmdir "$tmpdir/d" "$tmpdir" 374 | else 375 | # Remove any dirs left behind by ancient mkdir implementations. 376 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 377 | fi 378 | trap '' 0;; 379 | esac;; 380 | esac 381 | 382 | if 383 | $posix_mkdir && ( 384 | umask $mkdir_umask && 385 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 386 | ) 387 | then : 388 | else 389 | 390 | # The umask is ridiculous, or mkdir does not conform to POSIX, 391 | # or it failed possibly due to a race condition. Create the 392 | # directory the slow way, step by step, checking for races as we go. 393 | 394 | case $dstdir in 395 | /*) prefix='/';; 396 | -*) prefix='./';; 397 | *) prefix='';; 398 | esac 399 | 400 | eval "$initialize_posix_glob" 401 | 402 | oIFS=$IFS 403 | IFS=/ 404 | $posix_glob set -f 405 | set fnord $dstdir 406 | shift 407 | $posix_glob set +f 408 | IFS=$oIFS 409 | 410 | prefixes= 411 | 412 | for d 413 | do 414 | test -z "$d" && continue 415 | 416 | prefix=$prefix$d 417 | if test -d "$prefix"; then 418 | prefixes= 419 | else 420 | if $posix_mkdir; then 421 | (umask=$mkdir_umask && 422 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 423 | # Don't fail if two instances are running concurrently. 424 | test -d "$prefix" || exit 1 425 | else 426 | case $prefix in 427 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 428 | *) qprefix=$prefix;; 429 | esac 430 | prefixes="$prefixes '$qprefix'" 431 | fi 432 | fi 433 | prefix=$prefix/ 434 | done 435 | 436 | if test -n "$prefixes"; then 437 | # Don't fail if two instances are running concurrently. 438 | (umask $mkdir_umask && 439 | eval "\$doit_exec \$mkdirprog $prefixes") || 440 | test -d "$dstdir" || exit 1 441 | obsolete_mkdir_used=true 442 | fi 443 | fi 444 | fi 445 | 446 | if test -n "$dir_arg"; then 447 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 448 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 449 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 450 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 451 | else 452 | 453 | # Make a couple of temp file names in the proper directory. 454 | dsttmp=$dstdir/_inst.$$_ 455 | rmtmp=$dstdir/_rm.$$_ 456 | 457 | # Trap to clean up those temp files at exit. 458 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 459 | 460 | # Copy the file name to the temp name. 461 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 462 | 463 | # and set any options; do chmod last to preserve setuid bits. 464 | # 465 | # If any of these fail, we abort the whole thing. If we want to 466 | # ignore errors from any of these, just make sure not to ignore 467 | # errors from the above "$doit $cpprog $src $dsttmp" command. 468 | # 469 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 470 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 471 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 472 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 473 | 474 | # If -C, don't bother to copy if it wouldn't change the file. 475 | if $copy_on_change && 476 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 477 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 478 | 479 | eval "$initialize_posix_glob" && 480 | $posix_glob set -f && 481 | set X $old && old=:$2:$4:$5:$6 && 482 | set X $new && new=:$2:$4:$5:$6 && 483 | $posix_glob set +f && 484 | 485 | test "$old" = "$new" && 486 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 487 | then 488 | rm -f "$dsttmp" 489 | else 490 | # Rename the file to the real destination. 491 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 492 | 493 | # The rename failed, perhaps because mv can't rename something else 494 | # to itself, or perhaps because mv is so ancient that it does not 495 | # support -f. 496 | { 497 | # Now remove or move aside any old file at destination location. 498 | # We try this two ways since rm can't unlink itself on some 499 | # systems and the destination file might be busy for other 500 | # reasons. In this case, the final cleanup might fail but the new 501 | # file should still install successfully. 502 | { 503 | test ! -f "$dst" || 504 | $doit $rmcmd -f "$dst" 2>/dev/null || 505 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 506 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 507 | } || 508 | { echo "$0: cannot unlink or rename $dst" >&2 509 | (exit 1); exit 1 510 | } 511 | } && 512 | 513 | # Now rename the file to the real destination. 514 | $doit $mvcmd "$dsttmp" "$dst" 515 | } 516 | fi || exit 1 517 | 518 | trap '' 0 519 | fi 520 | done 521 | 522 | # Local variables: 523 | # eval: (add-hook 'write-file-hooks 'time-stamp) 524 | # time-stamp-start: "scriptversion=" 525 | # time-stamp-format: "%:y-%02m-%02d.%02H" 526 | # time-stamp-time-zone: "UTC" 527 | # time-stamp-end: "; # UTC" 528 | # End: 529 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in -- 2 | # 3 | # This file is a Makefile for Sample TEA Extension. If it has the name 4 | # "Makefile.in" then it is a template for a Makefile; to generate the 5 | # actual Makefile, run "./configure", which is a configuration script 6 | # generated by the "autoconf" program (constructs like "@foo@" will get 7 | # replaced in the actual Makefile. 8 | # 9 | # Copyright (c) 1999 Scriptics Corporation. 10 | # Copyright (c) 2002-2005 ActiveState Corporation. 11 | # 12 | # See the file "license.terms" for information on usage and redistribution 13 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 | # 15 | # RCS: @(#) $Id: Makefile.in,v 1.7 2008-11-18 22:32:07 karl Exp $ 16 | 17 | #======================================================================== 18 | # Add additional lines to handle any additional AC_SUBST cases that 19 | # have been added in a customized configure script. 20 | #======================================================================== 21 | 22 | #SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ 23 | 24 | #======================================================================== 25 | # Nothing of the variables below this line should need to be changed. 26 | # Please check the TARGETS section below to make sure the make targets 27 | # are correct. 28 | #======================================================================== 29 | 30 | #======================================================================== 31 | # The names of the source files is defined in the configure script. 32 | # The object files are used for linking into the final library. 33 | # This will be used when a dist target is added to the Makefile. 34 | # It is not important to specify the directory, as long as it is the 35 | # $(srcdir) or in the generic, win or unix subdirectory. 36 | #======================================================================== 37 | 38 | PKG_SOURCES = @PKG_SOURCES@ 39 | PKG_OBJECTS = @PKG_OBJECTS@ 40 | 41 | PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ 42 | PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ 43 | 44 | #======================================================================== 45 | # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with 46 | # this package that need to be installed, if any. 47 | #======================================================================== 48 | 49 | PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ 50 | 51 | #======================================================================== 52 | # This is a list of public header files to be installed, if any. 53 | #======================================================================== 54 | 55 | PKG_HEADERS = @PKG_HEADERS@ 56 | 57 | #======================================================================== 58 | # "PKG_LIB_FILE" refers to the library (dynamic or static as per 59 | # configuration options) composed of the named objects. 60 | #======================================================================== 61 | 62 | PKG_LIB_FILE = @PKG_LIB_FILE@ 63 | PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ 64 | 65 | lib_BINARIES = $(PKG_LIB_FILE) 66 | bin_BINARIES = tcllauncher 67 | BINARIES = $(lib_BINARIES) $(bin_BINARIES) 68 | 69 | SHELL = @SHELL@ 70 | 71 | srcdir = @srcdir@ 72 | prefix = @prefix@ 73 | exec_prefix = @exec_prefix@ 74 | 75 | bindir = @bindir@ 76 | libdir = @libdir@ 77 | includedir = @includedir@ 78 | datarootdir = @datarootdir@ 79 | datadir = @datadir@ 80 | mandir = @mandir@ 81 | 82 | DESTDIR = 83 | 84 | PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) 85 | pkgdatadir = $(datadir)/$(PKG_DIR) 86 | pkglibdir = $(libdir)/$(PKG_DIR) 87 | pkgincludedir = $(includedir)/$(PKG_DIR) 88 | 89 | top_builddir = . 90 | 91 | INSTALL_OPTIONS = 92 | INSTALL = @INSTALL@ ${INSTALL_OPTIONS} 93 | INSTALL_DATA_DIR = @INSTALL@ -d -m 755 94 | INSTALL_DATA = @INSTALL_DATA@ 95 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 96 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 97 | INSTALL_LIBRARY = @INSTALL_LIBRARY@ 98 | 99 | PACKAGE_NAME = @PACKAGE_NAME@ 100 | PACKAGE_VERSION = @PACKAGE_VERSION@ 101 | CC = @CC@ 102 | LINK_CC = @LINK_CC@ 103 | CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ 104 | CFLAGS_WARNING = @CFLAGS_WARNING@ 105 | EXEEXT = @EXEEXT@ 106 | LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ 107 | MAKE_LIB = @MAKE_LIB@ 108 | MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ 109 | MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ 110 | MAKE_STUB_LIB = @MAKE_STUB_LIB@ 111 | OBJEXT = @OBJEXT@ 112 | RANLIB = @RANLIB@ 113 | RANLIB_STUB = @RANLIB_STUB@ 114 | SHLIB_CFLAGS = @SHLIB_CFLAGS@ 115 | SHLIB_LD = @SHLIB_LD@ 116 | SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ 117 | STLIB_LD = @STLIB_LD@ 118 | #TCL_DEFS = @TCL_DEFS@ 119 | TCL_BIN_DIR = @TCL_BIN_DIR@ 120 | TCL_SRC_DIR = @TCL_SRC_DIR@ 121 | TCL_LIB_SPEC =@TCL_LIB_SPEC@ 122 | TCL_STUB_LIB_SPEC =@TCL_STUB_LIB_SPEC@ 123 | THREADS_LIBS =@THREADS_LIBS@ 124 | #TK_BIN_DIR = @TK_BIN_DIR@ 125 | #TK_SRC_DIR = @TK_SRC_DIR@ 126 | 127 | # Additional search flags needed to find the various shared libraries at 128 | # run-time. The first symbol is for use when creating a binary with cc, and 129 | # the second is for use when running ld directly. 130 | CC_SEARCH_FLAGS = @CC_SEARCH_FLAGS@ 131 | LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@ 132 | 133 | # Path to use at runtime to refer to LIB_INSTALL_DIR: 134 | LIB_RUNTIME_DIR = $(libdir) 135 | 136 | # Tcl8.7 actually requires specific libraries 137 | TCL_LIBS = @TCL_LIBS@ 138 | 139 | #======================================================================== 140 | # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our 141 | # package without installing. The other environment variables allow us 142 | # to test against an uninstalled Tcl. Add special env vars that you 143 | # require for testing here (like TCLX_LIBRARY). 144 | #======================================================================== 145 | 146 | EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) 147 | #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) 148 | TCLLIBPATH = $(top_builddir) 149 | TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` 150 | PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ 151 | PATH="$(EXTRA_PATH):$(PATH)" \ 152 | TCLLIBPATH="$(TCLLIBPATH)" 153 | 154 | TCLSH_PROG = @TCLSH_PROG@ 155 | TCLSH = $(PKG_ENV) $(TCLSH_ENV) $(TCLSH_PROG) 156 | 157 | #WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` 158 | #WISH_PROG = @WISH_PROG@ 159 | #WISH = $(PKG_ENV) $(TCLSH_ENV) $(WISH_ENV) $(WISH_PROG) 160 | 161 | SHARED_BUILD = @SHARED_BUILD@ 162 | 163 | INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ 164 | #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ 165 | 166 | PKG_CFLAGS = @PKG_CFLAGS@ 167 | 168 | # TCL_DEFS is not strictly need here, but if you remove it, then you 169 | # must make sure that configure.in checks for the necessary components 170 | # that your library may use. TCL_DEFS can actually be a problem if 171 | # you do not compile with a similar machine setup as the Tcl core was 172 | # compiled with. 173 | #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) 174 | DEFS = @DEFS@ $(PKG_CFLAGS) 175 | 176 | # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile 177 | CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl tcllauncher-support.tcl 178 | CLEANFILES = @CLEANFILES@ 179 | 180 | CPPFLAGS = @CPPFLAGS@ 181 | LIBS = @PKG_LIBS@ @LIBS@ 182 | AR = @AR@ 183 | CFLAGS = @CFLAGS@ 184 | COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 185 | 186 | .SUFFIXES: .c .$(OBJEXT) 187 | 188 | #======================================================================== 189 | # Start of user-definable TARGETS section 190 | #======================================================================== 191 | 192 | #======================================================================== 193 | # TEA TARGETS. Please note that the "libraries:" target refers to platform 194 | # independent files, and the "binaries:" target includes executable programs and 195 | # platform-dependent libraries. Modify these targets so that they install 196 | # the various pieces of your package. The make and install rules 197 | # for the BINARIES that you specified above have already been done. 198 | #======================================================================== 199 | 200 | all: binaries libraries doc 201 | 202 | #======================================================================== 203 | # The binaries target builds executable programs, Windows .dll's, unix 204 | # shared/static libraries, and any other platform-dependent files. 205 | # The list of targets to build for "binaries:" is specified at the top 206 | # of the Makefile, in the "BINARIES" variable. 207 | #======================================================================== 208 | 209 | binaries: $(BINARIES) 210 | 211 | libraries: 212 | 213 | #======================================================================== 214 | # Your doc target should differentiate from doc builds (by the developer) 215 | # and doc installs (see install-doc), which just install the docs on the 216 | # end user machine when building from source. 217 | #======================================================================== 218 | 219 | DTPLITE=@DTPLITE@ 220 | 221 | doc: $(srcdir)/doc/tcllauncher.n 222 | 223 | $(srcdir)/doc/tcllauncher.n: $(srcdir)/doc/tcllauncher.man 224 | @if [ -n "$(DTPLITE)" -a -x "$(DTPLITE)" ]; then \ 225 | echo "Building $@"; \ 226 | $(DTPLITE) -o $@ nroff $(srcdir)/doc/tcllauncher.man ; \ 227 | fi 228 | 229 | tcllauncher.html: $(srcdir)/doc/tcllauncher.man 230 | @if [ -n "$(DTPLITE)" -a -x "$(DTPLITE)" ]; then \ 231 | echo "Building $@"; \ 232 | $(DTPLITE) -o $@ html $(srcdir)/doc/tcllauncher.man ; \ 233 | fi 234 | 235 | install: all install-binaries install-libraries install-doc 236 | 237 | install-binaries: binaries install-lib-binaries install-bin-binaries 238 | 239 | #======================================================================== 240 | # This rule installs platform-independent files, such as header files. 241 | # The list=...; for p in $$list handles the empty list case x-platform. 242 | #======================================================================== 243 | 244 | install-libraries: libraries 245 | @$(INSTALL_DATA_DIR) $(DESTDIR)$(includedir) 246 | @echo "Installing header files in $(DESTDIR)$(includedir)" 247 | @list='$(PKG_HEADERS)'; for i in $$list; do \ 248 | echo "Installing $(srcdir)/$$i" ; \ 249 | $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ 250 | done; 251 | 252 | #======================================================================== 253 | # Install documentation. Unix manpages should go in the $(mandir) 254 | # directory. 255 | #======================================================================== 256 | 257 | install-doc: doc 258 | @$(INSTALL_DATA_DIR) $(DESTDIR)$(mandir)/mann 259 | @echo "Installing documentation in $(DESTDIR)$(mandir)" 260 | @list='$(srcdir)/doc/*.n'; for i in $$list; do \ 261 | echo "Installing $$i"; \ 262 | $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ 263 | done 264 | 265 | test: binaries libraries 266 | $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) \ 267 | -load "package ifneeded ${PACKAGE_NAME} ${PACKAGE_VERSION} \ 268 | [list load `@CYGPATH@ $(PKG_LIB_FILE)` $(PACKAGE_NAME)]" 269 | 270 | shell: binaries libraries 271 | @$(TCLSH) $(SCRIPT) 272 | 273 | gdb: 274 | $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) 275 | 276 | depend: 277 | 278 | #======================================================================== 279 | # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable 280 | # mentioned above. That will ensure that this target is built when you 281 | # run "make binaries". 282 | # 283 | # The $(PKG_OBJECTS) objects are created and linked into the final 284 | # library. In most cases these object files will correspond to the 285 | # source files above. 286 | #======================================================================== 287 | 288 | $(PKG_LIB_FILE): $(PKG_OBJECTS) 289 | -rm -f $(PKG_LIB_FILE) 290 | ${MAKE_LIB} 291 | $(RANLIB) $(PKG_LIB_FILE) 292 | 293 | $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) 294 | -rm -f $(PKG_STUB_LIB_FILE) 295 | ${MAKE_STUB_LIB} 296 | $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) 297 | 298 | #======================================================================== 299 | # We need to enumerate the list of .c to .o lines here. 300 | # 301 | # In the following lines, $(srcdir) refers to the toplevel directory 302 | # containing your extension. If your sources are in a subdirectory, 303 | # you will have to modify the paths to reflect this: 304 | # 305 | # sample.$(OBJEXT): $(srcdir)/generic/sample.c 306 | # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ 307 | # 308 | # Setting the VPATH variable to a list of paths will cause the makefile 309 | # to look into these paths when resolving .c to .obj dependencies. 310 | # As necessary, add $(srcdir):$(srcdir)/compat:.... 311 | #======================================================================== 312 | 313 | VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx 314 | 315 | .c.@OBJEXT@: 316 | $(COMPILE) -c `@CYGPATH@ $<` -o $@ 317 | 318 | #======================================================================== 319 | # Distribution creation 320 | # You may need to tweak this target to make it work correctly. 321 | #======================================================================== 322 | 323 | #COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar 324 | COMPRESS = tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR) 325 | DIST_ROOT = /tmp/dist 326 | DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) 327 | 328 | dist-clean: 329 | rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* 330 | 331 | dist: dist-clean 332 | $(INSTALL_DATA_DIR) $(DIST_DIR) 333 | cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \ 334 | $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ 335 | $(DIST_DIR)/ 336 | chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4 337 | chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in 338 | 339 | for i in $(srcdir)/*.[ch]; do \ 340 | if [ -f $$i ]; then \ 341 | cp -p $$i $(DIST_DIR)/ ; \ 342 | fi; \ 343 | done; 344 | 345 | $(INSTALL_DATA_DIR) $(DIST_DIR)/tclconfig 346 | cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ 347 | $(DIST_DIR)/tclconfig/ 348 | chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 349 | chmod +x $(DIST_DIR)/tclconfig/install-sh 350 | 351 | list='demos doc generic library mac tests unix win'; \ 352 | for p in $$list; do \ 353 | if test -d $(srcdir)/$$p ; then \ 354 | $(INSTALL_DATA_DIR) $(DIST_DIR)/$$p; \ 355 | cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ 356 | fi; \ 357 | done 358 | 359 | (cd $(DIST_ROOT); $(COMPRESS);) 360 | 361 | #======================================================================== 362 | # End of user-definable section 363 | #======================================================================== 364 | 365 | #======================================================================== 366 | # Don't modify the file to clean here. Instead, set the "CLEANFILES" 367 | # variable in configure.in 368 | #======================================================================== 369 | 370 | clean: 371 | -test -z "$(BINARIES)" || rm -f $(BINARIES) 372 | -rm -f *.$(OBJEXT) core *.core 373 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 374 | 375 | distclean: clean 376 | -rm -f *.tab.c 377 | -rm -f $(CONFIG_CLEAN_FILES) 378 | -rm -rf config.cache config.log config.status autom4te.cache 379 | 380 | #======================================================================== 381 | # Install binary object libraries. On Windows this includes both .dll and 382 | # .lib files. Because the .lib files are not explicitly listed anywhere, 383 | # we need to deduce their existence from the .dll file of the same name. 384 | # Library files go into the lib directory. 385 | # In addition, this will generate the pkgIndex.tcl 386 | # file in the install location (assuming it can find a usable tclsh shell) 387 | # 388 | # You should not have to modify this target. 389 | #======================================================================== 390 | 391 | install-lib-binaries: binaries 392 | @$(INSTALL_DATA_DIR) $(DESTDIR)$(pkglibdir) 393 | @list='$(lib_BINARIES)'; for p in $$list; do \ 394 | if test -f $$p; then \ 395 | echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ 396 | $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p; \ 397 | stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ 398 | if test "x$$stub" = "xstub"; then \ 399 | echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ 400 | $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ 401 | else \ 402 | echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ 403 | $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ 404 | fi; \ 405 | ext=`echo $$p|sed -e "s/.*\.//"`; \ 406 | if test "x$$ext" = "xdll"; then \ 407 | lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ 408 | if test -f $$lib; then \ 409 | echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ 410 | $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \ 411 | fi; \ 412 | fi; \ 413 | fi; \ 414 | done 415 | @list='$(PKG_TCL_SOURCES) tcllauncher-support.tcl'; for p in $$list; do \ 416 | if test -f $(srcdir)/$$p; then \ 417 | destp=`basename $$p`; \ 418 | echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ 419 | $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ 420 | fi; \ 421 | done 422 | @if test "x$(SHARED_BUILD)" = "x1"; then \ 423 | echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ 424 | $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ 425 | fi 426 | 427 | #======================================================================== 428 | # Install binary executables (e.g. .exe files and dependent .dll files) 429 | # This is for files that must go in the bin directory (located next to 430 | # wish and tclsh), like dependent .dll files on Windows. 431 | # 432 | # You should not have to modify this target, except to define bin_BINARIES 433 | # above if necessary. 434 | #======================================================================== 435 | 436 | install-bin-binaries: binaries 437 | @$(INSTALL_DATA_DIR) $(DESTDIR)$(bindir) 438 | @list='$(bin_BINARIES)'; for p in $$list; do \ 439 | if test -f $$p; then \ 440 | echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ 441 | $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ 442 | fi; \ 443 | done 444 | 445 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 446 | cd $(top_builddir) \ 447 | && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status 448 | 449 | uninstall-binaries: 450 | list='$(lib_BINARIES)'; for p in $$list; do \ 451 | rm -f $(DESTDIR)$(pkglibdir)/$$p; \ 452 | done 453 | list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ 454 | p=`basename $$p`; \ 455 | rm -f $(DESTDIR)$(pkglibdir)/$$p; \ 456 | done 457 | list='$(bin_BINARIES)'; for p in $$list; do \ 458 | rm -f $(DESTDIR)$(bindir)/$$p; \ 459 | done 460 | 461 | .PHONY: all binaries clean depend distclean doc install libraries test 462 | 463 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 464 | # Otherwise a system limit (for SysV at least) may be exceeded. 465 | .NOEXPORT: 466 | 467 | tclAppInit.o: unix/tclAppInit.c 468 | $(COMPILE) -c $(APP_CC_SWITCHES) $(CFLAGS_DEFAULT) $(CFLAGS_WARNING) \ 469 | -DTCLLAUNCHER_FILE="\"$(pkglibdir)/tcllauncher.tcl\"" unix/tclAppInit.c 470 | 471 | TCLSH_OBJS = tclAppInit.o 472 | 473 | tcllauncher: $(TCLSH_OBJS) 474 | $(LINK_CC) -o $@ $(TCLSH_OBJS) \ 475 | $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(THREADS_LIBS) $(CC_SEARCH_FLAGS) $(LIBS) 476 | -------------------------------------------------------------------------------- /tclconfig/ChangeLog: -------------------------------------------------------------------------------- 1 | 2013-10-08 Jan Nijtmans 2 | 3 | * unix/tcl.m4: Bug [172223e008]: Wrong filename in 4 | --disable-shared compile on MinGW 5 | 6 | 2013-10-04 Jan Nijtmans 7 | 8 | * unix/tcl.m4: stub library is no longer linked with msvcrt??.dll. 9 | 10 | 2013-10-01 Jan Nijtmans 11 | 12 | * unix/tcl.m4: Workaround for MinGW bug #2065: "gcc --shared" links 13 | with libgcc_s_dw2-1.dll when using 64-bit division in C 14 | 15 | 2013-07-04 Jan Nijtmans 16 | 17 | * unix/tcl.m4: Bug [3324676]: AC_PROG_INSTALL incompat, 18 | Bug [3606445]: Unneeded -DHAVE_NO_SEH=1 when not building on Windows 19 | 20 | 2013-07-02 Jan Nijtmans 21 | 22 | * unix/tcl.m4: Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4 23 | (thanks to Brian Griffin) 24 | 25 | 2013-06-20 Jan Nijtmans 26 | 27 | * unix/tcl.m4: Use X11/Xlib.h for checking where X11 can be found 28 | in stead of X11/XIntrinsic.h. Suggested by Pietro Cerutti. 29 | 30 | 2013-06-04 Jan Nijtmans 31 | 32 | * unix/tcl.m4: Eliminate NO_VIZ macro as current 33 | zlib uses HAVE_HIDDEN in stead. One more last-moment 34 | fix for FreeBSD by Pietro Cerutti 35 | 36 | 2013-05-19 Jan Nijtmans 37 | 38 | * unix/tcl.m4: Fix for FreeBSD, and remove support for old 39 | FreeBSD versions. Patch by Pietro Cerutti 40 | 41 | 2013-03-12 Jan Nijtmans 42 | 43 | * unix/tcl.m4: Patch by Andrew Shadura, providing better support for 44 | * three architectures they have in Debian. 45 | 46 | 2012-08-07 Stuart Cassoff 47 | 48 | * tcl.m4: Added "-DNDEBUG" to CFLAGS_DEFAULT 49 | when building with --disable-symbols. 50 | 51 | 2012-08-07 Stuart Cassoff 52 | 53 | * tcl.m4: [Bug 3555058]: Checkin [30736d63f0] broke 54 | CFLAGS_DEFAULT, LDFLAGS_DEFAULT 55 | 56 | 2012-08-07 Stuart Cassoff 57 | 58 | * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS 59 | 60 | 2012-08-07 Jan Nijtmans 61 | 62 | * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS 63 | 64 | 2012-07-25 Jan Nijtmans 65 | 66 | * tcl.m4: My previous commit (2012-04-03) broke the ActiveTcl 67 | build for AMD64, because of the quotes in "C://AMD64/cl.exe". 68 | It turns out that the AC_TRY_COMPILE macro cannot handle that. 69 | 70 | 2012-07-22 Stuart Cassoff 71 | 72 | * tcl.m4: Tidy: consistency, spelling, phrasing, whitespace. 73 | No functional change. 74 | 75 | 2012-04-03 Jan Nijtmans 76 | 77 | * tcl.m4: [Bug 3511806] Compiler checks too early 78 | This change allows to build the cygwin and mingw32 ports of 79 | Tcl/Tk extensions to build out-of-the-box using a native or 80 | cross-compiler, e.g. on Cygwin, Linux or Darwin. 81 | 82 | 2011-04-02 Jan Nijtmans 83 | 84 | * install-sh: Fix issue with library stripping in install-sh 85 | (backported from kevin_walzer's patch from Tcl 8.6 trunk) 86 | 87 | 2011-04-05 Andreas Kupries 88 | 89 | * tcl.m4: Applied patch by Jeff Lawson. Nicer error message when 90 | tclConfig.sh was not found. 91 | 92 | 2010-12-15 Stuart Cassoff 93 | 94 | * install-sh: Upgrade to newer install-sh and use it. 95 | * tcl.m4: 96 | 97 | 2010-12-14 Stuart Cassoff 98 | 99 | * tcl.m4: Better building on OpenBSD. 100 | 101 | 2010-12-14 Jan Nijtmans 102 | 103 | * tcl.m4: when using gcc, don't try to determine Win64 SDK 104 | 105 | 2010-12-12 Jan Nijtmans 106 | 107 | * tcl.m4: Determine correctly a cross-compiler-windres 108 | 109 | 2010-11-23 Jan Nijtmans 110 | 111 | * tcl.m4: add some cross-compile support, borrowed from Tcl 8.6 112 | 113 | 2010-09-16 Jeff Hobbs 114 | 115 | * tcl.m4: correct HP-UX LDFLAGS (only used when building big shell) 116 | 117 | 2010-09-14 Jeff Hobbs 118 | 119 | * tcl.m4: add extra if check for .manifest file generation 120 | Add notice about package name and version being built. 121 | 122 | 2010-09-09 Jan Nijtmans 123 | 124 | * tcl.m4: [FREQ #3058486] TEA_LOAD_CONFIG doesn't set all BUILD_ vars 125 | Slightly related: defining BUILD_$1 on all platforms - not only win - 126 | allows the -fvisibility feature to be used in extensions as well, at 127 | least if you compile against tcl >= 8.5. 128 | 129 | 2010-08-26 Jeff Hobbs 130 | 131 | * tcl.m4: ensure safe quoting for autoheader usage 132 | 133 | 2010-08-19 Jeff Hobbs 134 | 135 | * tcl.m4: add TEA_ADD_CLEANFILES macro to make adding cleanfiles 136 | easier, and add *.exp to CLEANFILES Windows default. 137 | (TEA_MAKE_LIB): Enhanced to check for MSVC that requires manifests 138 | and auto-embed it into proj DLL via MAKE_SHARED_LIB. Also define 139 | VC_MANIFEST_EMBED_DLL and VC_MANIFEST_EMBED_EXE that do the same 140 | magic in case it is needed for extended TEA projects. 141 | 142 | 2010-08-16 Jeff Hobbs 143 | 144 | *** Bump to TEA_VERSION 3.9 *** 145 | If upgrading from TEA_VERSION 3.8, copy over tcl.m4, change 146 | TEA_INIT to use 3.9 and reconfigure (ac-2.59+). 147 | BUILD_${PACKAGE_NAME} will be auto-defined on Windows for 148 | correct setting of TCL_STORAGE_CLASS. 149 | TEA_LOAD_CONFIG users should remove the SHLIB_LD_LIBS setting done 150 | in configure.in (LIBS will be automagically populated by 151 | TEA_LOAD_CONFIG). 152 | TEA_EXPORT_CONFIG has been added for ${pkg}Config.sh creators 153 | SHLIB_LD_FLAGS was deprecated a while ago, remove it if it is 154 | still in your Makefile.in. 155 | 156 | * tcl.m4: add /usr/lib64 to set of auto-search dirs. [Bug 1230554] 157 | Auto-define BUILD_$PACKAGE_NAME so users don't need to. This 158 | needs to correspond with $pkg.h define magic for TCL_STORAGE_CLASS. 159 | Auto-define CLEANFILES. Users can expand it. 160 | (SHLIB_LD_LIBS): define to '${LIBS}' default and change it only if 161 | necessary. Platforms not using this may simply not work or have 162 | very funky linkers. 163 | (TEA_LOAD_CONFIG): When loading config for another extension, 164 | auto-add stub libraries found with TEA_ADD_LIBS. Eases 165 | configure.in for modules like itk and img::*. 166 | (TEA_EXPORT_CONFIG): Add standardized function for exporting a 167 | ${pkg}Config.sh. See use by img::* and itcl. 168 | 169 | 2010-08-12 Jeff Hobbs 170 | 171 | *** Bump to TEA_VERSION 3.8 *** 172 | If upgrading from TEA_VERSION 3.7, copy over tcl.m4, change 173 | TEA_INIT to use 3.8 and reconfigure (ac-2.59+). 174 | No other changes should be necessary. 175 | 176 | * tcl.m4: remove more vestigial bits from removed platforms. 177 | Add back SCO_SV-3.2*. 178 | Remove use of DL_LIBS and DL_OBJS and related baggage - these are 179 | only needed by the core to support 'load'. 180 | Allow for macosx in TEA_ADD_SOURCES. 181 | Correct check for found_xincludes=no in TEA_PATH_UNIX_X. 182 | 183 | 2010-08-11 Jeff Hobbs 184 | 185 | * tcl.m4: remove the following old platform configurations: 186 | UNIX_SV*|UnixWare-5*, SunOS-4.*, SINIX*5.4*, SCO_SV-3.2*, 187 | OSF1-1.*, NEXTSTEP-*, NetBSD-1.*|FreeBSD-[[1-2]].*, MP-RAS-*, 188 | IRIX-5.*, HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*, dgux*, 189 | BSD/OS-2.1*|BSD/OS-3* 190 | (AIX): drop AIX-pre4 support and use of ldAix, use -bexpall/-brtl 191 | 192 | 2010-07-05 Jan Nijtmans 193 | 194 | * tcl.m4: [Patch #1055668] removal of exported internals from 195 | tclInt.h (EXTERN macro) 196 | 197 | 2010-04-14 Jan Nijtmans 198 | 199 | * tcl.m4 - Backport a lot of quoting fixes from tcl8.6/unix/tcl.m4 200 | - Fix determination of CYGPATH for CYGWIN 201 | With those fixes, itcl and tdbc compile fine with CYGWIN 202 | 203 | 2010-04-06 Jan Nijtmans 204 | 205 | * install-sh [Bug 2982540] configure and install* script files 206 | should always have LF 207 | 208 | 2010-02-19 Stuart Cassoff 209 | 210 | * tcl.m4: Correct compiler/linker flags for threaded builds on 211 | OpenBSD. 212 | 213 | 2010-01-19 Jan Nijtmans 214 | 215 | * tcl.m4: Detect CYGWIN variant: win32 or unix 216 | 217 | 2010-01-03 Donal K. Fellows 218 | 219 | * unix/tcl.m4 (TEA_CONFIG_CFLAGS): [Tcl Bug 1636685]: Use the 220 | configuration for modern FreeBSD suggested by the FreeBSD porter. 221 | 222 | 2009-10-22 Jan Nijtmans 223 | 224 | * tcl.m4: [Tcl Patch #2883533] tcl.m4 support for Haiku OS 225 | 226 | 2009-04-27 Jeff Hobbs 227 | 228 | * tcl.m4 (TEA_CONFIG_CFLAGS): harden the check to add _r to CC on 229 | AIX with threads. 230 | 231 | 2009-04-10 Daniel Steffen 232 | 233 | * tcl.m4 (Darwin): check for 64-bit TkAqua. 234 | 235 | 2009-03-26 Jan Nijtmans 236 | 237 | * tclconfig/tcl.m4: Adapt LDFLAGS and LD_SEARCH_FLAGS 238 | together with SHLIB_LD definition to unbreak building on HPUX. 239 | 240 | 2009-03-20 Andreas Kupries 241 | 242 | * tclconfig/tcl.m4: Changed SHLIB_LD definition to unbreak 243 | building on HPUX. 244 | 245 | 2009-03-16 Joe English 246 | 247 | * tcl.m4(TEA_PUBLIC_TK_HEADERS): Look at ${TK_INCLUDE_SPEC} 248 | (found in tkConfig.sh) when trying to guess where tk.h might be 249 | [Patch 1960628]. 250 | 251 | 2009-03-11 Joe English 252 | 253 | * tcl.m4: Allow ${SHLIB_SUFFIX} to be overridden at 254 | configure-time [Patch 1960628]. Also fix some comment typos, 255 | and an uninitialized variable bug-waiting-to-happen. 256 | 257 | 2008-12-21 Jan Nijtmans 258 | 259 | * tcl.m4: [Bug 2073255] Tcl_GetString(NULL) doesn't crash on HP-UX 260 | (this bug report was for Tcl, but holds for TEA as well.) 261 | 262 | 2008-12-20 Daniel Steffen 263 | 264 | * tcl.m4: sync with tdbc tcl.m4 changes 265 | (SunOS-5.11): Sun cc SHLIB_LD: use LDFLAGS_DEFAULT instead of LDFLAGS 266 | 267 | 2008-12-02 Jeff Hobbs 268 | 269 | *** Bump to TEA_VERSION 3.7 *** 270 | 271 | * tcl.m4: in private header check, check for Port.h instead 272 | of Int.h to ensure all private headers are available. 273 | 274 | 2008-11-04 Daniel Steffen 275 | 276 | * tcl.m4 (Darwin): sync TEA_PRIVATE_TK_HEADERS handling of 277 | Tk.framework PrivateHeaders with TEA_PRIVATE_TCL_HEADERS. 278 | 279 | 2008-11-04 Jeff Hobbs 280 | 281 | * tcl.m4 (TEA_PATH_TCLCONFIG, TEA_PATH_TKCONFIG): exit with error 282 | when tclConfig.sh cannot be found. [Bug #1997760] 283 | (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): allow for 284 | finding the headers installed in the public areas, e.g. a result of 285 | make install-private-headers. [Bug #1631922] 286 | 287 | 2008-08-12 Daniel Steffen 288 | 289 | * tcl.m4 (Darwin): link shlib with current and compatiblity version 290 | flags; look for libX11.dylib when searching for X11 libraries. 291 | 292 | 2008-06-12 Daniel Steffen 293 | 294 | * tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc. 295 | 296 | 2008-03-27 Daniel Steffen 297 | 298 | * tcl.m4 (SunOS-5.1x): fix 64bit support for Sun cc. [Bug 1921166] 299 | 300 | 2008-02-01 Donal K. Fellows 301 | 302 | * tcl.m4 (TEA_CONFIG_CFLAGS): Updated to work at least in part with 303 | more modern VC versions. Currently just made the linker flags more 304 | flexible; more work may be needed. 305 | 306 | 2007-10-26 Daniel Steffen 307 | 308 | * tcl.m4 (Darwin): add support for 64-bit X11. 309 | 310 | 2007-10-23 Jeff Hobbs 311 | 312 | *** Tagged tea-3-branch to start TEA 4 development on HEAD *** 313 | 314 | 2007-09-17 Joe English 315 | 316 | * tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable' 317 | to build shared libraries on current NetBSDs [Bug 1749251]. 318 | 319 | 2007-09-15 Daniel Steffen 320 | 321 | * tcl.m4: replace all direct references to compiler by ${CC} to 322 | enable CC overriding at configure & make time. 323 | (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by 324 | 'cc' compiler driver. 325 | 326 | 2007-08-08 Jeff Hobbs 327 | 328 | * tcl.m4: check Ttk dir for Tk private headers (8.5). 329 | Add some comments to other bits. 330 | 331 | 2007-06-25 Jeff Hobbs 332 | 333 | * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): move where / is added. 334 | 335 | 2007-06-13 Jeff Hobbs 336 | 337 | * tcl.m4: fix --with-tkinclude alignment. [Bug 1506111] 338 | 339 | 2007-06-06 Daniel Steffen 340 | 341 | * tcl.m4 (Darwin): fix 64bit arch removal in fat 32&64bit builds. 342 | 343 | 2007-05-18 Donal K. Fellows 344 | 345 | * tcl.m4: Added quoting so that paths with spaces cause fewer 346 | problems. 347 | 348 | 2007-03-07 Daniel Steffen 349 | 350 | * tcl.m4 (Darwin): s/CFLAGS/CPPFLAGS/ in -mmacosx-version-min check. 351 | 352 | 2007-02-15 Jeff Hobbs 353 | 354 | * tcl.m4: correct private header check to search in generic subdir 355 | 356 | 2007-02-09 Jeff Hobbs 357 | 358 | *** Bump to TEA_VERSION 3.6 *** 359 | 360 | * tcl.m4: correct -d to -f 361 | (TEA_CONFIG_CFLAGS): SHLIB_SUFFIX is .so on HP ia64 [Bug 1615058] 362 | 363 | 2007-02-08 Jeff Hobbs 364 | 365 | * tcl.m4 (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): check 366 | that the dirs actually have private headers. [Bug 1631922] 367 | 368 | 2007-02-04 Daniel Steffen 369 | 370 | * tcl.m4: add caching to -pipe check. 371 | 372 | 2007-01-25 Daniel Steffen 373 | 374 | * tcl.m4: integrate CPPFLAGS into CFLAGS as late as possible and 375 | move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to 376 | avoid errors about multiple -isysroot flags from some older gcc builds. 377 | 378 | 2006-01-19 Daniel Steffen 379 | 380 | * tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861] 381 | (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when 382 | present in CFLAGS to avoid discrepancies between what headers configure 383 | sees during preprocessing tests and compiling tests. 384 | 385 | 2006-12-19 Daniel Steffen 386 | 387 | * tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch flag 388 | succeeds before enabling 64bit build. 389 | 390 | 2006-12-16 Daniel Steffen 391 | 392 | * tcl.m4 (Linux): fix previous change to use makefile variable 393 | LDFLAGS_DEFAULT instead of LDFLAGS in SHLIB_LD, to ensure linker 394 | flags in sampleextension Makefile are picked up. 395 | 396 | 2006-11-26 Daniel Steffen 397 | 398 | * tcl.m4 (Linux): --enable-64bit support. [Patch 1597389], [Bug 1230558] 399 | 400 | 2006-08-18 Daniel Steffen 401 | 402 | * tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for 403 | universal builds including x86_64 and for use of -mmacosx-version-min 404 | instead of MACOSX_DEPLOYMENT_TARGET. For Tk extensions, remove 64-bit 405 | arch flags from CFLAGS like in the Tk configure, as neither TkAqua nor 406 | TkX11 can be built for 64-bit at present. 407 | 408 | 2006-03-28 Jeff Hobbs 409 | 410 | * tcl.m4: []-quote AC_DEFUN functions. 411 | (TEA_PATH_TKCONFIG): Fixed Windows-specific check for tkConfig.sh. 412 | (TEA_MAKE_LIB): Prepend 'lib' for Windows-gcc configs. 413 | 414 | 2006-03-07 Joe English 415 | 416 | * tcl.m4: Set SHLIB_LD_FLAGS='${LIBS}' on NetBSD, 417 | as per the other *BSD variants [Bug 1334613]. 418 | 419 | 2006-01-25 Jeff Hobbs 420 | 421 | *** Bump to TEA version 3.5 *** 422 | 423 | * tcl.m4: keep LD_SEARCH_FLAGS and CC_SEARCH_FLAGS synchronous 424 | with core tcl.m4 meaning. 425 | 426 | 2006-01-24 Daniel Steffen 427 | 428 | * tcl.m4 (Darwin): use makefile variable LDFLAGS_DEFAULT instead of 429 | LDFLAGS in SHLIB_LD, to ensure linker flags in sampleextension Makefile 430 | are picked up. [Bug 1403343] 431 | 432 | 2006-01-23 Jeff Hobbs 433 | 434 | * tcl.m4: add C:/Tcl/lib and C:/Progra~1/Tcl/lib dirs to check for 435 | *Config.sh on Windows. [Bug 1407544] 436 | 437 | 2006-01-23 Daniel Steffen 438 | 439 | * tcl.m4 (Darwin): for Tk extensions, remove -arch ppc64 from CFLAGS 440 | like in the Tk configure, as neither TkAqua nor TkX11 can be built for 441 | 64bit at present (no 64bit GUI libraries). 442 | 443 | 2006-01-22 Jeff Hobbs 444 | 445 | * tcl.m4: restore system=windows on Windows. 446 | Remove error if 'ar' isn't found (it may not be on Windows). 447 | Do not add -lxnet or define _XOPEN_SOURCE on HP-UX by default. 448 | Ensure the C|LDFLAGS_DEFAULT gets the fully sub'd value at 449 | configure time. 450 | 451 | 2006-01-10 Daniel Steffen 452 | 453 | * tcl.m4: add caching, use AC_CACHE_CHECK instead of AC_CACHE_VAL 454 | where possible, consistent message quoting, sync relevant 455 | tcl/unix/tcl.m4 HEAD changes and gratuitous formatting differences 456 | (notably sunc removal of support for for ancient BSD's, IRIX 4, 457 | RISCos and Ultrix by kennykb), Darwin improvements to 458 | TEA_LOAD_*CONFIG to make linking work against Tcl/Tk frameworks 459 | installed in arbitrary location, change TEA_PROG_* search order 460 | (look in *_BIN_DIR parents before *_PREFIX). 461 | 462 | 2006-01-05 Jeff Hobbs 463 | 464 | * tcl.m4: add dkf's system config refactor 465 | 466 | 2006-01-04 Jeff Hobbs 467 | 468 | * tcl.m4: remove extraneous ' that causes bash 3.1 to choke 469 | 470 | 2005-12-19 Joe English 471 | 472 | * tcl.m4 (TEA_PATH_TCLCONFIG &c): Look for tclConfig.sh &c 473 | in ${libdir}, where they are installed by default [Patch #1377407]. 474 | 475 | 2005-12-05 Don Porter 476 | 477 | * tcl.m4 (TEA_PUBLIC_*_HEADERS): Better support for finding 478 | header files for uninstalled Tcl and Tk. 479 | 480 | 2005-12-02 Jeff Hobbs 481 | 482 | * tcl.m4: correctly bump TEA_VERSION var to 3.4 483 | 484 | 2005-12-01 Daniel Steffen 485 | 486 | * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset 487 | 488 | 2005-11-29 Jeff Hobbs 489 | 490 | * tcl.m4: *** Bump to TEA version 3.4 *** 491 | Add Windows x64 build support. 492 | Remove TEA_PATH_NOSPACE and handle the problem with ""s where 493 | necessary - the macro relied on TCLSH_PROG which didn't work for 494 | cross-compiles. 495 | 496 | 2005-11-27 Daniel Steffen 497 | 498 | * tcl.m4 (Darwin): add 64bit support, add CFLAGS to SHLIB_LD to 499 | support passing -isysroot in env(CFLAGS) to configure (flag can't 500 | be present twice, so can't be in both CFLAGS and LDFLAGS during 501 | configure), don't use -prebind when deploying on 10.4. 502 | (TEA_ENABLE_LANGINFO, TEA_TIME_HANDLER): add/fix caching. 503 | 504 | 2005-10-30 Daniel Steffen 505 | 506 | * tcl.m4: fixed two tests for TEA_WINDOWINGSYSTEM = "aqua" that 507 | should have been for `uname -s` = "Darwin" instead; added some 508 | missing quoting. 509 | (TEA_PROG_TCLSH, TEA_PROG_WISH): fix incorrect assumption that 510 | install location of tclConfig.sh/tkConfig.sh allows to determine 511 | the tclsh/wish install dir via ../bin. Indeed tcl/tk can be 512 | configured with arbitrary --libdir and --bindir (independent of 513 | prefix) and such a configuration is in fact standard with Darwin 514 | framework builds. At least now also check ${TCL_PREFIX}/bin 515 | resp. ${TK_PREFIX}/bin for presence of tclsh resp. wish (if tcl/tk 516 | have been configured with arbitrary --bindir, this will still not 517 | find them, for a general solution *Config.sh would need to contain 518 | the values of bindir/libdir/includedir passed to configure). 519 | 520 | 2005-10-07 Jeff Hobbs 521 | 522 | * tcl.m4: Fix Solaris 5.10 check and Solaris AMD64 64-bit builds. 523 | 524 | 2005-10-04 Jeff Hobbs 525 | 526 | * tcl.m4 (TEA_PRIVATE_TCL_HEADERS): add / to finish sed macro 527 | (TEA_ENABLE_THREADS): don't check for pthread_attr_setstacksize func 528 | 529 | 2005-09-13 Jeff Hobbs 530 | 531 | * tcl.m4: *** Update to TEA version 3.3 *** 532 | define TEA_WINDOWINGSYSTEM in TEA_LOAD_TKCONFIG. 533 | Make --enable-threads the default (users can --disable-threads). 534 | Improve AIX ${CC}_r fix to better check existing ${CC} value. 535 | Do the appropriate evals to not require the *TOP_DIR_NATIVE vars 536 | be set for extensions that use private headers. 537 | Make aqua check for Xlib compat headers the same as win32. 538 | 539 | 2005-07-26 Mo DeJong 540 | 541 | * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH, 542 | TEA_PROG_WISH, TEA_BUILD_WISH): Remove 543 | TEA_BUILD_TCLSH and TEA_BUILD_WISH because 544 | of complaints that it broke the build when 545 | only an installed version of Tcl was available 546 | at extension build time. The TEA_PROG_TCLSH and 547 | TEA_PROG_WISH macros will no longer search the 548 | path at all. The build tclsh or installed 549 | tclsh shell will now be found by TEA_PROG_TCLSH. 550 | 551 | 2005-07-24 Mo DeJong 552 | 553 | * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH, 554 | TEA_PROG_WISH, TEA_BUILD_WISH): 555 | Split confused search for tclsh on PATH and 556 | build and install locations into two macros. 557 | TEA_PROG_TCLSH and TEA_PROG_WISH search the 558 | system PATH for an installed tclsh or wish. 559 | The TEA_BUILD_TCLSH and TEA_BUILD_WISH 560 | macros determine the name of tclsh or 561 | wish in the Tcl or Tk build directory even 562 | if tclsh or wish has not yet been built. 563 | [Tcl bug 1160114] 564 | [Tcl patch 1244153] 565 | 566 | 2005-06-23 Daniel Steffen 567 | 568 | * tcl.m4 (TEA_PRIVATE_TK_HEADERS): add ${TK_SRC_DIR}/macosx to 569 | TK_INCLUDES when building against TkAqua. 570 | 571 | * tcl.m4 (TEA_PATH_X): fixed missing comma in AC_DEFINE 572 | 573 | * tcl.m4: changes to better support framework builds of Tcl and Tk out 574 | of the box: search framework install locations for *Config.sh, and if in 575 | presence of a framework build, use the framework's Headers and 576 | PrivateHeaders directories for public and private includes. [FR 947735] 577 | 578 | 2005-06-18 Daniel Steffen 579 | 580 | * tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to 581 | ensure we can always relocate binaries with install_name_tool. 582 | 583 | 2005-06-04 Daniel Steffen 584 | 585 | * tcl.m4 (TEA_PATH_X): for TEA_WINDOWINGSYSTEM == aqua, check if xlib 586 | compat headers are available in tkheaders location, otherwise add xlib 587 | sourcedir to TK_XINCLUDES. 588 | 589 | 2005-04-25 Daniel Steffen 590 | 591 | * tcl.m4: added AC_DEFINE* descriptions (from core tcl.m4) to allow 592 | use with autoheader. 593 | (Darwin): added configure checks for recently added linker flags 594 | -single_module and -search_paths_first to allow building with older 595 | tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD. 596 | (TEA_MISSING_POSIX_HEADERS): added caching of dirent.h check. 597 | (TEA_BUGGY_STRTOD): added caching (sync with core tcl.m4). 598 | 599 | 2005-03-24 Jeff Hobbs 600 | 601 | * tcl.m4 (TEA_TCL_64BIT_FLAGS): use Tcl header defaults for wide 602 | int type only on Windows when __int64 is detected as valid. 603 | 604 | 2005-03-24 Don Porter 605 | 606 | * README.txt: Update reference to "SC_* macros" to "TEA_* macros". 607 | * tcl.m4: Incorporated recent improvements in SC_PATH_TCLCONFIG 608 | and SC_PATH_TKCONFIG into TEA_PATH_TCLCONFIG and TEA_PATH_TKCONFIG. 609 | Corrected search path in TEA_PATH_CONFIG and added 610 | AC_SUBST($1_BIN_DIR) to TEA_LOAD_CONFIG so that packages that load 611 | the configuration of another package can know where they loaded 612 | it from. 613 | 614 | 2005-03-18 Jeff Hobbs 615 | 616 | * tcl.m4 (TEA_CONFIG_CFLAGS): correct 2005-03-17 change to have 617 | variant LD_SEARCH_FLAGS for gcc and cc builds. 618 | 619 | * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): correct x-compile check. 620 | 621 | 2005-03-17 Jeff Hobbs 622 | 623 | * tcl.m4: Correct gcc build and HP-UX-11. 624 | 625 | 2005-02-08 Jeff Hobbs 626 | 627 | * tcl.m4 (TEA_ADD_LIBS): don't touch lib args starting with -. 628 | (TEA_CONFIG_CFLAGS): only define _DLL for CE in shared build. 629 | (TEA_MAKE_LIB): set RANLIB* to : on Windows (it's not needed). 630 | 631 | 2005-02-01 Jeff Hobbs 632 | 633 | * tcl.m4: redo of 2005-01-27 changes to correctly handle paths 634 | with spaces. Win/CE and Win/64 builds now require a prebuilt 635 | tclsh to handle conversion to short pathnames. This is done in 636 | the new TEA_PATH_NOSPACE macro. For Win/CE|64, make CC just the 637 | compiler and move the necessary includes to CFLAGS. 638 | (TEA_CONFIG_CFLAGS): Add Solaris 64-bit gcc build support. 639 | (TEA_PROG_TCLSH, TEA_PROG_WISH): Allow TCLSH_PROG and WISH_PROG to 640 | be set in the env and prevent resetting. 641 | (TEA_ADD_LIBS): On Windows using GCC (mingw), convert foo.lib 642 | args to -lfoo, for use with mingw. 643 | *** POTENTIAL INCOMPATABILITY *** 644 | (TEA_CONFIG_CFLAGS): Fix AIX gcc builds to work out-of-box. 645 | Bumped TEA to 3.2. 646 | 647 | 2005-01-27 Jeff Hobbs 648 | 649 | * tcl.m4: remove cygpath calls to support msys. 650 | Update base CE build assumption to "420,ARMV4,ARM,Pocket PC 2003". 651 | Make STLIB_LD use $LINKBIN -lib. 652 | 653 | 2005-01-25 Daniel Steffen 654 | 655 | * tcl.m4 (Darwin): fixed bug with static build linking to dynamic 656 | library in /usr/lib etc instead of linking to static library earlier 657 | in search path. [Tcl Bug 956908] 658 | Removed obsolete references to Rhapsody. 659 | 660 | 2004-12-29 Jeff Hobbs 661 | 662 | * tcl.m4: Updates for VC7 compatibility, fixing CFLAGS and LDFLAGS 663 | options, using better default -O levels. [Bug 1092952, 1091967] 664 | 665 | 2004-12-29 Joe English 666 | 667 | * tcl.m4: Do not use ${DBGX} suffix when building 668 | shared libraries [patch #1081595, TIP #34] 669 | 670 | 2004-09-07 Jeff Hobbs 671 | 672 | * tcl.m4 (TEA_CONFIG_CFLAGS): support eVC4 Win/CE builds 673 | 674 | 2004-08-10 Jeff Hobbs 675 | 676 | * tcl.m4 (TEA_INIT, TEA_PREFIX): update handling of exec_prefix to 677 | work around subdir configures since autoconf only propagates the 678 | prefix (not exec_prefix). 679 | 680 | 2004-07-23 Daniel Steffen 681 | 682 | * tcl.m4 (TEA_CONFIG_CFLAGS): Darwin section: brought inline with 683 | Tcl 8.5 HEAD config, removed core specific & obsolete settings. 684 | 685 | 2004-07-22 Jeff Hobbs 686 | 687 | * tcl.m4 (TEA_PATH_X): check in TK_DEFS for MAC_OSX_TK to see if 688 | we are compiling on Aqua. Add TEA_WINDOWINGSYSTEM var that 689 | reflects 'tk windowingsystem' value. 690 | 691 | 2004-07-16 Jeff Hobbs 692 | 693 | * tcl.m4 (TEA_ENABLE_THREADS): force a threaded build when 694 | building against a threaded core. 695 | (CFLAGS_WARNING): Remove -Wconversion for gcc builds 696 | (TEA_CONFIG_CFLAGS): Reorder configure.in for better 64-bit build 697 | configuration, replacing EXTRA_CFLAGS with CFLAGS. [Bug #874058] 698 | Update to latest Tcl 8.5 head config settings. 699 | Call this TEA version 3.1. 700 | 701 | 2004-04-29 Jeff Hobbs 702 | 703 | * tcl.m4 (TEA_TCL_64BIT_FLAGS): replace AC_TRY_RUN test with 704 | AC_TRY_COMPILE for the long vs. long long check. (kenny) 705 | 706 | 2004-04-26 Jeff Hobbs 707 | 708 | * tcl.m4 (TEA_TCL_64BIT_FLAGS): update against core tcl.m4 to 709 | define TCL_WIDE_INT_IS_LONG if 'using long'. 710 | 711 | 2004-03-19 Jeff Hobbs 712 | 713 | * tcl.m4: correct Windows builds getting LDFLAGS info in MAKE_LIB 714 | 715 | 2004-02-11 Jeff Hobbs 716 | 717 | * tcl.m4: correct TCL_INCLUDES for private headers on Windows - it 718 | doesn't need the eval. 719 | 720 | 2004-02-10 Jeff Hobbs 721 | 722 | * tcl.m4: don't require TK_INCLUDES and TCL_INCLUDES to have the 723 | DIR_NATIVE vars defined when using private headers on unix. 724 | Allow $... to TEA_ADD_SOURCES for constructs like 725 | TEA_ADD_SOURCES([\$(WIN_OBJECTS)]), that allow the developer to 726 | place more in the Makefile.in. 727 | tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and 728 | CHECK on limits.h 729 | 730 | 2003-12-10 Jeff Hobbs 731 | 732 | * Makefile.in: added TEA_ADD_LIBS, TEA_ADD_INCLUDES and 733 | * configure: TEA_ADD_CFLAGS to configurable parameters with 734 | * configure.in: PKG_* equivs in the Makefile. This allows the 735 | * tclconfig/tcl.m4: user to worry less about actual magic VAR names. 736 | Corrected Makefile.in to note that TEA_ADD_TCL_SOURCES requires 737 | exact file names. 738 | 739 | 2003-12-09 Jeff Hobbs 740 | 741 | * tcl.m4: updated OpenBSD support based on [Patch #775246] (cassoff) 742 | 743 | 2003-12-05 Jeff Hobbs 744 | 745 | * configure: 746 | * configure.in: 747 | * Makefile.in (VPATH): readd $(srcdir) to front of VPATH as the 748 | first part of VPATH can get chopped off. 749 | Change .c.$(OBJEXT) rule to .c.@OBJEXT@ to support more makes. 750 | * tclconfig/tcl.m4: add TEA_ADD_STUB_SOURCES to support libstub 751 | generation and TEA_ADD_TCL_SOURCES to replace RUNTIME_SOURCES as 752 | the way the user specifies library files. 753 | 754 | 2003-12-03 Jeff Hobbs 755 | 756 | * configure: Update of TEA spec to (hopefully) simplify 757 | * configure.in: some aspects of TEA by making use of more 758 | * Makefile.in: AC 2.5x features. Use PACKAGE_NAME (instead 759 | * generic/tclsample.c: of PACKAGE) and PACKAGE_VERSION (instead of 760 | * tclconfig/tcl.m4: VERSION) arguments to AC_INIT as the TEA 761 | package name and version. 762 | Provide a version argument to TEA_INIT - starting with 3.0. 763 | Drop all use of interior shell substs that older makefiles didn't 764 | like. Use PKG_* naming convention instead. 765 | Move specification of source files and public headers into 766 | configure.in with TEA_ADD_SOURCES and TEA_ADD_HEADERS. These will 767 | be munged during ./configure into the right obj file names (no 768 | $(SOURCES:.c=.obj) needed). 769 | There is almost nothing that should be touched in Makefile.in now 770 | for the developer. May want to add a TEA_ADD_TCL_SOURCES for the 771 | RUNTIME_SOURCES that remains. 772 | Use SHLID_LD_FLAGS (instead of SHLID_LDFLAGS) as Tcl does. 773 | Only specify the user requested LDFLAGS/CFLAGS in the Makefile, 774 | don't mention the _OPTIMIZE/_DEBUG variants. 775 | 776 | 2003-10-15 Jeff Hobbs 777 | 778 | * tcl.m4: create a TEA_SETUP_COMPILER_CC the precedes the 779 | TEA_SETUP_COMPILER macro. They are split so the check for CC 780 | occurs before any use of CC. Also add AC_PROG_CPP to the compiler 781 | checks. 782 | 783 | 2003-10-06 Jeff Hobbs 784 | 785 | * tcl.m4: Updated for autoconf 2.5x prereq. 786 | Where TCL_WIDE_INT_TYPE would be __int64, defer to the code checks 787 | in tcl.h, which also handles TCL_LL_MODIFIER* properly. 788 | 789 | 2003-04-22 Jeff Hobbs 790 | 791 | * tcl.m4: correct default setting of ARCH for WinCE builds. 792 | Correct \ escaping for CE sed macros. 793 | 794 | 2003-04-10 Jeff Hobbs 795 | 796 | * tcl.m4: replace $(syscal) construct with older `syscall` for 797 | systems where sh != bash. 798 | 799 | 2003-04-09 Jeff Hobbs 800 | 801 | * tcl.m4 (TEA_WITH_CELIB): add --enable-wince and --with-celib 802 | options for Windows/CE compilation support. Requires the 803 | Microsoft eMbedded SDK and Keuchel's celib emulation layer. 804 | 805 | 2003-02-18 Jeff Hobbs 806 | 807 | * tcl.m4 (TEA_ENABLE_THREADS): Make sure -lpthread gets passed on 808 | the link line when checking for the pthread_attr_setstacksize 809 | symbol. (dejong) 810 | 811 | * tcl.m4 (TEA_SETUP_COMPILER): added default calls to 812 | TEA_TCL_EARLY_FLAGS, TEA_TCL_64BIT_FLAGS, 813 | TEA_MISSING_POSIX_HEADERS and TEA_BUGGY_STRTOD. 814 | 815 | 2003-02-14 Jeff Hobbs 816 | 817 | * tcl.m4: correct HP-UX ia64 --enable-64bit build flags 818 | 819 | 2003-01-29 Jeff Hobbs 820 | 821 | * tcl.m4: check $prefix/lib as well as $exec_prefix/lib when 822 | looking for tcl|tkConfig.sh, as this check is done before we would 823 | set exec_prefix when the user does not define it. 824 | 825 | 2003-01-21 Mo DeJong 826 | 827 | * tcl.m4 (TEA_CONFIG_CFLAGS): Fix build support 828 | for mingw, the previous implementation would 829 | use VC++ when compiling with mingw gcc. Don't 830 | pass -fPIC since gcc always compiles pic code 831 | under win32. Change some hard coded cases 832 | of gcc to ${CC}. 833 | 834 | 2002-10-15 Jeff Hobbs 835 | 836 | * tcl.m4: move the CFLAGS definition from TEA_ENABLE_SHARED to 837 | TEA_MAKE_LIB because setting too early confuses other AC_* macros. 838 | Correct the HP-11 SHLIB_LD_LIBS setting. 839 | 840 | * tcl.m4: add the CFLAGS definition into TEA_ENABLE_SHARED and 841 | make it pick up the env CFLAGS at configure time. 842 | 843 | 2002-10-09 Jeff Hobbs 844 | 845 | * tcl.m4: add --enable-symbols=mem option to enable TCL_MEM_DEBUG. 846 | Improved AIX 64-bit build support, allow it on AIX-4 as well. 847 | Enable 64-bit HP-11 compilation with gcc. 848 | Enable 64-bit IRIX64-6 cc build support. 849 | Correct FreeBSD thread library linkage. 850 | Add OSF1 static build support. 851 | Improve SunOS-5 shared build SHLIB_LD macro. 852 | 853 | 2002-07-20 Zoran Vasiljevic 854 | 855 | * tcl.m4: Added MINGW32 to list of systems checked for Windows build. 856 | Also, fixes some indentation issues with "--with-XXX" options. 857 | 858 | 2002-04-23 Jeff Hobbs 859 | 860 | * tcl.m4 (TEA_ENABLE_THREADS): added USE_THREAD_ALLOC define to 861 | use new threaded allocatory by default on Unix for Tcl 8.4. 862 | (TEA_CONFIG_CFLAGS): corrected LD_SEARCH_FLAGS for FreeBSD-3+. 863 | 864 | 2002-04-22 Jeff Hobbs 865 | 866 | * tcl.m4 (TEA_SETUP_COMPILER): removed call to AC_CYGWIN so that 867 | we can use autoconf 2.5x as well as 2.13. This prevents us from 868 | being able to warn against the use of cygwin gcc at configure 869 | time, but allows autoconf 2.5x, which is what is shipped with most 870 | newer systems. 871 | 872 | 2002-04-11 Jeff Hobbs 873 | 874 | * tcl.m4: Enabled COFF as well as CV style debug info with 875 | --enable-symbols to allow Dr. Watson users to see function info. 876 | More info on debugging levels can be obtained at: 877 | http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp 878 | 879 | 2002-04-03 Jeff Hobbs 880 | 881 | * tcl.m4: change all SC_* macros to TEA_*. The SC_ was for 882 | Scriptics, which is no more. TEA represents a better, independent 883 | prefix that won't need changing. 884 | Added preliminary mingw gcc support. [Patch #538772] 885 | Added TEA_PREFIX macro that handles defaulting the prefix and 886 | exec_prefix vars to those used by Tcl if none were specified. 887 | Added TEA_SETUP_COMPILER macro that encompasses the AC_PROG_CC 888 | check and several other basic AC_PROG checks needed for making 889 | executables. This greatly simplifies user's configure.in files. 890 | Collapsed AIX-5 defines into AIX-* with extra checks for doing the 891 | ELF stuff on AIX-5-ia64. 892 | Updated TEA_ENABLE_THREADS to take an optional arg to allow 893 | switching it on by default (for Thread) and add sanity checking to 894 | warn the user if configuring threads incompatibly. 895 | 896 | 2002-03-29 Jeff Hobbs 897 | 898 | * tcl.m4: made sure that SHLIB_LDFLAGS was set to LDFLAGS_DEFAULT. 899 | Removed --enable-64bit support for AIX-4 because it wasn't correct. 900 | Added -MT or -MD Windows linker switches to properly support 901 | symbols-enabled builds. 902 | 903 | 2002-03-28 Jeff Hobbs 904 | 905 | * tcl.m4: called AC_MSG_ERROR when SC_TEA_INIT wasn't called first 906 | instead of calling it as that inlines it each time in shell code. 907 | Changed Windows CFLAGS_OPTIMIZE to use -O2 instead of -Oti. 908 | Noted TCL_LIB_VERSIONS_OK=nodots for Windows builds. 909 | A few changes to support itcl (and perhaps others): 910 | Added support for making your own stub libraries to SC_MAKE_LIB. 911 | New SC_PATH_CONFIG and SC_LOAD_CONFIG that take a package name arg 912 | and find that ${pkg}Config.sh file. itk uses this for itcl. 913 | 914 | 2002-03-27 Jeff Hobbs 915 | 916 | * tcl.m4: made SC_LOAD_TKCONFIG recognize when working with a Tk 917 | build dir setup. 918 | Added EXTRA_CFLAGS and SHLIB_LD_LIBS substs to SC_CONFIG_CFLAGS. 919 | Added XLIBSW onto LIBS when it is defined. 920 | Remove TCL_LIBS from MAKE_LIB and correctly use SHLIB_LD_LIBS 921 | instead to not rely as much on tclConfig.sh cached info. 922 | Add TK_BIN_DIR to paths to find wish in SC_PROG_WISH. 923 | These move towards making TEA much more independent of *Config.sh. 924 | 925 | 2002-03-19 Jeff Hobbs 926 | 927 | * tcl.m4: corrected forgotten (UN)SHARED_LIB_SUFFIX and 928 | SHLIB_SUFFIX defines for Win. 929 | (SC_PATH_X): made this only do the check on unix platforms. 930 | 931 | 2002-03-12 Jeff Hobbs 932 | 933 | * README.txt: updated to reflect fewer files 934 | 935 | 2002-03-06 Jeff Hobbs 936 | 937 | * config.guess (removed): 938 | * config.sub (removed): removed unnecessary files 939 | 940 | * installFile.tcl (removed): 941 | * mkinstalldirs (removed): these aren't really necessary for 942 | making TEA work 943 | 944 | * tcl.m4 (SC_PUBLIC_TCL_HEADERS, SC_PUBLIC_TK_HEADERS): don't 945 | check /usr(/local)/include for includes on Windows when not using 946 | gcc 947 | 948 | 2002-03-05 Jeff Hobbs 949 | 950 | * tcl.m4: added warnings on Windows, removed RELPATH define and 951 | added TCL_LIBS to MAKE_LIB macro. 952 | 953 | This import represents 2.0.0, or a new start at attempting to 954 | make TEA much easier for C extension developers. 955 | 956 | **** moved from tclpro project to core tcl project, **** 957 | **** renamed to 'tclconfig' **** 958 | 959 | 2001-03-15 Karl Lehenbauer 960 | 961 | * installFile.tcl: Added updating of the modification time of 962 | the target file whether we overwrote it or decided that it 963 | hadn't changed. This was necessary for us to be able to 964 | determine whether or not a module install touched the file. 965 | 966 | 2001-03-08 Karl Lehenbauer 967 | 968 | * installFile.tcl: Added support for converting new-style (1.1+) 969 | Cygnus drive paths to Tcl-style. 970 | 971 | 2001-01-15 972 | 973 | * tcl.m4: Added FreeBSD clause. 974 | 975 | 2001-01-03 976 | 977 | * tcl.m4: Fixed typo in SC_LIB_SPEC where it is checking 978 | for exec-prefix. 979 | 980 | 2000-12-01 981 | 982 | * tcl.m4: Concatenated most of the Ajuba acsite.m4 file 983 | so we don't need to modify the autoconf installation. 984 | * config.guess: 985 | * config.sub: 986 | * installFile.tcl: 987 | Added files from the itcl config subdirectory, 988 | which should go away. 989 | 990 | 2000-7-29 991 | 992 | * Fixed the use of TCL_SRC_DIR and TK_SRC_DIR within 993 | TCL_PRIVATE_INCLUDES and TK_PRIVATE_INCLUDES to match their recent 994 | change from $(srcdir) to $(srcdir)/.. 995 | --------------------------------------------------------------------------------