# ####################################################################### # GNUmakefile - Build Mac OS X Tcl/Tk BI distribution from CVS # # FILE: "GNUmakefile" # created: 14/9/02 07:58:03 EST # # Author: Daniel A. Steffen # E-mail: # mail: Mathematics Departement # Macquarie University NSW 2109 Australia # www: # # RCS: @(#) $Id: GNUmakefile,v 1.8 2004/02/04 07:14:07 das Exp $ # # BSD License: c.f. # # Copyright (c) 2002-2004, Daniel A. Steffen # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # * Redistributions of source code must retain the above # copyright notice, this list of conditions and the # following disclaimer. # # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials # provided with the distribution. # # * Neither the name of Macquarie University nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # ####################################################################### # Note: this makefile uses gnumake extensions incompatible with other makes #---------------------------------------------------------------------------------------- # default directories export TMP_DIR ?= $(CURDIR) export DESTDIR ?= export INSTALL_ROOT ?= $(DESTDIR) INSTALL_ROOT_EMBEDDED ?= $(TMP_DIR)/embedded/ INSTALL_ROOT_PACKAGE ?= $(TMP_DIR)/package/ INSTALL_ROOT_ARCHIVE ?= $(TMP_DIR)/tar/ export BUILD_DIR ?= $(TMP_DIR)/build export SRC_DIR ?= $(TMP_DIR) export ORIG_DIR ?= $(TMP_DIR)/orig export SRC_ARCHIVE_DIR ?= $(TMP_DIR)/src export PKG_ARCHIVE_DIR ?= $(TMP_DIR)/pkg #---------------------------------------------------------------------------------------- # default installation directories PREFIX := /Library/Tcl LIBDIR := /Library/Tcl #---------------------------------------------------------------------------------------- # tools AUTOCONF ?= autoconf-2.57 ifeq ($(wildcard /usr/bin/xcodebuild),) PBXBUILD ?= pbxbuild else PBXBUILD ?= xcodebuild endif CVS ?= cvs WGET ?= wget CURL ?= curl RSYNC ?= rsync DIFF ?= diff PATCH ?= patch TAR ?= tar FIND ?= find TCLSH ?= tclsh TCLKIT = $(BUILD_DIR)/tclkit/tclkit SDX = $(TCLKIT) $(SRC_DIR)/sdx/main.tcl CRITCL = $(TCLKIT) $(SRC_DIR)/critcl/main.tcl DO_CVS = $(CVS) -q DO_WGET = $(WGET) -N -nv DO_CURL = $(CURL) -L -s -S -O DO_RSYNC = $(RSYNC) -Crlpt --exclude=CVS --exclude=.DS_Store DO_DIFF = $(DIFF) -u -p -x configure -x autom4te.cache -x .DS_Store DO_PATCH = $(PATCH) -N #---------------------------------------------------------------------------------------- # projects (order determines order in installer) core := tcl tk tea := \ incrTcl iwidgets \ tcllib tklib bwidget mclistbox \ tclx thread tclvfs expect \ tktable vu \ tkimg htmlwidget tktreectrl \ tclxml tcldom tclxslt tclsoap \ tclexpat src-libxml2 \ libxml2 libxslt \ tdom \ tnc tdomhtml \ memchan trf trfcrypt tls \ tclhttpd \ tbcload tclcompiler tclparser \ sampleextension \ expat \ swig \ #sqlite tea_unix := \ metakit \ tcLex \ snack \ tix \ xotcl \ #mpexpr pbx := \ TclAE quicktimetcl tclspeech tclresource tcladdressbook tclbitprint other := \ e4graph \ tkcon \ Launcher \ tclkit critlib oomk \ #snit \ #tclapps tclbench tkdiff tkman SpecTcl \ starkit := sdx wikit critcl #---------------------------------------------------------------------------------------- # project sets ext := $(tea) $(tea_unix) $(pbx) $(other) $(starkit) wishkit core_x11 := $(core:%=%_x11) tcl_sf := tcl thread sampleextension tclconfig tcllib_sf := tcllib tklib bwidget mclistbox tclapps tclbench tclxml_sf := tclxml tcldom tclxslt tclpro := tbcload tclcompiler tclparser equi4 := metakit oomk tclkit $(starkit) xml := $(tclxml_sf) tclsoap tdom meta := core ext core_x11 xml tclpro standalone := tcl tk wishkit := tcl tk metakit tclvfs trf memchan incrTcl wrappers := standalone wishkit projects := $(core) $(ext) $(core_x11) standalone all := $(core) $(ext) PBX_BUILDSYSTEM := $(pbx) tk NO_TAR := tclexpat src-libxml2 tnc tdomhtml $(wrappers) NO_CVS := $(NO_TAR) trfcrypt snack critlib snit \ libxml2 libxslt \ TclAE Launcher \ xotcl \ #mpexpr EXTRA_CVS := tclconfig config NEED_CONFIG := incrTcl bwidget mclistbox DONT_INSTALL := libxml2 libxslt expat DONT_PACKAGE := tclexpat src-libxml2 libxml2 libxslt \ expat tnc tdomhtml sdx critcl wikit oomk targets := $(projects) #---------------------------------------------------------------------------------------- # targets all: $(all) $(meta): %: ; $(MAKE) $($*) targets += all $(all) $(meta) install := $(projects:%=install/%) $(install): install/%: % install/%: action := install install: $(all:%=install/%) $(meta:%=install/%): install/%: ; $(MAKE) $($*:%=install/%) targets += install $(install) $(meta:%=install/%) clean := $(projects:%=clean/%) $(clean): clean/%: % clean/%: action := clean clean: $(clean) $(meta:%=clean/%): clean/%: ; $(MAKE) $($*:%=clean/%) targets += clean $(clean) $(meta:%=clean/%) distclean := $(projects:%=distclean/%) $(distclean): distclean/%: % distclean/%: action := distclean distclean: $(distclean) $(meta:%=distclean/%): distclean/%: ; $(MAKE) $($*:%=distclean/%) targets += distclean $(distclean) $(meta:%=distclean/%) embedded := $(all:%=embedded/%) $(embedded): embedded/%: % $(core:%=embedded/%): action := embedded embedded: $(all:%=embedded/%) $(meta:%=embedded/%): embedded/%: ; $(MAKE) $($*:%=embedded/%) targets += embedded $(embedded) $(meta:%=embedded/%) install-embedded := $(all:%=install-embedded/%) $(core:%=install-embedded/%): install-embedded/%: % $(core:%=install-embedded/%): action := install-embedded $(ext:%=install-embedded/%): install-embedded/%: install/% install-embedded: $(all:%=install-embedded/%) $(meta:%=install-embedded/%): install-embedded/%: ; $(MAKE) $($*:%=install-embedded/%) targets += install-embedded $(install-embedded) $(meta:%=install-embedded/%) package := $(all:%=package/%) package: $(package) $(meta:%=package/%): package/%: ; $(MAKE) $($*:%=package/%) targets += package $(package) $(meta:%=package/%) archive := $(projects:%=archive/%) archive: $(archive) $(meta:%=archive/%): archive/%: ; $(MAKE) $($*:%=archive/%) targets += archive $(archive) $(meta:%=archive/%) pkg := package archive cvs_diff := $(all) $(EXTRA_CVS) update := $(cvs_diff:%=update/%) update: $(update) $(meta:%=update/%): update/%: ; $(MAKE) $($*:%=update/%) targets += update $(update) $(meta:%=update/%) diff := $(cvs_diff:%=diff/%) diff: $(diff) $(meta:%=diff/%): diff/%: ; $(MAKE) $($*:%=diff/%) targets += diff $(diff) $(meta:%=diff/%) patch := $(cvs_diff:%=patch/%) patch: $(patch) $(meta:%=patch/%): patch/%: ; $(MAKE) $($*:%=patch/%) targets += patch $(patch) $(meta:%=patch/%) diff := diff patch cvs := update $(diff) .PHONY: $(targets) #---------------------------------------------------------------------------------------- # project make build settings PRE_AUTOCONF = true PRE_MAKE = POST_MAKE = pre_make = @echo "*** $* $(action) ***"; $(PRE_MAKE) post_make = $(POST_MAKE) #---------------------------------------------------------------------------------------- # install build settings PRE_INSTALL = true POST_INSTALL = true POST_INSTALL_EMBEDDED = true install/%: INSTALL_ARGS = INSTALL_ROOT=$(INSTALL_ROOT) \ DESTDIR=$(INSTALL_ROOT) $(EXTRA_INSTALL_ARGS) install/% install-embedded/%: pre_install = mkdir -p $(INSTALL_ROOT)/ && \ cd $(INSTALL_ROOT)/ && \ if [ -n "$(INSTALL_ROOT)" -a $$(id -u) -eq 0 ]\; then \ chgrp admin . && chmod 1775 .\; fi && \ $(PRE_INSTALL) install/% install-embedded/%: post_install = cd $(INSTALL_ROOT)/ && \ $(POST_INSTALL) && \ if [ -n "$(INSTALL_ROOT)" -a $$(id -u) -eq 0 -a -d Library ]\; \ then chmod 775 Library\; fi && \ rmdir -p ./$(PREFIX)/{bin,lib,include,man/man?,man} 2>&- || true && \ $(POST_INSTALL_EMBEDDED) install-embedded/%: INSTALL_ROOT = $(INSTALL_ROOT_EMBEDDED) dont_install := $(DONT_INSTALL:%=install/%) $(dont_install): action := $(dont_install): POST_INSTALL := true $(dont_install): POST_INSTALL_EMBEDDED := true $(dont_install): PRE_INSTALL := true #---------------------------------------------------------------------------------------- # package & archive build settings package/%: INSTALL_ROOT = $(INSTALL_ROOT_PACKAGE) archive/%: INSTALL_ROOT = $(INSTALL_ROOT_ARCHIVE) $(pkg:%=%/%): VERSION = $$(eval \ $$(egrep '_VERSION=|MAJOR=|MINOR=|PATCH_?LEVEL=|^[ ]*VERSION='\ $$($(FIND) -d -H $(SRC_DIR)/$* ! \( -path '$(SRC_DIR)/$*/*/*/*' -prune \) -name "configure.in"\ | head -1) | egrep -v '^\#')\; echo $${VERSION}) $(pkg:%=%/%): README = $$($(FIND) -H $(SRC_DIR)/$* ! \( -path '$(SRC_DIR)/$*/*/*' -prune \) \ \( -name "README" -o -name "README.txt" -o -name "README.html" \) | head -1) $(pkg:%=%/%): LICENSE = $$(LICENSE=$$($(FIND) -H $(SRC_DIR)/$* ! \( -path '$(SRC_DIR)/$*/*/*' -prune \) \ \( -name "license*" -o -name "LICENSE*" -o -name "COPYING*" \) | head -1)\;\ if [ -z "$${LICENSE}" ] \; then \ LICENSE=$$($(FIND) -H $(SRC_DIR)/$* ! \( -path '$(SRC_DIR)/$*/*/*/*' -prune \) \ \( -name "license*" -o -name "LICENSE*" -o -name "COPYING*" \) | head -1)\;\ fi \; echo $${LICENSE}) $(pkg:%=%/%): NAME = $$(echo $* | awk '{print toupper(substr($$0,1,1))substr($$0,2)}') archive/%: ARCHIVE_DIR = $(LIBDIR) dont_package := $(DONT_PACKAGE:%=package/%) $(DONT_PACKAGE:%=archive/%) $(dont_package): DONT_PACKAGE_THIS := 1 #---------------------------------------------------------------------------------------- # cvs download settings checkout = @if [ ! -d $(SRC_DIR)/$* ]; then $(MAKE) update/$*; fi; $(cvs:%=%/%): PRE_CVS = true $(cvs:%=%/%): POST_CVS = true update/%: CVSROOT = $(CVS_USER)@$(CVS_SERVER) update/%: CVS_SERVER = cvs.sourceforge.net:/cvsroot/$(CVS_PROJ) update/%: CVS_PROJ = $* update/%: CVS_PSERVER_USER = anonymous update/%: CVS_USER = $$(U=$(call conf,cvsUser.conf,$(CVS_PROJ))\; \ if [ -n "$$U" ]\; then echo ":ext:$$U"\; \ else echo ":pserver:$(CVS_PSERVER_USER)"\; fi) update/%: CVS_TAG = $(call conf,cvsTag.conf,$*) update/%: CVS_DATE = $(call conf,cvsTag.conf,defaultdate) update/%: CVS_CO = $* update/%: URL = http://example.com/ update/%: DL_EXT = tar.gz #---------------------------------------------------------------------------------------- # gcc 3.3 specific settings ifneq ($(wildcard /usr/bin/gcc-3.3),) # # use gcc 3.1 for C++ code # ifeq ($(CXX),g++) # export CXX = g++3 # endif ## enable compilation of projecbuilder based projects with gcc 3.3 ## $(PBX_BUILDSYSTEM): EXTRA_MAKE_ARGS += GCC_VERSION=3.x PRECOMPILE_PREFIX_HEADER=NO \ CC="$(CC)" CPLUSPLUS="$(CXX)" PBXBUILD="$(PBXBUILD)" XCODEBUILD="$(PBXBUILD)" ifeq ($(CC),cc) $(PBX_BUILDSYSTEM): CC = gcc endif ifeq ($(CXX),c++) $(PBX_BUILDSYSTEM): CC = g++ endif endif #---------------------------------------------------------------------------------------- # project specific build settings ### core ### tcl tk: POST_INSTALL += && if [ "$(action)" != "install-embedded" ] \; then \ if [ -n "$(INSTALL_ROOT)" -a $$(id -u) -eq 0 -a -d usr/bin ]\; \ then chgrp wheel usr usr/bin && chmod 755 usr usr/bin\; fi && \ if [ -n "$(INSTALL_ROOT)" -a $$(id -u) -eq 0 -a -d Library/Frameworks ]\; \ then chmod 775 Library/Frameworks\; fi\; \ fi tk: PRE_INSTALL += && if [ "$(action)" != "install-embedded" ] \; then \ rm -rf Applications/Utilities/Wish\ Shell.app\; \ fi tk: POST_INSTALL += && if [ "$(action)" != "install-embedded" ] \; then \ rm -rf Applications/Utilities/Wish\ Shell.app && \ ln -s ../../Library/Frameworks/Tk.framework/Resources/Wish\ Shell.app \ Applications/Utilities/Wish\ Shell.app && \ if [ -n "$(INSTALL_ROOT)" -a $$(id -u) -eq 0 -a -d Applications/Utilities ]\; \ then chmod 775 Applications Applications/Utilities\; fi\; \ fi $(pkg:%=%/tcl) $(pkg:%=%/tk): \ VERSION = $$(awk -F\" '/PATCH_LEVEL/ {print $$2}' $(SRC_DIR)/$*/generic/$*.h) package/tk: EXTRA_PACKAGE_FLAGS += -a $(core:%=archive/%): ARCHIVE_DIR = / update/tk: CVS_PROJ = tktoolkit $(tcl_sf:%=update/%): CVS_PROJ = tcl ### sampleextension ### $(pkg:%=%/sampleextension): VERSION = $$(awk -F, '/^AC_INIT/ {gsub("[^0-9.]","",$$2)\; print $$2}' \ $(SRC_DIR)/$*/configure.in) ### tclx ### $(SRC_DIR)/tclx/configure: AUTOCONF=autoconf-2.13 tclx: EXTRA_MAKE_ARGS += \ SHLIB_LD='cc -dynamiclib -prebind -seg1addr 0xc000000 $${LDFLAGS}' tclx: POST_INSTALL += && strip -x -S ./$(LIBDIR)/tclx*/libtclx*.dylib && \ $(call redo_prebinding,./$(LIBDIR)/tclx*/libtclx*.dylib) $(pkg:%=%/tclx): NAME = TclX ### tclvfs ### $(pkg:%=%/tclvfs): README = $(SRC_DIR)/$*/Readme.txt $(pkg:%=%/tclvfs): NAME = TclVfs ### incrTcl & iwidgets ### incrTcl: POST_INSTALL += && $(call fix_stub_config,itcl) $(pkg:%=%/incrTcl): VERSION = $$(awk -F\" '/PATCH_LEVEL/ {print $$2}' $(SRC_DIR)/$*/itcl/generic/itcl.h) $(BUILD_DIR)/iwidgets/Makefile: EXTRA_CONFIGURE_ARGS = --with-itcl=$(SRC_DIR)/incrTcl iwidgets: POST_INSTALL += && cd ./$(LIBDIR) && rm -f $* && ln -s $** $* && cd ../.. $(pkg:%=%/iwidgets): NAME = IWidgets update/incrTcl update/iwidgets: CVS_PROJ = incrtcl ### tktable & vu ### tktable vu: EXTRA_MAKE_ARGS += CPPFLAGS+=-DMAC_OSX_TK LIBS= $(pkg:%=%/tktable): NAME = TkTable update/vu: CVS_PROJ = tktable $(pkg:%=%/tktable): VERSION = $$(awk -F, '/^AC_INIT/ {gsub("[^0-9.]","",$$2)\; print $$2}' \ $(SRC_DIR)/$*/configure.in) ### tcllib_sf ### install/tcllib install/tklib: action:=install install-htmldoc $(pkg:%=%/tcllib) $(pkg:%=%/tklib): VERSION = $$($(TCLSH) $(SRC_DIR)/$*/sak.tcl version) $(pkg:%=%/bwidget): NAME = BWidget $(tcllib_sf:%=update/%): CVS_PROJ = tcllib ### memchan ### memchan: EXTRA_MAKE_ARGS += TCLLIBPATH="$(SRC_DIR)/tcllib/modules" ### trf & trfcrypt ### $(SRC_DIR)/trf/configure $(SRC_DIR)/trfcrypt/configure: AUTOCONF=autoconf-2.13 trf trfcrypt: EXTRA_MAKE_ARGS += 'CPPFLAGS=-I/usr/include/openssl -I/usr/include/crypto \ -DLIBDES_LIB_NAME=\"libdes425.dylib\" -DNCOMPAT \ -DZ_LIB_NAME=\"libz.dylib\" -DSSL_LIB_NAME=\"libcrypto.dylib\" -UHAVE_zlibtcl_PACKAGE' update/trf: CVS_PROJ = tcltrf $(SRC_DIR)/trfcrypt/configure: PRE_AUTOCONF = chmod -f +w $(SRC_DIR)/$*/configure $(BUILD_DIR)/trfcrypt/Makefile: EXTRA_CONFIGURE_ARGS = \ --with-trf-include-dir=$(SRC_DIR)/trf/generic \ --with-trf-lib-dir=$(BUILD_DIR)/trf trfcrypt: POST_INSTALL += && $(call fix_pkg,Trfcrypt,/) install/trfcrypt: EXTRA_INSTALL_ARGS = TCLSH_PROG='TCLLIBPATH=$(BUILD_DIR)/trf $(TCLSH)' $(pkg:%=%/trfcrypt): NAME = TrfCrypt update/trfcrypt: URL = http://www.oche.de/~akupries/soft/trfcrypt/download/ $(cvs:%=%/trfcrypt): EXTRA_DIFF_ARGS = -x defs.old ### tls ### $(BUILD_DIR)/tls/Makefile: EXTRA_CONFIGURE_ARGS = \ --with-ssl-dir=/usr tls: POST_INSTALL += && $(call fix_pkg,$*, ) $(pkg:%=%/tls): NAME = TLS ### tclhttpd ### $(SRC_DIR)/tclhttpd/configure: AUTOCONF=autoconf-2.13 tclhttpd: POST_INSTALL += && $(call fix_pkg,crypt, ) && $(call fix_pkg,limit, ) $(pkg:%=%/tclhttpd): NAME = TclHttpd ### tcLex ### $(cvs:%=%/tcLex): POST_CVS = rm -f $(SRC_DIR)/$*/unix \; ln -s src $(SRC_DIR)/$*/unix\; \ touch $(SRC_DIR)/$*/src/configure.in patch/tcLex: PRE_CVS = rm -f $(SRC_DIR)/$*/src/configure $(pkg:%=%/tcLex): VERSION = $$(awk '/^PROJECT_VERSION[ \t]*=/ {print $$3}' \ $(SRC_DIR)/$*/unix/Makefile.in) update/tcLex: CVS_PROJ = tclex ### tkimg ### tkimg: EXTRA_MAKE_ARGS += AM_CPPFLAGS+=-DMAC_OSX_TK LIBS= tkimg: POST_INSTALL += && \ $(call fix_stub_config2,jpegtcl,Img) && \ $(call fix_stub_config2,pngtcl,Img) && \ $(call fix_stub_config2,tifftcl,Img) && \ $(call fix_stub_config2,zlibtcl,Img) && \ $(call fix_stub_config2,$*,Img) $(pkg:%=%/tkimg): NAME = TkImg $(cvs:%=%/tkimg): POST_CVS = $(call update_config,$(SRC_DIR)/$*/libjpeg)\; $(call update_config,$(SRC_DIR)/$*/libtiff) $(cvs:%=%/tkimg): PRE_CVS = $(call restore_config,$(SRC_DIR)/$*/libjpeg)\; $(call restore_config,$(SRC_DIR)/$*/libtiff) ### expect ### $(BUILD_DIR)/expect/Makefile: EXTRA_CONFIGURE_ARGS = --with-tclinclude=$(SRC_DIR)/tcl \ --with-tkinclude=$(SRC_DIR)/tk --enable-shared expect: POST_INSTALL += && $(call fix_pkg,$*, ) && \ cd ./$(LIBDIR) && rm -f libexpect*.a bin/expectk && (rmdir -p lib/expect* 2>&- || true) && \ for b in bin/expect \; do install_name_tool -change \ $$(otool -L $$b | awk '/libexpect/ {print $$1 " $(LIBDIR)/" substr($$1,4,length($$1)-9) "/" $$1}') \ $$b \; done && cd ../.. $(cvs:%=%/expect): POST_CVS = $(call update_config,$(SRC_DIR)/$*) $(cvs:%=%/expect): PRE_CVS = $(call restore_config,$(SRC_DIR)/$*) ### tkcon ### install/tkcon $(pkg:%=%/tkcon): VERSION = $$(awk -F\" '/VERSION / {print $$2}' $(SRC_DIR)/$*/tkcon.tcl) ### snit ### # install/snit $(pkg:%=%/snit): VERSION = $$(awk '/package ifneeded/ {print $$4}' $(SRC_DIR)/$*/pkgIndex.tcl) # update/snit: URL = http://www.wjduquette.com/snit/ ### snack ### snack: POST_INSTALL += && $(call fix_pkg,$*, ) $(pkg:%=%/snack): VERSION = $$(awk '/^VERSION[ \t]*=/ {print $$3}' $(SRC_DIR)/$*/unix/Makefile.in) $(pkg:%=%/snack): LICENSE = $(SRC_DIR)/$*/BSD.txt update/snack: URL = http://www.speech.kth.se/~kare/ update/snack: POST_CVS = $(MAKE) -C $(CURDIR) update/tclconfig && \ ln -fs ../../config/tcl.m4 $(SRC_DIR)/$*/unix $(cvs:%=%/snack): EXTRA_DIFF_ARGS = -x tcl.m4 ### TclAE ### TclAE: EXTRA_PBXBUILD_ARGS = -target TclAE INSTALL_ROOT='$$(SYMROOT)/Deployment.build/' TclAE: PROJ_DIR = Build install/TclAE: AFTER_OVERRIDES = INSTALL_ROOT=$(INSTALL_ROOT)$(LIBDIR)/ $(pkg:%=%/TclAE): VERSION = $$(tr "\r" "\n" < $(SRC_DIR)/$*/Build/Headers/tclAEid.h | \ awk -F\" '/TCLAE_VERSION/ {print $$2}') $(pkg:%=%/TclAE): README = $(SRC_DIR)/$*/Help/TclAE Help/index.html update/TclAE: URL = http://rutherglen.ics.mq.edu.au/~steffen/tcltk/$*/ ### tclspeech ### $(pkg:%=%/tclspeech): NAME = TclSpeech $(pkg:%=%/tclspeech): VERSION = $$(awk '/^\t*DYLIB_CURRENT_VERSION/ {sub("\;","",$$3)\; print $$3}' $(SRC_DIR)/$*/$*.pbproj/project.pbxproj) $(pkg:%=%/tclspeech): README = $(SRC_DIR)/$*/speech.html ### tclbitprint ### $(pkg:%=%/tclbitprint): NAME = MacCarbonPrint $(pkg:%=%/tclbitprint): VERSION = $$(awk '/^\t*DYLIB_CURRENT_VERSION/ {sub("\;","",$$3)\; print $$3}' \ $(SRC_DIR)/$*/MacCarbonPrint.pbproj/project.pbxproj) $(pkg:%=%/tclbitprint): README = $(SRC_DIR)/$*/docs/maccarbonprint.html tclbitprint: POST_INSTALL += && cp -p $(SRC_DIR)/$*/docs/maccarbonprint.html ./$(LIBDIR)/MacCarbonPrint* ### quicktimetcl ### $(pkg:%=%/quicktimetcl): NAME = QuickTimeTcl $(pkg:%=%/quicktimetcl): VERSION = $$(awk '/^\t*DYLIB_CURRENT_VERSION/ {sub("\;","",$$3)\; print $$3}' $(SRC_DIR)/$*/$*.pbproj/project.pbxproj) $(pkg:%=%/quicktimetcl): README = $(SRC_DIR)/$*/README.rtf ### tclresource ### tclresource: PROJ_DIR = Source update/tclresource: CVS_CO = -d $* Source Help $(pkg:%=%/tclresource): NAME = TclResource $(pkg:%=%/tclresource): VERSION = $$(awk '/^\t*DYLIB_CURRENT_VERSION/ {sub("\;","",$$3)\; print $$3}' $(SRC_DIR)/$*/Source/tclResource.pbproj/project.pbxproj) $(pkg:%=%/tclresource): README = $(SRC_DIR)/$*/Help/TclResourceHelp.html ### tcladdressbook ### tcladdressbook: PROJ_DIR = Source update/tcladdressbook: CVS_CO = -d $* Source Help Contribs $(pkg:%=%/tcladdressbook): NAME = TclAddressBook $(pkg:%=%/tcladdressbook): VERSION = $$(awk '/^\t*DYLIB_CURRENT_VERSION/ {sub("\;","",$$3)\; print $$3}' $(SRC_DIR)/$*/Source/TclAddressBook.pbproj/project.pbxproj) $(pkg:%=%/tcladdressbook): README = $(SRC_DIR)/$*/Help/TclAddressBookHelp.html ### tclsoap ### $(pkg:%=%/tclsoap): NAME = TclSOAP $(pkg:%=%/tclsoap): README = $(SRC_DIR)/$*/TclSOAP.ANN ### tclxml ### $(SRC_DIR)/tclxml/configure: AUTOCONF=autoconf-2.52 tclxml: POST_MAKE = $(MAKE) tclexpat tclxml: POST_INSTALL += && $(call fix_stub_config,Tclxml) && \ $(MAKE) -C $(CURDIR) $(action)/tclexpat $(pkg:%=%/tclxml): NAME = TclXML $(cvs:%=%/tclxml): POST_CVS = rm -f $(SRC_DIR)/tclexpat && ln -fs $*/expat $(SRC_DIR)/tclexpat $(tclxml_sf:%=update/%): CVS_PROJ = tclxml ### tcldom ### $(SRC_DIR)/tcldom/configure: AUTOCONF=autoconf-2.52 tcldom: POST_MAKE = $(MAKE) src-libxml2 tcldom: POST_INSTALL += && $(call fix_stub_config,Tcldom) && \ cp -p $(SRC_DIR)/$*/examples/*.tcl ./$(LIBDIR)/Tcldom* && \ $(MAKE) -C $(CURDIR) $(action)/src-libxml2 $(pkg:%=%/tcldom): NAME = TclDOM $(cvs:%=%/tcldom): POST_CVS = ln -fs $*/src-libxml2 $(SRC_DIR) $(cvs:%=%/tcldom): PATCH_EXCL_CONFDIR = |src-libxml2 $(SRC_DIR)/src-libxml2/configure: AUTOCONF=autoconf-2.52 $(BUILD_DIR)/src-libxml2/Makefile: PRE_CONFIGURE = $(MAKE) libxml2 && \ ln -fs .libs/libxml2.a $(BUILD_DIR)/libxml2 $(BUILD_DIR)/src-libxml2/Makefile: EXTRA_CONFIGURE_ARGS = \ --with-libxml2-lib=$(BUILD_DIR)/libxml2 \ --with-libxml2-include=$(SRC_DIR)/libxml2/include \ --without-iconv-lib src-libxml2: EXTRA_MAKE_ARGS += "LIBS=-lz" \ "AM_CPPFLAGS=-I$(SRC_DIR)/tcldom -I$(BUILD_DIR)/libxml2/include" src-libxml2: POST_INSTALL += && $(call fix_stub_config,tcldomxml) ### tclxslt ### $(SRC_DIR)/tclxslt/configure: AUTOCONF=autoconf-2.52 $(BUILD_DIR)/tclxslt/Makefile: PRE_CONFIGURE = $(MAKE) libxslt && \ ln -fs .libs/libxslt.a $(BUILD_DIR)/libxslt/libxslt && \ ln -fs .libs/libexslt.a $(BUILD_DIR)/libxslt/libexslt $(BUILD_DIR)/tclxslt/Makefile: EXTRA_CONFIGURE_ARGS = \ --with-libxml2-lib=$(BUILD_DIR)/libxml2 \ --with-libxml2-include=$(SRC_DIR)/libxml2/include \ --with-tcldomxml=$(BUILD_DIR)/src-libxml2 \ --with-libxslt-lib=$(BUILD_DIR)/libxslt/libxslt \ --with-libxslt-include=$(SRC_DIR)/libxslt \ --with-libexslt-lib=$(BUILD_DIR)/libxslt/libexslt \ --with-libexslt-include=$(SRC_DIR)/libxslt tclxslt: EXTRA_MAKE_ARGS += "LIBS=-lz" \ "AM_CPPFLAGS=-I$(SRC_DIR)/tcldom -I$(SRC_DIR)/tcldom/src-libxml2 \ -I$(BUILD_DIR)/libxml2/include -I$(BUILD_DIR)/libxslt \ -I$(BUILD_DIR)/libxslt/libxslt -I$(BUILD_DIR)/libxslt/libexslt" $(pkg:%=%/tclxslt): NAME = TclXSLT ### libxml2 & libxslt ### $(cvs:%=%/libxml2): POST_CVS = touch $(SRC_DIR)/$*/configure $(SRC_DIR)/libxml2/configure $(SRC_DIR)/libxslt/configure: \ PRE_AUTOCONF = cd $(SRC_DIR)/$* && \ if [ -n "$$(whereis aclocal)" -a -n "$$(whereis automake)" ]\; then \ glibtoolize --copy --force && aclocal && \ automake --add-missing --force-missing --copy\; fi $(BUILD_DIR)/libxml2/Makefile: PRE_CONFIGURE = rm -f $(SRC_DIR)/$*/include/libxml/xmlversion.h $(BUILD_DIR)/libxml2/Makefile: EXTRA_CONFIGURE_ARGS = --without-python --without-iconv \ --libdir=$(PREFIX)/lib libxml2: EXTRA_MAKE_ARGS += "AM_CFLAGS=-fno-common" $(BUILD_DIR)/libxslt/Makefile: EXTRA_CONFIGURE_ARGS = --without-python \ --with-libxml-src=$(BUILD_DIR)/libxml2 --libdir=$(PREFIX)/lib libxslt: EXTRA_MAKE_ARGS += "LIBXML_CFLAGS=-I$(BUILD_DIR)/libxml2/include \ -I$(SRC_DIR)/libxml2/include -fno-common" EXTRA_LIBS=-lz update/libxml2 update/libxslt: URL = ftp://xmlsoft.org/ update/libxml2 update/libxslt: CVS_SERVER = anoncvs.gnome.org:/cvs/gnome $(cvs:%=%/libxml2): EXTRA_DIFF_ARGS = -x xmlversion.h ### tdom ### $(cvs:%=%/tdom): POST_CVS = ln -fs $*/extensions/{tnc,tdomhtml} $(SRC_DIR) $(SRC_DIR)/tdom/configure $(SRC_DIR)/tnc/configure: AUTOCONF=autoconf-2.52 $(cvs:%=%/tdom): PATCH_EXCL_CONFDIR = |extensions\/tnc tdom: PRE_MAKE = ln -fs $(SRC_DIR)/$*/unix/*.c $(BUILD_DIR)/$* tdom: POST_MAKE = $(MAKE) tnc tdomhtml tdom: POST_INSTALL += && $(call fix_stub_config,tdom) && \ rm -f ./$(PREFIX)/bin/tcldomsh && \ rmdir -p ./$(PREFIX)/bin 2>&- || true && \ $(MAKE) -C $(CURDIR) $(action)/tnc $(action)/tdomhtml $(pkg:%=%/tdom): NAME = tDOM update/tdom: CVS_SERVER = cvs.tdom.org:/usr/local/pubcvs $(BUILD_DIR)/tnc/Makefile: EXTRA_CONFIGURE_ARGS = \ --with-tdom=$(BUILD_DIR)/tdom ### htmlwidget ### $(SRC_DIR)/htmlwidget/configure: AUTOCONF=autoconf-2.13 htmlwidget: EXTRA_MAKE_ARGS += CPPFLAGS+=-DMAC_OSX_TK LIBS= htmlwidget: POST_MAKE = cd $(BUILD_DIR)/$* \ && $(TCLSH) $(SRC_DIR)/$*/webpage/mkwebpage.tcl $(pkg:%=%/htmlwidget): NAME = TkHtml $(pkg:%=%/htmlwidget): README = $(BUILD_DIR)/$*/index.html $(pkg:%=%/htmlwidget): LICENSE = $(SRC_DIR)/$*/COPYRIGHT update/htmlwidget: CVS_PROJ = tktable ### tix ### $(SRC_DIR)/tix/unix/configure: AUTOCONF=autoconf-2.13 $(BUILD_DIR)/tix/Makefile: EXTRA_CONFIGURE_ARGS = --enable-stubs --enable-shared tix: EXTRA_MAKE_ARGS += CPPFLAGS+='-DMAC_OSX_TK -I$(SRC_DIR)/tk/macosx' tix: POST_INSTALL += && $(call fix_pkg,$*, ) && \ $(call fix_pkgIndex,$*,sed 's/\[file dirname \([^]]*\)]/\1/') && \ rm -f ./$(PREFIX)/bin/tixwish* ./$(PREFIX)/man/man1/tixwish* && \ rmdir -p ./$(PREFIX)/bin ./$(PREFIX)/man/man1 2>&- || true $(pkg:%=%/tix): README = $(SRC_DIR)/$*/ABOUT.html ### tktreectrl ### $(cvs:%=%/tktreectrl): POST_CVS = ln -fs configure.ac $(SRC_DIR)/$*/configure.in && \ touch $(SRC_DIR)/$*/configure tktreectrl: EXTRA_MAKE_ARGS += CPPFLAGS+='-DMAC_OSX_TK -I$(SRC_DIR)/tk/macosx' $(pkg:%=%/tktreectrl): NAME = Treectrl $(pkg:%=%/tktreectrl): README = $(SRC_DIR)/$*/doc/treectrl.html ### tclpro ### tclcompiler: EXTRA_MAKE_ARGS += CPPFLAGS='-I$(SRC_DIR)/$* -I$(SRC_DIR)/tbcload' $(pkg:%=%/tclcompiler): NAME = Compiler $(SRC_DIR)/tclparser/configure: AUTOCONF=autoconf-2.13 $(pkg:%=%/tclparser): NAME = Parser $(tclpro:%=update/%) update/config: CVS_PROJ = tclpro ### Launcher ### Launcher: MAKE_ENV += CC= $(pkg:%=%/Launcher): VERSION = $$(awk '/CFBundleVersion/ {getline\; split($$0,a,"<[^>]*>")\; print a[2]}' $(SRC_DIR)/$*/$*.pbproj/project.pbxproj) $(pkg:%=%/Launcher): README = $(SRC_DIR)/$*/Readme.rtf $(pkg:%=%/Launcher): LICENSE = $(SRC_DIR)/$*/License.rtf package/Launcher: EXTRA_PACKAGE_FLAGS += -a archive/Launcher: ARCHIVE_DIR = /Applications/Utilities update/Launcher: URL = http://rutherglen.ics.mq.edu.au/~steffen/tcltk/$*/ ### equi4 ### $(equi4:%=update/%): CVS_SERVER = equi4.com:/home/cvs EQUI4 = http://www.equi4.com ### metakit ### $(BUILD_DIR)/metakit/Makefile: EXTRA_CONFIGURE_ARGS = \ --with-tcl=$(BUILD_DIR)/tcl/Tcl.framework/Headers metakit: EXTRA_MAKE_ARGS += tcllibdir=$(LIBDIR) metakit: POST_MAKE = $(MAKE) oomk install/metakit: action:=install-tcl install/metakit: POST_INSTALL += && $(MAKE) -C $(CURDIR) install/oomk $(pkg:%=%/metakit): VERSION = $$(awk '/package ifneeded Mk4tcl/ {print $$5}' $(SRC_DIR)/$*/unix/Makefile.in) $(pkg:%=%/metakit): NAME = Mk4Tcl ### oomk ### install/oomk: VERSION = $$(awk '/package ifneeded/ {print $$4}' $(SRC_DIR)/$*/lib/$*/pkgIndex.tcl) update/oomk: URL = $(EQUI4)/pub/sk/ update/oomk: DL_EXT = kit ### critlib ### install-embedded/critlib: POST_INSTALL += && rm -f ./$(PREFIX)/$*/*README* $(pkg:%=%/critlib): README = $(SRC_DIR)/$*/README.html $(pkg:%=%/critlib): VERSION = $$(awk '/Last updated on/ {gsub("/","-",$$5)\; print substr($$5,1,10)}' \ $(SRC_DIR)/$*/README.html) $(pkg:%=%/critlib): NAME = CritLib $(cvs:%=%/critlib): EXTRA_DIFF_ARGS = -x lib -x "critcl*" -x cblas -x rhtml_c -x xre_c update/critlib: URL = $(EQUI4)/$*/ ### tclkit ### tclkit: TCLKIT_VERSION = 001 tclkit: POST_MAKE = $(MAKE) sdx wikit critcl install/tclkit: POST_INSTALL += && $(MAKE) -C $(CURDIR) $(action)/sdx $(action)/wikit $(action)/critcl $(cvs:%=%/tclkit): POST_CVS = cd $(SRC_DIR)/$* && \ $(call url_get,$(EQUI4)/pub/tk/tars/runtime.kit) && \ $(call url_get,$(EQUI4)/pub/tk/tars/zlib.tar.gz) && \ $(call url_get,$(EQUI4)/pub/tk/8.4.2/tclkit-darwin-ppc.gz) package/tclkit: VERSION = $$(awk -F\" '/PATCH_LEVEL/ {print $$2}' $(BUILD_DIR)/$*/src/tcl/generic/tcl.h\ ) $$(awk '{print $$3}' $(BUILD_DIR)/$*/tars/runtime.vfs/config.tcl) archive/tclkit: ARCHIVE_DIR = $(PREFIX)/bin/tclkit archive/tclkit: NAME = tclkit-darwin-ppc archive/tclkit: README = archive/tclkit: LICENSE = archive/tclkit: VERSION = $$(awk -F\" '/PATCH_LEVEL/ {print $$2}' $(BUILD_DIR)/$*/src/tcl/generic/tcl.h) ### wishkit ### wishkit: EXTRA_MAKE_ARGS = INSTALL_ROOT=$(INSTALL_ROOT)/$(LIBDIR)/tmp/ wishkit: POST_INSTALL += && cd ./$(LIBDIR) && rm -rf Wishkit.app && chmod -R u+w tmp && \ mv -f tmp/Wish\ Shell.app Wishkit.app && rmdir -p tmp && cd Wishkit.app/Contents && \ mv -f MacOS/Wish\ Shell MacOS/Wishkit && \ awk 's==1 {sub("Wish( Shell)?","Wishkit")\; s=0}\; /CFBundleExecutable|CFBundleName/ {s=1}\; {print}' \ Info.plist > Info.plist.1 && mv -f Info.plist.1 Info.plist && \ (cd Frameworks/Tcl.framework/Resources/Scripts && mv init.tcl realinit.tcl && \ echo 'set tcl_pkgPath [lsearch -all -inline $$tcl_pkgPath \ [file join [file dirname [file dirname [info nameofexecutable]]] *]]\; \ source [file join [file dirname [info script]] realinit.tcl]' > init.tcl) && \ rm -rf lib/{oomk*,itk*,itcl*/libitclstub*,Memchan*/libMemchanstub*,Trf*/libTrfstub*,vfs*/{{ftp,http,tar,tclproc,test,webdav}vfs.tcl,vfsUrl.tcl}} \ Frameworks/Tcl.framework/{Resources/Scripts/{http1.0,tclAppInit.c},{,Versions/Current/}{Headers,PrivateHeaders,libtclstub*,tclConfig.sh}} \ Frameworks/Tk.framework/{Resources/Scripts/{demos,images},{,Versions/Current/}{Headers,PrivateHeaders,libtkstub*,tkConfig.sh}} \ $$(ls Frameworks/Tcl.framework/Resources/Scripts/encoding/*.enc | \ egrep -v '/(ascii|cp1252|iso8859-[12]|macRoman)\.enc$$') && \ (cd lib/vfs* && egrep -v '(ftp|http|tar|tclproc|test|webdav|tk)vfs.tcl|vfsUrl.tcl' \ pkgIndex.tcl > pkgIndex.tcl.1 && mv -f pkgIndex.tcl.1 pkgIndex.tcl) && \ cd ../../../.. && mkdir -p ./$(PREFIX)/bin && cd ./$(PREFIX)/bin && \ printf '\#!/bin/sh\n"$$(dirname $$0)' > wishkit && \ printf "$$(echo $(PREFIX)/bin | sed -e 's|/[^/][^/]*|/..|g')$(PREFIX)" >> wishkit && \ printf '/Wishkit.app/Contents/MacOS/Wishkit" "$$@"\n' >> wishkit && \ chmod +x wishkit && cd ../../.. $(pkg:%=%/wishkit): VERSION = $$(awk -F\" '/PATCH_LEVEL/ {print $$2}' $(SRC_DIR)/tcl/generic/tcl.h) package/wishkit: README = $(SRC_DIR)/tk/macosx/README package/wishkit: LICENSE = $(SRC_DIR)/tk/license.terms archive/wishkit: ARCHIVE_DIR = $(LIBDIR)/Wishkit.app archive/wishkit: NAME = Wishkit.app archive/wishkit: README = archive/wishkit: LICENSE = ### standalone ### install/standalone: INSTALL_ROOT = $(INSTALL_ROOT_EMBEDDED) archive/standalone: ARCHIVE_DIR = / archive/standalone: NAME = TclTkAquaStandalone archive/standalone: README = $(SRC_DIR)/tk/macosx/README archive/standalone: LICENSE = $(SRC_DIR)/tk/license.terms archive/standalone: VERSION = $$(awk -F\" '/PATCH_LEVEL/ {print $$2}' $(SRC_DIR)/tcl/generic/tcl.h) ### starkit ### $(starkit:%=update/%): URL = $(EQUI4)/pub/sk/ $(starkit:%=update/%): DL_EXT = kit ### e4graph ### $(BUILD_DIR)/e4graph/all/makefile.include: PRE_CONFIGURE = $(MAKE) expat \; $(MAKE) metakit \; \ $(DO_RSYNC) $(SRC_DIR)/$*/ $(BUILD_DIR)/$*/ $(BUILD_DIR)/e4graph/all/makefile.include: EXTRA_CONFIGURE_ARGS = \ --enable-tcl --enable-xml \ --with-metakit=$(SRC_DIR)/metakit --with-expat=$(BUILD_DIR)/expat e4graph: PRE_MAKE = $(DO_RSYNC) $(SRC_DIR)/$*/ $(BUILD_DIR)/$*/ \;\ ln -fs .libs/libmk4.al $(BUILD_DIR)/metakit/libmk4.a \; \ ln -fs .libs/libexpat.a $(BUILD_DIR)/expat e4graph: EXTRA_MAKE_ARGS += METAKIT_LIB+='$(BUILD_DIR)/metakit' \ EXPAT_LIB+='$(BUILD_DIR)/expat' install/e4graph: EXTRA_MAKE_ARGS += libdir=$(INSTALL_ROOT)$(LIBDIR)/e4graph TCL_PKG=$(INSTALL_ROOT)$(LIBDIR) e4graph: POST_INSTALL += && rm -f ./$(PREFIX)/bin/testcore{,s} ./$(LIBDIR)/$*/libe4graphs.a && \ rmdir -p ./$(PREFIX)/bin 2>&- || true && \ $(call fix_pkgIndex,tgraph,sed 's/loadIfNotTcl843 \([^ ]*\)\]/loadIfNotTcl843 [file join $$$$dir \1]]/') && \ cd ./$(LIBDIR) && g=$$(ls -d tgraph*) && mv -f $*/* ./$${g}/ && rmdir -p $* && \ t=$(LIBDIR)/$${g} && cd ./$${g} && \ $(call fix_install_id,e4graph,$$$${t}) && \ $(call fix_install_id,e4xml,$$$${t}) && \ $(call fix_install_id,tgraph,$$$${t}) && \ $(call fix_install_id,txml,$$$${t}) && \ $(call fix_install_name,e4xml,e4graph,$$$${t}) && \ $(call fix_install_name,tgraph,e4graph,$$$${t}) && \ $(call fix_install_name,txml,e4graph,$$$${t}) && \ $(call fix_install_name,txml,tgraph,$$$${t}) && \ $(call fix_install_name,txml,e4xml,$$$${t}) $(pkg:%=%/e4graph): VERSION = $$(awk -F= '/^VERSION[ \t]*=/ {print $$2}' $(SRC_DIR)/$*/all/configure.in) $(pkg:%=%/e4graph): README = $(SRC_DIR)/$*/readme.html $(pkg:%=%/e4graph): NAME = e4Graph ### expat ### $(SRC_DIR)/expat/configure: PRE_AUTOCONF = cd $(SRC_DIR)/$* && export AUTOCONF=autoconf-2.57 && ./buildconf.sh expat: POST_MAKE = rm -f $(BUILD_DIR)/$*/include \; \ ln -s $(SRC_DIR)/$*/lib $(BUILD_DIR)/$*/include ### xotcl ### xotcl: POST_INSTALL += && $(call fix_pkg,$*, ) update/xotcl: URL = http://media.wu-wien.ac.at/download/ $(pkg:%=%/xotcl): NAME = XOTcl $(pkg:%=%/xotcl): LICENSE = $(SRC_DIR)/$*/COPYRIGHT $(pkg:%=%/xotcl): VERSION = $$(eval \ $$(egrep '_VERSION=|RELEASE_LEVEL=|PATCH_?LEVEL=|^FULLVERSION=' \ $(SRC_DIR)/$*/unix/configure.in | egrep -v '^\#')\; echo $${FULLVERSION}) $(cvs:%=%/xotcl): EXTRA_DIFF_ARGS = -x doc -x Makefile ### swig ### $(SRC_DIR)/swig/configure: PRE_AUTOCONF = cd $(SRC_DIR)/$* && \ test -d Tools/config || mkdir Tools/config && \ export LIBTOOL=libtool-1.5 && export AUTOCONF=autoconf-2.57 && \ aclocal-1.7 -I Tools/config && autoheader-2.57 && \ libtoolize-1.5 --force --copy && \ automake-1.7 --add-missing --copy --force-missing $(BUILD_DIR)/swig/Makefile: EXTRA_CONFIGURE_ARGS = --libdir=$(PREFIX)/lib \ --without-perl5 --without-python --without-java --without-javac \ --without-ruby --without-guile --without-php4 --without-ocaml \ --without-pike --without-chicken --without-cil-interpreter \ --without-csharp-compiler swig: MAKE_ENV += CFLAGS=-Os CXXFLAGS=-Os swig: EXTRA_MAKE_ARGS += $$(if [ -z "$(action)" ]\; then \ echo "source runtime"\; else if [ "$(action)" = install ]\; then \ echo "install-runtime"\; fi\; fi) swig: POST_INSTALL += && cd ./$(LIBDIR)/lib/$** && \ rm -rf chicken csharp guile java mzscheme ocaml \ perl5 php4 pike python ruby update/swig: CVS_SERVER = swig.cs.uchicago.edu:/cvsroot update/swig: CVS_PSERVER_USER = cvs update/swig: CVS_CO = -d $* SWIG $(pkg:%=%/swig): NAME = SWIG $(pkg:%=%/swig): VERSION = $$(awk -F, '/^AC_INIT/ {gsub("[^0-9.]","",$$2)\; print $$2}' \ $(SRC_DIR)/$*/configure.in) ### sqlite ### # $(BUILD_DIR)/sqlite/Makefile: CONFIGURE_ENV = \ # config_TARGET_TCL_INC=-I$(BUILD_DIR)/tcl/Tcl.framework/Headers \ # config_TARGET_TCL_LIBS=$(BUILD_DIR)/tcl/Tcl.framework/Tcl # config_TARGET_TCL_STUB_LIBS=$(BUILD_DIR)/tcl/Tcl.framework/libtclstub8.*.a # sqlite: action = all tclsqlite testfixture # update/sqlite: CVS_SERVER = www.sqlite.org:/sqlite ### embedded ### install-embedded/tk: POST_INSTALL_EMBEDDED = \ rm -rf Wish\ Shell.app && \ mv Applications/Utilities/Wish\ Shell.app . && \ rmdir -p Applications/Utilities 2>&- $(ext:%=install-embedded/%): POST_INSTALL_EMBEDDED = chmod +w Wish\ Shell.app/Contents && \ mkdir -p Wish\ Shell.app/Contents/lib && for f in ./$(LIBDIR)/*\; \ { if echo $$(basename $$f) | egrep -q -v -e '^(bin|lib|include|man)$$'\; \ then rm -rf Wish\ Shell.app/Contents/lib/$$(basename $$f) && \ mv -f $$f Wish\ Shell.app/Contents/lib\; fi\; \ } && rm -rf usr Library ### core_x11 ### $(BUILD_DIR)_x11/tk/Makefile: EXTRA_CONFIGURE_ARGS = --with-tcl=../tcl $(core_x11:%=install/%): INSTALL_ROOT := $(TMP_DIR)/install_x11/ $(core_x11:%=install/%): action := install-strip tcl_x11: POST_INSTALL += && $(call redo_prebinding,usr/local/bin/tclsh*) tk_x11: POST_INSTALL += && \ $(call redo_prebinding,usr/local/lib/libtk*.dylib usr/local/bin/wish*) tcl_x11 tk_x11: POST_INSTALL += && if [ "$(action)" != "install-embedded" ] \; then \ if [ -n "$(INSTALL_ROOT)" -a $$(id -u) -eq 0 -a -d usr/local ]\; \ then chgrp wheel usr usr/local usr/local/* && \ chmod 755 usr usr/local usr/local/* \; fi\; \ fi $(core_x11:%=archive/%): ARCHIVE_DIR = / archive/tcl_x11: NAME = Tcl_X11 archive/tk_x11: NAME = Tk_X11 $(core_x11:%=archive/%): README = $(SRC_DIR)/$$(echo $* | sed -e 's/_x11//')/README $(core_x11:%=archive/%): LICENSE = $(SRC_DIR)/$$(echo $* | sed -e 's/_x11//')/license.terms $(core_x11:%=archive/%): VERSION = $$(awk -F\" '/PATCH_LEVEL/ {print $$2}' \ $(SRC_DIR)/$$(echo $* | sed -e 's/_x11//')/generic/$$(echo $* | sed -e 's/_x11//').h) #---------------------------------------------------------------------------------------- # project specific dependencies # (disabled for now, depend on order in projects list instead) #tk: tcl #tk_x11: tcl_x11 #iwidgets: incrTcl #trfcrypt: trf #$(ext): core install/core #---------------------------------------------------------------------------------------- # TEA config need_config := $(foreach conf,$(NEED_CONFIG),$(cvs:%=%/$(conf))) $(need_config): POST_CVS = rm -rf $(SRC_DIR)/$*/config \; ln -fs ../tclconfig $(SRC_DIR)/$*/config $(need_config): PRE_CVS = rm -rf $(SRC_DIR)/$*/config $(cvs:%=%/config): POST_CVS = $(call update_config,$(SRC_DIR)/$*) $(cvs:%=%/config): PRE_CVS = $(call restore_config,$(SRC_DIR)/$*) $(cvs:%=%/tclconfig): POST_CVS = $(call update_config,$(SRC_DIR)/$*) \; \ ln -fs ../config/{installFile.tcl,mkinstalldirs} $(SRC_DIR)/$* $(cvs:%=%/tclconfig): PRE_CVS = $(call restore_config,$(SRC_DIR)/$*) \; \ rm -f $(SRC_DIR)/$*/{installFile.tcl,mkinstalldirs} $(NEED_CONFIG:%=update/%): update/tclconfig update/tclconfig: update/config #---------------------------------------------------------------------------------------- # build rules ### core ### $(core): %: $(checkout) $(pre_install) $(pre_make) $(MAKE_ENV) $(MAKE) -C $(SRC_DIR)/$*/macosx $(action) $(INSTALL_ARGS) $(EXTRA_MAKE_ARGS) $(post_make) $(post_install) ### tea ### define tea_autoconf @echo "*** $* $(AUTOCONF) ***" if [ $(SRC_DIR)/$*$(1)/configure.in -nt $(SRC_DIR)/$*$(1)/configure ]; then $(PRE_AUTOCONF); fi cd $(SRC_DIR)/$*$(1) && if [ configure.in -nt configure ]; then $(AUTOCONF); fi endef define tea_configure $(call tea_configure2,$(1),) endef define tea_configure2 @echo "*** $* configure ***" $(PRE_CONFIGURE) mkdir -p $(BUILD_DIR)/$*$(2) && cd $(BUILD_DIR)/$*$(2) && \ chmod +x $(SRC_DIR)/$*$(1)/configure && \ $(CONFIGURE_ENV) $(SRC_DIR)/$*$(1)/configure \ --prefix=$(PREFIX) --libdir=$(LIBDIR) \ --with-tcl=$(BUILD_DIR)/tcl/Tcl.framework \ --with-tclinclude=$(BUILD_DIR)/tcl/Tcl.framework/Headers \ --with-tk=$(BUILD_DIR)/tk/Tk.framework \ --with-tkinclude=$(BUILD_DIR)/tk/Tk.framework/Headers \ --enable-threads $(EXTRA_CONFIGURE_ARGS) endef $(tea:%=$(SRC_DIR)/%/configure.in): $(SRC_DIR)/%/configure.in: $(checkout) $(tea_unix:%=$(SRC_DIR)/%/unix/configure.in): $(SRC_DIR)/%/unix/configure.in: $(checkout) $(tea:%=$(SRC_DIR)/%/configure): $(SRC_DIR)/%/configure: $(SRC_DIR)/%/configure.in $(call tea_autoconf,) $(tea_unix:%=$(SRC_DIR)/%/unix/configure): $(SRC_DIR)/%/unix/configure: $(SRC_DIR)/%/unix/configure.in $(call tea_autoconf,/unix) $(tea:%=$(BUILD_DIR)/%/Makefile): $(BUILD_DIR)/%/Makefile: $(SRC_DIR)/%/configure #$(SRC_DIR)/%/Makefile.in $(call tea_configure,) $(tea_unix:%=$(BUILD_DIR)/%/Makefile): $(BUILD_DIR)/%/Makefile: $(SRC_DIR)/%/unix/configure #$(SRC_DIR)/%/Makefile.in $(call tea_configure,/unix) $(tea) $(tea_unix): %: $(BUILD_DIR)/%/Makefile $(pre_install) $(pre_make) $(MAKE_ENV) $(MAKE) -C $(BUILD_DIR)/$* $(action) $(INSTALL_ARGS) $(EXTRA_MAKE_ARGS) $(post_make) $(post_install) ### pbx ### $(pbx): %: $(checkout) $(pre_install) $(pre_make) cd $(SRC_DIR)/$*/$(PROJ_DIR) && $(PBXBUILD) -buildstyle Deployment $(EXTRA_PBXBUILD_ARGS) $(action) \ SYMROOT=$(BUILD_DIR)/$* $(INSTALL_ARGS) $(EXTRA_MAKE_ARGS) $(MAKEOVERRIDES) $(AFTER_OVERRIDES) $(post_make) $(post_install) ### e4graph ### $(SRC_DIR)/e4graph/all/configure: $(SRC_DIR)/%/all/configure: $(checkout) $(BUILD_DIR)/e4graph/all/makefile.include: $(BUILD_DIR)/%/all/makefile.include: $(SRC_DIR)/%/all/configure chmod +x $(SRC_DIR)/$*/all/configure $(call tea_configure2,/all,/all) e4graph: %: $(BUILD_DIR)/%/all/makefile.include $(pre_install) $(pre_make) $(MAKE_ENV) $(MAKE) -C $(BUILD_DIR)/$*/all $(action) $(INSTALL_ARGS) $(EXTRA_MAKE_ARGS) $(post_make) $(post_install) ### tkcon ### tkcon: %: $(checkout) $(pre_make) $(post_make) install/tkcon: install/%: $(pre_install) TKCON="$*$(VERSION)" && INSTALL_PATH="$(LIBDIR)" && \ TO="$(INSTALL_ROOT)$${INSTALL_PATH}/$${TKCON}" && \ mkdir -p "$(INSTALL_ROOT)$${INSTALL_PATH}" && \ rm -rf "$${TO}" && cp -RH $(SRC_DIR)/$* "$${TO}" && \ mkdir -p "$(INSTALL_ROOT)$(PREFIX)/bin" && \ ln -fs "$(LIBDIR)/$${TKCON}/$*.tcl" "$(INSTALL_ROOT)$(PREFIX)/bin/$*" && \ $(FIND) -d "$${TO}" -name CVS -type d -exec rm -rf {} \; $(post_make) $(post_install) ### oomk ### oomk: %: @if [ ! -e $(TCLKIT) ]; then \ d=$$(dirname $(TCLKIT)) && mkdir -p $$d && cd $$d && \ if [ -e $(SRC_DIR)/tclkit/tclkit-darwin-ppc.gz ]; then \ cp -p $(SRC_DIR)/tclkit/tclkit-darwin-ppc.gz . ; else \ $(call url_get,$(EQUI4)/pub/tk/8.4.2/tclkit-darwin-ppc.gz); fi && \ zcat tclkit-darwin-ppc.gz > tclkit && chmod +x tclkit && \ rm -f tclkit-darwin-ppc.gz && cd $(SRCDIR); fi $(checkout) $(pre_make) if [ -z "$(INSTALL_ARGS)" -o ! -e $(BUILD_DIR)/$* ]; then \ mkdir -p $(BUILD_DIR)/$* && cd $(BUILD_DIR) && \ $(DO_RSYNC) --delete $(SRC_DIR)/$*/ $*; \ fi $(post_make) install/oomk: install/%: $(pre_install) INSTALL_PATH="$(LIBDIR)" && \ TO="$(INSTALL_ROOT)$${INSTALL_PATH}/$*$(VERSION)" && \ mkdir -p "$(INSTALL_ROOT)$${INSTALL_PATH}" && \ rm -rf "$${TO}" && cp -RH $(BUILD_DIR)/$*/lib/$* "$${TO}" && \ cp -RH $(BUILD_DIR)/$*/lib/app-$*/{example.tcl,$*.txt} "$${TO}" $(post_install) ### snit ### # snit: %: # $(checkout) # $(pre_make) # $(post_make) # # install/snit: install/%: # $(pre_install) # INSTALL_PATH="$(LIBDIR)" && \ # TO="$(INSTALL_ROOT)$${INSTALL_PATH}/$*$(VERSION)" && \ # mkdir -p "$(INSTALL_ROOT)$${INSTALL_PATH}" && \ # rm -rf "$${TO}" && cp -RH $(SRC_DIR)/$* "$${TO}" # $(post_make) # $(post_install) ### Launcher ### Launcher: %: $(checkout) $(pre_install) $(pre_make) $(MAKE_ENV) $(MAKE) -C $(SRC_DIR)/$* $(action) $(INSTALL_ARGS) $(EXTRA_MAKE_ARGS) $(post_make) $(post_install) ### tclkit ### tclkit: %: $(checkout) $(pre_make) @if [ -z "$(INSTALL_ARGS)" -o ! -e $(BUILD_DIR)/$*/$* ]; then \ if [ ! -d $(SRC_DIR)/sdx ]; then $(MAKE) update/sdx; fi && \ mkdir -p $(BUILD_DIR)/$* && cd $(BUILD_DIR)/$* && \ rm -rf src tars && mkdir -p src tars && cd src && \ ln -fs $(SRC_DIR)/{tcl,tk} . && ln -fs $(SRC_DIR)/incrTcl itcl && \ ln -fs $(SRC_DIR)/metakit mk && ln -fs $(SRC_DIR)/tclvfs vfs && \ ln -fs $(SRC_DIR)/$* kit && cd .. && ln -fs src/kit/genkit . && \ rm -f $* && zcat src/kit/$*-darwin-ppc.gz > $* && chmod +x $* && \ cd tars && ln -fs ../src/kit/*.tar.gz . && \ $(SDX) unwrap ../src/kit/runtime.kit && \ cd runtime.vfs && ln -fs ../../src/kit/kitsh.vfs/boot.tcl . && \ echo "set ::vfs::tclkit_version $$(date '+%Y%m').$(TCLKIT_VERSION)" > config.tcl && \ ln -fs ../../src/kit/src/tclkit.ico . && cd lib && \ cd vfs && for f in $$(ls); do \ if [ "$$f" != "pkgIndex.tcl" -a -e ../../../../src/vfs/library/$$f ]; then \ ln -fs ../../../../src/vfs/library/$$f .; \ awk "/$$f/ {system(\"sed -e \\\"s/\\\\\\(\"\$$2\" \"\$$3\" *\\\\\\)[^ ][^ ]* /\\\\1\"\$$4\" /\\\" \ pkgIndex.tcl > pkgIndex.tcl.new; mv -f pkgIndex.tcl.new pkgIndex.tcl\")}" \ ../../../../src/vfs/library/pkgIndex.tcl; fi; done && cd .. && \ cd itcl* && for f in $$(ls); do \ if [ "$$f" != "pkgIndex.tcl" -a -e ../../../../src/itcl/itcl/library/$$f ]; then \ ln -fs ../../../../src/itcl/itcl/library/$$f .; fi; done && cd .. && \ v=$$(grep "TCL_VERSION=" "../../../src/tcl/unix/configure.in" | cut -d '=' -f 2) && \ mv tcl*/encoding . && rm -r tcl* && mkdir tcl$$v && cd tcl$$v && \ for f in $$(ls ../../../../src/tcl/library); do \ if ! echo $$f | egrep -q '^CVS|dde|encoding|http1\.0|reg$$'; then \ if [ -d ../../../../src/tcl/library/$$f ]; then \ mkdir $$f && cd $$f && ln -fs ../../../../../src/tcl/library/$$f/* . && rm -f CVS && cd ..; \ else ln -fs ../../../../src/tcl/library/$$f .; fi; fi; done && \ mv ../encoding . && cd encoding && for f in $$(ls); do \ ln -fs ../../../../../src/tcl/library/encoding/$$f .; done && cd ../.. && \ mv tk*/pkgIndex.tcl . && rm -r tk* && mkdir tk$$v && cd tk$$v && \ for f in $$(ls ../../../../src/tk/library); do \ if ! echo $$f | egrep -q '^CVS|demos|images$$'; then \ if [ -d ../../../../src/tk/library/$$f ]; then \ mkdir $$f && cd $$f && ln -fs ../../../../../src/tk/library/$$f/* . && rm -f CVS && cd ..; \ else ln -fs ../../../../src/tk/library/$$f .; fi; fi; done && \ mv ../pkgIndex.tcl . && cd .. && \ cd ../.. && $(SDX) wrap runtime.kit && cd .. && \ $(TCLSH) genkit A && $(TCLSH) genkit B tcl && sh genkit B && \ unset DISPLAY && sh genkit D && sh genkit E && \ ln -fs $*-$${HOSTNAME} $*; \ cd $(CURDIR) && $(post_make); fi install/tclkit: install/%: $(pre_install) mkdir -p "$(INSTALL_ROOT)$(PREFIX)/bin" && \ cp -H $(BUILD_DIR)/$*/$* $(INSTALL_ROOT)$(PREFIX)/bin && \ $(post_install) ### critlib ### critlib: %: $(checkout) $(pre_make) mkdir -p $(BUILD_DIR)/$* && \ rm -f $(SRC_DIR)/$*/lib && ln -fs $(BUILD_DIR)/$* $(SRC_DIR)/$*/lib $(MAKE_ENV) $(MAKE) -C $(SRC_DIR)/$* CRITCL="$(CRITCL)" $(EXTRA_MAKE_ARGS) $(post_make) install/critlib: install/%: $(pre_install) if [ -d $(SRC_DIR)/$*/lib ]; then if [ -n "$$(ls $(SRC_DIR)/$*/lib/)" ]; then \ mkdir -p "$(INSTALL_ROOT)$(LIBDIR)" && cd $(SRC_DIR)/$* && \ rm -rf "$(INSTALL_ROOT)$(LIBDIR)/$*"; \ cp -RH lib "$(INSTALL_ROOT)$(LIBDIR)/$*"; \ cp -RH README.html "$(INSTALL_ROOT)$(LIBDIR)/$*"; \ for f in $$(ls lib); { \ cp -RH "$${f}.tcl" "$${f}.README" "$(INSTALL_ROOT)$(LIBDIR)/$*"; \ }; \ echo "set auto_path [lappend auto_path \$$dir]" > \ "$(INSTALL_ROOT)$(LIBDIR)/$*/pkgIndex.tcl"; \ fi; fi $(post_install) ### starkit ### $(starkit): %: $(checkout) $(pre_make) if [ -z "$(INSTALL_ARGS)" -o ! -e $(BUILD_DIR)/$*/$*.kit ]; then \ mkdir -p $(BUILD_DIR)/$* && cd $(BUILD_DIR)/$* && \ $(DO_RSYNC) --delete $(SRC_DIR)/$*/ $*.vfs && \ $(SDX) wrap $*.kit; \ fi $(post_make) $(starkit:%=install/%): install/%: $(pre_install) mkdir -p "$(INSTALL_ROOT)$(PREFIX)/bin" && \ cp -H $(BUILD_DIR)/$*/$*.kit $(INSTALL_ROOT)$(PREFIX)/bin/$* $(post_install) ### wrappers ### $(wrappers:%=install/%): action := install-embedded $(wrappers): %: $(pre_install) $(pre_make) export A="$(action)" && : $${A:=embedded} && \ $(MAKE_ENV) $(MAKE) $($*:%=$$A/%) $(EXTRA_MAKE_ARGS) $(post_make) $(post_install) ### core_x11 ### $(core:%=$(SRC_DIR)/%/unix/configure.in): $(SRC_DIR)/%/unix/configure.in: $(checkout) $(core:%=$(SRC_DIR)/%/unix/configure): $(SRC_DIR)/%/unix/configure: $(SRC_DIR)/%/unix/configure.in cd $(SRC_DIR)/$* && $(AUTOCONF) $(core_x11:%_x11=$(BUILD_DIR)_x11/%/Makefile): \ $(BUILD_DIR)_x11/%/Makefile: $(SRC_DIR)/%/unix/configure mkdir -p $(BUILD_DIR)_x11/$* && cd $(BUILD_DIR)_x11/$* && \ $(SRC_DIR)/$*/unix/configure --prefix=/usr/local --enable-threads \ $(EXTRA_CONFIGURE_ARGS) $(core_x11): %_x11: $(BUILD_DIR)_x11/%/Makefile $(pre_install) $(pre_make) $(MAKE_ENV) $(MAKE) -C $(BUILD_DIR)_x11/$* $(action) $(INSTALL_ARGS) \ TCL_LIBRARY='$(LIBDIR)/tcl$$(VERSION)' \ TK_LIBRARY='$(LIBDIR)/tk$$(VERSION)' \ TCL_PACKAGE_PATH="~/Library/Tcl /Library/Tcl /Network/Library/Tcl \ /System/Library/Tcl" $(EXTRA_MAKE_ARGS) $(post_make) $(post_install) #---------------------------------------------------------------------------------------- # package & archive rules $(all:%=package/%): package/%: @if [ -z "$(DONT_PACKAGE_THIS)" ]; then \ echo Tools/buildPackage -d $(INSTALL_ROOT)Packages \ -n \"$(NAME)\" -v \"$(VERSION)\" -r \"$(README)\" -l \"$(LICENSE)\" \ -t \"$(PKG_ARCHIVE_DIR)\" $(EXTRA_PACKAGE_FLAGS) $*; \ Tools/buildPackage -d $(INSTALL_ROOT)Packages \ -n "$(NAME)" -v "$(VERSION)" -r "$(README)" -l "$(LICENSE)" \ -t "$(PKG_ARCHIVE_DIR)" $(EXTRA_PACKAGE_FLAGS) $*; \ fi $(projects:%=archive/%): archive/%: @if [ -z "$(DONT_PACKAGE_THIS)" ]; then \ export TMP="$(TMP_DIR)/tmp" && if [ -e "$${TMP}" ]; then \ chmod -R a+w "$${TMP}" && rm -rf "$${TMP}"; fi && mkdir -p "$${TMP}" && \ $(MAKE_ENV) $(MAKE) install/$* INSTALL_ROOT="$${TMP}/dest/" && \ mv -f "$${TMP}/dest/$(ARCHIVE_DIR)" "$${TMP}/$(NAME)" && \ if [ -e "$(README)" ]; then cp -RH "$(README)" "$${TMP}/$(NAME)"; fi && \ if [ -e "$(LICENSE)" ]; then cp -RH "$(LICENSE)" "$${TMP}/$(NAME)"; fi && \ mkdir -p "$(INSTALL_ROOT)" && echo "Tarring" && \ (cd "$${TMP}" && $(TAR) zcf "$(INSTALL_ROOT)/$(NAME)-$(VERSION).tar.gz" "$(NAME)") && \ chmod -R a+w "$${TMP}" && rm -rf "$${TMP}"; \ fi #---------------------------------------------------------------------------------------- # cvs/diff rules dont_update := $(NO_CVS:%=update/%) $(NO_CVS:%=diff/%) $(NO_CVS:%=patch/%) $(dont_update): DONT_UPDATE_THIS := 1 dont_diff := $(NO_TAR:%=diff/%) $(NO_TAR:%=patch/%) $(dont_diff): DONT_DIFF_THIS := 1 dont_download := $(NO_TAR:%=update/%) $(dont_download): DONT_DOWNLOAD_THIS := 1 $(cvs_diff:%=update/%): update/%: -@if [ -d $(SRC_DIR)/$* ]; then $(PRE_CVS); fi @if [ -z "$(DONT_UPDATE_THIS)" ]; then \ T=$(CVS_TAG); D=$(CVS_DATE); \ if echo $$T | grep -q -e "-D"; then D=; fi; \ if [ -d $(SRC_DIR)/$* ]; then \ echo "*** $* update $$T $$D ***"; \ cd $(SRC_DIR)/$* && eval $(DO_CVS) update -d -P -A $$T $$D || true; \ else \ R=$(CVSROOT); \ echo "*** $* checkout $$T $$D from $$R ***"; \ if [ -n "$$(echo $$R | egrep '^:pserver')" ]; then \ if ! grep -q "$$R" ~/.cvspass; then \ echo "$$R A" >> ~/.cvspass; fi; fi && \ mkdir -p $(SRC_DIR) && cd $(SRC_DIR) && \ eval $(DO_CVS) -d$$R checkout -P -A $$T $$D $(CVS_CO) && \ if [ -n "$(SRC_ARCHIVE_DIR)" ]; then \ rm -rf $(SRC_ARCHIVE_DIR)/$* && mkdir -p $(SRC_ARCHIVE_DIR) && \ echo "Tarring sources" && $(DO_RSYNC) $* $(SRC_ARCHIVE_DIR)/ && \ (cd $(SRC_ARCHIVE_DIR) && $(TAR) zcf $*.tar.gz $* && rm -rf $*); fi && \ if [ -e $(CURDIR)/patches/$*.diff ]; then \ cd $* && $(DO_PATCH) -p0 < $(CURDIR)/patches/$*.diff; fi; \ fi; \ else if [ -z "$(DONT_DOWNLOAD_THIS)" ]; then \ F=$*$(CVS_TAG); mkdir -p $(ORIG_DIR) $(SRC_ARCHIVE_DIR) && \ if [ ! -d $(SRC_DIR)/$* -o ! -d $(ORIG_DIR)/$$F ]; then \ if [ -d $(SRC_DIR)/$* ]; then \ $(MAKE) patch/$* && mv -f $(SRC_DIR)/$* $(SRC_DIR)/$*.old; fi && \ rm -f $$($(FIND) $(SRC_ARCHIVE_DIR) -maxdepth 1 -regex "$(SRC_ARCHIVE_DIR)/$*.*" -type d) 2>&- && \ rm -rf $$($(FIND) $(ORIG_DIR) -maxdepth 1 -regex "$(ORIG_DIR)/$*.*" -type d) 2>&- && \ cd $(SRC_ARCHIVE_DIR) && if [ ! -e $$F.$(DL_EXT) ]; then \ echo "*** $* download from $(URL)$$F.$(DL_EXT) ***" && \ $(call url_get,"$(URL)$$$$F.$(DL_EXT)"); fi && \ cd $(ORIG_DIR) && echo "*** $* extract $$F.$(DL_EXT) ***" && \ case $(DL_EXT) in \ tar.gz|tgz) $(TAR) zxf $(SRC_ARCHIVE_DIR)/$$F.$(DL_EXT);; \ tar) $(TAR) xf $(SRC_ARCHIVE_DIR)/$$F.$(DL_EXT);; \ kit) $(SDX) unwrap $(SRC_ARCHIVE_DIR)/$$F.$(DL_EXT);; \ \?) false;; \ esac && \ if [ ! -d $$F ]; then mv -f \ $$($(FIND) . -maxdepth 1 -regex "./$*.*" -type d) $$F; fi && \ mkdir -p $(SRC_DIR) && $(DO_RSYNC) $$F/ $(SRC_DIR)/$* && \ if [ -e $(CURDIR)/patches/$*.diff ]; then \ cd $(SRC_DIR)/$* && $(DO_PATCH) -p1 < $(CURDIR)/patches/$*.diff; fi; \ fi; \ fi; fi -@$(POST_CVS) $(cvs_diff:%=diff/%): diff/%: -@$(PRE_CVS) @if [ -z "$(DONT_DIFF_THIS)" ]; then \ echo "*** $* diff ***"; \ if [ -z "$(DONT_UPDATE_THIS)" ]; then \ cd $(SRC_DIR)/$* && $(DO_CVS) diff -u -p -N || true; \ else \ $(DO_DIFF) -r -N $(EXTRA_DIFF_ARGS) \ $$($(FIND) $(ORIG_DIR) -maxdepth 1 -regex "$(ORIG_DIR)/$*.*" -type d) $(SRC_DIR)/$* || true; \ fi; \ fi -@$(POST_CVS) $(cvs_diff:%=patch/%): patch/%: -@$(PRE_CVS) @if [ -z "$(DONT_DIFF_THIS)" ]; then \ echo "*** $* patch ***"; \ if [ -z "$(DONT_UPDATE_THIS)" ]; then \ cd $(SRC_DIR)/$* && $(DO_CVS) diff -u -p -N | \ awk '/^\? / {next}; /^Index: ((unix$(PATCH_EXCL_CONFDIR))\/)?configure$$/ {s=1; next}; /^Index: / {s=0}; s==0' \ > $(CURDIR)/patches/$*.diff || true; \ else \ $(DO_DIFF) -r -N $(EXTRA_DIFF_ARGS) \ $$($(FIND) $(ORIG_DIR) -maxdepth 1 -regex "$(ORIG_DIR)/$*.*" -type d) $(SRC_DIR)/$* \ | sed -e 's#$(ORIG_DIR)#orig#' -e 's#$(SRC_DIR)/##' \ > patches/$*.diff || true; \ fi; \ fi -@$(FIND) patches -name $*.diff -empty -delete -@$(POST_CVS) #---------------------------------------------------------------------------------------- # macros define redo_prebinding if [ ! -d usr/lib ]; then mkdir -p usr; ln -fs /usr/lib usr; \ ln -fs /usr/X11R6 usr; RM_USRLIB=1; fi; \ if [ ! -d System ]; then ln -fs /System .; RM_SYSTEM=1; fi; \ for f in $(1); { redo_prebinding -r . $$f; }; \ if [ -n "$${RM_USRLIB:-}" ]; then rm -f usr/lib; rm -f usr/X11R6; rmdir -p usr 2>&-; fi; \ if [ -n "$${RM_SYSTEM:-}" ]; then rm -f System; fi; true endef define fix_pkg $(call fix_pkg2,$(1),$(1),$(2)) endef define fix_pkg2 cd ./$(LIBDIR) && mkdir -p lib && \ $(FIND) . -maxdepth 1 -name "lib$(2)stub*.a" -exec mv -f {} lib \; && \ cd $(1)* && mv -f ../lib$(2)*.dylib . && \ sed -e 's|\.\.$(3)lib$(2)|lib$(2)|' pkgIndex.tcl > pkgIndex.tcl.1 && \ mv -f pkgIndex.tcl.1 pkgIndex.tcl && cd ../../.. endef define fix_pkgIndex cd ./$(LIBDIR)/$(1)* && \ $(2) pkgIndex.tcl > pkgIndex.tcl.1 && \ mv -f pkgIndex.tcl.1 pkgIndex.tcl && cd ../../.. endef define fix_stub_config $(call fix_stub_config2,$(1),$(1)) endef define fix_stub_config2 mkdir -p ./$(PREFIX)/lib && mv -f ./$(LIBDIR)/$(1)Config.sh ./$(PREFIX)/lib endef define update_config if [ -f $(1)/config.guess ]; then \ mv -f $(1)/config.guess $(1)/config.guess.orig && \ mv -f $(1)/config.sub $(1)/config.sub.orig; fi; \ cp -p /usr/share/libtool/{config.guess,config.sub} $(1) endef define restore_config if [ -f $(1)/config.guess.orig ]; then \ mv -f $(1)/config.guess.orig $(1)/config.guess && \ mv -f $(1)/config.sub.orig $(1)/config.sub; fi endef define conf $$(if [ -e $(1) ]; then \ awk '/^$(2)( |\t)/ {if(sub(/^$(2)( |\t)+/,"")) print}' $(1) | head -1; fi) endef define url_get if [ -n "$$(whereis $(WGET))" ]; then $(DO_WGET) $(1); else $(DO_CURL) $(1); fi endef define fix_install_id install_name_tool -id $(2)/lib$(1).dylib lib$(1).dylib endef define fix_install_name install_name_tool -change $$(otool -L lib$(1).dylib | awk '/lib$(2)\.dylib.*[^:]$$/ {print $$1}') $(3)/lib$(2).dylib lib$(1).dylib endef #----------------------------------------------------------------------------------------