-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
204 lines (189 loc) · 7.02 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
m4_define([allnet_api_version], [3.1])
AC_PREREQ([2.68])
AC_INIT([allnet],[allnet_api_version],[[email protected]])
AM_INIT_AUTOMAKE(foreign)
AM_SILENT_RULES
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/ad.c])
AC_CONFIG_HEADERS([config.h])
LT_INIT
# Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_SED
# Build variables
ALLNET_API_VERSION=allnet_api_version
ALLNET_BINDIR=\$\(top_srcdir\)/bin
ALLNET_SRCDIR=\$\(top_srcdir\)/src
ALLNET_LIBDIR=\$\(top_builddir\)/src/lib
ALLNET_ABCDIR=\$\(top_builddir\)/src/abc
LDVERSION=$(echo allnet_api_version | sed 's/\./:/g'):0
AC_SUBST(ALLNET_API_VERSION)
AC_SUBST(ALLNET_BINDIR)
AC_SUBST(ALLNET_LIBDIR)
AC_SUBST(ALLNET_SRCDIR)
AC_SUBST(ALLNET_ABCDIR)
AC_SUBST(LDVERSION)
# Checks for libraries.
AC_ARG_ENABLE([voa],
[AS_HELP_STRING([--disable-voa],
[Disable Voice-over-AllNet])],
[use_voa=$enableval],
[use_voa=maybe])
if test "x$use_voa" != "xno"; then
PKG_CHECK_MODULES(gstreamer, [gstreamer-1.0, gstreamer-app-1.0], have_gstreamer=yes, have_gstreamer=no)
if test "x$have_gstreamer" != "xyes"; then
if test "x$use_voa" == "xyes"; then
AC_MSG_ERROR([Voice-over-AllNet explicitly requested but GStreamer could not be found])
fi
AC_MSG_RESULT([Disabling Voice-over-AllNet due to missing GStreamer headers])
enable_voa=no
else
enable_voa=yes
fi
else
enable_voa=no
fi
AM_CONDITIONAL(USE_VOICE_OVER_ALLNET, test "x$enable_voa" = "xyes")
# openssl check adapted from
# http://cgit.sukimashita.com/libimobiledevice.git/tree/configure.ac
AC_ARG_ENABLE([openssl],
[AS_HELP_STRING([--disable-openssl],
[Do not look for OpenSSL])],
[use_openssl=$enableval],
[use_openssl=maybe])
if test "x$use_openssl" != "xno"; then
PKG_CHECK_MODULES(openssl, [openssl >= 1.0], [have_openssl=yes], [have_openssl=no])
if test "x$have_openssl" != "xyes"; then
if test "x$use_openssl" == "xyes"; then
AC_MSG_ERROR([OpenSSL support explicitly requested but OpenSSL could not be found])
fi
AC_MSG_RESULT([OpenSSL not found, Disabling OpenSSL])
enable_openssl=no
else
enable_openssl=yes
fi
else
enable_openssl=no
fi
AM_CONDITIONAL(HAVE_OPENSSL, test "x$enable_openssl" = "xyes")
if test "x$enable_openssl" = "xyes"; then
AC_DEFINE(HAVE_OPENSSL, 1, [Define if you have OpenSSL support])
AC_SUBST(openssl_CFLAGS)
AC_SUBST(openssl_LIBS)
ssl_provider="OpenSSL";
ssl_requires="$pkg_req_openssl"
AC_SUBST(ssl_requires)
CFLAGS+=" -DHAVE_OPENSSL"
# else
# pkg_req_gnutls="gnutls >= 2.2.0"
# pkg_req_libtasn1="libtasn1 >= 1.1"
# PKG_CHECK_MODULES(libgnutls, $pkg_req_gnutls)
# AC_CHECK_LIB(gcrypt, gcry_control, [AC_SUBST(libgcrypt_LIBS,[-lgcrypt])], [AC_MSG_ERROR([libgcrypt is required to build with GnuTLS])])
# PKG_CHECK_MODULES(libtasn1, $pkg_req_libtasn1)
# ssl_provider="GnuTLS"
# ssl_requires="$pkg_req_gnutls $pkg_req_libtasn1"
# AC_SUBST(ssl_requires)
fi
AC_ARG_ENABLE(network-manager,
AC_HELP_STRING([--disable-network-manager],
[turn off NetworkManager support]),[enable_network_manager=$enableval],[enable_network_manager="auto"])
if test "x$enable_network_manager" = "xauto"; then
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.6, [
enable_network_manager="yes"
have_dbus="yes"
AC_DEFINE(HAVE_DBUS,1,[libdbus-1 used to connect to NetworkManager])
], [
enable_network_manager="no"
have_dbus="no"
])
elif test "x$enable_network_manager" = "xyes"; then
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.6, [
have_dbus="yes"
AC_DEFINE(HAVE_DBUS,1,[libdbus-1 used to connect to NetworkManager])
], [
enable_network_manager="no"
have_dbus="no"
])
if test "x$have_dbus" = "xno"; then
AC_MSG_ERROR([Could not find libdbus-1 needed for NetworkManager support.])
fi
fi
if test "x$enable_network_manager" = "xyes"; then
AC_DEFINE(USE_NETWORK_MANAGER, [], [Enable NetworkManager support])
fi
AM_CONDITIONAL(USE_NETWORK_MANAGER, test "x$enable_network_manager" = "xyes")
build_gui="auto"
build_gui_flag_set="no"
AC_ARG_ENABLE(gui,
AC_HELP_STRING([--disable-gui],
[do not build GUI (building requires java)]),[
build_gui=$enableval
build_gui_flag_set="yes"
],[])
if test "x$build_gui" != "xno"; then
AX_PROG_JAVAC
AX_PROG_JAR
if (test "x$JAVAC" = "x" || test "x$JAR" = "x"); then
if test "x$build_gui" != "xauto"; then
AC_MSG_ERROR([Could not find a suitable java compiler needed to build GUI support.])
else
AC_MSG_NOTICE([Could not find a suitable java compiler needed to build GUI support -- disabling GUI build.])
fi
build_gui="no"
else
build_gui="yes"
fi
fi
AM_CONDITIONAL([ENABLE_GUI], [test "x$build_gui" = "xyes"])
install_precompiled_gui="auto"
AC_ARG_ENABLE(precompiled-gui,
AC_HELP_STRING([--disable-precompiled-gui],
[do not install precompiled GUI when java compiler is not available]),[install_precompiled_gui=$enableval],[])
if (test "x$install_precompiled_gui" != "xno" && test "x$build_gui" = "xno" && test "x$build_gui_flag_set" = "xno"); then
# only install precompiled GUI if we don't build it ourselves and the --enable-gui/--disable-gui isn't set
AX_PROG_JAVA
if test "x$JAVA" = "x"; then
if test "x$install_precompiled_gui" = "xyes"; then
AC_MSG_WARN([Could not find a suitable java runtime needed to run GUI.])
install_precompiled_gui="yes"
else
AC_MSG_WARN([Could not find a suitable java runtime needed to run GUI. Use --enable-precompiled-gui to force installation.])
install_precompiled_gui="no"
fi
else
install_precompiled_gui="yes"
fi
else
install_precompiled_gui="no"
fi
AM_CONDITIONAL([PRECOMP_GUI], [test "x$install_precompiled_gui" = "xyes"])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_STRCOLL
AC_CHECK_FUNCS([bzero dup2 getcwd gethostbyname gethostname gettimeofday inet_ntoa localtime_r memset mkdir select socket strstr strtol tzset])
AC_CONFIG_FILES([Makefile src/Makefile src/abc/Makefile src/ahra/Makefile src/lib/Makefile src/mgmt/Makefile src/voa/Makefile src/xchat/Makefile src/xchat_ui/Makefile src/xtime/Makefile doc/Makefile])
AC_OUTPUT
echo ""
echo " AllNet v${ALLNET_API_VERSION}"
echo ""
echo " Prefix : ${prefix}"
echo " Compiler flags : ${CFLAGS}"
echo " NetworkManager support : ${enable_network_manager}"
echo " Build User Interface : ${build_gui}"
if test "x$build_gui" = "xno"; then
echo " Install precompiled UI : ${install_precompiled_gui} (only available when Build User Interface is \"no\")"
fi
echo " Openssl : ${enable_openssl}"
echo " Voice-over-AllNet : ${enable_voa}"
echo ""