changeset 20180:28a9e59d0714

cross-tools: Add ability to build cross built octave-config * configure.ac: rename --enable-cross-mkoctfile to --enable-cross-tools * src/Makefile.am: rename AMCOND_CROSS_MKOCTFILE to AMCOND_CROSS_TOOLS, add rule to build $(host_triplet)-octave-config$(BUILD_EXEEXT)
author John Donoghue
date Fri, 20 Mar 2015 08:44:24 -0400
parents f7846f0ea6db
children 117ccb5080c1
files configure.ac src/Makefile.am
diffstat 2 files changed, 25 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac
+++ b/configure.ac
@@ -2957,20 +2957,20 @@
 AC_SUBST(QT_LDFLAGS)
 AC_SUBST(QT_LIBS)
 
-# do we want to create cross-mkoctfile ?
-cross_mkoctfile=no
-AC_ARG_ENABLE([cross-mkoctfile],
-  [AS_HELP_STRING([--enable-cross-mkoctfile],
-    [build cross-mkoctfile if cross compiling])],
-  [if test "$enableval" = yes; then cross_mkoctfile=yes; fi])
-
-if test "$cross_mkoctfile" = yes; then
+# do we want to create cross-mkoctfile etc ?
+cross_tools=no
+AC_ARG_ENABLE([cross-tools],
+  [AS_HELP_STRING([--enable-cross-tools],
+    [build cross tools (mkoctfile, octave-config) if cross compiling])],
+  [if test "$enableval" = yes; then cross_tools=yes; fi])
+
+if test "$cross_tools" = yes; then
   if test "$cross_compiling" = no; then
-    AC_MSG_WARN([ignoring --enable-cross-mkoctfile when not cross compiling])
-    cross_mkoctfile=no
+    AC_MSG_WARN([ignoring --enable-cross-tools when not cross compiling])
+    cross_tools=no
   fi
 fi
-AM_CONDITIONAL([AMCOND_CROSS_MKOCTFILE], [test $cross_mkoctfile = yes])
+AM_CONDITIONAL([AMCOND_CROSS_TOOLS], [test $cross_tools = yes])
 
 
 ### Decide whether or not to install build logs with Octave.
@@ -3141,7 +3141,7 @@
   Include support for GNU readline:   $USE_READLINE
   64-bit array dims and indexing:     $USE_64_BIT_IDX_T
   OpenMP SMP multithreading:          $USE_OPENMP
-  Build cross mkoctfile:              $cross_mkoctfile
+  Build cross tools:                  $cross_tools
 ])
 
 warn_msg_printed=false
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -131,17 +131,25 @@
   $(top_builddir)/libgnu/libgnu.la \
   $(LIBS)
 
-# if building cross octfile
 OCTAVE_CROSS_TOOLS=
-if AMCOND_CROSS_MKOCTFILE
+if AMCOND_CROSS_TOOLS
+# building cross mkoctfile
 OCTAVE_CROSS_TOOLS += $(host_triplet)-mkoctfile$(BUILD_EXEEXT)
 $(host_triplet)-mkoctfile$(BUILD_EXEEXT): $(host_triplet)-mkoctfile.cc
 	$(BUILD_CXX) -o $(host_triplet)-mkoctfile$(BUILD_EXEEXT) -Dgnulib='' -Doctave_idx_type=int $(DEFAULT_INCLUDES) $(BUILD_CXXFLAGS) $(BUILD_LDFLAGS) $(host_triplet)-mkoctfile.cc
-mostlyclean-local:
-	-rm -f $(TARGET)-mkoctfile$(BUILD_EXEEXT)
-
 $(host_triplet)-mkoctfile.cc: mkoctfile.in.cc Makefile
 	$(AM_V_GEN)$(do_subst_cross_config_vals)
+
+# building cross octave-config
+OCTAVE_CROSS_TOOLS += $(host_triplet)-octave-config$(BUILD_EXEEXT)
+$(host_triplet)-octave-config$(BUILD_EXEEXT): $(host_triplet)-octave-config.cc
+	$(BUILD_CXX) -o $(host_triplet)-octave-config$(BUILD_EXEEXT) -Dgnulib='' -Doctave_idx_type=int $(DEFAULT_INCLUDES) $(BUILD_CXXFLAGS) $(BUILD_LDFLAGS) $(host_triplet)-octave-config.cc
+$(host_triplet)-octave-config.cc: octave-config.in.cc Makefile
+	$(AM_V_GEN)$(do_subst_default_vals)
+
+mostlyclean-local:
+	-rm -f $(OCTAVE_CROSS_TOOLS)
+
 endif
 
 all-local: $(OCTAVE_VERSION_LINKS) $(OCTAVE_CROSS_TOOLS)