1plugin_init="$1"
2# mechanism plugins
3for mech in anonymous crammd5 digestmd5 scram gssapiv2 kerberos4 login ntlm otp passdss plain srp gs2; do
4    if [ ${plugin_init} = "${mech}_init.c" ];then
5
6        echo "
7#include <config.h>
8
9#include <string.h>
10#include <stdlib.h>
11#include <stdio.h>
12#ifndef macintosh
13#include <sys/stat.h>
14#endif
15#include <fcntl.h>
16#include <assert.h>
17
18#include <sasl.h>
19#include <saslplug.h>
20#include <saslutil.h>
21
22#include \"plugin_common.h\"
23
24#ifdef macintosh
25#include <sasl_${mech}_plugin_decl.h>
26#endif
27
28#ifdef WIN32
29BOOL APIENTRY DllMain( HANDLE hModule,
30                       DWORD  ul_reason_for_call,
31                       LPVOID lpReserved
32					 )
33{
34    switch (ul_reason_for_call)
35	{
36		case DLL_PROCESS_ATTACH:
37		case DLL_THREAD_ATTACH:
38		case DLL_THREAD_DETACH:
39		case DLL_PROCESS_DETACH:
40			break;
41    }
42    return TRUE;
43}
44#endif
45
46SASL_CLIENT_PLUG_INIT( $mech )
47SASL_SERVER_PLUG_INIT( $mech )
48"       > ${mech}_init.c
49        echo "generating $1"
50    fi # End of `if [ ${plugin_init} = "${mech}_init.c" ];then'
51done
52
53# auxprop plugins
54for auxprop in sasldb sql ldapdb; do
55    if [ ${plugin_init} = "${auxprop}_init.c" ];then
56
57        echo "
58#include <config.h>
59
60#include <string.h>
61#include <stdlib.h>
62#include <stdio.h>
63#ifndef macintosh
64#include <sys/stat.h>
65#endif
66#include <fcntl.h>
67#include <assert.h>
68
69#include <sasl.h>
70#include <saslplug.h>
71#include <saslutil.h>
72
73#include \"plugin_common.h\"
74
75#ifdef WIN32
76BOOL APIENTRY DllMain( HANDLE hModule,
77                       DWORD  ul_reason_for_call,
78                       LPVOID lpReserved
79					 )
80{
81    switch (ul_reason_for_call)
82	{
83		case DLL_PROCESS_ATTACH:
84		case DLL_THREAD_ATTACH:
85		case DLL_THREAD_DETACH:
86		case DLL_PROCESS_DETACH:
87			break;
88    }
89    return TRUE;
90}
91#endif
92
93SASL_AUXPROP_PLUG_INIT( $auxprop )
94"       > ${auxprop}_init.c
95        echo "generating $1"
96    fi # End of `if [ ${plugin_init} = "${auxprop}_init.c" ];then'
97done
98
99# ldapdb is also a canon_user plugin
100if [ ${plugin_init} = "ldapdb_init.c" ];then
101    echo "SASL_CANONUSER_PLUG_INIT( ldapdb )" >> ldapdb_init.c
102fi
103