summaryrefslogtreecommitdiff
path: root/libpq/libpq
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-11-28 18:29:18 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-11-28 18:29:18 +0300
commit855efb94214cc519805de89934d82bc5e0f92685 (patch)
treed8f5f741d46dbcb800bd2026bd8fd8f0d72a25e6 /libpq/libpq
parent646a9f3410dab150e0c7871273d4982fa5c132e9 (diff)
Release version 14.1.0+2HEADv14.1.0+2master
Add psql package. Don't compile port/strlcpy.c on Linux if GNU libc is 2.38 or newer. Switch to using -pthread instead of -D_REENTRANT/-lpthread in buildfiles and bump build2 version requirement to 0.15.0.
Diffstat (limited to 'libpq/libpq')
-rw-r--r--libpq/libpq/buildfile21
-rw-r--r--libpq/libpq/pg_config.h93
-rw-r--r--libpq/libpq/strlcpy.c6
3 files changed, 99 insertions, 21 deletions
diff --git a/libpq/libpq/buildfile b/libpq/libpq/buildfile
index 413583c..94fa06b 100644
--- a/libpq/libpq/buildfile
+++ b/libpq/libpq/buildfile
@@ -44,7 +44,13 @@ windows = ($tclass == 'windows')
#
lib{pq}: port/c{explicit_bzero}: include = (!$bsd)
lib{pq}: port/c{gettimeofday}: include = ($tsys == 'win32-msvc')
-lib{pq}: port/c{strlcpy}: include = (!$bsd && !$macos)
+
+# Note that we never compile port/strlcpy.c directly but rather conditionally
+# include it from our strlcpy.c if HAVE_DECL_STRLCAT is 0 (see
+# libpq/pg_config.h for the macro definition).
+#
+lib{pq}: port/c{strlcpy}: include = adhoc
+lib{pq}: c{strlcpy}: include = (!$bsd && !$macos)
lib{pq}: pq/{h c}{*win32* } \
port/{h c}{*win32* +getaddrinfo +inet_aton}: include = $windows
@@ -84,14 +90,7 @@ h{version}: in{version} $src_root/manifest
#
c.poptions += -DFRONTEND -DUNSAFE_STAT_OK -DSO_MAJOR_VERSION=$abi_major
-if! $windows
- # Note that the upstream package uses the -pthread compiler/linker option.
- # The option is unsupported by build2 so we pass -D_REENTRANT and -lpthread
- # preprocessor/linker options instead. We also omit -D_THREAD_SAFE (synonym
- # for -D_REENTRANT) and Solaris-specific -D_POSIX_PTHREAD_SEMANTICS.
- #
- c.poptions += -D_REENTRANT
-else
+if $windows
# Note that the upstream package defines the WIN32 macro for VC only,
# relying on the fact that MinGW GCC defines it by default. However, the
# macro disappears from the default ones if to compile with -std=c9x (as we
@@ -237,11 +236,11 @@ switch $tclass, $tsys
c.loptions += "-Wl,--version-script=$out_base/libpqdll.map"
- c.libs += -lpthread
+ c.libs += -pthread
}
default
- c.libs += -lpthread
+ c.libs += -pthread
}
# Export options.
diff --git a/libpq/libpq/pg_config.h b/libpq/libpq/pg_config.h
index c834880..e0e61ad 100644
--- a/libpq/libpq/pg_config.h
+++ b/libpq/libpq/pg_config.h
@@ -15,14 +15,23 @@
#include <stddef.h> /* offsetof() */
+#if defined(__linux__)
+# include <features.h> /* __GLIBC__, __GLIBC_MINOR__ */
+#endif
+
#include <openssl/opensslv.h> /* OPENSSL_VERSION_NUMBER */
+#define PACKAGE_NAME "PostgreSQL"
+#define PACKAGE_URL "https://www.postgresql.org/"
+#define PACKAGE_BUGREPORT "pgsql-bugs@lists.postgresql.org"
+
/*
* Version.
*/
#undef PG_VERSION
#undef PG_VERSION_NUM
#undef PG_MAJORVERSION
+#undef PG_VERSION_STR
#include <libpq/version.h>
/*
@@ -110,6 +119,22 @@
#define INT64_MODIFIER "ll"
/*
+ * GNU libc added strlcpy() and strlcat() in version 2.38 (in anticipation
+ * of their addition to POSIX).
+ */
+#if defined(__FreeBSD__) || \
+ defined(__APPLE__) || \
+ (defined(__GLIBC__) && \
+ defined(__GLIBC_MINOR__) && \
+ (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 38))
+# define HAVE_DECL_STRLCAT 1
+# define HAVE_DECL_STRLCPY 1
+#else
+# define HAVE_DECL_STRLCAT 0
+# define HAVE_DECL_STRLCPY 0
+#endif
+
+/*
* Specific for FreeBSD.
*/
#ifdef __FreeBSD__
@@ -142,8 +167,6 @@
* Specific for FreeBSD and Mac OS.
*/
#if defined(__FreeBSD__) || defined(__APPLE__)
-# define HAVE_DECL_STRLCAT 1
-# define HAVE_DECL_STRLCPY 1
# define STRERROR_R_INT 1
# define HAVE_FLS 1
# define HAVE_GETPEEREID 1
@@ -154,9 +177,7 @@
# define HAVE_SYS_UCRED_H 1
# define HAVE_UNION_SEMUN 1
# define HAVE_MEMSET_S 1
-#else
-# define HAVE_DECL_STRLCAT 0
-# define HAVE_DECL_STRLCPY 0
+# define HAVE_INT_OPTRESET 1
#endif
/*
@@ -190,6 +211,8 @@
# define HAVE_PWRITE 1
# define HAVE_LINK 1
# define HAVE_STRUCT_SOCKADDR_UN 1
+# define HAVE_READLINK 1
+# define HAVE_STRSIGNAL 1
/*
* Specific for Windows.
@@ -224,6 +247,12 @@
# define HAVE__BUILTIN_BSWAP64 1
# define HAVE__BUILTIN_OP_OVERFLOW 1
# define HAVE_SETENV 1
+# define HAVE_CLOCK_GETTIME 1
+# define HAVE_GETOPT 1
+# define HAVE_GETOPT_H 1
+# define HAVE_GETOPT_LONG 1
+# define HAVE_INT_OPTERR 1
+# define HAVE_STRUCT_OPTION 1
/*
* _Static_assert() was introduced in C11. However, all the latest major
@@ -288,11 +317,7 @@
#undef ENABLE_GSS
#undef USE_LDAP
-/*
- * Is meaningless if NLS support is disabled (see above and libpq/buildfile for
- * details).
- */
-#undef LOCALEDIR
+#undef HAVE_LIBREADLINE
/*
* Is meaningless if GSSAPI support is disabled (see above). It also seems that
@@ -355,4 +380,52 @@
#undef HAVE___STRTOLL
#undef HAVE___STRTOULL
+/*
+ * None of the supported platforms provides append_history().
+ */
+#undef HAVE_APPEND_HISTORY
+
+/*
+ * None of the supported OSes have <editline/history.h> or
+ * <editline/readline.h>.
+ */
+#undef HAVE_EDITLINE_HISTORY_H
+#undef HAVE_EDITLINE_READLINE_H
+
+/*
+ * None of the supported OSes have <history.h>.
+ */
+#undef HAVE_HISTORY_H
+#undef HAVE_HISTORY_TRUNCATE_FILE
+
+/*
+ * None of the supported OSes have <readline.h>, <readline/history.h>, or
+ * <readline/readline.h>.
+ */
+#undef HAVE_READLINE_H
+#undef HAVE_READLINE_HISTORY_H
+#undef HAVE_READLINE_READLINE_H
+
+/*
+ * None of the supported platforms provides rl_completion_append_character and
+ * rl_completion_suppress_quote global variables and rl_completion_matches().
+ */
+#undef HAVE_RL_COMPLETION_APPEND_CHARACTER
+#undef HAVE_RL_COMPLETION_MATCHES
+#undef HAVE_RL_COMPLETION_SUPPRESS_QUOTE
+
+/*
+ * None of the supported platforms provides rl_filename_quote_characters and
+ * rl_filename_quoting_function global variables and
+ * rl_filename_completion_function().
+ */
+#undef HAVE_RL_FILENAME_COMPLETION_FUNCTION
+#undef HAVE_RL_FILENAME_QUOTE_CHARACTERS
+#undef HAVE_RL_FILENAME_QUOTING_FUNCTION
+
+/*
+ * None of the supported platforms provides rl_reset_screen_size().
+ */
+#undef HAVE_RL_RESET_SCREEN_SIZE
+
#define pg_restrict __restrict
diff --git a/libpq/libpq/strlcpy.c b/libpq/libpq/strlcpy.c
new file mode 100644
index 0000000..2dd9f29
--- /dev/null
+++ b/libpq/libpq/strlcpy.c
@@ -0,0 +1,6 @@
+/* file : libpq/strlcpy.c -*- C -*-
+ * license : PostgreSQL License; see accompanying COPYRIGHT file
+ */
+#if !HAVE_DECL_STRLCPY
+# include <port/strlcpy.c>
+#endif