[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] FHS done right



On Thu, Dec 06, 2007 at 12:14:59PM +0100, Guillaume Rousse wrote:

> But it is discouraged to use it for anything else as makefile, because 
> directories variables are not totally evaluated:
> http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_mono/autoconf.html#SEC24

Ah, yes. The proposed patch does not have this problem but you're
generally right. In fact, I have this wonderful piece of code in some of my
projects' configure.ac (I also took it from somewhere but can't remember
where):

for i in prefix localstatedir sysconfdir; do
        name=`echo $i | sed -e 's/dir$//' | $TR 'a-z' 'A-Z'`
        x="\$$i"
        eval y="$x"
        while test "$x" != "$y"; do
                x="$y"
                eval y="$x"
        done
        AC_DEFINE_UNQUOTED([DIR_$name], ["$x"])
done

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------