1 dnl @synopsis AX_FUNC_WHICH_GETSPNAM_R
3 dnl Determines which historical variant of the getspnam_r() call
4 dnl (taking four or five arguments) is available on the system
5 dnl and sets NEW_SHADOW_API=YES if there are five arguments.
7 dnl Originally named "AX_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten
8 dnl for AX_FUNC_WHICH_GETSPNAM_R
10 dnl @author Caolan McNamara <caolan@skynet.ie>
11 dnl @author Daniel Richard G. <skunk@iskunk.org>
12 dnl @version 2006-05-01
15 AC_DEFUN([AX_FUNC_WHICH_GETSPNAM_R], [
18 AC_MSG_CHECKING([how many arguments getspnam_r() takes])
20 AC_CACHE_VAL(ac_cv_func_which_getspnam_r, [
22 ################################################################
24 ac_cv_func_which_getspnam_r=unknown
27 # ONE ARGUMENT (sanity check)
30 # This should fail, as there is no variant of getspnam_r() that takes
31 # a single argument. If it actually compiles, then we can assume that
32 # netdb.h is not declaring the function, and the compiler is thereby
33 # assuming an implicit prototype. In which case, we're out of luck.
38 #include <sys/types.h>
42 const char *name = "myname";
43 getspnam_r(name) /* ; */
45 ac_cv_func_which_getspnam_r=no)
51 if test "$ac_cv_func_which_getspnam_r" = "unknown"; then
56 #include <sys/types.h>
60 char buffer[[]] = { '\0' };
61 struct spwd spwdStruct;
62 const char *name = "myname";
63 getspnam_r(name, &spwdStruct, buffer, sizeof buffer, 0) /* ; */
65 ac_cv_func_which_getspnam_r=five)
73 if test "$ac_cv_func_which_getspnam_r" = "unknown"; then
78 #include <sys/types.h>
82 char buffer[[]] = { '\0' };
83 struct spwd spwdStruct;
84 const char *name = "myname";
85 getspnam_r(name, &spwdStruct, buffer, sizeof buffer) /* ; */
87 ac_cv_func_which_getspnam_r=four)
91 ################################################################
93 ]) dnl end AC_CACHE_VAL
95 case "$ac_cv_func_which_getspnam_r" in
102 AC_MSG_RESULT([four])
106 AC_MSG_RESULT([cannot find function declaration in shadow.h])
110 AC_MSG_RESULT([can't tell])
114 AC_MSG_ERROR([internal error])
122 dnl PKG_CHECK_MODULES_MACHACK is like PKG_CHECK_MODULES but sneaks in an extra
123 dnl argument between the first and second, denoting a program to call instead of
124 dnl pkg-config on Mac OS X (aka Darwin):
125 AC_DEFUN([PKG_CHECK_MODULES_MACHACK],
126 [if test "$_os" = "Darwin"; then
127 AC_MSG_CHECKING($1_CFLAGS)
128 $1_CFLAGS=`$2 --cflags`
129 AC_MSG_RESULT($$1_CFLAGS)
130 AC_MSG_CHECKING($1_LIBS)
132 AC_MSG_RESULT($$1_LIBS)
136 PKG_CHECK_MODULES($1, $3, $4, $5, $6)