changeset 3845:d68c34dc9c25

[project @ 2001-07-26 02:11:05 by jwe]
author jwe
date Thu, 26 Jul 2001 02:11:05 +0000
parents 87f85453b6b7
children 08cd791cd613
files ChangeLog Makeconf.in Makefile.in install-octave.in octMakefile.in octave-config.in
diffstat 6 files changed, 94 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-07-25  Rafael Laboissiere  <rafael@laboissiere.net>
+
+       * octave-config.in: New file.
+       * Makeconf.in (do-subst-default-vals): Substitute OCTAVE_VERSION.
+       * Makefile.in (TARGETS): Add octave-config to list.
+       * octMakefile.in (DISTFILES): Add octave-config.in to list.
+       (BINDISTFILES): Add octave-config to list.
+       (all): Add octave-config dependency.
+       (octave-config): New rule.
+       (install): Install octave-config.
+       (uninstall): Delete octave-config from bindir.
+       (maintainer-clean): Delete octave-config.
+       (binary-dist): Add octave-config dependency.
+
 2001-06-29  Mumit Khan  <khan@nanotech.wisc.edu>
 
 	* aclocal.m4 (OCTAVE_CXX_ABI): Use "sun_v5" instead of "sun".
--- a/Makeconf.in
+++ b/Makeconf.in
@@ -445,6 +445,7 @@
   -e "s;%OCTAVE_OCTFILEDIR%;\"${octfiledir}\";" \
   -e "s;%OCTAVE_OCTINCLUDEDIR%;\"${octincludedir}\";" \
   -e "s;%OCTAVE_OCTLIBDIR%;\"${octlibdir}\";" \
-  -e "s;%OCTAVE_PREFIX%;\"${prefix}\";"
+  -e "s;%OCTAVE_PREFIX%;\"${prefix}\";" \
+  -e "s;%OCTAVE_VERSION%;\"${version}\";"
 $(top_srcdir)/move-if-change $@.tmp $@
 endef
--- a/Makefile.in
+++ b/Makefile.in
@@ -6,10 +6,10 @@
 # University of Wisconsin-Madison
 # Department of Chemical Engineering
 
-TARGETS = octave-bug mkoctfile libcruft liboctave kpathsea dlfcn \
-	readline src scripts doc check octave.info INSTALL.OCTAVE BUGS \
-	install install-strip uninstall tags TAGS dist conf-dist \
-	snapshot snapshot-version
+TARGETS = octave-bug octave-config mkoctfile libcruft liboctave \
+	kpathsea dlfcn readline src scripts doc check octave.info \
+	INSTALL.OCTAVE BUGS install install-strip uninstall \
+	tags TAGS dist conf-dist snapshot snapshot-version
 
 NO_DEP_TARGETS = clean mostlyclean distclean maintainer-clean
 
@@ -85,6 +85,7 @@
 	@echo "  maintainer-clean     clean up everything"
 	@echo ""
 	@echo "  octave-bug           create octave-bug script"
+	@echo "  octave-config        create octave-config script"
 	@echo "  mkoctfile            create mkoctfile script"
 	@echo "  INSTALL.OCTAVE       create INSTALL.OCTAVE doc file"
 	@echo "  BUGS                 create BUGS doc file"
--- a/install-octave.in
+++ b/install-octave.in
@@ -217,6 +217,10 @@
 cp octave-bug $bindir/octave-bug
 chmod 755 $bindir/octave-bug
 
+echo "installing octave-config as $bindir/octave-config"
+cp octave-config $bindir/octave-config
+chmod 755 $bindir/octave-config
+
 if test -f LIBRARIES; then
   echo "installing shared libraries in $octlibdir"
   for f in `cat LIBRARIES`
--- a/octMakefile.in
+++ b/octMakefile.in
@@ -27,8 +27,8 @@
 	BUGS COPYING FLEX.patch INSTALL INSTALL.OCTAVE NEWS NEWS.[0-9] \
 	PROJECTS README README.Linux README.Windows README.MachTen ROADMAP \
 	SENDING-PATCHES THANKS move-if-change octave-sh octave-bug.in \
-	install-octave.in mkinstalldirs mkoctfile.in texi2dvi \
-	ChangeLog ChangeLog.[0-9]
+	octave-config.in install-octave.in mkinstalldirs mkoctfile.in \
+	texi2dvi ChangeLog ChangeLog.[0-9]
 
 # Complete directory trees to distribute.
 DISTDIRS = glob kpathsea # plplot
