source: trunk/base/scripts/config.sh @ 2426

Last change on this file since 2426 was 2426, checked in by landonf (Landon Fuller), 18 years ago

Allow DarwinPorts to build out of the box on newer Darwin releases with Tcl 8.4

  • Remove references to 'tclsh8.3', replacing them with 'tclsh'. This will work everywhere except FreeBSD
  • Remove compile.sh, link.sh, and tcldir.sh, replacing them with config.sh. config.sh references the config data provided by TEA and allows us to steer clear of autoconf.
  • Modify all Makefiles to use config.sh
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/sh
2args=`getopt c: $*`
3if [ $? != 0 ] || [ $# == 0 ]; then
4        echo "Usage: $0 [-c <tcl directory>] <action> <options>"
5        echo "Actions:"
6        echo "    compile <sources>"
7        echo "    link <library name> <object files>"
8        echo "    shlibname <library name>"
9        echo "    installdir"
10        exit 2
11fi
12
13set -- $args
14for i; do
15        case "$i"
16        in
17                -c)
18                        tclDir=$2; shift; shift;;
19                link|compile|installdir|shlibname)
20                        shift; action=$1; shift; args=$*; break;;
21        esac
22done
23
24if [ "$tclDir" == "" ]; then
25        for i in /usr/lib/ /usr/local/lib /usr/pkg/lib /System/Library/Tcl/8.3
26        do
27                if [ -f $i/tclConfig.sh ]; then
28                        tclConfig=$i/tclConfig.sh
29                fi
30        done
31else
32        tclConfig=$tclDir/tclConfig.sh
33        if [ ! -f $tclConfig ]; then
34                echo "$tclConfig: No such file or directory"
35                exit 3
36        fi
37fi
38
39if [ "$tclConfig" == "" ]; then
40        echo "Could not find tclConfig.sh"
41        exit 3
42fi
43
44. $tclConfig
45
46case $action
47in
48        compile)
49                if [ -f $TCL_PREFIX/include/tcl$TCL_VERSION/tcl.h ]; then
50                        tclInc=-I$TCL_PREFIX/include/tcl$TCL_VERSION
51                elif [ -f $TCL_PREFIX/include/tcl.h ]; then
52                        tclInc=-I$TCL_PREFIX/include/
53                else
54                        echo "Can not find tcl includes"
55                        exit 3
56                fi
57                tclCc="$TCL_CC -c $TCL_CFLAGS_OPTIMIZE $tclInc $*"
58                echo "$tclCc"
59                $tclCc
60                break;;
61        link)
62                libName=$1; shift; objFiles=$*
63                tclLd="$TCL_SHLIB_LD $tclLd $objFiles -o $libName$TCL_SHLIB_SUFFIX $TCL_LIB_SPEC"
64                tclLdClean=`echo $tclLd | sed s/\\\${[A-Za-z_]*}//g`
65                echo "$tclLdClean"
66                $tclLdClean
67                exit 0;;
68        shlibname)
69                echo "$1$TCL_SHLIB_SUFFIX"
70                exit 0;;
71        installdir)
72                if [ `uname -s` == "Darwin" ]; then
73                        if [ -d /System/Library/Tcl/$TCL_VERSION ]; then
74                                echo "/System/Library/Tcl/$TCL_VERSION/darwinports1.0"
75                                exit 0
76                        fi
77                        echo NO
78                fi
79                for i in /usr/lib /usr/pkg/lib /usr/local/lib; do
80                        if [ -d $i/tcl$TCL_VERSION ]; then
81                                echo $i/tcl$TCL_VERSION/darwinports1.0
82                                exit 0
83                        fi
84                done
85                exit 3;;
86esac
Note: See TracBrowser for help on using the repository browser.