# HG changeset patch # User Olaf Till # Date 1296074691 18000 # Node ID ad636c1f353b6c2332bfbb565ac0c06b8d9f3054 # Parent eceacb78aa7fc42bbcc6415f14a0ed2e4cc2397b Let pkg.m export environment variables MKOCTFILE, OCTAVE_CONFIG and OCTAVE. For configure, set all of these, for make, all except OCTAVE. They contain the full path of the respective programs of the correct version. diff -r eceacb78aa7f -r ad636c1f353b doc/ChangeLog --- a/doc/ChangeLog Wed Jan 26 15:14:51 2011 -0500 +++ b/doc/ChangeLog Wed Jan 26 15:44:51 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-26 Olaf Till + + * interpreter/package.txi: Document variables MKOCTFILE, + OCTAVE_CONFIG, and OCTAVE exported by pkg for configure and make. + 2011-01-25 Rik * Makefile.am: Remove pass-through rules for AUTHORS, BUGS, and diff -r eceacb78aa7f -r ad636c1f353b doc/interpreter/package.txi --- a/doc/interpreter/package.txi Wed Jan 26 15:14:51 2011 -0500 +++ b/doc/interpreter/package.txi Wed Jan 26 15:44:51 2011 -0500 @@ -259,11 +259,15 @@ packages installation. The Octave package manager will execute @file{./configure} in this directory if this script exists, and will then call @code{make} if a file @file{Makefile} exists in this -directory. @code{make install} will however not be called. If a file -called @code{FILES} exists all files listed there will be copied to the -@code{inst} directory, so they also will be installed. If the -@code{FILES} file doesn't exist, @file{src/*.m} and @file{src/*.oct} -will be copied to the @code{inst} directory. +directory. @code{make install} will however not be called. The +environment variables @env{MKOCTFILE}, @w{@env{OCTAVE_CONFIG}}, and +@env{OCTAVE} will be set to the full paths of the programs +@code{mkoctfile}, @code{octave-config}, and @code{octave}, respectively, +of the correct version when @code{configure} and @code{make} are +called. If a file called @code{FILES} exists all files listed there +will be copied to the @code{inst} directory, so they also will be +installed. If the @code{FILES} file doesn't exist, @file{src/*.m} and +@file{src/*.oct} will be copied to the @code{inst} directory. @item package/doc An optional directory containing documentation for the package. The diff -r eceacb78aa7f -r ad636c1f353b scripts/ChangeLog --- a/scripts/ChangeLog Wed Jan 26 15:14:51 2011 -0500 +++ b/scripts/ChangeLog Wed Jan 26 15:44:51 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-26 Olaf Till + + * pkg/pkg.m: Export environment variables MKOCTFILE and + OCTAVE_CONFIG for configure and make, to configure also OCTAVE. + 2011-01-24 John W. Eaton * audio/lin2mu: Doc fix. diff -r eceacb78aa7f -r ad636c1f353b scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Wed Jan 26 15:14:51 2011 -0500 +++ b/scripts/pkg/pkg.m Wed Jan 26 15:44:51 2011 -0500 @@ -1287,6 +1287,16 @@ ## Perform ./configure, make, make install in "src". if (exist (fullfile (packdir, "src"), "dir")) src = fullfile (packdir, "src"); + octave_bindir = octave_config_info ("bindir"); + ver = version (); + mkoctfile = fullfile (octave_bindir, sprintf ("mkoctfile-%s", ver)); + octave_config = fullfile (octave_bindir, sprintf ("octave-config-%s", ver)); + octave_binary = fullfile (octave_bindir, sprintf ("octave-%s", ver)); + cenv = {"MKOCTFILE"; mkoctfile; + "OCTAVE_CONFIG"; octave_config; + "OCTAVE"; octave_binary; + "INSTALLDIR"; desc.dir}; + scenv = sprintf ("%s=\"%s\" ", cenv{:}); ## Configure. if (exist (fullfile (src, "configure"), "file")) flags = ""; @@ -1302,8 +1312,9 @@ if (isempty (getenv ("RANLIB"))) flags = cstrcat (flags, " RANLIB=\"", octave_config_info ("RANLIB"), "\""); endif - [status, output] = shell (strcat ("cd '", src, "'; ./configure --prefix=\"", - desc.dir, "\"", flags)); + [status, output] = shell (cstrcat ("cd '", src, "'; ", scenv, + "./configure --prefix=\"", + desc.dir, "\"", flags)); if (status != 0) rm_rf (desc.dir); error ("the configure script returned the following error: %s", output); @@ -1315,8 +1326,7 @@ ## Make. if (exist (fullfile (src, "Makefile"), "file")) - [status, output] = shell (cstrcat ("export INSTALLDIR=\"", desc.dir, - "\"; make -C '", src, "'")); + [status, output] = shell (cstrcat (scenv, "make -C '", src, "'")); if (status != 0) rm_rf (desc.dir); error ("'make' returned the following error: %s", output);