in reply to Re: Sourcing Dot Config Files and Monitoring Make Processes
in thread Sourcing Dot Config Files and Monitoring Make Processes

Tadman, thank you for your reply.

This looks like the direction we will want to move to with future releases.

The problem I am having with our dot .profile configuration files is that they are actually ksh scripts (determining ports, etc) and not just a list of keys and values. I cannot actually determine what values they will produce until install time when the files are in the target directory and they are actually sourced.

I don't like this design, but I am thinking of sourcing the dot configuration files in a ksh script and then calling a Perl script that wraps the make process.

Or, at install time, should I source the dot configuration files in a ksh script that then writes the environment to a "frozen" file, read the "frozen environment" and then put the key/value pairs in the Perl environment hash? And then call make in the "thawed" environment?

These solutions still feel somewhat awkward.

  • Comment on Re: Re: Sourcing Dot Config Files and Monitoring Make Processes

Replies are listed 'Best First'.
Re^3: Sourcing Dot Config Files and Monitoring Make Processes
by tadman (Prior) on May 08, 2002 at 18:13 UTC
    You can find examples of this type of thing all over the place, but a notable one is with the Apache Web server. When compiling, there is a program called apaci which is a wrapper that works just like you want. It is simply a sh script. Here's a theoretical approximation:
    #!/bin/sh # Set Variables FOO="bar" CC="gcc" COPTS="-l -q -r" # Execute whatever $*
    All it does is set a few variables and then run whatever commands you give it. This also means that make doesn't "talk" as much during compiles since the commands are shorter. I'm not a fan of Makefiles which spew out reams of useless "-I../../../../../src -DSOMETHING -DSOMETHING_ELSE ..." type parameters since it is harder to casually spot warnings, and harder still to parse what is actually going on.

    As a note, though, you may not want to use Perl to actually execute the make process(es) as it is fairly heavy compared to a shell, something that might slow down your build. It might be advantageous for Perl to generate the required shell scripts and then kick off the whole process with a single exec call.