diff options
| author | Alvar Penning <post@0x21.biz> | 2025-12-10 20:55:56 +0100 |
|---|---|---|
| committer | Alvar Penning <post@0x21.biz> | 2025-12-11 21:05:49 +0100 |
| commit | 59d7d1c2f12363331d03d956cfce0936034c34f8 (patch) | |
| tree | 860ae3fe0c4515220b6e8d5a3b220d34e89581ab | |
| parent | 7ab5b3ba34128949902cb966ab73d84f8fb4113f (diff) | |
| download | monitoring-plugins-59d7d1c2f12363331d03d956cfce0936034c34f8.tar.gz | |
configure.ac: Fix PostgreSQL Check for OpenBSD
On OpenBSD, crypt is named crypto. This diff is a portable version of a
patch residing in the OpenBSD ports since ages.
https://codeberg.org/OpenBSD/ports/src/commit/1f15238782c26deb728250cbf591f1ffcd10422f/net/monitoring-plugins/patches/patch-configure_ac
| -rw-r--r-- | configure.ac | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 2bf94014..abd90413 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -205,32 +205,46 @@ fi | |||
| 205 | dnl Check for PostgreSQL libraries | 205 | dnl Check for PostgreSQL libraries |
| 206 | _SAVEDLIBS="$LIBS" | 206 | _SAVEDLIBS="$LIBS" |
| 207 | _SAVEDCPPFLAGS="$CPPFLAGS" | 207 | _SAVEDCPPFLAGS="$CPPFLAGS" |
| 208 | case $host in | ||
| 209 | *openbsd*) | ||
| 210 | _CRYPTLIB="crypto" | ||
| 211 | ;; | ||
| 212 | *) | ||
| 213 | _CRYPTLIB="crypt" | ||
| 214 | esac | ||
| 215 | |||
| 208 | AC_ARG_WITH(pgsql, | 216 | AC_ARG_WITH(pgsql, |
| 209 | ACX_HELP_STRING([--with-pgsql=DIR], | 217 | ACX_HELP_STRING([--with-pgsql=DIR], |
| 210 | [sets path to pgsql installation]), | 218 | [sets path to pgsql installation]), |
| 211 | PGSQL=$withval,) | 219 | PGSQL=$withval,) |
| 212 | AC_CHECK_LIB(crypt,main) | 220 | AC_CHECK_LIB(crypt,main) |
| 213 | if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then | 221 | AC_CHECK_LIB(crypto,main) |
| 222 | if test \( "$ac_cv_lib_crypt_main" = "yes" -o "$ac_cv_lib_crypto_main" = "yes" \) -a "x$PGSQL" != "xno"; then | ||
| 214 | if test -n "$PGSQL"; then | 223 | if test -n "$PGSQL"; then |
| 215 | LDFLAGS="$LDFLAGS -L$PGSQL/lib" | 224 | LDFLAGS="$LDFLAGS -L$PGSQL/lib" |
| 216 | CPPFLAGS="$CPPFLAGS -I$PGSQL/include" | 225 | CPPFLAGS="$CPPFLAGS -I$PGSQL/include" |
| 217 | fi | 226 | fi |
| 218 | AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt) | 227 | AC_CHECK_LIB(pq,PQsetdbLogin,,,"-l$_CRYPTLIB") |
| 219 | if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then | 228 | if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then |
| 220 | AC_CHECK_HEADERS(pgsql/libpq-fe.h) | 229 | AC_CHECK_HEADERS(pgsql/libpq-fe.h) |
| 221 | AC_CHECK_HEADERS(postgresql/libpq-fe.h) | 230 | AC_CHECK_HEADERS(postgresql/libpq-fe.h) |
| 222 | AC_CHECK_HEADERS(libpq-fe.h) | 231 | AC_CHECK_HEADERS(libpq-fe.h) |
| 223 | if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then | 232 | if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then |
| 224 | PGLIBS="-L$PGSQL/lib -lpq -lcrypt" | 233 | PGLIBS="-L$PGSQL/lib -lpq -l$_CRYPTLIB" |
| 225 | PGINCLUDE="-I$PGSQL/include" | 234 | PGINCLUDE="-I$PGSQL/include" |
| 226 | elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then | 235 | elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then |
| 227 | PGLIBS="-lpq -lcrypt" | 236 | PGLIBS="-lpq -l$_CRYPTLIB" |
| 228 | PGINCLUDE="-I/usr/include/pgsql" | 237 | PGINCLUDE="-I/usr/include/pgsql" |
| 229 | elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then | 238 | elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then |
| 230 | PGLIBS="-L$PGSQL/lib -lpq -lcrypt" | 239 | PGLIBS="-L$PGSQL/lib -lpq -l$_CRYPTLIB" |
| 231 | PGINCLUDE="-I/usr/include/postgresql" | 240 | case $host in |
| 241 | *openbsd*) | ||
| 242 | PGINCLUDE="-I$PGSQL/include/postgresql" ;; | ||
| 243 | *) | ||
| 244 | PGINCLUDE="-I/usr/include/postgresql" | ||
| 245 | esac | ||
| 232 | elif test "$ac_cv_header_libpq_fe_h" = "yes"; then | 246 | elif test "$ac_cv_header_libpq_fe_h" = "yes"; then |
| 233 | PGLIBS="-L$PGSQL/lib -lpq -lcrypt" | 247 | PGLIBS="-L$PGSQL/lib -lpq -l$_CRYPTLIB" |
| 234 | PGINCLUDE="-I$PGSQL/include" | 248 | PGINCLUDE="-I$PGSQL/include" |
| 235 | fi | 249 | fi |
| 236 | if test -z "$PGINCLUDE"; then | 250 | if test -z "$PGINCLUDE"; then |
