aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2013-04-12 02:18:59 +0800
committerLAN-TW <lantw44@gmail.com>2013-04-12 02:18:59 +0800
commitd0f23b62e732ddbf963b30070bad9203bee9e88b (patch)
tree2a7d4ec994ae0851ea4e5e1fc6ae8f000f0e247f
parente6589bc72a2a6d4a85b23542745731a1e58cb987 (diff)
downloadtaiwan-online-judge-lantw44-d0f23b62e732ddbf963b30070bad9203bee9e88b.tar.gz
taiwan-online-judge-lantw44-d0f23b62e732ddbf963b30070bad9203bee9e88b.tar.zst
taiwan-online-judge-lantw44-d0f23b62e732ddbf963b30070bad9203bee9e88b.zip
Add cross-compiling checks
-rw-r--r--configure.ac23
1 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6226498..8161f9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,6 +8,29 @@ AC_CONFIG_SRCDIR([include/judge_def.h])
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
+# Checks for platform.
+AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
+if test "$build" '!=' "$host" ; then
+ AC_MSG_ERROR([This program does not support cross-compiling])
+fi
+
+case "${host_cpu}" in
+ x86_64|amd64)
+ ;;
+ *)
+ AC_MSG_ERROR([This program can only be run on x86_64 platform])
+ ;;
+esac
+
+case "${host_os}" in
+ *linux*)
+ ;;
+ *)
+ AC_MSG_ERROR([Sorry, we only support Linux])
+ ;;
+esac
+
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX