Skip to content

Commit 3983869

Browse files
committed
Use wide-character library routines, if available, for upper/lower/initcap
functions. This allows these functions to work correctly with Unicode and other multibyte encodings. Per prior discussion. Also, revert my earlier change to move installation path mashing from Makefile.global to configure. Turns out not to work well because configure script is working with unexpanded variables, and so fails to match in cases where it should match.
1 parent add8b70 commit 3983869

File tree

5 files changed

+249
-117
lines changed

5 files changed

+249
-117
lines changed

configure

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6955,7 +6955,9 @@ done
69556955

69566956

69576957

6958-
for ac_header in crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.h utime.h kernel/OS.h kernel/image.h SupportDefs.h
6958+
6959+
6960+
for ac_header in crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h
69596961
do
69606962
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
69616963
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -10968,7 +10970,9 @@ test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
1096810970

1096910971

1097010972

10971-
for ac_func in cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask symlink sysconf utime utimes waitpid
10973+
10974+
10975+
for ac_func in cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs
1097210976
do
1097310977
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
1097410978
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -17939,59 +17943,6 @@ CFLAGS="$_CFLAGS"
1793917943
LIBS="$_LIBS"
1794017944
fi
1794117945

17942-
# Adjust installation directories.
17943-
#
17944-
# These are initially set by the equivalent --xxxdir configure options.
17945-
# We append "postgresql" to some of them, if the string does not already
17946-
# contain "pgsql" or "postgres", in order to avoid directory clutter.
17947-
17948-
if echo "$libexecdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
17949-
then
17950-
:
17951-
else
17952-
libexecdir="$libexecdir/postgresql"
17953-
fi
17954-
17955-
if echo "$datadir" | egrep 'pgsql|postgres' >/dev/null 2>&1
17956-
then
17957-
:
17958-
else
17959-
datadir="$datadir/postgresql"
17960-
fi
17961-
17962-
if echo "$sysconfdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
17963-
then
17964-
:
17965-
else
17966-
sysconfdir="$sysconfdir/postgresql"
17967-
fi
17968-
17969-
pkglibdir="$libdir"
17970-
if echo "$pkglibdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
17971-
then
17972-
:
17973-
else
17974-
pkglibdir="$pkglibdir/postgresql"
17975-
fi
17976-
17977-
17978-
pkgincludedir="$includedir"
17979-
if echo "$pkgincludedir" | egrep 'pgsql|postgres' >/dev/null 2>&1
17980-
then
17981-
:
17982-
else
17983-
pkgincludedir="$pkgincludedir/postgresql"
17984-
fi
17985-
17986-
17987-
if echo "$docdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
17988-
then
17989-
:
17990-
else
17991-
docdir="$docdir/postgresql"
17992-
fi
17993-
17994-
1799517946
# prepare build tree if outside source tree
1799617947
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
1799717948
# Note 2: /bin/pwd might be better than shell's built-in at getting
@@ -18692,8 +18643,6 @@ s,@have_docbook@,$have_docbook,;t t
1869218643
s,@DOCBOOKSTYLE@,$DOCBOOKSTYLE,;t t
1869318644
s,@COLLATEINDEX@,$COLLATEINDEX,;t t
1869418645
s,@SGMLSPL@,$SGMLSPL,;t t
18695-
s,@pkglibdir@,$pkglibdir,;t t
18696-
s,@pkgincludedir@,$pkgincludedir,;t t
1869718646
s,@vpath_build@,$vpath_build,;t t
1869818647
CEOF
1869918648

configure.in

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.357 2004/05/21 20:56:47 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.358 2004/05/22 00:34:49 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -670,7 +670,7 @@ fi
670670
##
671671

672672
dnl sys/socket.h is required by AC_FUNC_ACCEPT_ARGTYPES
673-
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.h utime.h kernel/OS.h kernel/image.h SupportDefs.h])
673+
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h])
674674

675675
# At least on IRIX, cpp test for netinet/tcp.h will fail unless
676676
# netinet/in.h is included first.
@@ -795,7 +795,7 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG
795795
# SunOS doesn't handle negative byte comparisons properly with +/- return
796796
AC_FUNC_MEMCMP
797797

798-
AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask symlink sysconf utime utimes waitpid])
798+
AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs])
799799

800800
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
801801

@@ -1202,59 +1202,6 @@ CFLAGS="$_CFLAGS"
12021202
LIBS="$_LIBS"
12031203
fi
12041204

