[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Best practice for recognizing cross-compilation and adjusting Makefile.a
Best practice for recognizing cross-compilation and adjusting Makefile.am
Thu, 19 Oct 2017 22:29:57 +0200
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
I'm working on enabling cross-compilation for GnuCOBOL. As a
prerequisite I'd see a release tarball (as `make dist` on the host for
the people cross-compiling from vcs).
The autoconf parts are fixed now , but there's one thing in the
Makefiles where we generate a binary with the compiler we've generated
directly beforehand. This obviously can't work and I'd like to skip
this and telling people to do so on the target machine.
The main question is: what is the best practice for doing so? I'd using
AC_SUBST([CROSS_COMPILATION]) and checking this in the "offending"
Makefile for simply dropping the generation completely.
Is there a better practice? How do other projects handle this?
extrasdir = @COB_LIBRARY_PATH@
extras_DATA = CBL_OC_DUMP.$(COB_MODULE_EXT)
EXTRA_DIST = CBL_OC_DUMP.cob
CLEANFILES = $(extras_DATA)
SUFFIXES = .cob .$(COB_MODULE_EXT)
. $(top_builddir)/tests/atconfig && \
. $(top_builddir)/tests/atlocal extras-$@ \
&& $$COBC -m -Wall -O -o $@ $<
Note: The environment variable COBC contains the full path to the
autoconf parts fixed by:
1. replacing AC_RUN_IFELSE by AC_COMPILE_IFELSE for parts that only
checked in the precprocessor
2. "assume" correct values for cross-compiling for example when checking
library vs. header
- Best practice for recognizing cross-compilation and adjusting Makefile.am,
Simon Sobisch <=