Skip to content

Commit

Permalink
Make OCTAVE_LINK_DEPS and OCT_LINK_DEPS in mkoctfile relocatable.
Browse files Browse the repository at this point in the history
* build-aux/subst-config-vals.in.sh, build-aux/subst-cross-config-vals.in.sh:
Replace installation prefix in MKOCTFILE_OCTAVE_LINK_DEPS and
MKOCTFILE_OCT_LINK_DEPS with ${prefix}.
* mkoctfile.in.cc (make_vars_map): Replace ${prefix} in these flags with actual
installation prefix on runtime.
  • Loading branch information
mmuetzel committed Sep 30, 2024
1 parent e6d99ca commit 7e544b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
10 changes: 6 additions & 4 deletions build-aux/subst-config-vals.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,17 @@ if [ "x@OCTAVE_RELOCATE_ALL@" = "xyes" ]; then
flibs=`echo '@FLIBS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
ldflags=`echo '@LDFLAGS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
oct_link_opts=`echo '@OCT_LINK_OPTS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_octave_link_deps=`echo '@MKOCTFILE_OCTAVE_LINK_DEPS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_oct_link_deps=`echo '@MKOCTFILE_OCT_LINK_DEPS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
else
cppflags=`echo '@CPPFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
fftw3f_ldflags=`echo '@FFTW3F_LDFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
fftw3_ldflags=`echo '@FFTW3_LDFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
flibs=`echo '@FLIBS@' | $SED 's|\"|\\\\\\\"|g'`
ldflags=`echo '@LDFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
oct_link_opts=`echo '@OCT_LINK_OPTS@' | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_octave_link_deps=`echo '@MKOCTFILE_OCTAVE_LINK_DEPS@' | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_oct_link_deps=`echo '@MKOCTFILE_OCT_LINK_DEPS@' | $SED 's|\"|\\\\\\\"|g'`
fi


Expand Down Expand Up @@ -190,8 +194,6 @@ MKOCTFILE_CXX="@MKOCTFILE_CXX@"
MKOCTFILE_DL_LDFLAGS="@MKOCTFILE_DL_LDFLAGS@"
MKOCTFILE_F77="@MKOCTFILE_F77@"
MKOCTFILE_RANLIB="@MKOCTFILE_RANLIB@"
MKOCTFILE_OCTAVE_LINK_DEPS="@MKOCTFILE_OCTAVE_LINK_DEPS@"
MKOCTFILE_OCT_LINK_DEPS="@MKOCTFILE_OCT_LINK_DEPS@"
OCTAVE_LINK_DEPS="@OCTAVE_LINK_DEPS@"
OCTAVE_LINK_OPTS="@OCTAVE_LINK_OPTS@"
OCT_LINK_DEPS="@OCT_LINK_DEPS@"
Expand Down Expand Up @@ -346,8 +348,8 @@ $SED \
-e "s|%OCTAVE_CONF_MKOCTFILE_CXX%|\"${MKOCTFILE_CXX}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${MKOCTFILE_DL_LDFLAGS}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_F77%|\"${MKOCTFILE_F77}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%|\"${MKOCTFILE_OCTAVE_LINK_DEPS}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%|\"${MKOCTFILE_OCT_LINK_DEPS}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%|\"${mkoctfile_octave_link_deps}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%|\"${mkoctfile_oct_link_deps}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_RANLIB%|\"${MKOCTFILE_RANLIB}\"|" \
-e "s|%OCTAVE_CONF_OCTAVE_LINK_DEPS%|\"${OCTAVE_LINK_DEPS}\"|" \
-e "s|%OCTAVE_CONF_OCTAVE_LINK_OPTS%|\"${OCTAVE_LINK_OPTS}\"|" \
Expand Down
10 changes: 6 additions & 4 deletions build-aux/subst-cross-config-vals.in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,17 @@ if [ "x@OCTAVE_RELOCATE_ALL@" = "xyes" ]; then
flibs=`echo '@FLIBS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
ldflags=`echo '@LDFLAGS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
oct_link_opts=`echo '@OCT_LINK_OPTS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_octave_link_deps=`echo '@MKOCTFILE_OCTAVE_LINK_DEPS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_oct_link_deps=`echo '@MKOCTFILE_OCT_LINK_DEPS@' | $SED "s|@prefix@|\$\{prefix\}|g" | $SED 's|\"|\\\\\\\"|g'`
else
cppflags=`echo '@CPPFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
fftw3f_ldflags=`echo '@FFTW3F_LDFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
fftw3_ldflags=`echo '@FFTW3_LDFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
flibs=`echo '@FLIBS@' | $SED 's|\"|\\\\\\\"|g'`
ldflags=`echo '@LDFLAGS@' | $SED 's|\"|\\\\\\\"|g'`
oct_link_opts=`echo '@OCT_LINK_OPTS@' | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_octave_link_deps=`echo '@MKOCTFILE_OCTAVE_LINK_DEPS@' | $SED 's|\"|\\\\\\\"|g'`
mkoctfile_oct_link_deps=`echo '@MKOCTFILE_OCT_LINK_DEPS@' | $SED 's|\"|\\\\\\\"|g'`
fi


