[hipl-users] [PATCH] Compiling bazaar checkout 2010-01-20

  • From: tkilappa@xxxxxxxxx
  • To: hipl-users@xxxxxxxxxxxxx
  • Date: Wed, 20 Jan 2010 11:51:52 +0200

Hello again. Thanks for the updates yesterday, I switched to the bazaar release to get them immediately.


Unfortunately, there's still two minor things with the compilation process, please bear with me:

1) lib/core/hashtree.c is specified twice in the build process for same library, which results in duplicate symbols.

2) When compiling lib/core/misc.c, an error about undefined strnlen is printed. This is because it's a GNU extension, and not declared unless __USE_GNU is defined before including string.h.

First issue is obvious, but I don't know what'd be the most elegant solution to the latter. I just added an #ifdef to misc.c to declare strnlen as extern if __USE_GNU was not defined up to that point.

Patch for the above included, you may use it freely however you see fit.

I'll try to look up the other error message from yesterday and check whether it was an user error on my part or something else.

--
-Tatu Kilappa <tatu.kilappa@xxxxxx>

=== modified file 'Makefile.am'
--- Makefile.am 2010-01-19 13:54:43 +0000
+++ Makefile.am 2010-01-20 08:36:35 +0000
@@ -340,7 +340,6 @@
                                  lib/core/hashtable.c \
                                  lib/core/hashtree.c \
                                  lib/core/utils.c \
-                                 lib/core/hashtree.c \
                                  lib/core/certtools.c \
                                  lib/core/linkedlist.c \
                                  lib/core/debug.c \

=== modified file 'lib/core/misc.c'
--- lib/core/misc.c     2010-01-19 09:28:42 +0000
+++ lib/core/misc.c     2010-01-20 08:56:19 +0000
@@ -24,6 +24,9 @@
 #define HIP_ID_TYPE_LSI     2
 #define HOST_ID_FILENAME_MAX_LEN 256
 
+#ifndef __USE_GNU
+extern size_t strnlen (const char *__string, size_t __maxlen);
+#endif
 
 /** Port numbers for NAT traversal of hip control packets. */
 in_port_t hip_local_nat_udp_port = HIP_NAT_UDP_PORT;

Other related posts: