Lists: | pgsql-hackerspgsql-patches |
---|
From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Duplicate definition of LOCALEDIR |
Date: | 2006-05-22 10:17:33 |
Message-ID: | 200605221217.33658.peter_e@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
LOCALEDIR is defined in
src/port/pg_config_paths.h
src/include/pg_config.h
but one of them should be enough. (May be dependent on --enable-nls.) Which
one should be removed?
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Duplicate definition of LOCALEDIR |
Date: | 2006-05-22 12:39:04 |
Message-ID: | 20060522123904.GD24404@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Mon, May 22, 2006 at 12:17:33PM +0200, Peter Eisentraut wrote:
> LOCALEDIR is defined in
>
> src/port/pg_config_paths.h
> src/include/pg_config.h
>
> but one of them should be enough. (May be dependent on --enable-nls.) Which
> one should be removed?
I'd suggest the version in pg_config. Both are ultimatly generated by
configure, but LOCALEDIR is the only directory definition that appears
in pg_config.h.
The fix is simple: remove the AC_DEFINE_UNQUOTED(LOCALEDIR, ...) from
programs/config.h. localedir is still defined.
The odd thing is that there are two paths defined, $localedir and
$exp_localedir, which are not the same and pg_config.h gets one and
pg_config_paths.h gets the other.
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Duplicate definition of LOCALEDIR |
Date: | 2006-05-22 15:23:19 |
Message-ID: | 19463.1148311399@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> The odd thing is that there are two paths defined, $localedir and
> $exp_localedir, which are not the same and pg_config.h gets one and
> pg_config_paths.h gets the other.
It looks to me like $localedir is literally "${prefix}/share/locale",
while exp_localedir has the full path (ie, the expanded contents of
$prefix). Better be careful about assuming they are redundant.
The correct solution to this might be to rename the downstream
variables to make it clearer what's what.
regards, tom lane
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Martijn van Oosterhout <kleptog(at)svana(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Duplicate definition of LOCALEDIR |
Date: | 2006-05-23 01:25:42 |
Message-ID: | 200605230125.k4N1Pgg01876@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > The odd thing is that there are two paths defined, $localedir and
> > $exp_localedir, which are not the same and pg_config.h gets one and
> > pg_config_paths.h gets the other.
>
> It looks to me like $localedir is literally "${prefix}/share/locale",
> while exp_localedir has the full path (ie, the expanded contents of
> $prefix). Better be careful about assuming they are redundant.
>
> The correct solution to this might be to rename the downstream
> variables to make it clearer what's what.
The pg_config_paths.h file was added by me to give files access to
configure paths, in part to allow relocation of install files.
Looking at LOCALEDIR in the two include files, I realize one uses prefix
while another optionally uses $ac_default_prefix, but if LOCALEDIR were
different in the two cases, "NONE" would be prepended to one of them.
I have attached a patch that removes the LOCALEDIR from pg_config.h, and
changed fe-misc.c to make use of the pg_config_paths.h define. I think
this is appropriate only for CVS HEAD.
We have not seen warnings about the two defines only because they are
always define the same.
--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/plain | 2.6 KB |
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Duplicate definition of LOCALEDIR |
Date: | 2006-05-23 19:27:46 |
Message-ID: | 200605231927.k4NJRkG04182@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Patch applied, autoconf and autoheader run.
---------------------------------------------------------------------------
Bruce Momjian wrote:
> Tom Lane wrote:
> > Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > > The odd thing is that there are two paths defined, $localedir and
> > > $exp_localedir, which are not the same and pg_config.h gets one and
> > > pg_config_paths.h gets the other.
> >
> > It looks to me like $localedir is literally "${prefix}/share/locale",
> > while exp_localedir has the full path (ie, the expanded contents of
> > $prefix). Better be careful about assuming they are redundant.
> >
> > The correct solution to this might be to rename the downstream
> > variables to make it clearer what's what.
>
> The pg_config_paths.h file was added by me to give files access to
> configure paths, in part to allow relocation of install files.
>
> Looking at LOCALEDIR in the two include files, I realize one uses prefix
> while another optionally uses $ac_default_prefix, but if LOCALEDIR were
> different in the two cases, "NONE" would be prepended to one of them.
>
> I have attached a patch that removes the LOCALEDIR from pg_config.h, and
> changed fe-misc.c to make use of the pg_config_paths.h define. I think
> this is appropriate only for CVS HEAD.
>
> We have not seen warnings about the two defines only because they are
> always define the same.
>
> --
> Bruce Momjian http://candle.pha.pa.us
> EnterpriseDB http://www.enterprisedb.com
>
> + If your life is a hard drive, Christ can be your backup. +
> Index: configure
> ===================================================================
> RCS file: /cvsroot/pgsql/configure,v
> retrieving revision 1.492
> diff -c -c -r1.492 configure
> *** configure 29 Apr 2006 20:47:29 -0000 1.492
> --- configure 23 May 2006 01:20:32 -0000
> ***************
> *** 22083,22099 ****
>
> # Note: share/locale is always the default, independent of $datadir
> localedir='${prefix}/share/locale'
> - if test x"$prefix" = x"NONE"; then
> - exp_localedir="$ac_default_prefix/share/locale"
> - else
> - exp_localedir="$prefix/share/locale"
> - fi
> -
> -
> -
> - cat >>confdefs.h <<_ACEOF
> - #define LOCALEDIR "$exp_localedir"
> - _ACEOF
>
>
> fi
> --- 22083,22088 ----
> Index: config/programs.m4
> ===================================================================
> RCS file: /cvsroot/pgsql/config/programs.m4,v
> retrieving revision 1.19
> diff -c -c -r1.19 programs.m4
> *** config/programs.m4 4 Dec 2005 03:52:28 -0000 1.19
> --- config/programs.m4 23 May 2006 01:20:32 -0000
> ***************
> *** 164,178 ****
>
> # Note: share/locale is always the default, independent of $datadir
> localedir='${prefix}/share/locale'
> - if test x"$prefix" = x"NONE"; then
> - exp_localedir="$ac_default_prefix/share/locale"
> - else
> - exp_localedir="$prefix/share/locale"
> - fi
> -
> AC_SUBST(localedir)
> - AC_DEFINE_UNQUOTED(LOCALEDIR, ["$exp_localedir"],
> - [Define to the location of locale files.])
> ])# PGAC_CHECK_GETTEXT
>
>
> --- 164,170 ----
> Index: src/include/pg_config.h.in
> ===================================================================
> RCS file: /cvsroot/pgsql/src/include/pg_config.h.in,v
> retrieving revision 1.96
> diff -c -c -r1.96 pg_config.h.in
> *** src/include/pg_config.h.in 29 Apr 2006 20:47:31 -0000 1.96
> --- src/include/pg_config.h.in 23 May 2006 01:20:37 -0000
> ***************
> *** 531,539 ****
> /* Define to build with Kerberos 5 support. (--with-krb5) */
> #undef KRB5
>
> - /* Define to the location of locale files. */
> - #undef LOCALEDIR
> -
> /* Define as the maximum alignment requirement of any C data type. */
> #undef MAXIMUM_ALIGNOF
>
> --- 531,536 ----
> Index: src/interfaces/libpq/fe-misc.c
> ===================================================================
> RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v
> retrieving revision 1.126
> diff -c -c -r1.126 fe-misc.c
> *** src/interfaces/libpq/fe-misc.c 18 May 2006 18:19:47 -0000 1.126
> --- src/interfaces/libpq/fe-misc.c 23 May 2006 01:20:45 -0000
> ***************
> *** 60,65 ****
> --- 60,66 ----
> #include "libpq-int.h"
> #include "pqsignal.h"
> #include "mb/pg_wchar.h"
> + #include "pg_config_paths.h"
>
>
> static int pqPutMsgBytes(const void *buf, size_t len, PGconn *conn);
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +