[clfswm-cvs] r335 - in clfswm: . contrib

Philippe Brochard pbrochard at common-lisp.net
Wed Sep 29 21:18:20 UTC 2010


Author: pbrochard
Date: Wed Sep 29 17:18:19 2010
New Revision: 335

Log:
configure: Use the Xavier Maillard clfswm script in contrib to build an executable in the standard way.

Modified:
   clfswm/ChangeLog
   clfswm/Makefile.template
   clfswm/configure
   clfswm/contrib/clfswm

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Wed Sep 29 17:18:19 2010
@@ -1,3 +1,8 @@
+2010-09-29  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* configure: Use the Xavier Maillard clfswm script in contrib to
+	build an executable in the standard way.
+
 2010-09-26  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-expose-mode.lisp (expose-mode-display-accel-windows):

Modified: clfswm/Makefile.template
==============================================================================
--- clfswm/Makefile.template	(original)
+++ clfswm/Makefile.template	Wed Sep 29 17:18:19 2010
@@ -1,50 +1,45 @@
 # -*- makefile -*-
-PROJECT_NAME=+PROJECT_NAME+
 DESTDIR=+DESTDIR+
-
-LISP=+LISP+
-EVAL_OPT=+EVAL_OPT+
-LOAD_OPT=+LOAD_OPT+
-EXT=+EXT+
-CORE=+CORE+
-
-all: build
-	@echo "ALL"
+BUILD_PATH=+BUILD_PATH+
 
 build:
 	@echo "Building"
-	$(LISP) $(CORE) $(EVAL_OPT) '(progn (pushnew :BUILD *features*) (load "load.lisp") (quit))'
+	chmod a+x $(BUILD_PATH)/clfswm
 	@echo ""
-	@echo "Type 'make install' to install $(PROJECT_NAME) in '$(DESTDIR)/bin/$(PROJECT_NAME)'"
+	@echo "Type 'make install' to install clfswm in '$(DESTDIR)/bin/clfswm'"
 	@echo ""
 
 install:
-	@echo "1) Installing: Creating directories"
-	mkdir -p $(DESTDIR)/lib/$(PROJECT_NAME)/src
-	mkdir -p $(DESTDIR)/lib/$(PROJECT_NAME)/contrib
 	mkdir -p $(DESTDIR)/bin
