aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac221
1 files changed, 221 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..5276c8b
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,221 @@
1# This file is part of GNUnet.
2# (C) 2001-2019 Christian Grothoff (and other contributing authors)
3#
4# GNUnet is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published
6# by the Free Software Foundation; either version 2, or (at your
7# option) any later version.
8#
9# GNUnet is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with GNUnet; see the file COPYING. If not, write to the
16# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17# Boston, MA 02110-1301, USA.
18#
19#
20# Process this file with autoconf to produce a configure script.
21#
22AC_PREREQ(2.61)
23AC_INIT([gnunet-secushare],[0.0.0],[bug-gnunet@gnu.org])
24AM_INIT_AUTOMAKE([gnunet-secushare], [0.0.0])
25AM_CONFIG_HEADER(gnunet_secushare_config.h)
26
27AH_TOP([#define _GNU_SOURCE 1])
28
29AC_ISC_POSIX
30AC_PROG_AWK
31AC_PROG_CC
32
33AC_PROG_MKDIR_P
34AC_PROG_CPP
35AC_PROG_INSTALL
36AC_PROG_LN_S
37AC_PROG_MAKE_SET
38AC_LIBTOOL_WIN32_DLL
39AC_PROG_CC
40AM_PROG_CC_STDC
41AC_HEADER_STDC
42AC_CANONICAL_HOST
43
44# dynamic libraries/plugins
45AC_DISABLE_STATIC
46AC_PROG_LIBTOOL
47
48AC_SYS_LARGEFILE
49AC_FUNC_FSEEKO
50
51CFLAGS="-Wall $CFLAGS"
52# use '-fno-strict-aliasing', but only if the compiler can take it
53if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
54then
55 CFLAGS="-fno-strict-aliasing $CFLAGS"
56fi
57
58
59# Check system type
60case "$host_os" in
61*darwin* | *rhapsody* | *macosx*)
62 AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system])
63 CFLAGS="-no-cpp-precomp $CFLAGS"
64 LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS"
65 ;;
66linux*)
67 AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
68 ;;
69freebsd*)
70 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
71 AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
72 ;;
73openbsd*)
74 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
75 AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
76 ;;
77netbsd*)
78 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
79 AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
80 ;;
81*solaris*)
82 AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
83 AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
84 build_target="solaris"
85 ;;
86*arm-linux*)
87 AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
88 ;;
89*cygwin*)
90 AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
91 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
92 AC_CHECK_LIB(intl, gettext)
93 LDFLAGS="$LDFLAGS -no-undefined"
94 build_target="cygwin"
95 ;;
96*mingw*)
97 AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
98 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
99 AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
100 AC_CHECK_LIB(intl, gettext)
101 LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32"
102 CFLAGS="-mms-bitfields $CFLAGS"
103 build_target="mingw"
104 ;;
105*)
106 AC_MSG_RESULT(Unrecognised OS $host_os)
107 AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
108;;
109esac
110
111AM_CONDITIONAL(MINGW, test "$build_target" = "mingw")
112
113# check for gettext
114AM_GNU_GETTEXT_VERSION([0.18.1])
115AM_GNU_GETTEXT([external])
116
117AC_CHECK_HEADERS([errno.h stdio.h unistd.h locale.h sys/stat.h sys/types.h langinfo.h libintl.h unistd.h stddef.h argz.h sys/socket.h netinet/in.h stdarg.h])
118
119# test for GNUnet core
120gnunet=0
121lookin=${prefix}
122backup_LDFLAGS="$LDFLAGS"
123backup_CPPFLAGS="$CPPFLAGS"
124GNUNET_LDFLAGS=""
125GNUNET_CPPFLAGS=""
126AC_MSG_CHECKING(for GNUnet core)
127AC_ARG_WITH(gnunet,
128 [ --with-gnunet=PFX Base of GNUnet installation],
129 [AC_MSG_RESULT([$with_gnunet])
130 case $with_gnunet in
131 no)
132 lookin=""
133 ;;
134 yes)
135 lookin="${prefix}"
136 ;;
137 *)
138 lookin="$with_gnunet"
139 ;;
140 esac
141 ],
142 [
143 AC_MSG_RESULT([--with-gnunet not specified])
144 PKG_CHECK_MODULES([GNUNET], [gnunetutil >= 0.9.0], gnunet=1)
145 ]
146)
147
148if test "x$gnunet" == "x0" -a ! "x$lookin" == "x"
149then
150 AC_MSG_CHECKING(for GNUnet util library in $lookin)
151 GNUNET_LDFLAGS="-L${lookin}/lib"
152 GNUNET_CPPFLAGS="-I${lookin}/include"
153 LDFLAGS="$GNUNET_LDFLAGS $backup_LDFLAGS"
154 CPPFLAGS="$GNUNET_CPPFLAGS $backup_CPPFLAGS"
155 AC_CHECK_HEADERS([gnunet/gnunet_util_lib.h],
156 AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
157 [
158 gnunet=1
159 EXT_LIB_PATH="-L${lookin}/lib $EXT_LIB_PATH"
160 ]
161 ),,[#include <gnunet/platform.h>]
162 )
163fi
164
165if test "x$gnunet" == "x0"
166then
167 AC_MSG_ERROR([gnunet-ext requires GNUnet])
168fi
169
170
171
172# Linker hardening options
173# Currently these options are ELF specific - you can't use this with MacOSX
174AC_ARG_ENABLE(linker-hardening,
175 AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups),
176[if test x$enableval = xyes; then
177 LDFLAGS="$LDFLAGS -z relro -z now"
178fi])
179
180
181extra_logging=GNUNET_NO
182AC_ARG_ENABLE([logging],
183 AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),
184 [AS_IF([test "x$enableval" = "xyes"], [],
185 [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
186 [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES]
187 [test "x$enableval" = "xveryverbose"], [extra_logging=\(GNUNET_YES+1\)])
188 ], [])
189AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise])
190
191
192AC_SUBST(GNUNET_CPPFLAGS)
193AC_SUBST(GNUNET_LDFLAGS)
194LDFLAGS="$backup_LDFLAGS"
195CPPFLAGS="$backup_CPPFLAGS"
196
197AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data])
198
199# Set PACKAGE_SOURCE_DIR in gnunet_ext_config.h.
200packagesrcdir=`cd $srcdir && pwd`
201AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir])
202
203AC_OUTPUT([ po/Makefile.in
204Makefile
205pkgconfig/Makefile
206src/Makefile
207src/include/Makefile
208src/multicast/Makefile
209src/multicast/multicast.conf
210src/psycutil/Makefile
211src/psyc/Makefile
212src/psyc/psyc.conf
213src/psycstore/Makefile
214src/psycstore/psycstore.conf
215src/social/Makefile
216src/social/social.conf
217pkgconfig/gnunetmulticast.pc
218pkgconfig/gnunetpsyc.pc
219pkgconfig/gnunetpsycstore.pc
220pkgconfig/gnunetsocial.pc
221])