aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2013-04-17 01:22:01 +0800
committerLAN-TW <lantw44@gmail.com>2013-04-17 01:25:09 +0800
commit865556906ff35d09d16472ede01ef64228c94b5a (patch)
treeb499d4f5ba4f5c8a9f28561142ae6f7d29b3647c
parente283620ff04a159060a5829aded86fb31b7c1404 (diff)
downloadtaiwan-online-judge-lantw44-865556906ff35d09d16472ede01ef64228c94b5a.tar.gz
taiwan-online-judge-lantw44-865556906ff35d09d16472ede01ef64228c94b5a.tar.zst
taiwan-online-judge-lantw44-865556906ff35d09d16472ede01ef64228c94b5a.zip
Remove unused checks and include autoheader-generated files
-rw-r--r--.gitignore4
-rw-r--r--configure.ac29
-rw-r--r--judge/center_judge.cpp4
-rw-r--r--judge/center_manage.cpp4
-rw-r--r--judge/center_server.cpp4
-rw-r--r--judge/event_exec.cpp4
-rw-r--r--judge/jmod_test_check.cpp4
-rw-r--r--judge/jmod_test_line.cpp4
-rw-r--r--judge/jmod_test_manage.cpp4
-rw-r--r--judge/judge_manage.cpp4
-rw-r--r--judge/judge_server.cpp4
-rw-r--r--judge/tool.cpp4
12 files changed, 65 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 40d3463..27b6b8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,8 +37,8 @@ missing
stamp-h1
/Makefile
/Makefile.in
-/include/config.h
-/include/config.h.in
+/include/judge_conf.h
+/include/judge_conf.h.in
/judge/Makefile
/judge/Makefile.in
/judge/center_server
diff --git a/configure.ac b/configure.ac
index 3045b5c..27c9384 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ AC_INIT([taiwan-online-judge], [0.1], [BUG-REPORT-ADDRESS])
AM_INIT_AUTOMAKE([foreign -Wall])
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([include/judge_def.h])
-AC_CONFIG_HEADERS([include/config.h])
+AC_CONFIG_HEADERS([include/judge_conf.h])
AC_CONFIG_MACRO_DIR([m4])
# Checks for platform.
@@ -78,11 +78,15 @@ AC_SUBST([KERNEL_CC], ["$with_kernel_cc"])
AC_SUBST([KERNEL_SRC], ["$with_kernel_src"])
# Checks for header files.
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
+dnl We only support Linux, so it is no need to check header files (?)
+dnl AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
-AC_CHECK_HEADER_STDBOOL
-AC_C_INLINE
+
+dnl We only use C++, so we do not have to check them.
+dnl AC_CHECK_HEADER_STDBOOL
+dnl AC_C_INLINE
+
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
@@ -90,9 +94,22 @@ AC_TYPE_SSIZE_T
# Checks for library functions.
AC_FUNC_FORK
-AC_FUNC_MALLOC
+test x"${ac_cv_func_fork_works}" = xyes || \
+ AC_MSG_ERROR(This program requires a working fork function.)
+
AC_FUNC_MMAP
-AC_CHECK_FUNCS([dup2 getcwd memset mkdir munmap realpath rmdir socket])
+test x"${ac_cv_func_mmap_fixed_mapped}" = xyes || \
+ AC_MSG_ERROR(This program requires a working mmap function.)
+
+dnl We do not use malloc(0), so this check may not be important. (?)
+dnl AC_FUNC_MALLOC
+
+for f in \
+ dup2 getcwd memset mkdir munmap realpath rmdir socket
+do
+ AC_CHECK_FUNC([$f], [true],
+ [AC_MSG_ERROR(This program requires function $f!)])
+done
AC_CONFIG_FILES([Makefile judge/Makefile judgk/Makefile])
AC_OUTPUT
diff --git a/judge/center_judge.cpp b/judge/center_judge.cpp
index 604670d..fc4dd85 100644
--- a/judge/center_judge.cpp
+++ b/judge/center_judge.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
diff --git a/judge/center_manage.cpp b/judge/center_manage.cpp
index 0e3eef4..865cb06 100644
--- a/judge/center_manage.cpp
+++ b/judge/center_manage.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
diff --git a/judge/center_server.cpp b/judge/center_server.cpp
index 030e273..0c5da53 100644
--- a/judge/center_server.cpp
+++ b/judge/center_server.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
diff --git a/judge/event_exec.cpp b/judge/event_exec.cpp
index af258c0..7723f74 100644
--- a/judge/event_exec.cpp
+++ b/judge/event_exec.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include "event_exec.h"
#define EVENT_BUFLEN 1005
diff --git a/judge/jmod_test_check.cpp b/judge/jmod_test_check.cpp
index 984473b..ae5fe89 100644
--- a/judge/jmod_test_check.cpp
+++ b/judge/jmod_test_check.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
diff --git a/judge/jmod_test_line.cpp b/judge/jmod_test_line.cpp
index 33a32b9..31bdd34 100644
--- a/judge/jmod_test_line.cpp
+++ b/judge/jmod_test_line.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
diff --git a/judge/jmod_test_manage.cpp b/judge/jmod_test_manage.cpp
index b020574..192931c 100644
--- a/judge/jmod_test_manage.cpp
+++ b/judge/jmod_test_manage.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
diff --git a/judge/judge_manage.cpp b/judge/judge_manage.cpp
index 78bee4c..1c713d9 100644
--- a/judge/judge_manage.cpp
+++ b/judge/judge_manage.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
diff --git a/judge/judge_server.cpp b/judge/judge_server.cpp
index 6277499..2bea17c 100644
--- a/judge/judge_server.cpp
+++ b/judge/judge_server.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
diff --git a/judge/tool.cpp b/judge/tool.cpp
index b4a302d..1c4c10a 100644
--- a/judge/tool.cpp
+++ b/judge/tool.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include<judge_conf.h>
+#endif
+
#include<string.h>
#include<dirent.h>
#include<unistd.h>