diff options
author | Fabian Groffen <grobian@gentoo.org> | 2011-01-12 21:01:07 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2011-01-17 16:32:39 +0100 |
commit | 0aeb57aca31816ca5b93cc10ad0fb9d62ad805de (patch) | |
tree | 15b5d1a3395da747dfaada6ac28f3a2b14b9b2e9 /login-utils | |
parent | aabe2441765c632bba697945491e3e0ac29ac886 (diff) | |
download | util-linux-old-0aeb57aca31816ca5b93cc10ad0fb9d62ad805de.tar.gz |
build-sys: improve check for crypt
Check for crypt.h existence, and use it if available over using unistd.h
for which a certain feature level has to be set to export a definition
for crypt. On Solaris this set causes a standards conflict in the
headers, because at the time of this check C99 mode is already enabled,
which implies certain standards non-compatible with _XOPEN_SOURCE.
92 #define _XOPEN_SOURCE
93 #include <unistd.h>
configure:16259: gcc -std=gnu99 -c -g -O2 conftest.c >&5
In file included from /usr/include/unistd.h:18,
from conftest.c:93:
/prefix/gentoo/usr/lib/gcc/i386-pc-solaris2.10/4.4.5/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
configure.ac: improve crypt check
login-utils/my_crypt.h: replace old GNU_LIBRARY check with autoconf
define for crypt.h
[kzak@redhat.com: - remove my_crypt.h]
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/Makefile.am | 5 | ||||
-rw-r--r-- | login-utils/chfn.c | 5 | ||||
-rw-r--r-- | login-utils/chsh.c | 5 | ||||
-rw-r--r-- | login-utils/login.c | 5 | ||||
-rw-r--r-- | login-utils/my_crypt.h | 3 | ||||
-rw-r--r-- | login-utils/newgrp.c | 5 |
6 files changed, 18 insertions, 10 deletions
diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am index c490999d..9c64149f 100644 --- a/login-utils/Makefile.am +++ b/login-utils/Makefile.am @@ -34,10 +34,9 @@ login_ldadd_common = chfn_SOURCES = chfn.c $(chfn_chsh_common) chsh_SOURCES = chsh.c $(chfn_chsh_common) -chfn_chsh_common = islocal.c setpwnam.c islocal.h my_crypt.h setpwnam.h \ +chfn_chsh_common = islocal.c setpwnam.c islocal.h setpwnam.h \ $(top_srcdir)/lib/env.c -login_SOURCES = login.c login.h my_crypt.h $(top_srcdir)/lib/setproctitle.c -newgrp_SOURCES = newgrp.c my_crypt.h +login_SOURCES = login.c login.h $(top_srcdir)/lib/setproctitle.c vipw_SOURCES = vipw.c setpwnam.h chfn_LDADD = $(login_ldadd_common) diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 2e0c82b1..64f4ac42 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -34,7 +34,10 @@ #include <ctype.h> #include <getopt.h> -#include "my_crypt.h" +#ifdef HAVE_CRYPT_H +#include <crypt.h> +#endif + #include "islocal.h" #include "setpwnam.h" #include "strutils.h" diff --git a/login-utils/chsh.c b/login-utils/chsh.c index 22b33506..778c4578 100644 --- a/login-utils/chsh.c +++ b/login-utils/chsh.c @@ -33,8 +33,11 @@ #include <ctype.h> #include <getopt.h> +#ifdef HAVE_CRYPT_H +#include <crypt.h> +#endif + #include "c.h" -#include "my_crypt.h" #include "islocal.h" #include "setpwnam.h" #include "nls.h" diff --git a/login-utils/login.c b/login-utils/login.c index ad2932d0..5584c320 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -111,8 +111,11 @@ # include <libaudit.h> #endif +#ifdef HAVE_CRYPT_H +#include <crypt.h> +#endif + #include "pathnames.h" -#include "my_crypt.h" #include "login.h" #include "strutils.h" #include "nls.h" diff --git a/login-utils/my_crypt.h b/login-utils/my_crypt.h deleted file mode 100644 index efb1a66f..00000000 --- a/login-utils/my_crypt.h +++ /dev/null @@ -1,3 +0,0 @@ -#if defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 -#include <crypt.h> -#endif diff --git a/login-utils/newgrp.c b/login-utils/newgrp.c index 6323af19..2ffe3873 100644 --- a/login-utils/newgrp.c +++ b/login-utils/newgrp.c @@ -16,9 +16,12 @@ #include <errno.h> #include <err.h> +#ifdef HAVE_CRYPT_H +#include <crypt.h> +#endif + #include "c.h" #include "pathnames.h" -#include "my_crypt.h" #include "nls.h" /* try to read password from gshadow */ |