Rainer,

On 1/7/15 6:24 AM, Rainer Jung wrote:
> Am 07.01.2015 um 03:15 schrieb Konstantin Kolinko:
>> 2015-01-07 2:25 GMT+03:00 Christopher Schultz
>> <ch...@christopherschultz.net>:
>>> All,
>>>
>>> I give up. I can't seem to figure out exactly how common/config.h comes
>>> into existence during the "configure" process.
> 
> It is created from common/config.h.in. Whereas most of the .in-based
> files are created by configure (see configure.ac) in
> 
> AC_OUTPUT([
>     Makefile
>     apache-1.3/Makefile
>     apache-1.3/Makefile.apxs
>     apache-2.0/Makefile
>     apache-2.0/Makefile.apxs
>     common/Makefile
>     common/list.mk
>     common/jk_types.h
> ])
> 
> the config.h is handled by
> 
> AC_CONFIG_HEADER(common/config.h)
> 
> and the PACKAGE variable values come from
> 
> AC_INIT([mod_jk], [1.2.41])

Okay, but how can we tweak what comes out into common/config.h?

>> I have never built mod_jk, but here are some thoughts
>>
>>> When compiling on Mac OS X, I get the following irritating warning:
>>>
>>> In file included from mod_jk.c:89:
>>> In file included from ../common/jk_global.h:29:
>>> ../common/config.h:81:9: warning: 'PACKAGE_NAME' macro redefined
>>> #define PACKAGE_NAME "mod_jk"
>>>          ^
>>
>> 1. I think that the PACKAGE_NAME define is generated by the following
>> macro in native/configure.ac:
>>
>> dnl package and version.
>> dnl synchronization with common/jk_version.h ?
>> AC_INIT([mod_jk], [1.2.41])
>>
>>
>>> /usr/include/apache2/ap_config_auto.h:213:9: note: previous definition
>>> is here
>>> #define PACKAGE_NAME ""
>>>          ^
>>
>> 2. From the path and file name, I think that the above header file
>> belongs to Apache HTTPD, not mod_jk.  It is no wonder that it has a
>> different PACKAGE_NAME.
>>
>>> There are 3 others like it for a few other #defines. I would like to
>>> clean these up, but I can't just commit changes to common/config.h
>>> because it's auto-generated.
>>>
>>> Can anyone shed some light on where I can modify what gets dumped into
>>> common/config.h? I see some stuff in config.status, but that in turn
>>> gets generated by configure.
>>>
>>> Any suggestions?
> 
> Yes, those errors are annoying. The problem is, that the Apache web
> server and also mod_jk use autoconf/automake and both include the
> generated defines for PACKAGE_NAME etc. in their header files.
> Officially those vars should not get published by Apache but instead be
> kept in private header files.
> 
> During mod_jk build that generates these redefine warnings. Currently
> that does not pose a real problem, since the mod_jk defines win and we
> don't need the Apache defines.
> 
> In Apache land the defines are in ap_config_auto.h, which is included in
> ap_config.h. I don't expect that not including Apache ap_config.h is an
> option. It is included itself in to many other Apache include files.
> 
> So I applied a workaround in r1650036, that can be found in other
> modules as well, namely undefining those vars before including our own
> config.h.

That's exactly what I was going to do... just in config.h.

> Thanks for the heads up. I found it annoying as well and simply needed a
> kick to look for a solution.

:)

I was going to take a look at all our native components to see if I
could get rid of all warnings on both Linux and Mac OS X (environments
to which I have easy access).

It looks like mod_jk builds on Mac OS X now with no warnings or anything
when using "-Wall -pedantic". Yay!

Thanks,
-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to