tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Supplying CONFIGURE_ARGS that have package-specific variables
Am 26.11.2024 um 21:47 schrieb Louis Guillaume:
> Hi - I'm trying again on AIX to get a build of perl (this time 5.40.0nb1).
>
> Looking at an RPM Spec that produced a working version of 5.38.x with
> GCC, I see these options:
>
> export LDDLFLAGS3264="-G -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp
> -bnoentry -lc -lm"
>
>
> Now those LDDLFLAGS3264 get stuffed into LDDLFLAGS and then used in the
> configure statement:
>
> ... -Dlddlflags="$LDDLFLAGS" \
>
>
> That's all understandable, but if I set this up in mk.conf like this:
>
> CONFIGURE_ARGS+= "-Dlddlflags=-G -bI:$(PERL_INC)/perl.exp
> -bE:$(BASEEXT).exp -bnoentry -lc -lm"
You need a two-level approach.
The first level is to add the escaping for bmake, which is to double
each '$':
> CONFIGURE_ARGS+= ... -bI:$$(PERL_INC)/perl.exp ...
Next, you need to add the escaping for the shell, by adding a '\' before
each '$' that reaches the shell:
> CONFIGURE_ARGS+= ... -bI:\$$(PERL_INC)/perl.exp ...
You don't need "double quotes" around the whole variable value, that's
only needed when you use shell variables, but not when you compose shell
commands in bmake:
CONFIGURE_ARGS+= \
-Dlddlflags=-G \
-bI:\$$(PERL_INC)/perl.exp \
-bE:\$$(BASEEXT).exp \
-bnoentry \
-lc \
-lm
This will preserve the '$' characters through both bmake and the shell.
The tricky detail is to know at which exact point these '$' characters
will be expanded later. The expression '$(PERL_INC)' is for a makefile,
due to the parentheses. But this would mean that there really needs to
be an environment variable named LDDLFLAGS3264 that has this exact
value, and that passing the flags directly to CONFIGURE_ARGS is probably
the wrong approach.
Roland
Home |
Main Index |
Thread Index |
Old Index