@@ -54,7 +54,7 @@
 	ChangeLog ChangeLog.[0-9]
 
 BINDISTFILES = $(addprefix $(srcdir)/, $(XBINDISTFILES)) \
-	octave-bug config.status config.h VERSION ARCH
+	octave-bug octave-config config.status config.h VERSION ARCH
 
 # Subdirectories in which to run `make bin-dist'.
 BINDISTSUBDIRS = libcruft liboctave src scripts doc emacs examples
@@ -67,7 +67,7 @@
   `echo $(localfcnfilepath) | awk -F: '{for (i=1; i<=NF; i++) print $$i}'` \
   `echo $(localoctfilepath) | awk -F: '{for (i=1; i<=NF; i++) print $$i}'`
 
-all: octave-bug mkoctfile src
+all: octave-bug octave-config mkoctfile src
 .PHONY: all
 
 src: $(SUBDIRS)
@@ -78,6 +78,10 @@
 	@$(do-subst-config-vals)
 	chmod a+rx $@
 
+octave-config: octave-config.in Makeconf octMakefile
+	@$(do-subst-default-vals)
+	chmod a+rx $@
+
 mkoctfile: mkoctfile.in Makeconf octMakefile
 	@$(do-subst-config-vals)
 	chmod a+rx $@
@@ -107,6 +111,9 @@
 	rm -f $(bindir)/octave-bug
 	$(INSTALL_SCRIPT) octave-bug $(bindir)/octave-bug-$(version)
 	cd $(bindir); $(LN_S) octave-bug-$(version) octave-bug
+	rm -f $(bindir)/octave-config
+	$(INSTALL_SCRIPT) octave-config $(bindir)/octave-config-$(version)
+	cd $(bindir); $(LN_S) octave-config-$(version) octave-config
 	rm -f $(bindir)/mkoctfile
 	$(INSTALL_SCRIPT) mkoctfile $(bindir)/mkoctfile-$(version)
 	cd $(bindir); $(LN_S) mkoctfile-$(version) mkoctfile
@@ -131,7 +138,7 @@
 .PHONY: clean mostlyclean distclean maintainer-clean
 
 maintainer-clean distclean::
-	rm -f octMakefile octave-bug Makeconf config.cache \
+	rm -f octMakefile octave-bug octave-config Makeconf config.cache \
 	config.h config.log config.status Makerules.f77 mk-oct-links \
 	mkoctfile Makefrag.f77
 
@@ -216,7 +223,7 @@
 	echo $(canonical_host_type) > ARCH
 .PHONY: ARCH
 
-binary-dist: VERSION ARCH octave-bug dist-info-files
+binary-dist: VERSION ARCH octave-bug octave-config dist-info-files
 	echo octave-$(version)-$(canonical_host_type) > .fname
 	rm -rf `cat .fname`
 	mkdir `cat .fname`
new file mode 100644
--- /dev/null
+++ b/octave-config.in
@@ -0,0 +1,56 @@
+#! /bin/sh -
+#
+# octave-config - reports some configuration values for Octave
+#
+# Rafael Laboissiere <rafael@laboissiere.net>
+# This script is in the public domain
+
+VERSION="%OCTAVE_VERSION%"
+OCT_SITE_DIR="%OCTAVE_LOCALVEROCTFILEDIR%"
+M_SITE_DIR="%OCTAVE_LOCALVERFCNFILEDIR%"
+
+usage_msg="usage: octave-config [options]"
+
+if [ $# -eq 0 ]; then
+  echo "$usage_msg" 1>&2
+  exit 1
+fi
+
+for arg
+do
+  case "$1" in
+    -h | -\? | --help)
+      echo "$usage_msg"
+      cat << EOF
+
+Options:
+
+  -h, -?, --help      Print this message.
+
+  --m-site-dir        Print the name of the directory where Octave
+                      expects to find locally installed .m files.
+
+  --oct-site-dir      Print the name of the directory where Octave
+                      expects to find locally installed .oct files.
+
+  -v, --version       Print the Octave version number.
+
+EOF
+      exit 0
+    ;;
+    --m-site-dir)
+      echo $M_SITE_DIR
+    ;;
+    --oct-site-dir)
+      echo $OCT_SITE_DIR
+    ;;
+    -v | --version)
+      echo $VERSION
+    ;;
+    *)
+      echo "octave-config: unrecognized argument $1" 2>&1
+      exit 1
+    ;;
+  esac
+  shift
+done