Mercurial > hg > octave-nkf
changeset 15944:4803b8c138e3
use mkoctfile, not octave_config_info to get default pkg compiler tools
* common.mk (MKOCTFILE_AR, MKOCTFILE_RANLIB): New variables.
(do_subst_config_vals): Include MKOCTFILE_AR and MKOCTFILE_RANLIB in
the list of substitutions.
* configure.ac (MKOCTFILE_AR, MKOCTFILE_RANLIB): Additional mkoctfile
values that receive special treatment when cross compiling.
* pkg/private/configure_make.m: Use mkoctfile, not octave_config_info
to get values for CC, CXX, AR, and RANLIB.
* mkoctfile.in.cc, mkoctfile.in.sh (AR, RANLIB): New variables.
Update usage message.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 14 Jan 2013 14:59:01 -0500 |
parents | 75cea615ade4 |
children | 25eff7fe556d |
files | build-aux/common.mk configure.ac scripts/pkg/private/configure_make.m src/mkoctfile.in.cc src/mkoctfile.in.sh |
diffstat | 5 files changed, 66 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/build-aux/common.mk +++ b/build-aux/common.mk @@ -156,12 +156,14 @@ NO_UNDEFINED_LDFLAG = @NO_UNDEFINED_LDFLAG@ +MKOCTFILE_AR = @MKOCTFILE_AR@ MKOCTFILE_CC = @MKOCTFILE_CC@ MKOCTFILE_CXX = @MKOCTFILE_CXX@ MKOCTFILE_DL_LD = @MKOCTFILE_DL_LD@ MKOCTFILE_DL_LDFLAGS = @MKOCTFILE_DL_LDFLAGS@ MKOCTFILE_F77 = @MKOCTFILE_F77@ MKOCTFILE_LD_CXX = @MKOCTFILE_LD_CXX@ +MKOCTFILE_RANLIB = @MKOCTFILE_RANLIB@ # List of libraries and their special compilation flags @@ -572,12 +574,14 @@ -e "s|%OCTAVE_CONF_MAGICK_CPPFLAGS%|\"${MAGICK_CPPFLAGS}\"|" \ -e "s|%OCTAVE_CONF_MAGICK_LDFLAGS%|\"${MAGICK_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_MAGICK_LIBS%|\"${MAGICK_LIBS}\"|" \ + -e 's|%OCTAVE_CONF_MKOCTFILE_AR%|\"${MKOCTFILE_AR}\"|' \ -e 's|%OCTAVE_CONF_MKOCTFILE_CC%|\"${MKOCTFILE_CC}\"|' \ -e 's|%OCTAVE_CONF_MKOCTFILE_CXX%|\"${MKOCTFILE_CXX}\"|' \ -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LD%|\"${MKOCTFILE_DL_LD}\"|' \ -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${MKOCTFILE_DL_LDFLAGS}\"|' \ -e 's|%OCTAVE_CONF_MKOCTFILE_F77%|\"${MKOCTFILE_F77}\"|' \ -e 's|%OCTAVE_CONF_MKOCTFILE_LD_CXX%|\"${MKOCTFILE_LD_CXX}\"|' \ + -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}\"|" \ -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
--- a/configure.ac +++ b/configure.ac @@ -1814,30 +1814,38 @@ if test "$cross_compiling" = yes && test -n "$ac_tool_prefix"; then CROSS_TOOL_PREFIX="$ac_tool_prefix" + MKOCTFILE_AR='$(shell echo $(AR) | sed "s,$(CROSS_TOOL_PREFIX),,")' MKOCTFILE_CC='$(shell echo $(CC) | sed "s,$(CROSS_TOOL_PREFIX),,")' MKOCTFILE_CXX='$(shell echo $(CXX) | sed "s,$(CROSS_TOOL_PREFIX),,")' MKOCTFILE_DL_LD='$(shell echo $(DL_LD) | sed "s,$(CROSS_TOOL_PREFIX),,")' MKOCTFILE_F77='$(shell echo $(F77) | sed "s,$(CROSS_TOOL_PREFIX),,")' MKOCTFILE_LD_CXX='$(shell echo $(LD_CXX) | sed "s,$(CROSS_TOOL_PREFIX),,")' + MKOCTFILE_RANLIB='$(shell echo $(RANLIB) | sed "s,$(CROSS_TOOL_PREFIX),,")' else + MKOCTFILE_AR="$AR" MKOCTFILE_CC="$CC" MKOCTFILE_CXX="$CXX" MKOCTFILE_DL_LD="$DL_LD" MKOCTFILE_F77="$F77" MKOCTFILE_LD_CXX="$LD_CXX" + MKOCTFILE_RANLIB="$RANLIB" fi AC_MSG_NOTICE([defining CROSS_TOOL_PREFIX to be $CROSS_TOOL_PREFIX]) +AC_MSG_NOTICE([defining MKOCTFILE_AR to be $MKOCTFILE_AR]) AC_MSG_NOTICE([defining MKOCTFILE_CC to be $MKOCTFILE_CC]) AC_MSG_NOTICE([defining MKOCTFILE_CXX to be $MKOCTFILE_CXX]) AC_MSG_NOTICE([defining MKOCTFILE_DL_LD to be $MKOCTFILE_DL_LD]) AC_MSG_NOTICE([defining MKOCTFILE_F77 to be $MKOCTFILE_F77]) AC_MSG_NOTICE([defining MKOCTFILE_LD_CXX to be $MKOCTFILE_LD_CXX]) +AC_MSG_NOTICE([defining MKOCTFILE_RANLIB to be $MKOCTFILE_RANLIB]) AC_SUBST(CROSS_TOOL_PREFIX) +AC_SUBST(MKOCTFILE_AR) AC_SUBST(MKOCTFILE_CC) AC_SUBST(MKOCTFILE_CXX) AC_SUBST(MKOCTFILE_DL_LD) AC_SUBST(MKOCTFILE_F77) AC_SUBST(MKOCTFILE_LD_CXX) +AC_SUBST(MKOCTFILE_RANLIB) ### Check for existence of various libraries
--- a/scripts/pkg/private/configure_make.m +++ b/scripts/pkg/private/configure_make.m @@ -28,11 +28,11 @@ 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)); + mkoctfile_program = fullfile (octave_bindir, sprintf ("mkoctfile-%s", ver)); + octave_config_program = fullfile (octave_bindir, sprintf ("octave-config-%s", ver)); octave_binary = fullfile (octave_bindir, sprintf ("octave-%s", ver)); - cenv = {"MKOCTFILE"; mkoctfile; - "OCTAVE_CONFIG"; octave_config; + cenv = {"MKOCTFILE"; mkoctfile_program; + "OCTAVE_CONFIG"; octave_config_program; "OCTAVE"; octave_binary; "INSTALLDIR"; desc.dir}; scenv = sprintf ("%s=\"%s\" ", cenv{:}); @@ -40,16 +40,16 @@ if (exist (fullfile (src, "configure"), "file")) flags = ""; if (isempty (getenv ("CC"))) - flags = cstrcat (flags, " CC=\"", octave_config_info ("CC"), "\""); + flags = cstrcat (flags, " CC=\"", mkoctfile ("-p", "CC"), "\""); endif if (isempty (getenv ("CXX"))) - flags = cstrcat (flags, " CXX=\"", octave_config_info ("CXX"), "\""); + flags = cstrcat (flags, " CXX=\"", mkoctfile ("-p", "CXX"), "\""); endif if (isempty (getenv ("AR"))) - flags = cstrcat (flags, " AR=\"", octave_config_info ("AR"), "\""); + flags = cstrcat (flags, " AR=\"", mkoctfile ("-p", "AR"), "\""); endif if (isempty (getenv ("RANLIB"))) - flags = cstrcat (flags, " RANLIB=\"", octave_config_info ("RANLIB"), "\""); + flags = cstrcat (flags, " RANLIB=\"", mkoctfile ("-p", "RANLIB"), "\""); endif [status, output] = shell (cstrcat ("cd '", src, "'; ", scenv, "./configure --prefix=\"",
--- a/src/mkoctfile.in.cc +++ b/src/mkoctfile.in.cc @@ -214,6 +214,9 @@ vars["XTRA_CFLAGS"] = get_variable ("XTRA_CFLAGS", %OCTAVE_CONF_XTRA_CFLAGS%); vars["XTRA_CXXFLAGS"] = get_variable ("XTRA_CXXFLAGS", %OCTAVE_CONF_XTRA_CXXFLAGS%); + vars["AR"] = get_variable ("AR", %OCTAVE_CONF_MKOCTFILE_AR%); + vars["RANLIB"] = get_variable ("RANLIB", %OCTAVE_CONF_MKOCTFILE_RANLIB%); + vars["DEPEND_FLAGS"] = get_variable ("DEPEND_FLAGS", %OCTAVE_CONF_DEPEND_FLAGS%); vars["DEPEND_EXTRA_SED_PATTERN"] = get_variable ("DEPEND_EXTRA_SED_PATTERN", %OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%); @@ -299,30 +302,29 @@ " -p VAR, --print VAR Print configuration variable VAR. Recognized\n" " variables are:\n" "\n" -" ALL_CFLAGS FLIBS\n" -" ALL_CXXFLAGS FPICFLAG\n" -" ALL_FFLAGS INCFLAGS\n" -" ALL_LDFLAGS LAPACK_LIBS\n" -" BLAS_LIBS LDFLAGS\n" -" CC LD_CXX\n" -" CFLAGS LD_STATIC_FLAG\n" -" CPICFLAG LFLAGS\n" -" CPPFLAGS LIBOCTAVE\n" -" CXX LIBOCTINTERP\n" -" CXXFLAGS LIBS\n" -" CXXPICFLAG OCTAVE_LIBS\n" -" DEPEND_EXTRA_SED_PATTERN OCTAVE_LINK_DEPS\n" -" DEPEND_FLAGS OCTAVE_LINK_OPTS\n" -" DL_LD OCT_LINK_DEPS\n" -" DL_LDFLAGS OCT_LINK_OPTS\n" -" EXEEXT RDYNAMIC_FLAG\n" -" F77 READLINE_LIBS\n" -" F77_INTEGER_8_FLAG SED\n" -" FFLAGS XTRA_CFLAGS\n" -" FFTW3_LDFLAGS XTRA_CXXFLAGS\n" -" FFTW3_LIBS\n" -" FFTW3F_LDFLAGS\n" -" FFTW3F_LIBS\n" +" ALL_CFLAGS FFTW3F_LDFLAGS\n" +" ALL_CXXFLAGS FFTW3F_LIBS\n" +" ALL_FFLAGS FLIBS\n" +" ALL_LDFLAGS FPICFLAG\n" +" AR INCFLAGS\n" +" BLAS_LIBS LAPACK_LIBS\n" +" CC LDFLAGS\n" +" CFLAGS LD_CXX\n" +" CPICFLAG LD_STATIC_FLAG\n" +" CPPFLAGS LFLAGS\n" +" CXX LIBOCTAVE\n" +" CXXFLAGS LIBOCTINTERP\n" +" CXXPICFLAG LIBS\n" +" DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS\n" +" DEPEND_FLAGS OCTAVE_LINK_DEPS\n" +" DL_LD OCT_LINK_DEPS\n" +" DL_LDFLAGS RANLIB\n" +" EXEEXT RDYNAMIC_FLAG\n" +" F77 READLINE_LIBS\n" +" F77_INTEGER_8_FLAG SED\n" +" FFLAGS XTRA_CFLAGS\n" +" FFTW3_LDFLAGS XTRA_CXXFLAGS\n" +" FFTW3_LIBS\n" "\n" " --link-stand-alone Link a stand-alone executable file.\n" "\n"
--- a/src/mkoctfile.in.sh +++ b/src/mkoctfile.in.sh @@ -79,6 +79,9 @@ : ${XTRA_CFLAGS=%OCTAVE_CONF_XTRA_CFLAGS%} : ${XTRA_CXXFLAGS=%OCTAVE_CONF_XTRA_CXXFLAGS%} +: ${AR=%OCTAVE_CONF_MKOCTFILE_AR%} +: ${RANLIB=%OCTAVE_CONF_MKOCTFILE_RANLIB%} + : ${DEPEND_FLAGS=%OCTAVE_CONF_DEPEND_FLAGS%} : ${DEPEND_EXTRA_SED_PATTERN=%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%} @@ -233,29 +236,30 @@ -p VAR, --print VAR Print configuration variable VAR. Recognized variables are: - ALL_CFLAGS FFTW3F_LIBS - ALL_CXXFLAGS FLIBS - ALL_FFLAGS FPICFLAG - ALL_LDFLAGS INCFLAGS + ALL_CFLAGS FFTW3F_LDFLAGS + ALL_CXXFLAGS FFTW3F_LIBS + ALL_FFLAGS FLIBS + ALL_LDFLAGS FPICFLAG + AR INCFLAGS BLAS_LIBS LAPACK_LIBS CC LDFLAGS CFLAGS LD_CXX CPICFLAG LD_STATIC_FLAG CPPFLAGS LFLAGS - CXX LIBOCTAVE - CXXFLAGS LIBOCTINTERP - CXXPICFLAG LIBS - DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS + CXX LIBOCTAVE + CXXFLAGS LIBOCTINTERP + CXXPICFLAG LIBS + DEPEND_EXTRA_SED_PATTERN OCTAVE_LIBS DEPEND_FLAGS OCTAVE_LINK_DEPS - DL_LD OCT_LINK_DEPS - DL_LDFLAGS RDYNAMIC_FLAG - EXEEXT READLINE_LIBS - F77 SED - F77_INTEGER_8_FLAG XTRA_CFLAGS - FFLAGS XTRA_CXXFLAGS - FFTW3_LDFLAGS + DL_LD OCT_LINK_DEPS + DL_LDFLAGS RANLIB + EXEEXT RDYNAMIC_FLAG + F77 READLINE_LIBS + F77_INTEGER_8_FLAG SED + FFLAGS XTRA_CFLAGS + FFTW3_LDFLAGS XTRA_CXXFLAGS FFTW3_LIBS - FFTW3F_LDFLAGS + -v, --verbose Echo commands as they are executed.