[CRIU] [PATCH 1/7] configure: add configure.in
Ruslan Kuprieiev
kupruser at gmail.com
Thu Mar 20 09:17:29 PDT 2014
Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
configure.in | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100644 configure.in
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..085852f
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,66 @@
+AC_INIT
+AC_PROG_CC
+AC_LANG_C
+AC_CONFIG_HEADER([include/config.h])
+
+AC_CHECK_LIB(
+ [bsd],
+ [strlcat],
+ [AC_DEFINE(CONFIG_HAS_LIBBSD)
+ LIBS="$LIBS -lbsd"
+ ])
+
+AC_MSG_CHECKING([whether system already have struct tcp_repait_opt and TCP_NO_QUEUE in netinet/tcp.h])
+AC_TRY_COMPILE(
+ [#include <netinet/tcp.h>],
+ [
+ struct tcp_repair_opt opts;
+ opts.opt_code = TCP_NO_QUEUE;
+ opts.opt_val = 0;
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(CONFIG_HAS_TCP_REPAIR)],
+ [AC_MSG_RESULT(no)])
+
+
+AC_MSG_CHECKING([whether there are needed structures for prlimit])
+AC_TRY_RUN(
+ [
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+
+ int main(void)
+ {
+ struct rlimit limit = {
+ .rlim_cur = RLIM_INFINITY,
+ .rlim_max = RLIM_INFINITY,
+ };
+
+ return prlimit(getpid(), RLIMIT_CPU, &limit, NULL);
+ }
+ ],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(CONFIG_HAS_PRLIMIT)
+ ],
+ [AC_MSG_RESULT(no)])
+
+AC_CHECK_FUNC([strlcpy], [AC_DEFINE(CONFIG_HAS_STRLCPY)])
+
+AC_CHECK_FUNC([strlcat], [AC_DEFINE(CONFIG_HAS_STRLCAT)])
+
+AC_MSG_CHECKING([whether struct prtrace_peeksiginfo_args is defined in sys/prtrace.h])
+AC_TRY_COMPILE(
+ [#include <sys/ptrace.h>],
+ [struct ptrace_peeksiginfo_args args = {};],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(CONFIG_HAS_PEEKSIGINFO_ARGS)
+ ],
+ [AC_MSG_RESULT(no)])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
--
1.8.3.2
More information about the CRIU
mailing list