octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relocatable octave


From: John W. Eaton
Subject: Re: Relocatable octave
Date: Fri, 1 Jun 2007 14:25:34 -0400

On  1-Jun-2007, Thomas Treichl wrote:

| There are some entries left - I don't know if they should also be replaced 
(if 
| you please could have a look at them):
| 
|    MKOCTFILE_DL_LDFLAGS = -bundle -bundle_loader \
|      /tmp/octave-2.9.12/bin/octave-2.9.12

See the attached patch.  I think this change will handle the current
case, but it is not exactly a general solution for this kind of
problem.  We don't want to blindly apply the OCTAVE_HOME substitution
everywhere, so we have to arrange to build these kinds of variables
from others that we know are "safe" for substitution.  I could not
find a better solution to handle the quoting.  Maybe someone else
knows a better way?

|    SONAME_FLAGS = \
|      -install_name /tmp/octave-2.9.12/lib/octave-2.9.12/oct-conf.h

I think this is just used while building of Octave and doesn't appear
in any generated script, so it is probably not necessary to change it.

|    config_opts = 'CC=gcc' 'CPP=cpp' 'CXX=g++' 'F77=gfortran' \
|      'CFLAGS=-I/opt/local/include' 'CPPFLAGS=-I/opt/local/include' \
|      'LDFLAGS=-L/opt/local/lib' '--enable-shared' '--disable-static' \
|      '--prefix=/tmp/octave-2.9.12'

This is a record of the options that were passed to configure, so it
should not be changed.

| A test gave me
| 
|    octave:14> mkoctfile oregonator.cc
|    /usr/bin/ld: can't open: /tmp/octave-2.9.12/bin/octave-2.9.12 \
|      (No such file or directory, errno = 2)
|    collect2: ld returned 1 exit status
|    warning: mkoctfile exited with failure status
| 
| So I needed to set up (at least)
| 
|    export DL_LDFLAGS "-bundle -bundle_loader \
|      /Users/MyHome/octave.app/Contents/Resources/bin/octave-2.9.12"
| 
| but I do think that this isn't the right path I'm taking even if it does work 
| with this environment variable (LDFLAGS -> bin)?!

I don't know what the purpose of the -bundle_loader option is, or why
its argument is the Octave binary itself.

jwe


ChangeLog:

2007-06-01  John W. Eaton  <address@hidden>

        * configure.in (*-*-darwin*): Fix quoting and construction of
        MKOCTFILE_DL_LDFLAGS.
        * mkoctfile.in (DEFAULT_BINDIR, EXEEXT): New substitutions.
        * Makeconf.in (MKOCTFILE_DL_LDFLAGS): Delete.
        (do-subst-config-vals): Do configure substitution of
        MKOCTFILE_DL_LDFLAGS directly here instead of using intermediate
        variable.  Quote this sed substitution with ' instead of ".


Index: Makeconf.in
===================================================================
RCS file: /cvs/octave/Makeconf.in,v
retrieving revision 1.192
diff -u -u -r1.192 Makeconf.in
--- Makeconf.in 22 May 2007 16:33:06 -0000      1.192
+++ Makeconf.in 1 Jun 2007 18:18:36 -0000
@@ -351,8 +351,6 @@
 # LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PATH, ...
 library_path_var = @library_path_var@
 
-MKOCTFILE_DL_LDFLAGS = @MKOCTFILE_DL_LDFLAGS@
-
 NO_OCT_FILE_STRIP = @NO_OCT_FILE_STRIP@
 
 # The following pattern rules and the substitution functions require
@@ -500,7 +498,7 @@
   -e "s|%OCTAVE_CONF_LIBREADLINE%|\"${LIBREADLINE}\"|" \
   -e "s|%OCTAVE_CONF_LIBS%|\"${LIBS}\"|" \
   -e "s|%OCTAVE_CONF_LN_S%|\"${LN_S}\"|" \
-  -e "s|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${MKOCTFILE_DL_LDFLAGS}\"|" \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"@address@hidden"|' \
   -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
   -e "s|%OCTAVE_CONF_OCTLIBDIR%|\"${octlibdir}\"|" \
   -e "s|%OCTAVE_CONF_PREFIX%|\"${prefix}\"|" \
Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.561
diff -u -u -r1.561 configure.in
--- configure.in        29 May 2007 07:57:19 -0000      1.561
+++ configure.in        1 Jun 2007 18:18:36 -0000
@@ -1106,7 +1106,7 @@
   ;;
   *-*-darwin*)
     DL_LDFLAGS='-bundle -bundle_loader $(TOPDIR)/src/octave $(LDFLAGS)'
-    MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader 
$(bindir)/octave-$(version)$(EXEEXT)'
+    MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader 
$$BINDIR/octave-$$OCTAVE_VERSION$$EXEEXT'
     SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)'
     CXXPICFLAG=
     CPICFLAG=
Index: mkoctfile.in
===================================================================
RCS file: /cvs/octave/mkoctfile.in,v
retrieving revision 1.57
diff -u -u -r1.57 mkoctfile.in
--- mkoctfile.in        16 Feb 2007 11:14:44 -0000      1.57
+++ mkoctfile.in        1 Jun 2007 18:18:36 -0000
@@ -12,18 +12,21 @@
 OCTAVE_VERSION=%OCTAVE_CONF_VERSION%
 OCTAVE_PREFIX=%OCTAVE_CONF_PREFIX%
 
-DEFAULT_OCTINCLUDEDIR=%OCTAVE_CONF_OCTINCLUDEDIR%
+DEFAULT_BINDIR=%OCTAVE_BINDIR%
 DEFAULT_INCLUDEDIR=%OCTAVE_CONF_INCLUDEDIR%
+DEFAULT_OCTINCLUDEDIR=%OCTAVE_CONF_OCTINCLUDEDIR%
 DEFAULT_OCTLIBDIR=%OCTAVE_CONF_OCTLIBDIR%
 
 if [ -n "$OCTAVE_HOME" ]; then
-  DEFAULT_OCTINCLUDEDIR="`echo $DEFAULT_OCTINCLUDEDIR | $SED 
"s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
+  DEFAULT_BINDIR="`echo $DEFAULT_BINDIR | $SED 
"s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
   DEFAULT_INCLUDEDIR="`echo $DEFAULT_INCLUDEDIR | $SED 
"s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
+  DEFAULT_OCTINCLUDEDIR="`echo $DEFAULT_OCTINCLUDEDIR | $SED 
"s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
   DEFAULT_OCTLIBDIR="`echo $DEFAULT_OCTLIBDIR | $SED 
"s,^$OCTAVE_PREFIX,$OCTAVE_HOME,"`"
 fi
 
-: ${OCTINCLUDEDIR=$DEFAULT_OCTINCLUDEDIR}
+: ${BINDIR=$DEFAULT_BINDIR}
 : ${INCLUDEDIR=$DEFAULT_INCLUDEDIR}
+: ${OCTINCLUDEDIR=$DEFAULT_OCTINCLUDEDIR}
 : ${OCTLIBDIR=$DEFAULT_OCTLIBDIR}
 
 DEFAULT_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/octave"
@@ -36,6 +39,8 @@
 # Default values for these variables are filled in when Octave is
 # compiled. 
 
+: ${EXEEXT=%OCTAVE_CONF_EXEEXT%}
+
 : ${CPPFLAGS=%OCTAVE_CONF_CPPFLAGS%}
 : ${INCFLAGS=$DEFAULT_INCFLAGS}
 : ${F2C=%OCTAVE_CONF_F2C%}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]