0

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.

Ralph Ritoch
  • 3,260
  • 27
  • 37

1 Answers1

1

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.

ldav1s
  • 15,885
  • 2
  • 53
  • 56
  • Thanks, this solution wasn't easy to figure out though. tmp_ac_compile=$ac_compile ac_compile='$APXS -c conftest.$ac_ext' # AC_CHECK_MEMBER calls ac_compile=$tmp_ac_compile – Ralph Ritoch Nov 14 '13 at 04:47