[csw-devel] SF.net SVN: gar:[10315] csw/mgar/pkg/gawk/trunk

theferret at users.sourceforge.net theferret at users.sourceforge.net
Fri Jun 25 05:37:10 CEST 2010


Revision: 10315
          http://gar.svn.sourceforge.net/gar/?rev=10315&view=rev
Author:   theferret
Date:     2010-06-25 03:37:10 +0000 (Fri, 25 Jun 2010)

Log Message:
-----------
gawk: tweaks

Modified Paths:
--------------
    csw/mgar/pkg/gawk/trunk/Makefile
    csw/mgar/pkg/gawk/trunk/pkginfo
    csw/mgar/pkg/gawk/trunk/prototype

Modified: csw/mgar/pkg/gawk/trunk/Makefile
===================================================================
--- csw/mgar/pkg/gawk/trunk/Makefile	2010-06-24 23:34:47 UTC (rev 10314)
+++ csw/mgar/pkg/gawk/trunk/Makefile	2010-06-25 03:37:10 UTC (rev 10315)
@@ -1,60 +1,154 @@
-#This Makefile originally generated from a template under 
-# pkg/TEMPLATES/createpkg
-# You will most likely have to use GNU make to use it.
+# This file is from TEMPLATES/createpkg/Makefile.lib
+# You MUST build this with gnu make, unfortunately.
+# Mainly just because of the ARCH expansion, but also for "?="
 
+# Customize your prototype file(s) as needed
 
-#Uncomment one of these definitions. The -b invokation,
-# is suitable for use with small packages, where you want to have a few files
-# in your top level src directory. It is also suitable for
-# "relocateable" packages. see the createpkg docs for more details.
-#CREATEPKG=createpkg -b `pwd`
+# Organization: variable defintions up top,
+# targets in second half.
+# Note that assignments with "?=" mean "assign if not already assigned.
+
+# Where do we keep local downloads of software src files
+ARCHIVEDIR ?= /home/src
+ARCHIVENAME ?= gawk-3.1.8.tar.gz
+EXTRACTPROG ?= /usr/sfw/bin/gtar zfx
+
+# Only use ONE here. The name is used for compat with 'gar'.
+MASTER_SITES ?= http://ftp.gnu.org/pub/gnu/gawk
+
+ARCH := $(shell /bin/uname -p)
+
+LDFLAGS_COMMON :=
+
+SRCDIR= build/*
+
+# DO NOT specify the arch-64 stuff such as -m64 here.
+# the individual targets will do that.
+
+CFLAGS_COMMON   ?= -mt -xnorunpath -fast
+CXXFLAGS_COMMON ?= -mt -norunpath  -fast
+CFLAGS_sparc    ?= -xarch=v8
+CFLAGS_i386     ?= -xarch=386
+
+# Keep this arch-neutral if possible. add arch-specific tweaks
+# to arch-specific target
+CONFIGURE=./configure --prefix=/opt/csw
+
+
+
 CREATEPKG=createpkg -r `pwd`/build/*/cswstage
 
 
-BUILDDIR=build/*
+all:	$(ARCH)-32
+#all:	$(ARCH)-32 package
 
+# ARCH-XX handles configure, build, and stage for its own combo
+# 
 
+EXTRACTPROG ?= /bin/echo ERROR: need to set EXTRACTPROG ; exit 1 ;
 
-STDFILES=pkginfo copyright prototype
-FILES=
 
-all:	build package
 
+extract:	build/.extract.done
 
-build:	build/.config.done
-	(cd $(BUILDDIR) ; \
-	$(MAKE) ; \
-	stagepkg  )
+build/.extract.done:
+	test -d build || mkdir build
+	@if test -f  $(ARCHIVEDIR)/$(ARCHIVENAME) ; then \
+		echo Extracting $(ARCHIVENAME) under build dir... ;\
+		( cd build && $(EXTRACTPROG) $(ARCHIVEDIR)/$(ARCHIVENAME) ) ; \
+	else echo Cannot extract - $(ARCHIVEDIR)/$(ARCHIVENAME) does not exist ;\
+		exit 1; \
+	fi
+	touch build/.extract.done
+	
 
+clean distclean:
+	@echo Calling $@ in $(SRCDIR)
+	$(MAKE) -C $(SRCDIR) $@
 
-# dummy target for configure
-build/.config.done:
-	@echo Configuring with:
-	@echo CC=$(CC) $(CFLAGS)
-	@echo CXX=$(CXX) $(CXXFLAGS)
-	(cd $(BUILDDIR) ; \
-	test -f ../../patchfile.preconf && \
-		gpatch -p0 <../../patchfile.preconf ; \
-	./configure --prefix=/opt/csw ; \
-	if test -f ../../patchfile.postconf ; then \
-                 gpatch -p0 <../../patchfile.postconf ; fi)
-	touch build/.config.done
 
+reallyclean:	distclean
+	@echo Removing any milestone files in build as well...
+	@rm -f build/.??*
+	@echo '(However, leaving src tree intact, with any patches in it)'
+	@echo '(If you want, you could rm -r build, then make extract once more)'
 
-# I tried depending this on   $(BUILDDIR)/config.log  but that didnt stick
-configure:	build/.config.done
+garchive:
+	@echo Call the fetch target instead: it does the same thing.
 
-package:	$(STDFILE) $(FILES) build
-	cp build/gawk*/COPYING `echo build/gawk*/cswstage/opt/csw/share/awk`/COPYING.gawk
+
+# Downloads the source code to the common ARCHIVEDIR
+fetch:	$(ARCHIVEDIR)/$(ARCHIVENAME)
+	@echo fetch done
+
+$(ARCHIVEDIR)/$(ARCHIVENAME):
+	wget -P $(ARCHIVEDIR) $(MASTER_SITES)/$(ARCHIVENAME)
+
+patch:
+	@echo patch: patching is handled automatically as part of the configure phase.
+
+package:
 	$(CREATEPKG)
 
 
