[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: RE: RE: OCTAVE_HOME support in octave_config_info
From: |
John W. Eaton |
Subject: |
RE: RE: RE: OCTAVE_HOME support in octave_config_info |
Date: |
Thu, 15 Feb 2007 16:18:13 -0500 |
On 7-Feb-2007, address@hidden wrote:
| > OK, I fixed it to also substitute prefix, exec_prefix, and infofile
| > (though maybe infofile should just be the name of the file itself, and
| > any code that needs to use that should concat it with infodir).
| >
| > Currently there is also no substitution for MKOCTFILE_INCFLAGS,
| > MKOCTFILE_LFLAGS, or RLD_FLAG because I don't see how to do the
| > substitution properly, so I think the portions of these variables that
| > contain directory names need to have the substitution done on the
| > directory name before those names are combind with the option
| > characters, etc.
| >
| > I also checked in the following change to avoid possibly bad substitutions.
|
| OK, thanks. The reason I implemented multiple substitution was specifically
| for cases like MKOCTFILE_INCFLAGS, which contain several instances
| of the prefix to substitute. As long as these are not substituted (or another
| mechanism is used), single substitution is OK.
I checked in the attached changes to handle OCTAVE_HOME in the
mkoctfile and octave-config scripts. I've eliminated
MKOCTFILE_INCFLAGS and MKOCTFILE_LFLAGS from Makeconf and other files,
and constructed INCFLAGS and LFLAGS directly in the mkoctfile script
from other variables, which have OCTAVE_HOME substituted.
Will you please make your C++ versions of these scripts do the same?
Once you do that, I think we should include those files in the Octave
sources, even if they are only built on Windows systems for now.
Thanks,
jwe
ChangeLog:
2007-02-15 John W. Eaton <address@hidden>
* octave-config.in (DATAROOTDIR): Include in list of vars.
Substitute OCTAVE_HOME.
* Makeconf.in (MKOCTFILE_INCFLAGS, MKOCTFILE_LFLAGS): Delete vars.
(do-subst-config-vals): Don't substitute them.
Also substitute OCTAVE_CONF_INCLUDEDIR, OCTAVE_CONF_OCTINCLUDEDIR,
OCTAVE_CONF_OCTLIBDIR, and OCTAVE_CONF_PREFIX here.
* mkoctfile.in (OCTAVE_CONF_OCTINCLUDEDIR, OCTAVE_CONF_INCLUDEDIR,
OCTAVE_CONF_OCTLIBDIR): Substitute values and perform OCTAVE_HOME
substitution here.
(DEFAULT_INCFLAGS, DEFAULT_LFLAGS): New variables. Use them to
set default values for INCFLAGS and LFLAGS.
Index: Makeconf.in
===================================================================
RCS file: /cvs/octave/Makeconf.in,v
retrieving revision 1.187
diff -u -u -r1.187 Makeconf.in
--- Makeconf.in 8 Feb 2007 03:47:19 -0000 1.187
+++ Makeconf.in 15 Feb 2007 21:13:54 -0000
@@ -351,18 +351,6 @@
# LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PATH, ...
library_path_var = @library_path_var@
-# The -I flags to use for the mkoctfile script.
-ifeq ($(includedir),/usr/include)
- MKOCTFILE_INCFLAGS = \
- -I$(octincludedir) -I$(octincludedir)/octave
-else
- MKOCTFILE_INCFLAGS = \
- -I$(octincludedir) -I$(octincludedir)/octave -I$(includedir)
-endif
-
-# The -L flags to use for the mkoctfile scrip (for --link-stand-alone)
-MKOCTFILE_LFLAGS = -L$(octlibdir)
-
MKOCTFILE_DL_LDFLAGS = @MKOCTFILE_DL_LDFLAGS@
NO_OCT_FILE_STRIP = @NO_OCT_FILE_STRIP@
@@ -495,6 +483,7 @@
-e "s|%OCTAVE_CONF_FPICFLAG%|\"${FPICFLAG}\"|" \
-e "s|%OCTAVE_CONF_GLPK_LIBS%|\"${GLPK_LIBS}\"|" \
-e "s|%OCTAVE_CONF_INCFLAGS%|\"${INCFLAGS}\"|" \
+ -e "s|%OCTAVE_CONF_INCLUDEDIR%|\"${includedir}\"|" \
-e "s|%OCTAVE_CONF_LD_CXX%|\"${LD_CXX}\"|" \
-e "s|%OCTAVE_CONF_LDFLAGS%|\"${LDFLAGS}\"|" \
-e "s|%OCTAVE_CONF_LD_STATIC_FLAG%|\"${LD_STATIC_FLAG}\"|" \
@@ -512,8 +501,9 @@
-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_INCFLAGS%|\"${MKOCTFILE_INCFLAGS}\"|" \
- -e "s|%OCTAVE_CONF_MKOCTFILE_LFLAGS%|\"${MKOCTFILE_LFLAGS}\"|" \
+ -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
+ -e "s|%OCTAVE_CONF_OCTLIBDIR%|\"${octlibdir}\"|" \
+ -e "s|%OCTAVE_CONF_PREFIX%|\"${prefix}\"|" \
-e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \
-e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \
-e "s|%OCTAVE_CONF_RLD_FLAG%|\"${RLD_FLAG}\"|" \
Index: mkoctfile.in
===================================================================
RCS file: /cvs/octave/mkoctfile.in,v
retrieving revision 1.55
diff -u -u -r1.55 mkoctfile.in
--- mkoctfile.in 9 Feb 2007 22:01:37 -0000 1.55
+++ mkoctfile.in 15 Feb 2007 21:13:54 -0000
@@ -7,15 +7,37 @@
set -e
+: ${SED=%OCTAVE_CONF_SED%}
+
OCTAVE_VERSION=%OCTAVE_CONF_VERSION%
+OCTAVE_PREFIX=%OCTAVE_CONF_PREFIX%
+
+DEFAULT_OCTINCLUDEDIR=%OCTAVE_CONF_OCTINCLUDEDIR%
+DEFAULT_INCLUDEDIR=%OCTAVE_CONF_INCLUDEDIR%
+DEFAULT_OCTLIBDIR=%OCTAVE_CONF_OCTLIBDIR%
+
+if [ -n "$OCTAVE_HOME" ]; then
+ DEFAULT_OCTINCLUDEDIR="`echo $DEFAULT_OCTINCLUDEDIR | $SED
"s,^$OCTAVE_CONF_PREFIX,$OCTAVE_HOME,"`"
+ DEFAULT_INCLUDEDIR="`echo $DEFAULT_INCLUDEDIR | $SED
"s,^$OCTAVE_CONF_PREFIX,$OCTAVE_HOME,"`"
+ DEFAULT_OCTLIBDIR="`echo $DEFAULT_OCTLIBDIR | $SED
"s,^$OCTAVE_CONF_PREFIX,$OCTAVE_HOME,"`"
+fi
+
+: ${OCTINCLUDEDIR=$DEFAULT_OCTINCLUDEDIR}
+: ${INCLUDEDIR=$DEFAULT_INCLUDEDIR}
+: ${OCTLIBDIR=$DEFAULT_OCTLIBDIR}
+
+DEFAULT_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/octave"
+if [ "$INCLUDEDIR" != /usr/include ]; then
+ DEFAULT_INCFLAGS="$DEFAULT_INCFLAGS -I$INCLUDEDIR"
+fi
+
+DEFAULT_LFLAGS="-L$OCTLIBDIR"
# Default values for these variables are filled in when Octave is
# compiled.
-: ${SED=%OCTAVE_CONF_SED%}
-
: ${CPPFLAGS=%OCTAVE_CONF_CPPFLAGS%}
-: ${INCFLAGS=%OCTAVE_CONF_MKOCTFILE_INCFLAGS%}
+: ${INCFLAGS=$DEFAULT_INCFLAGS}
: ${F2C=%OCTAVE_CONF_F2C%}
: ${F2CFLAGS=%OCTAVE_CONF_F2CFLAGS%}
: ${F77=%OCTAVE_CONF_F77%}
@@ -49,7 +71,7 @@
: ${LD_CXX=%OCTAVE_CONF_LD_CXX%}
: ${LDFLAGS=%OCTAVE_CONF_LDFLAGS%}
: ${LD_STATIC_FLAG=%OCTAVE_CONF_LD_STATIC_FLAG%}
-: ${LFLAGS=%OCTAVE_CONF_MKOCTFILE_LFLAGS%}
+: ${LFLAGS=$DEFAULT_LFLAGS}
: ${ALL_FFLAGS="$FFLAGS"}
Index: octave-config.in
===================================================================
RCS file: /cvs/octave/octave-config.in,v
retrieving revision 1.7
diff -u -u -r1.7 octave-config.in
--- octave-config.in 27 Jul 2006 19:35:22 -0000 1.7
+++ octave-config.in 15 Feb 2007 21:13:54 -0000
@@ -11,6 +11,7 @@
ARCHLIBDIR=%OCTAVE_ARCHLIBDIR%
BINDIR=%OCTAVE_BINDIR%
DATADIR=%OCTAVE_DATADIR%
+DATADIR=%OCTAVE_DATAROOTDIR%
EXEC_PREFIX=%OCTAVE_EXEC_PREFIX%
FCNFILEDIR=%OCTAVE_FCNFILEDIR%
IMAGEDIR=%OCTAVE_IMAGEDIR%
@@ -19,7 +20,6 @@
INFOFILE=%OCTAVE_INFOFILE%
LIBDIR=%OCTAVE_LIBDIR%
LIBEXECDIR=%OCTAVE_LIBEXECDIR%
-LIBEXECDIR=%OCTAVE_LIBEXECDIR%
LOCALAPIARCHLIBDIR=%OCTAVE_LOCALAPIARCHLIBDIR%
LOCALAPIFCNFILEDIR=%OCTAVE_LOCALAPIFCNFILEDIR%
LOCALAPIOCTFILEDIR=%OCTAVE_LOCALAPIOCTFILEDIR%
@@ -40,6 +40,38 @@
STARTUPFILEDIR=%OCTAVE_STARTUPFILEDIR%
VERSION=%OCTAVE_VERSION%
+if [ -n "$OCTAVE_HOME" ]; then
+ ARCHLIBDIR="`echo $ARCHLIBDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ BINDIR="`echo $BINDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ DATADIR="`echo $DATADIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ DATAROOTDIR="`echo $DATAROOTDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ EXEC_PREFIX="`echo $EXEC_PREFIX | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ FCNFILEDIR="`echo $FCNFILEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ IMAGEDIR="`echo $IMAGEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ INCLUDEDIR="`echo $INCLUDEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ INFODIR="`echo $INFODIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ INFOFILE="`echo $INFOFILE | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ LIBDIR="`echo $LIBDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ LIBEXECDIR="`echo $LIBEXECDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALAPIARCHLIBDIR="`echo $LOCALAPIARCHLIBDIR | sed
"s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALAPIFCNFILEDIR="`echo $LOCALAPIFCNFILEDIR | sed
"s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALAPIOCTFILEDIR="`echo $LOCALAPIOCTFILEDIR | sed
"s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALARCHLIBDIR="`echo $LOCALARCHLIBDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALFCNFILEDIR="`echo $LOCALFCNFILEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALOCTFILEDIR="`echo $LOCALOCTFILEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALSTARTUPFILEDIR="`echo $LOCALSTARTUPFILEDIR | sed
"s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALVERARCHLIBDIR="`echo $LOCALVERARCHLIBDIR | sed
"s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALVERFCNFILEDIR="`echo $LOCALVERFCNFILEDIR | sed
"s,^$PREFIX,$OCTAVE_HOME,"`"
+ LOCALVEROCTFILEDIR="`echo $LOCALVEROCTFILEDIR | sed
"s,^$PREFIX,$OCTAVE_HOME,"`"
+ MAN1DIR="`echo $MAN1DIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ MANDIR="`echo $MANDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ OCTFILEDIR="`echo $OCTFILEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ OCTINCLUDEDIR="`echo $OCTINCLUDEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ OCTLIBDIR="`echo $OCTLIBDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+ STARTUPFILEDIR="`echo $STARTUPFILEDIR | sed "s,^$PREFIX,$OCTAVE_HOME,"`"
+fi
+PREFIX="$OCTAVE_HOME"
+
usage_msg="usage: octave-config [options]"
if [ $# -eq 0 ]; then
Index: src/ChangeLog
===================================================================
RCS file: /cvs/octave/src/ChangeLog,v
retrieving revision 1.1638
diff -u -u -r1.1638 ChangeLog
--- src/ChangeLog 15 Feb 2007 03:39:10 -0000 1.1638
+++ src/ChangeLog 15 Feb 2007 21:13:59 -0000
@@ -1,3 +1,13 @@
+2007-02-15 John W. Eaton <address@hidden>
+
+ * toplev.cc (Foctave_config_info): Remove
+ OCTAVE_CONF_MKOCTFILE_INCFLAGS and OCTAVE_CONF_MKOCTFILE_LFLAGS
+ from the list.
+ * oct-conf.h.in (OCTAVE_CONF_MKOCTFILE_INCFLAGS,
+ OCTAVE_CONF_MKOCTFILE_LFLAGS): Don't define.
+ (OCTAVE_CONF_INCLUDEDIR, OCTAVE_CONF_OCTINCLUDEDIR,
+ OCTAVE_CONF_OCTLIBDIR, OCTAVE_CONF_PREFIX): New definitions.
+
2007-02-14 Alexander Barth <address@hidden>
* DLD-FUNCTIONS/interpn.cc: New file.
Index: src/oct-conf.h.in
===================================================================
RCS file: /cvs/octave/src/oct-conf.h.in,v
retrieving revision 1.29
diff -u -u -r1.29 oct-conf.h.in
--- src/oct-conf.h.in 9 Oct 2006 19:49:04 -0000 1.29
+++ src/oct-conf.h.in 15 Feb 2007 21:13:59 -0000
@@ -165,6 +165,10 @@
#define OCTAVE_CONF_INCFLAGS %OCTAVE_CONF_INCFLAGS%
#endif
+#ifndef OCTAVE_CONF_INCLUDEDIR
+#define OCTAVE_CONF_INCLUDEDIR %OCTAVE_CONF_INCLUDEDIR%
+#endif
+
#ifndef OCTAVE_CONF_LDFLAGS
#define OCTAVE_CONF_LDFLAGS %OCTAVE_CONF_LDFLAGS%
#endif
@@ -233,12 +237,16 @@
#define OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS %OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%
#endif
-#ifndef OCTAVE_CONF_MKOCTFILE_INCFLAGS
-#define OCTAVE_CONF_MKOCTFILE_INCFLAGS %OCTAVE_CONF_MKOCTFILE_INCFLAGS%
+#ifndef OCTAVE_CONF_OCTINCLUDEDIR
+#define OCTAVE_CONF_OCTINCLUDEDIR %OCTAVE_CONF_OCTINCLUDEDIR%
+#endif
+
+#ifndef OCTAVE_CONF_OCTLIBDIR
+#define OCTAVE_CONF_OCTLIBDIR %OCTAVE_CONF_OCTLIBDIR%
#endif
-#ifndef OCTAVE_CONF_MKOCTFILE_LFLAGS
-#define OCTAVE_CONF_MKOCTFILE_LFLAGS %OCTAVE_CONF_MKOCTFILE_LFLAGS%
+#ifndef OCTAVE_CONF_PREFIX
+#define OCTAVE_CONF_PREFIX %OCTAVE_CONF_PREFIX%
#endif
#ifndef OCTAVE_CONF_RANLIB
Index: src/toplev.cc
===================================================================
RCS file: /cvs/octave/src/toplev.cc,v
retrieving revision 1.193
diff -u -u -r1.193 toplev.cc
--- src/toplev.cc 7 Feb 2007 09:01:24 -0000 1.193
+++ src/toplev.cc 15 Feb 2007 21:13:59 -0000
@@ -787,8 +787,6 @@
{ false, "LIBS", OCTAVE_CONF_LIBS },
{ false, "LN_S", OCTAVE_CONF_LN_S },
{ false, "MKOCTFILE_DL_LDFLAGS", OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS },
- { false, "MKOCTFILE_INCFLAGS", OCTAVE_CONF_MKOCTFILE_INCFLAGS },
- { false, "MKOCTFILE_LFLAGS", OCTAVE_CONF_MKOCTFILE_LFLAGS },
{ false, "RANLIB", OCTAVE_CONF_RANLIB },
{ false, "RDYNAMIC_FLAG", OCTAVE_CONF_RDYNAMIC_FLAG },
{ false, "RLD_FLAG", OCTAVE_CONF_RLD_FLAG },
@@ -822,13 +820,13 @@
{ true, "infofile", OCTAVE_INFOFILE },
{ true, "libdir", OCTAVE_LIBDIR },
{ true, "libexecdir", OCTAVE_LIBEXECDIR },
+ { true, "localapiarchlibdir", OCTAVE_LOCALAPIARCHLIBDIR },
{ true, "localapifcnfiledir", OCTAVE_LOCALAPIFCNFILEDIR },
{ true, "localapioctfiledir", OCTAVE_LOCALAPIOCTFILEDIR },
{ true, "localarchlibdir", OCTAVE_LOCALARCHLIBDIR },
{ true, "localfcnfiledir", OCTAVE_LOCALFCNFILEDIR },
{ true, "localoctfiledir", OCTAVE_LOCALOCTFILEDIR },
{ true, "localstartupfiledir", OCTAVE_LOCALSTARTUPFILEDIR },
- { true, "localapiarchlibdir", OCTAVE_LOCALAPIARCHLIBDIR },
{ true, "localverarchlibdir", OCTAVE_LOCALVERARCHLIBDIR },
{ true, "localverfcnfiledir", OCTAVE_LOCALVERFCNFILEDIR },
{ true, "localveroctfiledir", OCTAVE_LOCALVEROCTFILEDIR },