On 16-Nov-2005, Rafael Laboissiere wrote:

| [Please, keep Cc: to [EMAIL PROTECTED]
| 
| * John W. Eaton <[EMAIL PROTECTED]> [2005-11-16 12:49]:
| 
| > OK, I will fix this by generating this PKG_ADD file differently so we
| > avoid problems related to creating a package by running make install
| > with a value of prefix that is different from the one used at configure
| > time.
| 
| I am happy that the riddle is solved.  Indeed, mk-pkg-add is called with
| --prefix having the DESTDIR in it.  I could not reproduce the error,
| because I had the build tree present in my system.
| 
| Please provide a patch that I can apply to the 2.9.4 tarball and I will
| immediately upload a fixed version of the package.

Try the following.

jwe


src/ChangeLog:

2005-11-16  John W. Eaton  <[EMAIL PROTECTED]>

        * Makefile.in (PKG_ADD.inst): New target.
        (install): Dependo on it.
        (clean): Remove it.

        * mk-pkg-add: New option --install.  Don't use --prefix option.
        Delete obsolete comments.


Index: src/Makefile.in
===================================================================
RCS file: /cvs/octave/src/Makefile.in,v
retrieving revision 1.390
diff -u -r1.390 Makefile.in
--- src/Makefile.in     12 Nov 2005 02:31:23 -0000      1.390
+++ src/Makefile.in     16 Nov 2005 18:43:40 -0000
@@ -343,8 +343,12 @@
        @$(top_srcdir)/move-if-change [EMAIL PROTECTED] $@
 
 PKG_ADD: $(DLD_DEF_FILES)
-       $(srcdir)/mk-pkg-add --prefix $(shell pwd) $(DLD_DEF_FILES) > PKG_ADD-t
-       mv PKG_ADD-t PKG_ADD
+       $(srcdir)/mk-pkg-add --prefix $(shell pwd) $(DLD_DEF_FILES) > [EMAIL 
PROTECTED]
+       mv [EMAIL PROTECTED] $@
+
+PKG_ADD.inst: $(srcdir)/mk-pkg-add $(DLD_DEF_FILES)
+       $(srcdir)/mk-pkg-add --install $(DLD_DEF_FILES) > [EMAIL PROTECTED]
+       mv [EMAIL PROTECTED] $@
 
 DOCSTRINGS: gendoc$(BUILD_EXEEXT)
        ./gendoc > [EMAIL PROTECTED]
@@ -396,9 +400,9 @@
        cd $(DESTDIR)$(bindir) ; $(LN_S) octave-$(version)$(EXEEXT) 
octave$(EXEEXT)
 .PHONY: install-bin
 
-install-oct:
+install-oct: PKG_ADD.inst
        $(top_srcdir)/mkinstalldirs $(DESTDIR)$(octfiledir)
-       $(srcdir)/mk-pkg-add --prefix $(octfiledir) $(DLD_DEF_FILES) > 
$(DESTDIR)$(octfiledir)/PKG_ADD
+       $(INSTALL_DATA) PKG_ADD.inst $(DESTDIR)$(octfiledir)/PKG_ADD
        if [ -n "$(OCT_FILES)" ]; then \
          xfiles="$(OCT_FILES)"; \
          for f in $$xfiles; do \
@@ -472,6 +476,7 @@
        rm -f $(PICOBJ) $(DLD_PICOBJ) stmp-pic gendoc$(EXEEXT)
        rm -f builtins.cc ops.cc defaults.h oct-conf.h def-files var-files
        rm -f PKG_ADD
+       rm -f PKG_ADD.inst
        -rmdir pic
 .PHONY: clean
 
Index: src/mk-pkg-add
===================================================================
RCS file: /cvs/octave/src/mk-pkg-add,v
retrieving revision 1.1
diff -u -r1.1 mk-pkg-add
--- src/mk-pkg-add      11 Nov 2005 17:45:51 -0000      1.1
+++ src/mk-pkg-add      16 Nov 2005 18:43:40 -0000
@@ -1,21 +1,25 @@
 #! /bin/sh -e
 
-# Create additional links to .oct files that define more than one
-# function.
-
-# If the first arg is --print, only print the links we need to make.
-
-# The first non-option arg is taken as the directory where the .oct
-# files are installed.  The remaining arguments should be the list of
-# .df files corresponding to the source files that were used to
-# create the .oct files.
-
 SED=${SED:-'sed'}
 
+install=false
 if [ $1 = "--prefix" ]; then
   shift
   prefix="$1"
   shift
+elif [ $1 = "--install" ]; then
+  install=true
+  shift
+fi
+
+if [ $# -gt 0 ]; then
+  if $install; then
+    cat <<EOF
+__octfiledir__ = strrep (octave_config_info ("octfiledir"),
+                         octave_config_info ("prefix"),
+                         OCTAVE_HOME);
+EOF
+  fi
 fi
 
 for f in "$@"; do
@@ -33,7 +37,9 @@
          true
        else
           if [ -n "$prefix" ]; then
-           echo "autoload (\"$n\", \"$prefix/$base.oct\");"
+           echo "autoload (\"$n\", strcat (\"$prefix\", filesep, 
\"$base.oct\"));"
+          elif $install; then
+            echo "autoload (\"$n\", strcat (__octfiledir__, filesep, 
\"$base.oct\"));"
          else
            echo "autoload (\"$n\", \"$base.oct\");"
          fi


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to