1 2dnl 3dnl read lib version from file (and trim trailing newline) 4dnl 5define([EL_RELEASE], [patsubst(esyscmd([. src/shlib_version; echo $major.$minor]), [ 6])]) 7 8dnl 9dnl read cvsexport timestamp from file (and trim trailing newline) 10dnl 11define([EL_TIMESTAMP], [patsubst(esyscmd([date +"%Y%m%d"]), [ 12])]) 13 14 15dnl 16dnl NetBSD use the -mdoc macro package for manpages, but e.g. 17dnl AIX and Solaris only support the -man package. 18dnl 19AC_DEFUN([EL_MANTYPE], 20[ 21 MANTYPE= 22 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" 23 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath) 24 if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then 25 MANTYPE=mdoc 26 fi 27 AC_SUBST(MANTYPE) 28]) 29 30 31dnl 32dnl Check if getpwnam_r and getpwuid_r are POSIX.1 compatible 33dnl POSIX draft version returns 'struct passwd *' (used on Solaris) 34dnl NOTE: getpwent_r is not POSIX so we always use getpwent 35dnl 36AC_DEFUN([EL_GETPW_R_POSIX], 37[ 38 AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix like]) 39 # The prototype for the POSIX version is: 40 # int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **) 41 # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); 42 AC_LINK_IFELSE( 43 [AC_LANG_PROGRAM([[#include <stdlib.h> 44 #include <sys/types.h> 45 #include <pwd.h>]], 46 [[getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL); 47 getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);]])], 48 [AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.]) 49 AC_MSG_RESULT(yes)], 50 [AC_MSG_RESULT(no)]) 51]) 52 53AC_DEFUN([EL_GETPW_R_DRAFT], 54[ 55 AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix _draft_ like]) 56 # The prototype for the POSIX draft version is: 57 # struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int); 58 # struct passwd *getpwnam_r(char *, struct passwd *, char *, int); 59 AC_LINK_IFELSE( 60 [AC_LANG_PROGRAM([[#include <stdlib.h> 61 #include <sys/types.h> 62 #include <pwd.h>]], 63 [[getpwnam_r(NULL, NULL, NULL, (size_t)0); 64 getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);]])], 65 [AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.]) 66 AC_MSG_RESULT(yes)], 67 [AC_MSG_RESULT(no)]) 68]) 69 70 71dnl 72dnl deprecate option --enable-widec to turn on use of wide-character support 73dnl 74AC_DEFUN([EL_DEPRECATE_WIDEC], 75[ 76 AC_MSG_CHECKING(if you want wide-character code) 77 AC_ARG_ENABLE(widec, 78 [ --enable-widec deprecated, wide-character/UTF-8 is always enabled], 79 [with_widec=$enableval], 80 [with_widec=no]) 81 AC_MSG_RESULT($with_widec) 82 AC_MSG_WARN([--enable-widec is deprecated, wide-character/UTF-8 is always enabled]) 83]) 84 85