> tis 2007-07-10 klockan 20:34 +1200 skrev Amos Jeffries:
>> Duane Wessels wrote:
>>
>> > On Tue, 10 Jul 2007, Amos Jeffries wrote:
>> >
>> >> Hey guys,
>> >>  I find myself in need of a ./configure option to set the
>> >> cache_effective_user other than 'nobody' on a per-dist basis, leaving
>> >> the squid.conf setup as-is.
>> >>  Can someone please explain to me how the @HTTP_PORT@ etc get
>> >> replaced in squid.conf / cf.data.pre
>> >> I have tried modifying src/makefile.am and ./configure.in to no
>> >> visible effect.
>> >
>> > Calling AC_DEFINE (etc) causes the variables to be set for autoconf.
>> > After ./configure runs, you should see them in config.status.  eg:
>> >
>> >     s,@CACHE_HTTP_PORT@,3128,;t t
>> >
>> >
>> > config.status does the substitutions from Makefile.in to Makefile.
>> > for example:
>> >
>> >     $ sh config.status
>> >     ...
>> >     config.status: creating src/Makefile
>> >
>> >
>> > So in src/Makefile.in you have:
>> >
>> >     DEFAULT_HTTP_PORT = @CACHE_HTTP_PORT@
>> >
>> > While in src/Makefile you have:
>> >
>> >     DEFAULT_HTTP_PORT = 3128
>> >
>> >
>> > Our src/Makefile (but you must edit src/Makefile.am of course) has
>> > a long-ish sed commands to do very similar substitutions on the
>> > cf.data.pre file:
>> >
>> >     cf.data: cf.data.pre Makefile
>> >         sed "\
>> >         [EMAIL PROTECTED]@%$(DEFAULT_HTTP_PORT)%g;\
>> >         [EMAIL PROTECTED]@%$(DEFAULT_ICP_PORT)%g;\
>> >     ...
>> >
>>
>> Thanks Duane,
>>    What you have just written matched perfectly with my earlier reading
>> straight from the code. So I still can't see whats going wrong here.
>>
>>
>> > So if you want to add your own macro goop you have to (at least):
>> >
>> >    - modify configure.in (if you want it to be set via ./configure)
>>
>> yes:::
>>
>> AC_ARG_WITH(cache-user,
>> [  --with-cache-user=USER System user account for squid permissions.
>>                           default: nobody],
>> [ if tets -z "$withval"; then
>>     AC_DEFINE(cfg_CACHE_EFFECTIVE_USER, "$withval", [change User for
>> squid to $withval])
>>   else
>>     AC_DEFINE(cfg_CACHE_EFFECTIVE_USER, "nobody", [default User for
>> squid])
>>   fi
>> ])
>> AC_SUBST(cfg_CACHE_EFFECTIVE_USER)
>
> You also need to assign the cfg_CACHE_EFFECTIVE_USER variable a value
>
> The following should work:
>
> cfg_CACHE_EFFECTIVE_USER="nobody"
> AC_ARG_WITH(cache-user,
> [  --with-cache-user=USER System user account for squid permissions.
>                           default: nobody],
> [
>     cfg_CACHE_EFFECTIVE_USER="$withval"
> ])
> AC_SUBST(cfg_CACHE_EFFECTIVE_USER)
>
>
> You don't need AC_DEFINE. AC_DEFINE adds a C macro definition.
>
> Regards
> Henrik
>

Eureka. As always Henrik is knows everything :-)
It was those AC_DEFINE's

Amos

Reply via email to