summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-12-19 16:14:10 +0200
committerAdrian Thurston <thurston@colm.net>2019-12-19 16:16:05 +0200
commita60a18880ecd3549aaafbb199abb6d159a4941a1 (patch)
tree630250f0150ab33d635cf955f974fbea7ddffc99 /configure.ac
parent33a1d9896f2dc7d31b8c0b97feed33b902aeee27 (diff)
downloadcolm-a60a18880ecd3549aaafbb199abb6d159a4941a1.tar.gz
testing: added a configure check for ASM tests
Addded a configure check to see if the ASM tests are appropriate. If we can build a basic ASM file with .rodata references, assume we can run the tests.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac44
1 files changed, 42 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 1d34b74e..88d8493c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,19 +262,58 @@ AC_PATH_PROG([RUST_BIN], [rustc])
AC_PATH_PROG([JULIA_BIN], [julia])
AC_PATH_PROG([GNUSTEP_CONFIG], [gnustep-config])
+dnl
+dnl Julia requires a large virtual address space. On systems where this is
+dnl limited by ulimit, julia will fail to run.
+dnl
+
if test "x$JULIA_BIN" != x; then
- echo -n "checking if julia is able to run programs ... "
echo 'println( "can run julia programs" );' > conftest.jl
+ echo -n "checking if julia is able to run programs ... "
if sh -c "$JULIA_BIN conftest.jl" >>config.log 2>&1; then
echo "yes"
else
- echo "FAILED to run julia program" >> config.log
echo "no"
JULIA_BIN=""
fi
rm -f conftest.jl
fi
+dnl
+dnl The ASM tests have been based off of sources that are non-relocatable
+dnl These won't assemble on some systems (with the right architecture). Check
+dnl our specific flavour of ASM now so we can avoid some test failures.
+dnl
+
+ASM_BIN=$CC
+
+cat <<\EOF > conftest.s
+.section .rodata
+.L_works:
+.string "works"
+
+.text
+.globl main
+main:
+ pushq %rbp
+ movq %rsp, %rbp
+ pushq %rdi
+ movq $.L_works, %rdi
+ call puts
+ popq %rdi
+ mov $0, %rax
+ ret
+EOF
+
+echo -n "checking if ragel ASM tests will build ... "
+if sh -c "$ASM_BIN -o conftest.bin conftest.s" >>config.log 2>&1; then
+ echo "yes"
+else
+ echo "no"
+ ASM_BIN=""
+fi
+rm -f conftest.s
+
SED_SUBST="$SED_SUBST -e 's|@D_BIN@|${D_BIN}|g'"
SED_SUBST="$SED_SUBST -e 's|@JAVAC_BIN@|${JAVAC_BIN}|g'"
SED_SUBST="$SED_SUBST -e 's|@RUBY_BIN@|${RUBY_BIN}|g'"
@@ -284,6 +323,7 @@ SED_SUBST="$SED_SUBST -e 's|@OCAML_BIN@|${OCAML_BIN}|g'"
SED_SUBST="$SED_SUBST -e 's|@RUST_BIN@|${RUST_BIN}|g'"
SED_SUBST="$SED_SUBST -e 's|@JULIA_BIN@|${JULIA_BIN}|g'"
SED_SUBST="$SED_SUBST -e 's|@GNUSTEP_CONFIG@|${GNUSTEP_CONFIG}|g'"
+SED_SUBST="$SED_SUBST -e 's|@ASM_BIN@|${ASM_BIN}|g'"
AC_ARG_WITH(crack,
[AC_HELP_STRING([--with-crack], [location of crack install])],