View Issue Details

IDProjectCategoryView StatusLast Update
0003805GNUnetbuild processpublic2018-06-07 00:25
ReporterdanAssigned ToChristian Grothoff 
Status closedResolutionfixed 
PlatformOSOpenWrtOS Versiontrunk
Product VersionSVN HEAD 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0003805: libmicrohttpd detection is not cross-compile-proof
Descriptionin starting from line 844 an executable is being created on run on the build-host to figure out the version of libmicrohttpd. This obviously can't work in when cross-compiling.
Steps To Reproduce...
checking for mysql... "no"
checking for libmicrohttpd... /usr/src/openwrt/staging_dir/target-mips_mips32_uClibc-
checking for microhttpd.h... yes
checking whether MHD_OPTION_PER_IP_CONNECTION_LIMIT is declared... yes
checking for MHD_get_fdset2 in -lmicrohttpd... yes
checking for libmicrohttpd >= 0.9.32... checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/src/openwrt/staging_dir/host/bin/python
configure: NOTICE: libmicrohttpd not found, http transport will not be installed.
Additional InformationPlease fix the autotools mess...
TagsNo tags attached.


Christian Grothoff

2015-05-31 13:07

manager   ~0009200

Ok, my best idea right now is to just disable that check when cross-compiling.

Christian Grothoff

2015-05-31 13:44

manager   ~0009201

Should be fixed in SVN 35845. Please re-open if not.


2015-05-31 16:39

reporter   ~0009203

Skipping the tests works.
However, as probably all you are testing for are precompiler macros, you could as well go for
#ifndef FEATURE
#error It won't work without FEATURE
and compile that. If compilation works, you got FEATURE macro defined, if not, it fails (so testing whether compiling works and making it fail deliberately rather than trying to execute the resulting binary).
That'd be more elegant and fool-proof compared to just assuming FEATURE is there.


2015-05-31 16:39

reporter   ~0009204

Anyway, just wanted to add that, the bug can stay closed (I just couldn't add another Note while it was closed)

Christian Grothoff

2015-05-31 17:13

manager   ~0009206

Yes, I know, we do that *sometimes*, but I don't like cluttering the code with tons of #ifdef's. So having some minimum version as a hard requirement is sometimes the sane thing to do (especially if that minimum version is years old).


2015-06-01 10:34

reporter   ~0009219

Nah, what I meant wasn't polluting the actual code with #ifdef's but rather just the test-for-lib-version-or-fail in I.e., instead of compiling and running this snippet of C-code (taken from current

#include "$native_srcdir/src/include/platform.h"
#include <microhttpd.h>
int main () { return MHD_VERSION >= 0x0093200 ? 0 : 1; }

You could instead do something like this in the test, given that MHD_VERSION is a macro with a known constant value at compile time, not needing to evaluated at run-time:

#include "$native_srcdir/src/include/platform.h"
#include <microhttpd.h>
#if (MHD_VERSION < 0x0093200)
#error needs at least version 0.9.32

int main () { return 0; }

This will either compile fine (if the version if sufficiently new) or fail. No need to run it.

Christian Grothoff

2015-06-01 11:29

manager   ~0009222

Fixed as suggested in SVN 35850.


2015-06-01 12:24

reporter   ~0009223

Nice, please fix it in the other occurance a few lines down from that one as well.
I reckon a similar change for asserting the mysql library version should be introduced as well.

The gcrypt tests are a bit more complex, but could be split up into testing stuff known at compile-time using precompiler macros and only skip the tests actually really needing run-time evaluation when cross-compiling.

Christian Grothoff

2015-06-01 15:21

manager   ~0009225

Done in SVN 35851.

Issue History

Date Modified Username Field Change
2015-05-31 07:07 dan New Issue
2015-05-31 13:06 Christian Grothoff Assigned To => Christian Grothoff
2015-05-31 13:06 Christian Grothoff Status new => assigned
2015-05-31 13:07 Christian Grothoff Note Added: 0009200
2015-05-31 13:44 Christian Grothoff Note Added: 0009201
2015-05-31 13:44 Christian Grothoff Status assigned => resolved
2015-05-31 13:44 Christian Grothoff Fixed in Version => 0.11.0pre66
2015-05-31 13:44 Christian Grothoff Resolution open => fixed
2015-05-31 13:44 Christian Grothoff Target Version => 0.11.0pre66
2015-05-31 16:39 dan Note Added: 0009203
2015-05-31 16:39 dan Status resolved => feedback
2015-05-31 16:39 dan Resolution fixed => reopened
2015-05-31 16:39 dan Note Added: 0009204
2015-05-31 16:39 dan Status feedback => assigned
2015-05-31 17:13 Christian Grothoff Note Added: 0009206
2015-05-31 17:13 Christian Grothoff Status assigned => resolved
2015-05-31 17:13 Christian Grothoff Resolution reopened => fixed
2015-06-01 10:34 dan Note Added: 0009219
2015-06-01 10:34 dan Status resolved => feedback
2015-06-01 10:34 dan Resolution fixed => reopened
2015-06-01 11:29 Christian Grothoff Note Added: 0009222
2015-06-01 11:29 Christian Grothoff Status feedback => resolved
2015-06-01 11:29 Christian Grothoff Resolution reopened => fixed
2015-06-01 12:24 dan Note Added: 0009223
2015-06-01 12:24 dan Status resolved => feedback
2015-06-01 12:24 dan Resolution fixed => reopened
2015-06-01 15:21 Christian Grothoff Note Added: 0009225
2015-06-01 15:21 Christian Grothoff Status feedback => resolved
2015-06-01 15:21 Christian Grothoff Resolution reopened => fixed
2018-06-07 00:25 Christian Grothoff Status resolved => closed