gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: adapt build to latest GNUnet wit


From: gnunet
Subject: [taler-exchange] branch master updated: adapt build to latest GNUnet without gnunet/platform.h
Date: Mon, 05 Dec 2022 12:55:20 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 597c9950 adapt build to latest GNUnet without gnunet/platform.h
597c9950 is described below

commit 597c9950a34801ed80f3cdcb030c20950cb55e9b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Dec 5 12:55:15 2022 +0100

    adapt build to latest GNUnet without gnunet/platform.h
---
 configure.ac                             |  80 +++++--------
 contrib/gana                             |   2 +-
 src/exchange-tools/taler-crypto-worker.c |   2 +-
 src/include/platform.h                   | 187 +++++++++++++++++++++++++++++--
 src/testing/testing_api_loop.c           |   2 +-
 src/util/amount.c                        |   4 +-
 src/util/util.c                          |   2 +-
 7 files changed, 214 insertions(+), 65 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2df8674e..c80c2e8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,13 @@ AS_IF([test "x$doc_only" != xyes],[
 # Force some CFLAGS
 CFLAGS="-Wall -Wno-address-of-packed-member $CFLAGS"
 
+TALER_LIB_LDFLAGS="-export-dynamic -no-undefined"
+TALER_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
+
+AC_SUBST(TALER_LIB_LDFLAGS)
+AC_SUBST(TALER_PLUGIN_LDFLAGS)
+
+
 # Checks for header files.
 AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h sys/socket.h sys/un.h 
netinet/in.h netinet/ip.h])
 
@@ -76,6 +83,7 @@ AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], 
["$need_libgcrypt_version"],
 AM_PATH_LIBGCRYPT([$need_libgcrypt_version])
 
 
