/ [pam-modules] / trunk / acinclude.m4
To checkout: svn checkout http://svn.gnu.org.ua/sources/pam-modules/trunk/acinclude.m4
Puszcza

Contents of /trunk/acinclude.m4

Parent Directory Parent Directory | Revision Log Revision Log


Revision 26 - (show annotations)
Tue Sep 5 21:32:30 2006 UTC (15 years, 4 months ago) by gray
File size: 2461 byte(s)
New files

1 dnl RA_FLUSHLEFT -- remove all whitespace at the beginning of lines
2 dnl This is useful for c-code which may include cpp statements
3 dnl
4 define([RA_FLUSHLEFT],
5 [changequote(`,')dnl
6 patsubst(`$1', `^[ ]+')
7 changequote([,])])dnl
8
9 dnl RA_RESULT_ACTIONS -- generate shell code for the result of a test
10 dnl $1 -- CVAR -- cache variable to check
11 dnl $2 -- NAME -- if not empty, used to generate a default value TRUE:
12 dnl `AC_DEFINE(HAVE_NAME)'
13 dnl $2 -- TRUE -- what to do if the CVAR is not `no'
14 dnl $3 -- FALSE -- what to do otherwise; defaults to `:'
15 dnl
16 AC_DEFUN([RA_RESULT_ACTIONS], [
17 [if test "$$1" != "" -a "$$1" != no; then
18 ]ifelse([$3], ,
19 [AC_DEFINE(HAVE_]translit($2, [a-z ./<>], [A-Z___])[,1,[FIXME])],
20 [$3])[
21 else
22 ]ifelse([$4], , [:], [$4])[
23 fi]])dnl
24
25 dnl RA_CHECK_STRUCT_FIELD -- See if a structure has a particular field
26 dnl $1 - NAME -- name of structure
27 dnl $2 - FIELD -- name of field to test
28 dnl $3 - INCLS -- C program text to inculde necessary files for testing
29 dnl $4 - TRUE -- what to do if struct NAME has FIELD; defaults to
30 dnl `AC_DEFINE(HAVE_NAME_FIELD)'
31 dnl $5 - FALSE -- what to do if not; defaults to `:'
32 dnl
33 dnl NOTE: We still don't use AC_CHECK_MEMBERS, since it has (as of
34 dnl autoconf 2.53) a bug which prevents it from recognizing members
35 dnl of aggregate type.
36
37 AC_DEFUN([RA_CHECK_STRUCT_FIELD], [
38 define([ra_CVAR], [ra_cv_struct_]translit($1_$2, [A-Z], [a-z]))dnl
39 AC_CACHE_CHECK([whether struct $1 has $2 field], ra_CVAR,
40 AC_TRY_COMPILE(RA_FLUSHLEFT([$3]),
41 [struct $1 ra_x; int ra_y = sizeof ra_x.$2;],
42 ra_CVAR[=yes], ra_CVAR[=no]))
43 RA_RESULT_ACTIONS(ra_CVAR, [$1_$2], [$4], [$5])dnl
44 undefine([ra_CVAR])])dnl
45
46 dnl Arguments:
47 dnl $1 -- Library to look for
48 dnl $2 -- Function to check in the library
49 dnl $3 -- Any additional libraries that might be needed
50 dnl $4 -- Action to be taken when test succeeds
51 dnl $5 -- Action to be taken when test fails
52 dnl $6 -- Directories where the library may reside
53 AC_DEFUN([RA_CHECK_LIB],
54 [
55 save_LIBS=$LIBS
56 AC_CACHE_CHECK([for -l$1], ra_cv_lib_$1,
57 [
58 for path in $6
59 do
60 LIBS="$save_LIBS -L$path"
61 AC_CHECK_LIB($1, $2,
62 [ra_cv_lib_$1="$3 -L$path -l$1"
63 break],
64 [ra_cv_lib_$1=no],$3)
65 done
66 ])
67 RA_RESULT_ACTIONS([ra_cv_lib_$1],[LIB$1],[$4],[$5])
68 LIBS=$save_LIBS
69 ])

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

Send suggestions and bug reports to Sergey Poznyakoff
ViewVC Help
Powered by ViewVC 1.1.20