-
Notifications
You must be signed in to change notification settings - Fork 28
/
configure.ac
102 lines (98 loc) · 3.83 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
AC_INIT([ansvif], [1.11], [marshallwhittaker@gmail.com], [], [https://oxagast.github.io/ansvif])
AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
AC_TYPE_SIZE_T
AC_PROG_RANLIB
#AC_CONFIG_HEADERS([include/gzstream/gzstream.h])
AC_HEADER_STDC
#AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
AX_CXX_COMPILE_STDCXX_11
AC_CHECK_HEADERS([string])
AC_CHECK_HEADERS([ipstream])
AC_CHECK_HEADERS(zlib.h)
#AC_CHECK_HEADERS([lz])
#AC_SEARCH_LIBS(z)
#AC_CHECK_HEADERS([crypto])
AC_CHECK_LIB(pthread, pthread_create, have_pthread=yes)
AC_CONFIG_FILES([Makefile])
AM_INIT_AUTOMAKE([subdir-objects])
# This adds the option of compiling without using the ctemplate library,
# which has proved troublesome for compilation on some platforms
AC_ARG_ENABLE(syscalls,
[ --enable-syscalls Enable Syscalls compiliation (experimental)],
[case "${enableval}" in
yes) WITH_SYSCALLS=true ;;
no) WITH_SYSCALLS=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-syscalls) ;;
esac],[WITH_SYSCALLS=false])
AM_CONDITIONAL([WITH_SYSCALLS], [test "$WITH_SYSCALLS" = "true"])
# try to compile syscalls if they're enabled
if test "$WITH_SYSCALLS" = "true"; then
AC_DEFINE([WITH_SYSCALLS], [], ["build syscalls module"])
AC_MSG_NOTICE([syscalls enabled, we will try to compile them])
else
AC_MSG_NOTICE([syscalls module is disabled])
fi
AC_ARG_ENABLE(gtk,
[ --disable-gtk Enable GTK compiliation (experimental)],
[case "${enableval}" in
yes) WITH_GTK=true ;;
no) WITH_GTK=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-gtk) ;;
esac],[WITH_GTK=true])
AM_CONDITIONAL([WITH_GTK], [test "$WITH_GTK" = "true"])
# try to compile syscalls if they're enabled
if test "$WITH_GTK" = "false"; then
AC_MSG_NOTICE([GTK module is disabled])
else
AC_DEFINE([WITH_GTK], [], ["build GTK module"])
AC_MSG_NOTICE([GTK enabled, we will try to compile them])
PKG_CHECK_MODULES(GTK, [gtk+-2.0])
# PKG_CHECK_MODULES([gtk+-2.0])
fi
AC_ARG_ENABLE(testcode,
[ --disable-testcode Disable Test Code)],
[case "${enableval}" in
yes) WITH_TESTCODE=true ;;
no) WITH_TESTCODE=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-testcode) ;;
esac],[WITH_TESTCODE=true])
AM_CONDITIONAL([WITH_TESTCODE], [test "$WITH_TESTCODE" = "true"])
if test "$WITH_TESTCODE" = "false"; then
AC_MSG_NOTICE([Test Code is disabled])
else
AC_DEFINE([WITH_TESTCODE], [], ["build Test Code"])
AC_MSG_NOTICE([Test Code, we will try to compile them])
fi
AM_CONDITIONAL(OS_IS_REDHAT, [ test `grep "Fedora\|Redhat" /etc/os-release | wc -l` -gt "0" ])
if test "$OS_IS_REDHAT" = "0"; then
AC_DEFINE([__REDHAT], [], ["build for RedHat"])
AC_MSG_NOTICE([trying to build for a RedHat based system])
fi
AM_CONDITIONAL(OS_IS_DEBIAN, [ test `grep "Debian\|Ubuntu\|Kali" /etc/os-release | wc -l` -gt "0" ])
if test "$OS_IS_DEBIAN" = "0"; then
AC_DEFINE([__DEBIAN], [], ["build for Debian"])
AC_MSG_NOTICE([trying to build for a Debian based system])
fi
AM_CONDITIONAL(OS_IS_KALI, [ test `grep "Kali" /etc/os-release | wc -l` -gt "0" ])
if test "$OS_IS_KALI" = "0"; then
AC_DEFINE([__KALI__], [], ["build for Kali"])
AC_MSG_NOTICE([trying to build for a Kali based system])
fi
AM_CONDITIONAL(OS_IS_ARCH, [ test `grep "arch" -i /etc/os-release | wc -l` -gt "0" ])
if test "$OS_IS_ARCH" = "0"; then
AC_DEFINE([__ARCH__], [], ["build for Arch"])
AC_MSG_NOTICE([trying to build for a Arch based system])
fi
AM_CONDITIONAL(OS_IS_FREEBSD, [ test `uname -o` == "FreeBSD" ])
if test "$IS_IS_FREEBSD" = "0"; then
AC_DEFINE([__UNKNOWN], [], ["build for FreeBSD"])
AC_MSG_NOTICE([trying to build for a FreeBSD based system])
fi
AM_CONDITIONAL(OS_IS_UNKNOWN, [ test `test -e /dummy; echo $?` -eq "0" ])
if test "$OS_IS_UNKNOWN" = "0"; then
AC_DEFINE([__UNKNOWN], [], ["build for Unknown"])
AC_MSG_NOTICE([trying to build for a unknown system])
fi
AC_OUTPUT