summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-02-03 20:12:12 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-02-03 20:12:12 +0200
commitae0d3255ddd792402650ad0caaf611dcc3ada091 (patch)
tree29e84a70d30630de638752bdf64be6ca1a1656fc
parente893d68460908a358a3a0cfbb08c177610955eaf (diff)
downloadgawk-ae0d3255ddd792402650ad0caaf611dcc3ada091.tar.gz
Additional changes for cross-compiling.
-rw-r--r--ChangeLog4
-rw-r--r--awklib/ChangeLog5
-rw-r--r--awklib/Makefile.am5
-rw-r--r--awklib/Makefile.in3
-rwxr-xr-xconfigure15
-rw-r--r--configure.ac3
6 files changed, 34 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f1ef7f34..e52e3ebb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-02-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac: Add Automake test for cross compiling.
+
2013-01-31 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Include "dfa.h" which includes regex.h after limits.h
diff --git a/awklib/ChangeLog b/awklib/ChangeLog
index 1b6a31e6..e286a469 100644
--- a/awklib/ChangeLog
+++ b/awklib/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (AWKPROG): Add definition and conditional for
+ cross compiling. Thanks to Juergen Kahrs.
+
2013-01-08 Andrew J. Schorr <aschorr@telemetry-investments.com>
* eg/lib/inplace.awk: Add new file generated from doc/gawk.texi.
diff --git a/awklib/Makefile.am b/awklib/Makefile.am
index 4ff14036..b10fa644 100644
--- a/awklib/Makefile.am
+++ b/awklib/Makefile.am
@@ -26,7 +26,12 @@
EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg
# With some locales, the script extract.awk fails.
# So we fix the locale to some sensible value.
+
+if TEST_CROSS_COMPILE
+AWKPROG = LC_ALL=C LANG=C awk$(EXEEXT)
+else
AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT)
+endif
# Get config.h from the build directory and custom.h from the source directory.
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index d4a7788c..f392eeb7 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -276,9 +276,10 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = ChangeLog ChangeLog.0 extract.awk eg $(srcdir)/stamp-eg
+@TEST_CROSS_COMPILE_FALSE@AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT)
# With some locales, the script extract.awk fails.
# So we fix the locale to some sensible value.
-AWKPROG = LC_ALL=C LANG=C $(abs_top_builddir)/gawk$(EXEEXT)
+@TEST_CROSS_COMPILE_TRUE@AWKPROG = LC_ALL=C LANG=C awk$(EXEEXT)
# Get config.h from the build directory and custom.h from the source directory.
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
diff --git a/configure b/configure
index 769237e7..c4c89138 100755
--- a/configure
+++ b/configure
@@ -638,6 +638,8 @@ LTLIBSIGSEGV
LIBSIGSEGV
HAVE_LIBSIGSEGV
LIBOBJS
+TEST_CROSS_COMPILE_FALSE
+TEST_CROSS_COMPILE_TRUE
POSUB
LTLIBINTL
LIBINTL
@@ -8375,6 +8377,15 @@ done
fi
+ if test "x$build_alias" != "x$host_alias"; then
+ TEST_CROSS_COMPILE_TRUE=
+ TEST_CROSS_COMPILE_FALSE='#'
+else
+ TEST_CROSS_COMPILE_TRUE='#'
+ TEST_CROSS_COMPILE_FALSE=
+fi
+
+
ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
if test "x$ac_cv_type_pid_t" = xyes; then :
@@ -11021,6 +11032,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${TEST_CROSS_COMPILE_TRUE}" && test -z "${TEST_CROSS_COMPILE_FALSE}"; then
+ as_fn_error $? "conditional \"TEST_CROSS_COMPILE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
diff --git a/configure.ac b/configure.ac
index 4ba5f6aa..5b2507e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,9 @@ else
AC_CHECK_HEADERS(strings.h)
fi
+dnl Check cross compiling
+AM_CONDITIONAL([TEST_CROSS_COMPILE], [test "x$build_alias" != "x$host_alias"])
+
dnl checks for typedefs
AC_TYPE_PID_T
AC_TYPE_SIGNAL