You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

222 lines
6.3 KiB

  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. #
  22. AC_PREREQ(2.61)
  23. AC_INIT([gnunet-secushare],[0.0.0],[bug-gnunet@gnu.org])
  24. AM_INIT_AUTOMAKE([gnunet-secushare], [0.0.0])
  25. AM_CONFIG_HEADER(gnunet_secushare_config.h)
  26. AH_TOP([#define _GNU_SOURCE 1])
  27. AC_ISC_POSIX
  28. AC_PROG_AWK
  29. AC_PROG_CC
  30. AC_PROG_MKDIR_P
  31. AC_PROG_CPP
  32. AC_PROG_INSTALL
  33. AC_PROG_LN_S
  34. AC_PROG_MAKE_SET
  35. AC_LIBTOOL_WIN32_DLL
  36. AC_PROG_CC
  37. AM_PROG_CC_STDC
  38. AC_HEADER_STDC
  39. AC_CANONICAL_HOST
  40. # dynamic libraries/plugins
  41. AC_DISABLE_STATIC
  42. AC_PROG_LIBTOOL
  43. AC_SYS_LARGEFILE
  44. AC_FUNC_FSEEKO
  45. CFLAGS="-Wall $CFLAGS"
  46. # use '-fno-strict-aliasing', but only if the compiler can take it
  47. if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
  48. then
  49. CFLAGS="-fno-strict-aliasing $CFLAGS"
  50. fi
  51. # Check system type
  52. case "$host_os" in
  53. *darwin* | *rhapsody* | *macosx*)
  54. AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system])
  55. CFLAGS="-no-cpp-precomp $CFLAGS"
  56. LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS"
  57. ;;
  58. linux*)
  59. AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
  60. ;;
  61. freebsd*)
  62. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  63. AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
  64. ;;
  65. openbsd*)
  66. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  67. AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
  68. ;;
  69. netbsd*)
  70. AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
  71. AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
  72. ;;
  73. *solaris*)
  74. AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
  75. AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
  76. build_target="solaris"
  77. ;;
  78. *arm-linux*)
  79. AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
  80. ;;
  81. *cygwin*)
  82. AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
  83. AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
  84. AC_CHECK_LIB(intl, gettext)
  85. LDFLAGS="$LDFLAGS -no-undefined"
  86. build_target="cygwin"
  87. ;;
  88. *mingw*)
  89. AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
  90. AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
  91. AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
  92. AC_CHECK_LIB(intl, gettext)
  93. LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32"
  94. CFLAGS="-mms-bitfields $CFLAGS"
  95. build_target="mingw"
  96. ;;
  97. *)
  98. AC_MSG_RESULT(Unrecognised OS $host_os)
  99. AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
  100. ;;
  101. esac
  102. AM_CONDITIONAL(MINGW, test "$build_target" = "mingw")
  103. # check for gettext
  104. AM_GNU_GETTEXT_VERSION([0.18.1])
  105. AM_GNU_GETTEXT([external])
  106. 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])
  107. # test for GNUnet core
  108. gnunet=0
  109. lookin=${prefix}
  110. backup_LDFLAGS="$LDFLAGS"
  111. backup_CPPFLAGS="$CPPFLAGS"
  112. GNUNET_LDFLAGS=""
  113. GNUNET_CPPFLAGS=""
  114. AC_MSG_CHECKING(for GNUnet core)
  115. AC_ARG_WITH(gnunet,
  116. [ --with-gnunet=PFX Base of GNUnet installation],
  117. [AC_MSG_RESULT([$with_gnunet])
  118. case $with_gnunet in
  119. no)
  120. lookin=""
  121. ;;
  122. yes)
  123. lookin="${prefix}"
  124. ;;
  125. *)
  126. lookin="$with_gnunet"
  127. ;;
  128. esac
  129. ],
  130. [
  131. AC_MSG_RESULT([--with-gnunet not specified])
  132. PKG_CHECK_MODULES([GNUNET], [gnunetutil >= 0.9.0], gnunet=1)
  133. ]
  134. )
  135. if test "x$gnunet" == "x0" -a ! "x$lookin" == "x"
  136. then
  137. AC_MSG_CHECKING(for GNUnet util library in $lookin)
  138. GNUNET_LDFLAGS="-L${lookin}/lib"
  139. GNUNET_CPPFLAGS="-I${lookin}/include"
  140. LDFLAGS="$GNUNET_LDFLAGS $backup_LDFLAGS"
  141. CPPFLAGS="$GNUNET_CPPFLAGS $backup_CPPFLAGS"
  142. AC_CHECK_HEADERS([gnunet/gnunet_util_lib.h],
  143. AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
  144. [
  145. gnunet=1
  146. EXT_LIB_PATH="-L${lookin}/lib $EXT_LIB_PATH"
  147. ]
  148. ),,[#include <gnunet/platform.h>]
  149. )
  150. fi
  151. if test "x$gnunet" == "x0"
  152. then
  153. AC_MSG_ERROR([gnunet-ext requires GNUnet])
  154. fi
  155. # Linker hardening options
  156. # Currently these options are ELF specific - you can't use this with MacOSX
  157. AC_ARG_ENABLE(linker-hardening,
  158. AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups),
  159. [if test x$enableval = xyes; then
  160. LDFLAGS="$LDFLAGS -z relro -z now"
  161. fi])
  162. extra_logging=GNUNET_NO
  163. AC_ARG_ENABLE([logging],
  164. AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),
  165. [AS_IF([test "x$enableval" = "xyes"], [],
  166. [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
  167. [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES]
  168. [test "x$enableval" = "xveryverbose"], [extra_logging=\(GNUNET_YES+1\)])
  169. ], [])
  170. AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise])
  171. AC_SUBST(GNUNET_CPPFLAGS)
  172. AC_SUBST(GNUNET_LDFLAGS)
  173. LDFLAGS="$backup_LDFLAGS"
  174. CPPFLAGS="$backup_CPPFLAGS"
  175. AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data])
  176. # Set PACKAGE_SOURCE_DIR in gnunet_ext_config.h.
  177. packagesrcdir=`cd $srcdir && pwd`
  178. AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir])
  179. AC_OUTPUT([ po/Makefile.in
  180. Makefile
  181. pkgconfig/Makefile
  182. src/Makefile
  183. src/include/Makefile
  184. src/multicast/Makefile
  185. src/multicast/multicast.conf
  186. src/psycutil/Makefile
  187. src/psyc/Makefile
  188. src/psyc/psyc.conf
  189. src/psycstore/Makefile
  190. src/psycstore/psycstore.conf
  191. src/social/Makefile
  192. src/social/social.conf
  193. pkgconfig/gnunetmulticast.pc
  194. pkgconfig/gnunetpsyc.pc
  195. pkgconfig/gnunetpsycstore.pc
  196. pkgconfig/gnunetsocial.pc
  197. ])