Re: pg_config/share_dir

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Darcy Buskermolen <darcy(at)wavefire(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 00:31:30
Message-ID: 431F8662.30506@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Darcy Buskermolen wrote:

>On Wednesday 07 September 2005 15:52, Andrew Dunstan wrote:
>
>
>>Peter Eisentraut wrote:
>>
>>
>>>Andrew Dunstan wrote:
>>>
>>>
>>>>pg_config doesn't currently seem to have an option to report the
>>>>share_dir. Should it?
>>>>
>>>>
>>>Is there a case where a user would need anything from there?
>>>
>>>
>
>the way wo do this in slony is with the following macro:
>
>AC_MSG_CHECKING(for postgresql.conf.sample)
>PGSHARE_POSSIBLE_LOCATIONS="${with_pgsharedir} /usr/local/pgsql/share /usr/local/share/postgresql /usr/share/postgresql /usr/local/share/pgsql /usr/share/pgsql /opt/local/pgsql/share /opt/pgsql/share
>${PG_BINDIR}/../share
>for i in $PGSHARE_POSSIBLE_LOCATIONS; do
> if test -s "$i/postgresql.conf.sample" ; then
> PG_SHAREDIR=$i/
> break;
> fi
>done
>
>if test -n "$PG_SHAREDIR" ; then
> AC_MSG_RESULT(${PG_SHAREDIR}postgresql.conf.sample)
> AC_DEFINE(PG_SHAREDIR_VERIFIED,1,[PostgreSQL sharedir])
>else
> AC_MSG_RESULT(not found)
> AC_MSG_ERROR(
> postgresql.conf.sample not found! Please specify the sharedir
> with --with-pgsharedir=<dir>
> )
>fi
>
>
>(where ${PG_BINDIR} is the result of: pg_config --bindir )
>
>
>

That's foul, and looks horribly fragile too. You have just provided what
seems to me a perfect use case.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-08 00:39:27 Re: pg_config/share_dir
Previous Message James William Pye 2005-09-08 00:31:25 PQ versions request message