-	@echo "2) Installing: Copying files"
-	cp -R `pwd`/load.lisp $(DESTDIR)/lib/$(PROJECT_NAME)/
-	cp -R `pwd`/clfswm.asd $(DESTDIR)/lib/$(PROJECT_NAME)/
-	cp -R `pwd`/src/*.lisp  $(DESTDIR)/lib/$(PROJECT_NAME)/src
-	cp -R `pwd`/contrib/*   $(DESTDIR)/lib/$(PROJECT_NAME)/contrib
-	@sleep 1
-	cp -R `pwd`/src/*.$(EXT)  $(DESTDIR)/lib/$(PROJECT_NAME)/src
-	@echo "3) Installing: Creating starter script"
-	echo "#!/bin/sh" > $(DESTDIR)/bin/$(PROJECT_NAME)
-	echo "$(LISP) $(CORE) $(LOAD_OPT) $(DESTDIR)/lib/$(PROJECT_NAME)/load.lisp" >> $(DESTDIR)/bin/$(PROJECT_NAME)
-	chmod a+x $(DESTDIR)/bin/$(PROJECT_NAME)
+	rm -rf $(DESTDIR)/lib/clfswm/
+	mkdir -p $(DESTDIR)/lib/clfswm/src
+	mkdir -p $(DESTDIR)/share/doc/clfswm
+	cp $(BUILD_PATH)/clfswm $(DESTDIR)/bin
+	cp $(BUILD_PATH)/clfswm.asd $(DESTDIR)/lib/clfswm/
+	cp -R $(BUILD_PATH)/src/*.lisp $(DESTDIR)/lib/clfswm/src
+	cp -R $(BUILD_PATH)/contrib $(DESTDIR)/lib/clfswm/
+	cp -R $(BUILD_PATH)/doc/* $(DESTDIR)/share/doc/clfswm/
+	cp -R $(BUILD_PATH)/AUTHORS $(DESTDIR)/share/doc/clfswm/
+	cp -R $(BUILD_PATH)/COPYING $(DESTDIR)/share/doc/clfswm/
+	cp -R $(BUILD_PATH)/README $(DESTDIR)/share/doc/clfswm/
+	cp -R $(BUILD_PATH)/TODO $(DESTDIR)/share/doc/clfswm/
+	cp -R $(BUILD_PATH)/ChangeLog $(DESTDIR)/share/doc/clfswm/
 	@echo ""
-	@echo "$(PROJECT_NAME) has been installed in '$(DESTDIR)/bin/$(PROJECT_NAME)'"
+	@echo "clfswm has been installed in '$(DESTDIR)/bin/clfswm'"
 	@echo ""
 
 
 uninstall:
-	rm -rf $(DESTDIR)/bin/$(PROJECT_NAME)
-	rm -rf $(DESTDIR)/lib/$(PROJECT_NAME)/
+	rm -rf $(DESTDIR)/bin/clfswm
+	rm -rf $(DESTDIR)/lib/clfswm
+	rm -rf $(DESTDIR)/share/doc/clfswm
 
 clean:
 	find . \( -name "*~" -o -name "*.fas" -o -name "*.fasl" -o -name "*.lib" -o -name "*.lx32fsl" -o -name "*.x86f" \) -print0 | xargs -0 rm -f
 
 dist: clean
-	cd .. && tar czvf $(PROJECT_NAME)-`date +%y%m%d`.tar.gz $(PROJECT_NAME)
+	cd .. && tar czvf clfswm-`date +%y%m%d`.tar.gz clfswm
+
+
+distclean: clean
+	rm -f clfswm Makefile

Modified: clfswm/configure
==============================================================================
--- clfswm/configure	(original)
+++ clfswm/configure	Wed Sep 29 17:18:19 2010
@@ -1,11 +1,16 @@
 #! /bin/sh
 
-PROJECT_NAME=clfswm
-CONFIGURE_VERSION=0.1
+CONFIGURE_VERSION=0.2
 
+PREFIX="/usr/local"
+lisp=clisp
+lisp_opt=''
+dump_path="\$XDG_CACHE_HOME/clfswm/"
+clfswm_asd_path="$PREFIX/lib/clfswm"
+asdf_path="$PREFIX/lib/clfswm/contrib"
 
 usage () {
-    echo "'configure' configures $PROJECT_NAME to adapt to many kinds of systems.
+    echo "'configure' configures clfswm to adapt to many kinds of systems.
 
 Usage: ./configure [OPTION]... [VAR=VALUE]...
 
@@ -14,18 +19,17 @@
 Configuration:
   -h, --help                display this help and exit
   -V, --version             display version information and exit
-  --with-lisp=LISP          use a particular Lisp implementation [ask]
-  --with-lisp-eval-opt=OPT  use a particular Lisp eval command line option
-  --with-lisp-load-opt=OPT  use a particular Lisp load command line option
-  --with-lisp-ext=OPT       use a particular Lisp extension filename
-  --with-lisp-core=CORE     use a particular Lisp core (initial memory image)
-  --prefix=PREFIX           install architecture-independent files in PREFIX
-			    [/usr/local]
+  --prefix=PREFIX           install architecture-independent files in PREFIX [/usr/local]
+  -l, --with-lisp           use <lisp> as the common lisp implementation [$lisp]
+  -o, --lisp-opt            use <opt> as lisp option [$lisp_opt]
+  -d, --dump-path           path to the dump directory [$dump_path]
+  --with-clfswm             path to clfswm.asd file [$clfswm_asd_path]
+  --with-asdf               path to the asdf.lisp file [$asdf_path]
 
 By default, 'make install' will install all the files in
 '/usr/local/bin', '/usr/local/lib' etc.  You can specify
 an installation prefix other than '/usr/local' using '--prefix',
-for instance '--prefix=$HOME'."
+for instance '--prefix=\$HOME/clfswm'."
     exit 0
 }
 
@@ -35,88 +39,80 @@
     exit 0
 }
 
+reset_clfswm_asd_path=true
+reset_asdf_path=true
 
-
-TEMP=`getopt -o hV: --long help,version,srcdir:,with-lisp:,with-lisp-eval-opt:,with-lisp-load-opt:,with-lisp-ext:,with-lisp-core:,prefix: -- "$@"`
-PREFIX=/usr/local
-
-if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
-
-eval set -- "$TEMP"
-
-while true ; do
+while test $# != 0
+do
     case "$1" in
-	-h|--help) usage ; shift ;;
-	-V|--version) version ; shift ;;
-	--srcdir) SRCDIR=$2 ; shift 2 ;;
-	--with-lisp) LISP=$2 ; shift 2 ;;
-	--with-lisp-eval-opt) EVAL_OPT=$2 ; shift 2 ;;
-	--with-lisp-load-opt) LOAD_OPT=$2 ; shift 2 ;;
-	--with-lisp-ext) EXT=$2 ; shift 2 ;;
-	--with-lisp-core) CORE=$2 ; shift 2 ;;
-	--prefix) PREFIX=$2 ; shift 2 ;;
-	--) shift ; break ;;
-	*) echo "Internal error!" ; exit 1 ;;
+	--prefix)
+	    shift
+	    PREFIX="$1" ;;
+	-d|--dump-path)
+	    shift
+	    dump_path="$1" ;;
+	--with-clfswm)
+	    shift
+	    clfswm_asd_path="$1"
+	    reset_clfswm_asd_path=false ;;
+	--with-asdf)
+	    shift
+	    asdf_path="$1"
+	    reset_asdf_path=false ;;
+	-l|--with-lisp)
+	    shift
+	    case "$1" in
+		'')
+		    usage;;
+		clisp|sbcl|cmucl|ccl|ecl)
+		    lisp="$1" ;;
+	    esac
+	    ;;
+	-o|--lisp-opt)
+	    shift
+	    lisp_opt="$1" ;;
+	--)
+	    shift
+	    break ;;
+	*)
+	    usage ;;
     esac
+    shift
 done
 
+
 DESTDIR=$PREFIX
 
+if [ "$reset_clfswm_asd_path" = "true" ]; then
+    clfswm_asd_path="$PREFIX/lib/clfswm"
+fi
 
-if [ "x$LISP" = "x" ]; then
-    echo "Please, choose a Lisp implementation in:
-1) SBCL 2) CMUCL 3) CLISP 4) ECL 5) CCL 6) Other"
-    read REP_LISP
-    case $REP_LISP in
-	1) LISP=sbcl ;;
-	2) LISP=cmucl ;;
-	3) LISP=clisp ;;
-	4) LISP=ecl ;;
-	5) LISP=ccl ;;
-	6) echo -n "Please, enter your Lisp implementation: "
-	    read LISP ;;
-	*) echo "Error"; exit -1 ;;
-    esac
+if [ "$reset_asdf_path" = "true" ]; then
+    asdf_path="$PREFIX/lib/clfswm/contrib"
 fi
 
 
-case $LISP in
-    clisp) LISP=$(which clisp)
-	EVAL_OPT="-x -q"
-	LOAD_OPT=""
-	EXT=fas ;;
-    sbcl) LISP=$(which sbcl)
-	EVAL_OPT="--eval"
-	LOAD_OPT="--load"
-	EXT=fasl ;;
-    cmucl) LISP=$(which cmucl)
-	EVAL_OPT="-eval"
-	LOAD_OPT="-load"
-	EXT=x86f ;;
-    ecl) LISP=$(which ecl)
-	EVAL_OPT="-eval"
-	LOAD_OPT="-load"
-	EXT=fas ;;
-    ccl) LISP=$(which ccl)
-	EVAL_OPT="-e"
-	LOAD_OPT="-l"
-	EXT=lx32fsl ;;
-esac
-
-echo "Configuration:"
-echo SRCDIR = $SRCDIR
-echo PREFIX = $PREFIX
-echo "LISP=$LISP  EVAL_OPT=$EVAL_OPT  LOAD_OPT=$LOAD_OPT  EXT=$EXT CORE=$CORE"
-
-sed -e "s#+PROJECT_NAME+#$PROJECT_NAME#g" \
-    -e "s#+DESTDIR+#$DESTDIR#g" \
-    -e "s#+LISP+#$LISP#g" \
-    -e "s#+EVAL_OPT+#$EVAL_OPT#g" \
-    -e "s#+LOAD_OPT+#$LOAD_OPT#g" \
-    -e "s#+EXT+#$EXT#g" \
-    -e "s#+CORE+#$CORE#g" \
+echo "  prefix=$PREFIX
+  with-lisp=$lisp
+  lisp-opt=$lisp_opt
+  dump-path=$dump_path
+  with-clfswm=$clfswm_asd_path
+  with-asdf=$asdf_path"
+
+
+
+sed -e "s?^lisp=.*# +config+?lisp=\"$lisp\"   # +config+?g" \
+    -e "s?^lisp_opt=.*# +config+?lisp_opt=\"$lisp_opt\"   # +config+?g" \
+    -e "s?^dump_path=.*# +config+?dump_path=\"$dump_path\"   # +config+?g" \
+    -e "s?^clfswm_asd_path=.*# +config+?clfswm_asd_path=\"$clfswm_asd_path\"   # +config+?g" \
+    -e "s?^asdf_path=.*# +config+?asdf_path=\"$asdf_path\"   # +config+?g" \
+    $(pwd)/contrib/clfswm > $(pwd)/clfswm
+
+sed -e "s#+DESTDIR+#$DESTDIR#g" \
+    -e "s#+BUILD_PATH+#$(pwd)/#g" \
     Makefile.template > Makefile
 
+
 echo ""
-echo "Type 'make' to build $PROJECT_NAME"
+echo "Type 'make' to build clfswm"
 echo ""

Modified: clfswm/contrib/clfswm
==============================================================================
--- clfswm/contrib/clfswm	(original)
+++ clfswm/contrib/clfswm	Wed Sep 29 17:18:19 2010
@@ -33,11 +33,12 @@
 
 
 no_start=no
-lisp=clisp
-lisp_opt=''
-dump_path="$XDG_CACHE_HOME/clfswm/"
-asdf_path="$(pwd)/contrib"
-clfswm_asd_path="$(pwd)"
+
+lisp=clisp   # +config+
+lisp_opt=''   # +config+
+dump_path="$XDG_CACHE_HOME/clfswm/"   # +config+
+clfswm_asd_path="$(pwd)"   # +config+
+asdf_path="$(pwd)/contrib"   # +config+
 
 tmp_dir=/tmp
 
@@ -45,15 +46,14 @@
 usage() {
 
     echo "$0 [options]
---
-n,no-start           don't start CLFSWM after image dump
-f,force              force image dump
-rebuild              same as -f,--force
-l,with-lisp          use <lisp> as the common lisp implementation [$lisp]
-o,lisp-opt           use <opt> as lisp option [$lisp_opt]
-d,dump-path          path to the dump directory [\$XDG_CACHE_HOME=$XDG_CACHE_HOME]
-with-clfswm          path to clfswm.asd file [$clfswm_asd_path]
-with-asdf            path to the asdf.lisp file [$asdf_path]"
+  -n, --no-start           don't start CLFSWM after image dump
+  -f, --force              force image dump
+  --rebuild                same as -f, --force
+  -l, --with-lisp          use <lisp> as the common lisp implementation [$lisp]
+  -o, --lisp-opt           use <opt> as lisp option [$lisp_opt]
+  -d, --dump-path          path to the dump directory [$dump_path]
+  --with-clfswm            path to clfswm.asd file [$clfswm_asd_path]
+  --with-asdf              path to the asdf.lisp file [$asdf_path]"
 
     exit 0
 }
@@ -65,7 +65,7 @@
 
 build_clisp ()
 {
-    clisp $lisp_opt -m 8MB -E ISO-8859-1 -q -i $asdf_path/asdf.lisp -x "(load \"$clfswm_asd_path/clfswm.asd\")
+    clisp $lisp_opt -m 8MB -E ISO-8859-1 -q -i "$asdf_path"/asdf.lisp -x "(load \"$clfswm_asd_path/clfswm.asd\")
                 (asdf:oos 'asdf:load-op :clfswm) \
        		(EXT:SAVEINITMEM \"$dump_image\" :INIT-FUNCTION (lambda () (clfswm:main) (quit)) :EXECUTABLE t :norc t)"
 }
@@ -101,8 +101,8 @@
 	-eval "(load \"$clfswm_asd_path/clfswm.asd\")" \
 	-eval "(asdf:make-build :clfswm :type :program :monolithic t :move-here \".\" :prologue-code '(progn (require :asdf) (require :clx)))" \
 	-eval "(ext:quit 0)"
-    mv ./clfswm-mono $dump_image
-    echo $dump_image
+    mv ./clfswm-mono "$dump_image"
+    echo "$dump_image"
 }
 
 
@@ -152,45 +152,54 @@
     rm -f "$dump_image"
 fi
 
-if test ! -e "$dump_image" ||
-    (   for i in "$(dirname $(readlink $clfswm_asd_path/clfswm.asd))"/*.lisp
-        do  test "$dump_image" -ot "$i" && exit 1
-        done )
+clfswm_asd="$clfswm_asd_path"/clfswm.asd
+if test -L "$clfswm_asd_path"; then
+    clfswm_asd=$(readlink "$clfswm_asd")
+fi
+
+older_image=0
+for i in "$(dirname $clfswm_asd)"/src/*.lisp; do
+    test "$dump_image" -ot "$i" && older_image=1
+done
+
+if test ! -e "$dump_image" || test $older_image -eq 1
 then
-    test -x $(type -p $lisp) || die "$lisp can't be found."
-    test -e $clfswm_asd_path/clfswm.asd || die "can't find clfswm.asd in $clfswm_asd_path"
-    test -e $asdf_path/asdf.lisp || die "can't find asdf.lisp in $asdf_path"
+    echo "Image is nonexistent or older than sources. Rebuilding clfswm."
+    test -x $(type -p "$lisp") || die "$lisp can't be found."
+    test -e "$clfswm_asd_path"/clfswm.asd || die "can't find clfswm.asd in $clfswm_asd_path"
+    test -e "$asdf_path"/asdf.lisp || die "can't find asdf.lisp in $asdf_path"
 
     # Move clfswm sources to $tmp_dir if there is no write permission on $clfswm_asd_path
-    if test ! -w $clfswm_asd_path ; then
-	rm -rf $tmp_dir/clfswm-tmp
-	mkdir $tmp_dir/clfswm-tmp
-	cp -R $clfswm_asd_path/* $tmp_dir/clfswm-tmp
-	clfswm_asd_path=$tmp_dir/clfswm-tmp
-	asdf_path=$tmp_dir/clfswm-tmp/contrib
-	echo "* Note: No write access in sources, copying in $clfswm_asd_path"
+    if test ! -w "$clfswm_asd_path" ; then
+	echo "* Note: No write access in sources ($clfswm_asd_path),
+ -> copying in a writable directory ($tmp_dir/clfswm-tmp)"
+	rm -rf "$tmp_dir"/clfswm-tmp
+	mkdir "$tmp_dir"/clfswm-tmp
+	cp -R "$clfswm_asd_path"/* "$tmp_dir"/clfswm-tmp
+	clfswm_asd_path="$tmp_dir"/clfswm-tmp
+	asdf_path="$tmp_dir"/clfswm-tmp/contrib
     fi
 
     mkdir -p "$dump_path"
     mkdir -p "$dump_path/contrib"
-    eval build_$lisp
+    eval build_"$lisp"
     rm -rf "$dump_path/contrib"
     cp -R "$clfswm_asd_path/contrib/" "$dump_path/"
     rm -rf $(find "$dump_path/" -name "*svn")
 
-    rm -rf $tmp_dir/clfswm-tmp
+    rm -rf "$tmp_dir"/clfswm-tmp
 fi
 
 # Run the resulting image
 if test no = "$no_start"
 then
-    cd $dump_path
+    cd "$dump_path"
     case $lisp in
-	clisp ) $dump_image ;;
+	clisp ) "$dump_image" ;;
 	sbcl ) exec sbcl --core "$dump_image" ;;
 	cmucl ) exec cmucl -core "$dump_image" ;;
 	ccl ) exec ccl -I "$dump_image" ;;
-	ecl ) $dump_image -eval "(progn (clfswm:main) (ext:quit 0))" ;;
+	ecl ) "$dump_image" -eval "(progn (clfswm:main) (ext:quit 0))" ;;
 	*) echo "..." ;;
     esac
 else




More information about the clfswm-cvs mailing list