| 1 | #!/bin/bash |
| 2 | # |
| 3 | # This script checks if cross compiling ECL itself from x86 to x86_64 |
| 4 | # and vice versa works. It assumes that you are running an x86_64 |
| 5 | # system which can also run and compile x86 programs. You might have |
| 6 | # to install additional packages for that (for example on debian, the |
| 7 | # gcc-multilib package is needed). |
| 8 | # |
| 9 | # Four versions of ECL will be compiled: |
| 10 | # - ecl-x86[_64]-native: direct (i.e. same host and target) x86[_64] build |
| 11 | # - ecl-x86[_64]-native: cross build for x86[_64] target |
| 12 | # |
| 13 | # The results of running the test suite will be put in the files |
| 14 | # test-results-x86[_64]-[native/cross]. It is recommended to also run |
| 15 | # the ansi-tests for the output binaries. |
| 16 | # |
| 17 | set -e |
| 18 | rm -rf build/; CFLAGS="-g -O2" ./configure --prefix=`pwd`/ecl-x86_64-native && make -j${JOBS} && rm -rf ecl-x86_64-native && make install && make check > test-results-x86_64-native |
| 19 | rm -rf build/; ABI=32 CFLAGS="-g -O2 -m32" LDFLAGS="-m32" ./configure --prefix=`pwd`/ecl-x86-native && make -j${JOBS} && rm -rf ecl-x86-native && make install && make check > test-results-x86-native |
| 20 | rm -rf build/; CFLAGS="-g -O2" ECL_TO_RUN=`pwd`/ecl-x86-native/bin/ecl ./configure --prefix=`pwd`/ecl-x86_64-cross --build=x86_64-pc-linux-gnu --host=x86-pc-linux-gnu --with-cross-config=`pwd`/src/util/x86_64-linux-gnu.cross_config && make -j${JOBS} && rm -rf ecl-x86_64-cross && make install && make check > test-results-x86_64-cross |
| 21 | rm -rf build/; ABI=32 CFLAGS="-g -O2 -m32" LDFLAGS="-m32" ECL_TO_RUN=`pwd`/ecl-x86_64-native/bin/ecl ./configure --prefix=`pwd`/ecl-x86-cross --build=x86-pc-linux-gnu --host=x86_64-pc-linux-gnu --with-cross-config=`pwd`/src/util/x86-linux-gnu.cross_config && make -j${JOBS} && rm -rf ecl-x86-cross && make install && make check > test-results-x86-cross |