Expand Down Expand Up @@ -194,8 +198,6 @@ LN_S="@LN_S@"
MAGICK_CPPFLAGS="@MAGICK_CPPFLAGS@"
MAGICK_LDFLAGS="@MAGICK_LDFLAGS@"
MAGICK_LIBS="@MAGICK_LIBS@"
MKOCTFILE_OCTAVE_LINK_DEPS="@MKOCTFILE_OCTAVE_LINK_DEPS@"
MKOCTFILE_OCT_LINK_DEPS="@MKOCTFILE_OCT_LINK_DEPS@"
OCTAVE_LINK_DEPS="@OCTAVE_LINK_DEPS@"
OCTAVE_LINK_OPTS="@OCTAVE_LINK_OPTS@"
OCT_LINK_DEPS="@OCT_LINK_DEPS@"
Expand Down Expand Up @@ -350,8 +352,8 @@ $SED \
-e "s|%OCTAVE_CONF_MKOCTFILE_CXX%|\"${CXX}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_F77%|\"${F77}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%|\"${MKOCTFILE_OCTAVE_LINK_DEPS}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%|\"${MKOCTFILE_OCT_LINK_DEPS}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%|\"${mkoctfile_octave_link_deps}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%|\"${mkoctfile_oct_link_deps}\"|" \
-e "s|%OCTAVE_CONF_MKOCTFILE_RANLIB%|\"${RANLIB}\"|" \
-e "s|%OCTAVE_CONF_OCTAVE_LINK_DEPS%|\"${OCTAVE_LINK_DEPS}\"|" \
-e "s|%OCTAVE_CONF_OCTAVE_LINK_OPTS%|\"${OCTAVE_LINK_OPTS}\"|" \
Expand Down
4 changes: 2 additions & 2 deletions src/mkoctfile.in.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,13 @@ make_vars_map (bool link_stand_alone, bool verbose, bool debug)
replace_prefix (%OCTAVE_CONF_FLIBS%));

vars["OCTAVE_LINK_DEPS"] = get_variable ("OCTAVE_LINK_DEPS",
%OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%);
replace_prefix (%OCTAVE_CONF_MKOCTFILE_OCTAVE_LINK_DEPS%));

vars["OCTAVE_LINK_OPTS"] = get_variable ("OCTAVE_LINK_OPTS",
%OCTAVE_CONF_OCTAVE_LINK_OPTS%);

vars["OCT_LINK_DEPS"] = get_variable ("OCT_LINK_DEPS",
%OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%);
replace_prefix (%OCTAVE_CONF_MKOCTFILE_OCT_LINK_DEPS%));

vars["OCT_LINK_OPTS"]
= get_variable ("OCT_LINK_OPTS",
Expand Down

0 comments on commit 7e544b9

Please sign in to comment.