configure.ac (5747B)
1 # This file is part of GNUnet. 2 # (C) 2001-2013, 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 3, 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 # 22 AC_PREREQ([2.71]) 23 AC_INIT([gnunet-fuse],[0.26.0],[bug-gnunet@gnu.org]) 24 AM_INIT_AUTOMAKE 25 AM_CONFIG_HEADER(gnunet_fuse_config.h) 26 27 AH_TOP([#define _GNU_SOURCE 1]) 28 29 AC_SEARCH_LIBS([strerror],[cposix]) 30 AC_PROG_AWK 31 AC_PROG_CC 32 33 AC_PROG_MKDIR_P 34 AC_PROG_INSTALL 35 AC_PROG_LN_S 36 AC_PROG_MAKE_SET 37 AC_PROG_CC 38 AM_PROG_CC_STDC 39 m4_warn([obsolete], 40 [The preprocessor macro `STDC_HEADERS' is obsolete. 41 Except in unusual embedded environments, you can safely include all 42 ISO C90 headers unconditionally.])dnl 43 # Autoupdate added the next two lines to ensure that your configure 44 # script's behavior did not change. They are probably safe to remove. 45 AC_CHECK_INCLUDES_DEFAULT 46 AC_PROG_EGREP 47 48 AC_CANONICAL_HOST 49 AC_SYS_LARGEFILE 50 AC_FUNC_FSEEKO 51 AM_PROG_CC_C_O 52 53 CFLAGS="-Wall $CFLAGS" 54 # use '-fno-strict-aliasing', but only if the compiler can take it 55 if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; 56 then 57 CFLAGS="-fno-strict-aliasing $CFLAGS" 58 fi 59 60 61 # Check system type 62 case "$host_os" in 63 *darwin* | *rhapsody* | *macosx*) 64 AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system]) 65 CFLAGS="-no-cpp-precomp $CFLAGS" 66 LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS" 67 ;; 68 linux*) 69 AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system]) 70 ;; 71 freebsd*) 72 build_target="freebsd" 73 ;; 74 openbsd*) 75 build_target="openbsd" 76 ;; 77 netbsd*) 78 build_target="netbsd" 79 # This seems to be required for librefuse, once I manage to make 80 # gnunet-fuse build with it: 81 # CFLAGS="-D_KERNTYPES -D_NETBSD_SOURCE $CFLAGS" 82 ;; 83 *solaris*) 84 AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system]) 85 AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work]) 86 build_target="solaris" 87 ;; 88 *arm-linux*) 89 build_target="linux" 90 ;; 91 *cygwin*) 92 AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) 93 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) 94 AC_CHECK_LIB(intl, gettext) 95 LDFLAGS="$LDFLAGS -no-undefined" 96 build_target="cygwin" 97 ;; 98 *mingw*) 99 AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) 100 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) 101 AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system]) 102 AC_CHECK_LIB(intl, gettext) 103 LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32" 104 CFLAGS="-mms-bitfields $CFLAGS" 105 build_target="mingw" 106 ;; 107 *) 108 AC_MSG_RESULT(Unrecognised OS $host_os) 109 AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) 110 ;; 111 esac 112 113 AM_CONDITIONAL(MINGW, test "$build_target" = "mingw") 114 115 # check for gettext 116 AM_GNU_GETTEXT_VERSION([0.19.4]) 117 AM_GNU_GETTEXT([external]) 118 119 AC_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 sys/param.h]) 120 121 backup_LIBS="$LIBS" 122 backup_CFLAGS="$CFLAGS " 123 backup_CPPFLAGS="$CPPFLAGS" 124 CPPFLAGS="-D_FILE_OFFSET_BITS=64" 125 126 AC_SEARCH_LIBS([fuse_exit], [fuse refuse], [], [AC_MSG_ERROR([fuse is required.])]) 127 128 # uncrustify 129 # TODO: maybe add flag to pass location 130 AC_CHECK_PROG(UNCRUSTIFY_BINARY, uncrustify, true) 131 AM_CONDITIONAL(HAVE_UNCRUSTIFY_BINARY, $UNCRUSTIFY_BINARY) 132 133 # test for GNUnet core 134 gnunet=0 135 lookin=${prefix} 136 GNUNET_CFLAGS="" 137 GNUNET_CPPFLAGS="" 138 GNUNET_LIBS="" 139 AC_MSG_CHECKING(for GNUnet core) 140 AC_ARG_WITH(gnunet, 141 [ --with-gnunet=PFX Base of GNUnet installation], 142 [AC_MSG_RESULT([$with_gnunet]) 143 case $with_gnunet in 144 no) 145 lookin="" 146 ;; 147 yes) 148 lookin="${prefix}" 149 ;; 150 *) 151 lookin="$with_gnunet" 152 ;; 153 esac 154 ], 155 [ 156 AC_MSG_RESULT([--with-gnunet not specified]) 157 PKG_CHECK_MODULES([GNUNET], [gnunetutil >= 0.9.0], gnunet=1) 158 ] 159 ) 160 161 if test "x$gnunet" = "x0" -a ! "x$lookin" = "x" 162 then 163 AC_MSG_CHECKING(for GNUnet util library in $lookin) 164 GNUNET_LIBS="-L${lookin}/lib -L${lookin}/lib64" 165 GNUNET_CFLAGS="-I${lookin}/include" 166 GNUNET_CPPFLAGS="-I${lookin}/include" 167 LIBS="$GNUNET_LIBS $backup_LIBS" 168 CFLAGS="$GNUNET_CFLAGS $backup_CFLAGS" 169 CPPFLAGS="$GNUNET_CPPFLAGS $backup_CPPFLAGS" 170 AC_CHECK_HEADERS([gnunet/gnunet_util_lib.h], 171 AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_], 172 [ 173 gnunet=1 174 EXT_LIB_PATH="-L${lookin}/lib -L${lookin}/lib64 $EXT_LIB_PATH" 175 ] 176 ),, 177 ) 178 fi 179 180 if test "x$gnunet" = "x0" 181 then 182 AC_MSG_ERROR([gnunet-fuse requires GNUnet]) 183 fi 184 185 AC_SUBST(GNUNET_CFLAGS) 186 AC_SUBST(GNUNET_LIBS) 187 LIBS="$backup_LIBS" 188 CFLAGS="$backup_CFLAGS" 189 CPPFLAGS="$backup_CPPFLAGS" 190 191 AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data]) 192 193 # Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h. 194 packagesrcdir=`cd $srcdir && pwd` 195 AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir]) 196 197 AC_CONFIG_FILES([ 198 Makefile 199 po/Makefile.in 200 doc/Makefile 201 src/Makefile 202 src/fuse/Makefile 203 ]) 204 AC_OUTPUT