0
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2025-06-30 22:18:49 -04:00

Autodetect HAVE_PASSWD support

Fixes #122
This commit is contained in:
Samuel Tyler 2024-12-29 11:35:19 +11:00
parent 1f2ca97c1d
commit 9538f73d65
3 changed files with 24 additions and 2 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ src/filetypes.h
src/bin2c src/bin2c
src/gophernicus src/gophernicus
Makefile Makefile
config.h
README README
README.options README.options

21
configure vendored
View File

@ -64,6 +64,9 @@ done
: ${CFLAGS:=-O2} : ${CFLAGS:=-O2}
: ${HOSTNAME:=autodetect} : ${HOSTNAME:=autodetect}
rm -f config.h
touch config.h
# Check for a compiler that actually works # Check for a compiler that actually works
printf "checking for working compiler... " printf "checking for working compiler... "
cat > conftest.c <<EOF cat > conftest.c <<EOF
@ -243,7 +246,8 @@ cat > conftest.c <<EOF
int main() {} int main() {}
EOF EOF
if ${CC} -o conftest -lwrap conftest.c 2>/dev/null; then if ${CC} -o conftest -lwrap conftest.c 2>/dev/null; then
LIBWRAP="-DHAVE_LIBWRAP -lwrap" LIBWRAP="-lwrap"
echo "#define HAVE_LIBWARP " >> config.h
printf "yes" printf "yes"
else else
LIBWRAP= LIBWRAP=
@ -251,6 +255,21 @@ else
fi fi
printf "\\n" printf "\\n"
# Checking for passwd support
printf "checking for passwd support... "
cat > conftest.c <<EOF
#include <pwd.h>
int main() {}
EOF
if ${CC} -o conftest conftest.c 2>/dev/null; then
echo "#define HAVE_PASSWD " >> config.h
printf "yes"
else
printf "no"
fi
printf "\\n"
# Check and use SHM if available # Check and use SHM if available
printf "checking for ipcrm (SHM management)... " printf "checking for ipcrm (SHM management)... "
if ! IPCRM="$(command -v ipcrm)"; then if ! IPCRM="$(command -v ipcrm)"; then

View File

@ -53,7 +53,7 @@
/* Defaults should fit standard POSIX systems */ /* Defaults should fit standard POSIX systems */
#define HAVE_IPv4 /* IPv4 should work anywhere */ #define HAVE_IPv4 /* IPv4 should work anywhere */
#define HAVE_IPv6 /* Requires modern POSIX */ #define HAVE_IPv6 /* Requires modern POSIX */
#define HAVE_PASSWD /* For systems with passwd-like userdb */ /* #define HAVE_PASSWD autodetected, For systems with passwd-like userdb */
#define PASSWD_MIN_UID 100 /* Minimum allowed UID for ~userdirs */ #define PASSWD_MIN_UID 100 /* Minimum allowed UID for ~userdirs */
#define HAVE_LOCALES /* setlocale() and friends */ #define HAVE_LOCALES /* setlocale() and friends */
#define HAVE_SHMEM /* Shared memory support */ #define HAVE_SHMEM /* Shared memory support */
@ -63,6 +63,8 @@
#undef HAVE_SENDFILE /* sendfile() in Linux & others */ #undef HAVE_SENDFILE /* sendfile() in Linux & others */
/* #undef HAVE_LIBWRAP autodetected, don't enable here */ /* #undef HAVE_LIBWRAP autodetected, don't enable here */
#include "config.h"
/* Linux */ /* Linux */
#ifdef __linux #ifdef __linux
#undef PASSWD_MIN_UID #undef PASSWD_MIN_UID