don't. */
#undef HAVE_DECL___SYS_SIGLIST
-/* Define to 1 if you have the `dgettext' function. */
-#undef HAVE_DGETTEXT
-
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the `ldap_unbind_ext_s' function. */
#undef HAVE_LDAP_UNBIND_EXT_S
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
/* Define to 1 to enable Linux audit support. */
#undef HAVE_LINUX_AUDIT
#undef ISSET
#define ISSET(t, f) ((t) & (f))
+/*
+ * Internationalization support.
+ */
+#ifdef HAVE_LIBINTL_H
+# define _(String) gettext(String)
+# define gettext_noop(String) String
+# define N_(String) gettext_noop(String)
+#else
+# define _(String) String
+# define N_(String) String
+# define textdomain(Domain)
+# define bindtextdomain(Package, Directory)
+#endif /* HAVE_LIBINTL_H */
+
/* New ANSI-style OS defs for HP-UX and ConvexOS. */
#if defined(hpux) && !defined(__hpux)
# define __hpux 1
done
+# gettext() and friends may be located in libc (Linux and Solaris)
+# or in libintl. However, it is possible to have libintl installed
+# even when gettext() is present in libc. In the case of GNU libintl,
+# gettext() will be defined to gettext_libintl in libintl.h.
+# Since gcc prefers /usr/local/include to /usr/include, we need to
+# make sure we use the gettext() that matches the include file.
+# First check that it links w/o additional libs, then try with -lintl.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <libintl.h>
+int
+main ()
+{
+(void)gettext((char *)0, (char *)0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ $as_echo "#define HAVE_LIBINTL_H 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5
+$as_echo_n "checking for gettext in -lintl... " >&6; }
+if test "${ac_cv_lib_intl_gettext+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gettext ();
+int
+main ()
+{
+return gettext ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_intl_gettext=yes
+else
+ ac_cv_lib_intl_gettext=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5
+$as_echo "$ac_cv_lib_intl_gettext" >&6; }
+if test "x$ac_cv_lib_intl_gettext" = x""yes; then :
+ LIBS="${LIBS} -lintl"
+ $as_echo "#define HAVE_LIBINTL_H 1" >>confdefs.h
+
+fi
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
case ${enable_zlib-"yes"} in
yes)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzdopen in -lz" >&5
$as_echo "yes" >&6; }
fi
-
- case $host in
- *-*-linux*|*-*-solaris*)
- # dgettext() may be defined to dgettext_libintl in the
- # header file, so first check that it links w/ additional
- # libs, then try with -lintl
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <libintl.h>
-int
-main ()
-{
-(void)dgettext((char *)0, (char *)0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- $as_echo "#define HAVE_DGETTEXT 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
-$as_echo_n "checking for dgettext in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_dgettext+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dgettext ();
-int
-main ()
-{
-return dgettext ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_intl_dgettext=yes
-else
- ac_cv_lib_intl_dgettext=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
-$as_echo "$ac_cv_lib_intl_dgettext" >&6; }
-if test "x$ac_cv_lib_intl_dgettext" = x""yes; then :
- LIBS="${LIBS} -lintl"
- $as_echo "#define HAVE_DGETTEXT 1" >>confdefs.h
-
-fi
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ;;
- esac
fi
fi
AC_MSG_RESULT($sudo_cv___progname)
])
+# gettext() and friends may be located in libc (Linux and Solaris)
+# or in libintl. However, it is possible to have libintl installed
+# even when gettext() is present in libc. In the case of GNU libintl,
+# gettext() will be defined to gettext_libintl in libintl.h.
+# Since gcc prefers /usr/local/include to /usr/include, we need to
+# make sure we use the gettext() that matches the include file.
+# First check that it links w/o additional libs, then try with -lintl.
+AC_LINK_IFELSE([AC_LANG_PROGRAM(
+[[#include <libintl.h>]], [(void)gettext((char *)0, (char *)0);])],
+[AC_DEFINE(HAVE_LIBINTL_H)],
+[AC_CHECK_LIB(intl, gettext, [LIBS="${LIBS} -lintl"]
+ [AC_DEFINE(HAVE_LIBINTL_H)])])
+
dnl
dnl Deferred zlib option processing.
dnl By default we use the system zlib if it is present.
AC_MSG_WARN([Ignoring unknown argument to --enable-pam-session: $enableval])
;;
esac], AC_MSG_RESULT(yes))
-
- case $host in
- *-*-linux*|*-*-solaris*)
- # dgettext() may be defined to dgettext_libintl in the
- # header file, so first check that it links w/ additional
- # libs, then try with -lintl
- AC_LINK_IFELSE([AC_LANG_PROGRAM(
- [[#include <libintl.h>]], [(void)dgettext((char *)0, (char *)0);])],
- [AC_DEFINE(HAVE_DGETTEXT)],
- [AC_CHECK_LIB(intl, dgettext, [LIBS="${LIBS} -lintl"]
- [AC_DEFINE(HAVE_DGETTEXT)])])
- ;;
- esac
fi
fi
AH_TEMPLATE(HAVE_DCE, [Define to 1 if you use OSF DCE.])
AH_TEMPLATE(HAVE_DD_FD, [Define to 1 if your `DIR' contains dd_fd.])
AH_TEMPLATE(HAVE_DIRFD, [Define to 1 if you have the `dirfd' function or macro.])
-AH_TEMPLATE(HAVE_DGETTEXT, [Define to 1 if you have the `dgettext' function.])
AH_TEMPLATE(HAVE_DISPCRYPT, [Define to 1 if you have the `dispcrypt' function.])
AH_TEMPLATE(HAVE_DLOPEN, [Define to 1 if you have the `dlopen' function.])
AH_TEMPLATE(HAVE_EXTENDED_GLOB, [Define to 1 if your glob.h defines the GLOB_BRACE and GLOB_TILDE flags.])
AH_TEMPLATE(HAVE_KRB5_VERIFY_USER, [Define to 1 if you have the `krb5_verify_user' function.])
AH_TEMPLATE(HAVE_LBER_H, [Define to 1 if your LDAP needs <lber.h>. (OpenLDAP does not)])
AH_TEMPLATE(HAVE_LDAP, [Define to 1 if you use LDAP for sudoers.])
+AH_TEMPLATE(HAVE_LIBINTL_H, [Define to 1 if you have the <libintl.h> header file.])
AH_TEMPLATE(HAVE_LINUX_AUDIT, [Define to 1 to enable Linux audit support.])
AH_TEMPLATE(HAVE_OPIE, [Define to 1 if you use NRL OPIE.])
AH_TEMPLATE(HAVE_PAM, [Define to 1 if you use PAM authentication.])
#undef ISSET
#define ISSET(t, f) ((t) & (f))
+/*
+ * Internationalization support.
+ */
+#ifdef HAVE_LIBINTL_H
+# define _(String) gettext(String)
+# define gettext_noop(String) String
+# define N_(String) gettext_noop(String)
+#else
+# define _(String) String
+# define N_(String) String
+# define textdomain(Domain)
+# define bindtextdomain(Package, Directory)
+#endif /* HAVE_LIBINTL_H */
+
/* New ANSI-style OS defs for HP-UX and ConvexOS. */
#if defined(hpux) && !defined(__hpux)
# define __hpux 1
# include <security/pam_appl.h>
#endif
-#ifdef HAVE_DGETTEXT
+#ifdef HAVE_LIBINTL_H
# include <libintl.h>
# if defined(__LINUX_PAM__)
# define PAM_TEXT_DOMAIN "Linux-PAM"
(def_prompt[9] == ' ' && def_prompt[10] == '\0'));
/* Only override PAM prompt if it matches /^Password: ?/ */
-#if defined(PAM_TEXT_DOMAIN) && defined(HAVE_DGETTEXT)
+#if defined(PAM_TEXT_DOMAIN) && defined(HAVE_LIBINTL_H)
if (!def_passprompt_override && (std_prompt ||
(strcmp(pm->msg, dgettext(PAM_TEXT_DOMAIN, "Password: ")) &&
strcmp(pm->msg, dgettext(PAM_TEXT_DOMAIN, "Password:")))))