Question

How do I make GNU autoconf script to test for typedef struct members using APXS as the compiler?

I have defined the following tests but the results are not what I'm expecting...

AC_CHECK_MEMBER(struct conn_rec.remote_ip, define 'USE_CON_REC_REMOTE_IP',,[#include "httpd.h"]);
AC_CHECK_MEMBER(struct conn_rec.client_ip, define 'USE_CON_REC_CLIENT_IP',,[#include "httpd.h"]);
AC_CHECK_MEMBER(struct conn_rec.remote_addr, define 'USE_CON_REC_REMOTE_ADDR',,[#include "httpd.h"]);

All of these tests are returning "no" even though I know that the first test and the last test should return "yes". I suspect this may be because these are typedefs instead of structs, and/or because autoconf isn't using APXS to run the tests.

The full code is at https://github.com/rritoch/PikeVM/blob/master/root/boot/system-1.1/apache/configure.ac

I am hoping there is a preexisting solution that doesn't require making custom test scripts.

Was it helpful?

Solution

AC_CHECK_MEMBER is for the C/C++ compiler. There are apxs macros to help setup compilation with apxs. It shouldn't be too hard to translate AC_CHECK_MEMBER into a macro suitable for apxs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top