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_TRY_LINK([#include <stdlib.h>
43                #include <sys/types.h>
44                #include <pwd.h>],
45               [getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL);
46                getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
47      [AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.]) 
48       AC_MSG_RESULT(yes)],
49      [AC_MSG_RESULT(no)])
50])
51
52AC_DEFUN([EL_GETPW_R_DRAFT],
53[
54   AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix _draft_ like])
55      # The prototype for the POSIX draft version is:
56      # struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
57      # struct passwd *getpwnam_r(char *, struct passwd *,  char *, int);
58   AC_TRY_LINK([#include <stdlib.h>
59                #include <sys/types.h>
60                #include <pwd.h>],
61               [getpwnam_r(NULL, NULL, NULL, (size_t)0);
62                getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);],
63      [AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.]) 
64       AC_MSG_RESULT(yes)],
65      [AC_MSG_RESULT(no)])
66])
67
68
69dnl
70dnl use option --enable-widec to turn on use of wide-character support
71dnl
72AC_DEFUN([EL_ENABLE_WIDEC],
73[
74   AC_MSG_CHECKING(if you want wide-character code)
75   AC_ARG_ENABLE(widec,
76      [  --enable-widec          compile with wide-char/UTF-8 code],
77      [with_widec=$enableval],
78      [with_widec=no])
79   AC_MSG_RESULT($with_widec)
80   if test "$with_widec" = yes ; then
81      AC_DEFINE(WIDECHAR, 1, [Define to 1 if you want wide-character code])
82   fi
83   AM_CONDITIONAL([WIDECHAR], [test "$with_widec" = yes])
84])
85
86