-pkgclean:
-	rm -f *.pkg.gz package
+# split out generic $(ARCH) sections to platform-specific sections if needed.
+# but it usually should not be neccessary
 
-clean:	pkgclean
-	cd $(BUILDDIR) && make clean
 
-reallyclean:	clean
-	rm -f $BUILDDIR/config.log $BUILDDIR/config.cache $BUILDDIR/config.status
-	rm -f build/.config.done	
+$(ARCH)-32 ::   configure-$(ARCH)-32 build-$(ARCH)-32 stage-$(ARCH)-32
+	@echo Completed $(ARCH)-32 configure, build and stage
+	touch build/.$(ARCH)-32.done
+
+
+
+build/.$(ARCH)-32.done:	$(ARCH)-32
+
+# Since we share the same src tree, we should only need to
+# pre-configure patching one time for all.
+build/.patch-preconf.done:	build/.extract.done
+	if test -f patchfile.preconf ; then \
+	 gpatch -d $(SRCDIR) -p0  <patchfile.preconf ; fi
+	touch $@
+
+
+#Note: I WANT to use LDFLAGS=-R$$ORIGIN, but stupid libtool
+# wont allow it! so force it at build time
+build/.configure-$(ARCH)-32.done:	build/.patch-preconf.done
+	@echo handling $@ target
+	(cd $(SRCDIR) ; \
+	  CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_$(ARCH))" \
+	  CXXFLAGS="$(CXXFLAGS_COMMON)" \
+	  LDFLAGS='-R/opt/csw/lib -L/opt/csw/lib' \
+	  $(CONFIGURE) )
+	if test -f patchfile.postconf ; then \
+	 gpatch -d $(SRCDIR) -p0  <patchfile.postconf ; fi
+	touch $@
+
+
+# See note about LDFLAGS and ORIGIN, higher up	
+build/.build-$(ARCH)-32.done:
+	@echo handling $@ target
+	LD_OPTIONS='-R$$ORIGIN' $(MAKE) -C $(SRCDIR) $(MFLAGS)
+	touch $@
+
+
+
+## NOTE: This is a DESTRUCTIVE target build!!
+## 'stagepkg'  will destroy any prior "cswstage" directory!!!
+## So, we remove all 64bit milestones
+build/.stage-$(ARCH)-32.done:
+	@echo Handling stage of $(ARCH)-32
+	(cd $(SRCDIR) ; MAKE=gmake stagepkg)
+	(cd $(SRCDIR); cp COPYING cswstage/.)
+	@rm -f build/.*64.done
+	touch $@
+
+
+
+#These are the easy-to-type targets. They just trigger the real ones.
+configure-$(ARCH)-32:	build/.configure-$(ARCH)-32.done
+	@echo $@ done
+build-$(ARCH)-32:	build/.build-$(ARCH)-32.done
+	@echo $@ done
+stage-$(ARCH)-32:	build/.stage-$(ARCH)-32.done
+	@echo $@ done

Modified: csw/mgar/pkg/gawk/trunk/pkginfo
===================================================================
--- csw/mgar/pkg/gawk/trunk/pkginfo	2010-06-24 23:34:47 UTC (rev 10314)
+++ csw/mgar/pkg/gawk/trunk/pkginfo	2010-06-25 03:37:10 UTC (rev 10315)
@@ -1,6 +1,6 @@
 PKG=CSWgawk
 NAME=gawk - GNU AWK
-VERSION=3.1.8,REV=2010.05.31
+VERSION=3.1.8,REV=2010.06.25
 ARCH=i386
 CATEGORY=system
 VENDOR=http://ftp.gnu.org/pub/gnu/gawk packaged for CSW by Philip Brown

Modified: csw/mgar/pkg/gawk/trunk/prototype
===================================================================
--- csw/mgar/pkg/gawk/trunk/prototype	2010-06-24 23:34:47 UTC (rev 10314)
+++ csw/mgar/pkg/gawk/trunk/prototype	2010-06-25 03:37:10 UTC (rev 10315)
@@ -10,7 +10,7 @@
 f cswtexinfo /opt/csw/share/info/gawk.info 0644 root bin
 f cswtexinfo /opt/csw/share/info/gawkinet.info 0644 root bin
 d none /opt/csw/share/awk 0755 root bin
-f none /opt/csw/share/awk/COPYING.gawk 0644 root bin
+f none /opt/csw/share/awk/COPYING=COPYING 0644 root bin
 f none /opt/csw/share/awk/ftrans.awk 0644 root bin
 f none /opt/csw/share/awk/ord.awk 0644 root bin
 f none /opt/csw/share/awk/nextfile.awk 0644 root bin


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list