]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: cleanup HAVE_LIBCRYPT
authorKarel Zak <kzak@redhat.com>
Thu, 27 Oct 2011 13:13:40 +0000 (15:13 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 3 Nov 2011 11:32:50 +0000 (12:32 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
login-utils/Makefile.am

index 48b53dbcb1ee56e3764b49d5ab9c5f810ba998d0..facc9e41f8f1cdedbe4f46ea3196f41381480116 100644 (file)
@@ -429,6 +429,39 @@ AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
 #include <sched.h>
 ]])
 
+# on Solaris, you can't mix and match standards, since we use c99
+# aparently at this stage, XOPEN_SOURCE will conflict.  As workaround,
+# check for crypt.h and use that without XOPEN_SOURCE.
+AC_CHECK_HEADERS([crypt.h])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#else
+#define _XOPEN_SOURCE
+#include <unistd.h>
+#endif
+]], [[
+char *c = crypt("abc","pw");
+]])],[],[
+  LIBS="$LIBS -lcrypt"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+  #ifdef HAVE_CRYPT_H
+  #include <crypt.h>
+  #else
+  #define _XOPEN_SOURCE
+  #include <unistd.h>
+  #endif
+  ]], [[
+  char *c = crypt("abc","pw");
+  ]])],[
+  AC_DEFINE(HAVE_LIBCRYPT, 1, [Do we need -lcrypt?])
+  have_libcrypt=yes
+  ],[
+  AC_MSG_ERROR([crypt() is not available])
+  ])
+])
+AM_CONDITIONAL(HAVE_LIBCRYPT, test "x$have_libcrypt" = xyes)
+
 
 AC_ARG_ENABLE([most-builds],
   AS_HELP_STRING([--enable-most-builds], [build everthing other than experimental code]),
@@ -637,41 +670,6 @@ else
   AM_CONDITIONAL(HAVE_UTEMPTER, false)
 fi
 
-# on Solaris, you can't mix and match standards, since we use c99
-# aparently at this stage, XOPEN_SOURCE will conflict.  As workaround,
-# check for crypt.h and use that without XOPEN_SOURCE.
-AC_CHECK_HEADERS([crypt.h])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_CRYPT_H
-#include <crypt.h>
-#else
-#define _XOPEN_SOURCE
-#include <unistd.h>
-#endif
-]], [[
-char *c = crypt("abc","pw");
-]])],[],[
-  LIBS="$LIBS -lcrypt"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-  #ifdef HAVE_CRYPT_H
-  #include <crypt.h>
-  #else
-  #define _XOPEN_SOURCE
-  #include <unistd.h>
-  #endif
-  ]], [[
-  char *c = crypt("abc","pw");
-  ]])],[
-  AC_DEFINE(NEED_LIBCRYPT, 1, [Do we need -lcrypt?])
-  need_libcrypt=yes
-  ],[
-  AC_MSG_ERROR([crypt() is not available])
-  ])
-])
-
-AM_CONDITIONAL(NEED_LIBCRYPT, test "x$need_libcrypt" = xyes)
-
-
 UL_CHECK_SYSCALL([pivot_root])
 UL_CHECK_SYSCALL([sched_getaffinity])
 UL_CHECK_SYSCALL([ioprio_set],
index ada45553ddb9354b72ac46941bc4728ef1809f75..6d1e85fd5fdb3b4b021f5bbe92a334f86d6e7d4f 100644 (file)
@@ -45,7 +45,7 @@ newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 
 login_ldadd_common += -lpam -lpam_misc
 
-if NEED_LIBCRYPT
+if HAVE_LIBCRYPT
 newgrp_LDADD += -lcrypt
 endif