/ [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 118 - (show annotations)
Sun May 13 09:48:57 2012 UTC (9 years, 6 months ago) by gray
File size: 3980 byte(s)
Revamp build system. Add pam_ldaphome module.

* configure.ac: Test for ldap.
(AC_OUTPUT): Create pam_ldaphome/Makefile.
* acinclude.m4 (PM_ENABLE): Declare PAM_COND_<item>
conditional in addition to BUILD_PAM_<item> substitution
variable.
* Makefile.am (SUBDIRS): Include most modules via
conditionally defined Makefile variables.

* lib/graypam.h (gray_env): New struct.
(gray_env_get,gray_env_free,gray_env_read)
(gray_boolean_true_p): New protos.
* lib/env.c: New file.
* lib/Makefile.am (libgraypam_la_SOURCES): Add env.c

* pam_fshadow/Makefile.am: Remove BUILD_PAM_FSHADOW
substitution.
* pam_regex/Makefile.am: Remove BUILD_PAM_REGEX
substitution.
* pam_sql/pam_sql.c (free_config, boolean_true_p)
(read_config): Remove. Use gray_env_* functions
instead. All uses updated.
* pam_regex/pam_regex.c: Fix typo.

* pam_ldaphome/Makefile.am: New file.

1 # Copyright (C) 2001, 2006, 2008-2012 Sergey Poznyakoff
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3, or (at your option)
6 # any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License along
14 # with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 AC_DEFUN([PM_ENABLE],[
17 AC_ARG_ENABLE($1,
18 AC_HELP_STRING([--disable-$1], [Disable pam_$1]),
19 [if test $build_$1 = probe; then
20 build_$1=$enableval
21 fi],
22 [build_$1=probe])
23 m4_pushdef([upmodname],translit($1, [a-z.-], [A-Z__]))
24 if test $build_$1 != no; then
25 build_$1=yes
26 AC_SUBST([BUILD_PAM_]upmodname, ['$(]upmodname[)'])
27 $2
28 fi
29 AM_CONDITIONAL([PAM_COND_]upmodname, [test "$[]build_$1" = "yes"])
30 m4_popdef([upmodname])
31 ])
32
33 dnl PM_FLUSHLEFT -- remove all whitespace at the beginning of lines
34 dnl This is useful for c-code which may include cpp statements
35 dnl
36 define([PM_FLUSHLEFT],
37 [changequote(`,')dnl
38 patsubst(`$1', `^[ ]+')
39 changequote([,])])dnl
40
41 dnl PM_RESULT_ACTIONS -- generate shell code for the result of a test
42 dnl $1 -- CVAR -- cache variable to check
43 dnl $2 -- NAME -- if not empty, used to generate a default value TRUE:
44 dnl `AC_DEFINE(HAVE_NAME)'
45 dnl $2 -- TRUE -- what to do if the CVAR is not `no'
46 dnl $3 -- FALSE -- what to do otherwise; defaults to `:'
47 dnl
48 AC_DEFUN([PM_RESULT_ACTIONS], [
49 [if test "$$1" != "" -a "$$1" != no; then
50 ]ifelse([$3], ,
51 [AC_DEFINE(HAVE_]translit($2, [a-z ./<>], [A-Z___])[,1,[FIXME])],
52 [$3])[
53 else
54 ]ifelse([$4], , [:], [$4])[
55 fi]])dnl
56
57 dnl PM_CHECK_STRUCT_FIELD -- See if a structure has a particular field
58 dnl $1 - NAME -- name of structure
59 dnl $2 - FIELD -- name of field to test
60 dnl $3 - INCLS -- C program text to inculde necessary files for testing
61 dnl $4 - TRUE -- what to do if struct NAME has FIELD; defaults to
62 dnl `AC_DEFINE(HAVE_NAME_FIELD)'
63 dnl $5 - FALSE -- what to do if not; defaults to `:'
64 dnl
65 dnl NOTE: We still don't use AC_CHECK_MEMBERS, since it has (as of
66 dnl autoconf 2.53) a bug which prevents it from recognizing members
67 dnl of aggregate type.
68
69 AC_DEFUN([PM_CHECK_STRUCT_FIELD], [
70 define([pm_CVAR], [pm_cv_struct_]translit($1_$2, [A-Z], [a-z]))dnl
71 AC_CACHE_CHECK([whether struct $1 has $2 field], pm_CVAR,
72 AC_TRY_COMPILE(PM_FLUSHLEFT([$3]),
73 [struct $1 pm_x; int pm_y = sizeof pm_x.$2;],
74 pm_CVAR[=yes], pm_CVAR[=no]))
75 PM_RESULT_ACTIONS(pm_CVAR, [$1_$2], [$4], [$5])dnl
76 undefine([pm_CVAR])])dnl
77
78 dnl Arguments:
79 dnl $1 -- Library to look for
80 dnl $2 -- Function to check in the library
81 dnl $3 -- Any additional libraries that might be needed
82 dnl $4 -- Action to be taken when test succeeds
83 dnl $5 -- Action to be taken when test fails
84 dnl $6 -- Directories where the library may reside
85 AC_DEFUN([PM_CHECK_LIB],
86 [m4_ifval([$4], , [AH_CHECK_LIB([$1])])dnl
87 AS_VAR_PUSHDEF([pm_Lib], [pm_cv_lib_$1])dnl
88 AC_CACHE_CHECK([for $2 in -l$1], [pm_Lib],
89 [AS_VAR_SET([pm_Lib], [no])
90 pm_check_lib_save_LIBS=$LIBS
91 for path in "" $6
92 do
93 if test -n "$path"; then
94 pm_ldflags="-L$path -l$1 $3"
95 else
96 pm_ldflags="-l$1 $3"
97 fi
98 LIBS="$pm_ldflags $pm_check_lib_save_LIBS"
99 AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
100 [AS_VAR_SET([pm_Lib], ["$pm_ldflags"])
101 break])
102 done
103 LIBS=$pm_check_lib_save_LIBS])
104 AS_IF([test "AS_VAR_GET([pm_Lib])" != no],
105 [m4_default([$4], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
106 LIBS="-l$1 $LIBS"
107 ])],
108 [$5])dnl
109 AS_VAR_POPDEF([pm_Lib])dnl
110 ])# PM_CHECK_LIB

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