+
 # should expensive tests be run?
 AC_MSG_CHECKING(whether to run expensive tests)
 AC_ARG_ENABLE([expensivetests],
@@ -133,20 +141,12 @@ AS_CASE([$with_gnunet],
         [no], [AC_MSG_ERROR([--with-gnunet is required])],
         [LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
          CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
-AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
- [AC_CHECK_LIB([gnunetutil], [GNUNET_SCHEDULER_run], libgnunetutil=1)],
-  [], [#ifdef HAVE_GNUNET_PLATFORM_H
-        #include <gnunet/platform.h>
-       #endif
-        #include <gnunet/gnunet_common.h>
-       #if GNUNET_UTIL_VERSION < 0x00A0104
-        #fail libgnunetutil is too old
-       #endif])
+AC_CHECK_HEADERS([gnunet/gnunet_util_lib.h],
+ [AC_CHECK_LIB([gnunetutil], [GNUNET_SCHEDULER_run], libgnunetutil=1)])
 AS_IF([test $libgnunetutil != 1],
   [AC_MSG_ERROR([[
 ***
-*** You need libgnunetutil > 0.14.0 to build this program.
-*** (Yes, ">", libgnunetutil 0.14.0 is NOT enough.)
+*** You need libgnunetutil >= 0.19.0 to build this program.
 *** This library is part of GNUnet, available at
 ***   https://gnunet.org
 *** ]])])
@@ -165,11 +165,8 @@ AS_CASE([$with_gnunet],
         [no], [AC_MSG_ERROR([--with-gnunet is required])],
         [LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
          CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
-AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_json_lib.h],
- [AC_CHECK_LIB([gnunetjson], [GNUNET_JSON_parse], libgnunetjson=1)],
-  [], [#ifdef HAVE_GNUNET_PLATFORM_H
-        #include <gnunet/platform.h>
-       #endif])
+AC_CHECK_HEADERS([gnunet/gnunet_json_lib.h],
+ [AC_CHECK_LIB([gnunetjson], [GNUNET_JSON_parse], libgnunetjson=1)])
 AS_IF([test $libgnunetjson != 1],
   [AC_MSG_ERROR([[
 ***
@@ -231,11 +228,8 @@ AS_CASE([$with_gnunet],
         [no], [AC_MSG_ERROR([--with-gnunet is required])],
         [LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
          CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
-AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_curl_lib.h],
- [AC_CHECK_LIB([gnunetcurl], [GNUNET_CURL_get_select_info], libgnunetcurl=1)],
-  [], [#ifdef HAVE_GNUNET_PLATFORM_H
-        #include <gnunet/platform.h>
-       #endif])
+AC_CHECK_HEADERS([gnunet/gnunet_curl_lib.h],
+ [AC_CHECK_LIB([gnunetcurl], [GNUNET_CURL_get_select_info], libgnunetcurl=1)])
 AS_IF([test $libgnunetcurl != 1],
   [AC_MSG_ERROR([[
 ***
@@ -250,6 +244,12 @@ CFLAGS=$CFLAGS_SAVE
 LDFLAGS=$LDFLAGS_SAVE
 LIBS=$LIBS_SAVE
 
+# test for postgres
+AX_LIB_POSTGRESQL([13.0])
+AS_IF([test "x$found_postgresql" = "xyes"],[postgres=true])
+
+AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
+
 # Check for GNUnet's libgnunetpq.
 libgnunetpq=0
 AC_MSG_CHECKING([for libgnunetpq])
@@ -262,12 +262,9 @@ AS_CASE([$with_gnunet],
         [yes], [],
         [no], [AC_MSG_ERROR([--with-gnunet is required])],
         [LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
-         CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
-AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_pq_lib.h],
- [AC_CHECK_LIB([gnunetpq], [GNUNET_PQ_result_spec_string], libgnunetpq=1)],
-  [], [#ifdef HAVE_GNUNET_PLATFORM_H
-        #include <gnunet/platform.h>
-       #endif])
+         CPPFLAGS="-I$with_gnunet/include ${CPPFLAGS} ${POSTGRESQL_CPPFLAGS}"])
+AC_CHECK_HEADERS([gnunet/gnunet_pq_lib.h],
+ [AC_CHECK_LIB([gnunetpq], [GNUNET_PQ_result_spec_string], libgnunetpq=1)])
 AS_IF([test $libgnunetpq != 1],
   [AC_MSG_ERROR([[
 ***
@@ -277,15 +274,15 @@ AS_IF([test $libgnunetpq != 1],
 *** is recent!)
 *** ]])])
 
+CFLAGS_SAVE=$CFLAGS
+LDFLAGS_SAVE=$LDFLAGS
+LIBS_SAVE="$LIBS"
 
 # Check for GNUnet's libgnunetsq
 libgnunetsq=0
 AC_MSG_CHECKING([for libgnunetsq])
 AC_CHECK_HEADERS([gnunet/gnunet_sq_lib.h],
- [AC_CHECK_LIB([gnunetsq], [GNUNET_SQ_result_spec_string], libgnunetsq=1)],
-  [], [#ifdef HAVE_GNUNET_PLATFORM_H
-        #include <gnunet/platform.h>
-       #endif])
+ [AC_CHECK_LIB([gnunetsq], [GNUNET_SQ_result_spec_string], libgnunetsq=1)])
 
 
 # check for libmicrohttpd
@@ -324,22 +321,6 @@ AS_IF([test $jansson = 0],
 *** ]])])
 
 
-# test for postgres
-AX_LIB_POSTGRESQL([13.0])
-AS_IF([test "x$found_postgresql" = "xyes"],[postgres=true])
-
-TALER_LIB_LDFLAGS="-export-dynamic -no-undefined"
-TALER_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
-
-AC_SUBST(TALER_LIB_LDFLAGS)
-AC_SUBST(TALER_PLUGIN_LDFLAGS)
-
-CFLAGS_SAVE=$CFLAGS
-LDFLAGS_SAVE=$LDFLAGS
-LIBS_SAVE="$LIBS"
-
-
-AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
 
 CFLAGS=$CFLAGS_SAVE
 LDFLAGS=$LDFLAGS_SAVE
@@ -389,10 +370,7 @@ AS_CASE([$with_twister],
          CPPFLAGS="-I$with_twister/include $CPPFLAGS"])
 
 AC_CHECK_HEADERS([taler/taler_twister_service.h],
- [AC_CHECK_LIB([talertwister], [TALER_TWISTER_connect], talertwister=1)],
-   [], [#ifdef HAVE_GNUNET_PLATFORM_H
-        #include <gnunet/platform.h>
-       #endif])
+ [AC_CHECK_LIB([talertwister], [TALER_TWISTER_connect], talertwister=1)])
 AM_CONDITIONAL(HAVE_TWISTER, test x$talertwister = x1)
 
 # should developer logic be compiled (not-for-production code)?
diff --git a/contrib/gana b/contrib/gana
index 212ee0a7..20f8eb7a 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 212ee0a78adc43cb5c04d6ea96ccc2fe74fed62b
+Subproject commit 20f8eb7a72e2160409f0f78264ec5198e9caa193
diff --git a/src/exchange-tools/taler-crypto-worker.c 
b/src/exchange-tools/taler-crypto-worker.c
index 8c3a123c..c3abfa54 100644
--- a/src/exchange-tools/taler-crypto-worker.c
+++ b/src/exchange-tools/taler-crypto-worker.c
@@ -21,7 +21,7 @@
 #include "platform.h"
 #include "taler_util.h"
 #include <gnunet/gnunet_json_lib.h>
-#include <gnunet/gnunet_crypto_lib.h>
+#include <gnunet/gnunet_util_lib.h>
 #include "taler_error_codes.h"
 #include "taler_json_lib.h"
 #include "taler_signatures.h"
diff --git a/src/include/platform.h b/src/include/platform.h
index b2c286b7..d4d2c80e 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -20,17 +20,17 @@
  *        rest of the modules
  * @author Sree Harsha Totakura <sreeharsha@totakura.in>
  */
-
 #ifndef PLATFORM_H_
 #define PLATFORM_H_
 
 /* Include our configuration header */
 #ifndef HAVE_USED_CONFIG_H
-# define HAVE_USED_CONFIG_H
-# ifdef HAVE_CONFIG_H
-#  include "taler_config.h"
-# endif
+#define HAVE_USED_CONFIG_H
+#ifdef HAVE_CONFIG_H
+#include "taler_config.h"
+#endif
 #endif
+
 /* For the exchange build, we do NOT want gettext, even
    if it is available! */
 #undef ENABLE_NLS
@@ -45,9 +45,6 @@
 /* Include the features available for GNU source */
 #define _GNU_SOURCE
 
-/* Include GNUnet's platform file */
-#include <gnunet/platform.h>
-
 /* Do not use shortcuts for gcrypt mpi */
 #define GCRYPT_NO_MPI_MACROS 1
 
@@ -67,6 +64,171 @@
 #define ENABLE_SANITY_CHECKS 1
 
 
+#include <netdb.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>         /* superset of previous */
+#endif
+#include <arpa/inet.h>
+#include <netinet/tcp.h>
+#include <pwd.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
+#include <grp.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <signal.h>
+#include <libgen.h>
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>             /* for mallinfo on GNU */
+#endif
+#include <unistd.h>             /* KLB_FIX */
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <dirent.h>             /* KLB_FIX */
+#include <fcntl.h>
+#include <math.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+#ifdef BSD
+#include <net/if.h>
+#endif
+#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
+#include <semaphore.h>
+#endif
+#ifdef DARWIN
+#include <dlfcn.h>
+#include <semaphore.h>
+#include <net/if.h>
+#endif
+#if defined(__linux__) || defined(GNU)
+#include <net/if.h>
+#endif
+#ifdef SOLARIS
+#include <sys/sockio.h>
+#include <sys/filio.h>
+#include <sys/loadavg.h>
+#include <semaphore.h>
+#endif
+#if HAVE_UCRED_H
+#include <ucred.h>
+#endif
+#if HAVE_SYS_UCRED_H
+#include <sys/ucred.h>
+#endif
+#if HAVE_IFADDRS_H
+#include <ifaddrs.h>
+#endif
+#include <errno.h>
+#include <limits.h>
+
+#if HAVE_VFORK_H
+#include <vfork.h>
+#endif
+
+#include <ctype.h>
+#if HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#if HAVE_ENDIAN_H
+#include <endian.h>
+#endif
+#if HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_STR "/"
+#define PATH_SEPARATOR ':'
+#define PATH_SEPARATOR_STR ":"
+#define NEWLINE "\n"
+
+
+#include <locale.h>
+#include "gettext.h"
+/**
+ * GNU gettext support macro.
+ */
+#define _(String) dgettext (PACKAGE, String)
+
+
+#include <sys/mman.h>
+
+/* FreeBSD_kernel is not defined on the now discontinued kFreeBSD  */
+#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+
+#ifdef DARWIN
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+/* not available on darwin, override configure */
+#undef HAVE_STAT64
+#undef HAVE_MREMAP
+#endif
+
+#if ! HAVE_ATOLL
+long long
+atoll (const char *nptr);
+
+#endif
+
+#if ENABLE_NLS
+#include "langinfo.h"
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t) (-1))
+#endif
+
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
+
+#if defined(__sparc__)
+#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove (&__tmp, 
&(val), \
+                                                                 
sizeof((val))); \
+                               __tmp; })
+#else
+#define MAKE_UNALIGNED(val) val
+#endif
+
+
+#ifndef PATH_MAX
+/**
+ * Assumed maximum path length.
+ */
+#define PATH_MAX 4096
+#endif
+
+#if HAVE_THREAD_LOCAL_GCC
+#define TALER_THREAD_LOCAL __thread
+#else
+#define TALER_THREAD_LOCAL
+#endif
+
+
 /* LSB-style exit status codes */
 #ifndef EXIT_INVALIDARGUMENT
 #define EXIT_INVALIDARGUMENT 2
@@ -92,6 +254,15 @@
 #define EXIT_NOTRUNNING 7
 #endif
 
+/**
+ * clang et al do not have such an attribute
+ */
+#if __has_attribute (__nonstring__)
+# define __nonstring                    __attribute__((__nonstring__))
+#else
+# define __nonstring
+#endif
+
 
 #endif  /* PLATFORM_H_ */
 
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index 190e2092..986358ed 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -827,7 +827,7 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,
   sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
   GNUNET_assert (NULL != sigpipe);
   shc_chld = GNUNET_SIGNAL_handler_install (
-    GNUNET_SIGCHLD,
+    SIGCHLD,
     &sighandler_child_death);
   is.ctx = GNUNET_CURL_init (
     &GNUNET_CURL_gnunet_scheduler_reschedule,
diff --git a/src/util/amount.c b/src/util/amount.c
index 43116af8..d5698e8b 100644
--- a/src/util/amount.c
+++ b/src/util/amount.c
@@ -553,8 +553,8 @@ const char *
 TALER_amount2s (const struct TALER_Amount *amount)
 {
   /* 24 is sufficient for a uint64_t value in decimal; 3 is for ":.\0" */
-  static GNUNET_THREAD_LOCAL char result[TALER_AMOUNT_FRAC_LEN
-                                         + TALER_CURRENCY_LEN + 3 + 24];
+  static TALER_THREAD_LOCAL char result[TALER_AMOUNT_FRAC_LEN
+                                        + TALER_CURRENCY_LEN + 3 + 24];
   struct TALER_Amount norm;
 
   if (GNUNET_YES != TALER_amount_is_valid (amount))
diff --git a/src/util/util.c b/src/util/util.c
index 2b8c9d95..5321b31e 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -28,7 +28,7 @@ const char *
 TALER_b2s (const void *buf,
            size_t buf_size)
 {
-  static GNUNET_THREAD_LOCAL char ret[9];
+  static TALER_THREAD_LOCAL char ret[9];
   struct GNUNET_HashCode hc;
   char *tmp;
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]