File: acinclude.m4

package info (click to toggle)
openipmi 2.0.25-2.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 11,560 kB
  • sloc: ansic: 150,609; python: 8,801; sh: 5,752; perl: 1,356; makefile: 561
file content (67 lines) | stat: -rw-r--r-- 2,458 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

dnl
dnl read lib version from file (and trim trailing newline)
dnl
define([EL_RELEASE], [patsubst(esyscmd([. src/shlib_version; echo $major.$minor]), [
])])

dnl
dnl read cvsexport timestamp from file (and trim trailing newline)
dnl
dnl define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([cat patches/timestamp.cvsexport]), [
define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([date +"%Y%m%d"]), [
])])


dnl
dnl NetBSD use the -mdoc macro package for manpages, but e.g.
dnl AIX and Solaris only support the -man package. 
dnl
AC_DEFUN([EL_MANTYPE],
[
   MANTYPE=
   TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
   AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
   if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then
      MANTYPE=mdoc
   fi
   AC_SUBST(MANTYPE)
])


dnl
dnl Check if getpwnam_r and getpwuid_r are POSIX.1 compatible
dnl POSIX draft version returns 'struct passwd *' (used on Solaris)
dnl NOTE: getpwent_r is not POSIX so we always use getpwent
dnl
AC_DEFUN([EL_GETPW_R_POSIX],
[
   AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix like])
      # The prototype for the POSIX version is:
      # int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **)
      # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
   AC_TRY_LINK([#include <stdlib.h>
                #include <sys/types.h>
                #include <pwd.h>],
               [getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL);
                getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
      [AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.]) 
       AC_MSG_RESULT(yes)],
      [AC_MSG_RESULT(no)])
])

AC_DEFUN([EL_GETPW_R_DRAFT],
[
   AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix _draft_ like])
      # The prototype for the POSIX draft version is:
      # struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
      # struct passwd *getpwnam_r(char *, struct passwd *,  char *, int);
   AC_TRY_LINK([#include <stdlib.h>
                #include <sys/types.h>
                #include <pwd.h>],
               [getpwnam_r(NULL, NULL, NULL, (size_t)0);
                getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);],
      [AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.]) 
       AC_MSG_RESULT(yes)],
      [AC_MSG_RESULT(no)])
])