1205-
# Adjust installation directories.
1206-
#
1207-
# These are initially set by the equivalent --xxxdir configure options.
1208-
# We append "postgresql" to some of them, if the string does not already
1209-
# contain "pgsql" or "postgres", in order to avoid directory clutter.
1210-
1211-
if echo "$libexecdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
1212-
then
1213-
:
1214-
else
1215-
libexecdir="$libexecdir/postgresql"
1216-
fi
1217-
1218-
if echo "$datadir" | egrep 'pgsql|postgres' >/dev/null 2>&1
1219-
then
1220-
:
1221-
else
1222-
datadir="$datadir/postgresql"
1223-
fi
1224-
1225-
if echo "$sysconfdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
1226-
then
1227-
:
1228-
else
1229-
sysconfdir="$sysconfdir/postgresql"
1230-
fi
1231-
1232-
pkglibdir="$libdir"
1233-
if echo "$pkglibdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
1234-
then
1235-
:
1236-
else
1237-
pkglibdir="$pkglibdir/postgresql"
1238-
fi
1239-
AC_SUBST(pkglibdir)
1240-
1241-
pkgincludedir="$includedir"
1242-
if echo "$pkgincludedir" | egrep 'pgsql|postgres' >/dev/null 2>&1
1243-
then
1244-
:
1245-
else
1246-
pkgincludedir="$pkgincludedir/postgresql"
1247-
fi
1248-
AC_SUBST(pkgincludedir)
1249-
1250-
if echo "$docdir" | egrep 'pgsql|postgres' >/dev/null 2>&1
1251-
then
1252-
:
1253-
else
1254-
docdir="$docdir/postgresql"
1255-
fi
1256-
1257-
12581205
# prepare build tree if outside source tree
12591206
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
12601207
# Note 2: /bin/pwd might be better than shell's built-in at getting

src/Makefile.global.in

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.186 2004/05/21 20:56:48 tgl Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.187 2004/05/22 00:34:49 tgl Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -51,29 +51,65 @@ configure_args = @configure_args@
5151
##########################################################################
5252
#
5353
# Installation directories
54+
#
55+
# These are set by the equivalent --xxxdir configure options. We
56+
# append "postgresql" to some of them, if the string does not already
57+
# contain "pgsql" or "postgres", in order to avoid directory clutter.
5458

5559
prefix := @prefix@
5660
exec_prefix := @exec_prefix@
5761

5862
bindir := @bindir@
5963
sbindir := @sbindir@
64+
6065
libexecdir := @libexecdir@
66+
ifeq "$(findstring pgsql, $(libexecdir))" ""
67+
ifeq "$(findstring postgres, $(libexecdir))" ""
68+
override libexecdir := $(libexecdir)/postgresql
69+
endif
70+
endif
6171

6272
datadir := @datadir@
73+
ifeq "$(findstring pgsql, $(datadir))" ""
74+
ifeq "$(findstring postgres, $(datadir))" ""
75+
override datadir := $(datadir)/postgresql
76+
endif
77+
endif
78+
6379
sysconfdir := @sysconfdir@
80+
ifeq "$(findstring pgsql, $(sysconfdir))" ""
81+
ifeq "$(findstring postgres, $(sysconfdir))" ""
82+
override sysconfdir := $(sysconfdir)/postgresql
83+
endif
84+
endif
6485

6586
libdir := @libdir@
66-
pkglibdir := @pkglibdir@
87+
pkglibdir = $(libdir)
88+
ifeq "$(findstring pgsql, $(pkglibdir))" ""
89+
ifeq "$(findstring postgres, $(pkglibdir))" ""
90+
override pkglibdir := $(pkglibdir)/postgresql
91+
endif
92+
endif
6793

6894
includedir := @includedir@
69-
pkgincludedir := @pkgincludedir@
95+
pkgincludedir = $(includedir)
96+
ifeq "$(findstring pgsql, $(pkgincludedir))" ""
97+
ifeq "$(findstring postgres, $(pkgincludedir))" ""
98+
override pkgincludedir := $(pkgincludedir)/postgresql
99+
endif
100+
endif
70101
includedir_server = $(pkgincludedir)/server
71102
includedir_internal = $(pkgincludedir)/internal
72103

73104
mandir := @mandir@
74105
sqlmansect_dummy = l
75106

76107
docdir := @docdir@
108+
ifeq "$(findstring pgsql, $(docdir))" ""
109+
ifeq "$(findstring postgres, $(docdir))" ""
110+
override docdir := $(docdir)/postgresql
111+
endif
112+
endif
77113

78114
localedir := @localedir@
79115

0 commit comments

Comments
 (0)