#6 compilation fails with APR ~ 1.2.2

closed-invalid
nobody
None
5
2006-04-21
2006-03-27
No

Given versions:
Apache 2.2
APR 1.2.2
MySQL 5.0.19

How to reproduce:
# apxs2 -c -L/usr/lib/mysql -I/usr/include/mysql
-lmysqlclient -lm -lz mod_auth_mysql.c

Result:
/usr/share/apr-1/build-1/libtool --silent
--mode=compile i686-pc-linux-gnu-gcc -prefer-pic -Os
-march=athlon-xp -ffast-math -fomit-frame-pointer -pipe
-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE
-D_LARGEFILE64_SOURCE -pthread -I/usr/include/apache2
-I/usr/include/apr-1 -I/usr/include/apr-1
-I/usr/include/mysql -c -o mod_auth_mysql.lo
mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:591: error: syntax error before
"mysql_auth_config_rec"
mod_auth_mysql.c:591: error: initializer element is not
constant
mod_auth_mysql.c:591: error: (near initialization for
`mysql_auth_cmds[0].cmd_data')
mod_auth_mysql.c:591: error: initializer element is not
constant
mod_auth_mysql.c:591: error: (near initialization for
`mysql_auth_cmds[0]')
mod_auth_mysql.c:595: error: initializer element is not
constant
mod_auth_mysql.c:595: error: (near initialization for
`mysql_auth_cmds[1].func')
mod_auth_mysql.c:595: error: syntax error before
"mysql_auth_config_rec"
mod_auth_mysql.c:595: error: initializer element is not
constant
mod_auth_mysql.c:595: error: (near initialization for
`mysql_auth_cmds[1].cmd_data')
mod_auth_mysql.c:595: error: initializer element is not
constant
mod_auth_mysql.c:595: error: (near initialization for
`mysql_auth_cmds[1]')

... and so on (the output is actually much longer).

Discussion

  • Mark Kubacki

    Mark Kubacki - 2006-03-27

    Logged In: YES
    user_id=432893

    Well, and here comes the solution:
    Rename
    APR_XtOffsetOf to APR_OFFSETOF
    and
    APR_XtOffset to APR_OFFSET

    ... and you're done.

    ####
    cat mod_auth_mysql.c \ | sed 's#APR_XtOffsetOf#APR_OFFSETOF#g' \ | sed 's#APR_XtOffset#APR_OFFSET#g' \ > mod_auth_mysql.c1
    mv mod_auth_mysql.c1 mod_auth_mysql.c
    ###

     
  • Mark Kubacki

    Mark Kubacki - 2006-03-27

    Logged In: YES
    user_id=432893

    But the journey continues, now comes:

    Cannot load /usr/lib/apache2/modules/mod_auth_mysql.so into
    server: /usr/lib/apache2/modules/mod_auth_mysql.so:
    undefined symbol: ap_pstrcat

     
  • Mark Kubacki

    Mark Kubacki - 2006-03-27

    Logged In: YES
    user_id=432893

    ap_pstrcat has been replaced by apr_pstrcat in APR > 1.0.

    Thus you have to include "apr_strings.h" and link against
    apr-1 (-lapr-1).

     
  • Mark Kubacki

    Mark Kubacki - 2006-03-27

    Logged In: YES
    user_id=432893

    Unfortunately Apache will start with the new module but
    produce internal server errors. In the logs you will receive
    this message:

    [error] Internal error: pcfg_openfile() called with NULL
    filename

    For now, I switch to mod_authn_dbd.

     
  • Jerry Stuckle

    Jerry Stuckle - 2006-04-21
    • status: open --> closed-invalid
     
  • Jerry Stuckle

    Jerry Stuckle - 2006-04-21

    Logged In: YES
    user_id=1049703

    This is not a bug.

    mod_auth_mysql does not support Apache 2.2 at this time. We
    have been looking at the changes required, but we also need
    to maintain compatibility with older releases of Apache -
    something which is getting increasingly harder to do.

    Additionally, we are looking at whether there is even a need
    for mod_auth_mysql with the new Apache dbd stragety, and if
    so, how we can implement this without breaking anything else.

    Just compiling for Apache 2.2 is the easy part. But it gets
    very complicated, very quickly!

     
  • Mark Kubacki

    Mark Kubacki - 2006-04-21

    Logged In: YES
    user_id=432893

    I fully agree. DBD certainly will be a proper replacement
    for mod_auth_mysql ("MAM")- yet it is some features lacking
    MAM already has.

    And, BTW, by now DBD cannot be seen as stable: in 7 of 10
    cases Apache's httpd 2.2 does not even start with it being
    active.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks