]> skyeroc.xyz Git - dgamelaunch/commitdiff
Check for libcrypt instead of unconditionally adding -lcrypt
authorRon Nazarov <ron@noisytoot.org>
Mon, 25 Nov 2024 16:31:04 +0000 (16:31 +0000)
committerRon Nazarov <ron@noisytoot.org>
Mon, 25 Nov 2024 16:31:04 +0000 (16:31 +0000)
This was causing the configure script to fail on checking for ncurses
when it was actually failing due to libcrypt being missing.  A check
for -lutil should be added to, but I didn't do this since -lutil is
not required since glibc 2.34 and I'm using a newer version and don't
know what function it should check for.

configure.ac

index afeb6f8035c27f78365bdc401e00a9e4031a760f..d4b5578d5b2c7d29ad9b0a4a7b2f99c7839a9d37 100644 (file)
@@ -26,7 +26,10 @@ fi
 
 case "$(uname -s)" in
   Linux | *BSD)
-    LIBS="$LIBS -lutil -lcrypt"
+    LIBS+=" -lutil"
+    AC_CHECK_LIB(crypt, crypt, [LIBS+=" -lcrypt"], [
+        AC_MSG_ERROR([Cannot find libcrypt.])
+    ])
     AC_DEFINE(NOSTREAMS, 1, [Don't use SVR4 streams support in ttyrec.])
   ;;
 esac