smbcacls: fix uninitialized variable
[obnox/samba/samba-obnox.git] / nsswitch / wscript_build
index 97f0af55a110350f44774f47331ee489a9d86f40..f2868963258b1c8e2fd8bca52c3fd81720eebc9e 100644 (file)
@@ -1,18 +1,21 @@
 #!/usr/bin/env python
 import Utils
+import sys
+host_os = sys.platform
 
 bld.SAMBA_LIBRARY('winbind-client',
        source='wb_common.c',
        deps='replace',
-       cflags='-DSOCKET_WRAPPER_DISABLE=1 -DWINBINDD_SOCKET_DIR=\"%s\"' % bld.env.WINBINDD_SOCKET_DIR,
+       cflags='-DWINBINDD_SOCKET_DIR=\"%s\"' % bld.env.WINBINDD_SOCKET_DIR,
        private_library=True
        )
 
 
 bld.SAMBA_BINARY('nsstest',
-       source='nsstest.c',
-       deps='replace dl'
-       )
+                source='nsstest.c',
+                deps='replace dl',
+                 install=False
+                )
 
 # The nss_wrapper code relies strictly on the linux implementation and
 # name, so compile but do not install a copy under this name.
@@ -23,24 +26,79 @@ bld.SAMBA_LIBRARY('nss_wrapper_winbind',
                  install=False,
                  vnum='2')
 
-if Utils.unversioned_sys_platform() == 'linux':
+# FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
+# the search for .rfind('gnu') covers gnu* and *-gnu is that too broad?
+
+if (Utils.unversioned_sys_platform() == 'linux' or (host_os.rfind('gnu') > -1)):
+    bld.SAMBA_LIBRARY('nss_winbind',
+              keep_underscore=True,
+              source='winbind_nss_linux.c',
+              deps='winbind-client',
+              public_headers=[],
+              public_headers_install=False,
+              pc_files=[],
+              vnum='2')
+
+    bld.SAMBA3_LIBRARY('nss_wins',
+                       keep_underscore=True,
+                       source='wins.c',
+                       deps='''wbclient''',
+                       public_headers=[],
+                       public_headers_install=False,
+                       pc_files=[],
+                       vnum='2')
+elif (host_os.rfind('freebsd') > -1):
+       # FreeBSD winbind client is implemented as a wrapper around
+       # the Linux version.
        bld.SAMBA_LIBRARY('nss_winbind',
-               source='winbind_nss_linux.c',
-               deps='winbind-client',
-               realname='libnss_winbind.so.2',
-               vnum='2')
+                         source='winbind_nss_linux.c winbind_nss_freebsd.c',
+                         deps='winbind-client',
+                         realname='nss_winbind.so.1',
+                         vnum='1')
+
+       bld.SAMBA3_LIBRARY('nss_wins',
+                         source='wins.c wins_freebsd.c',
+                         deps='''wbclient''',
+                         realname='nss_wins.so.1',
+                         vnum='1')
 
-if Utils.unversioned_sys_platform() == 'sunos':
+elif (host_os.rfind('netbsd') > -1):
+       # NetBSD winbind client is implemented as a wrapper
+       # around the Linux version. It needs getpwent_r() to
+       # indicate libc's use of the correct nsdispatch API.
+
+       if bld.CONFIG_SET("HAVE_GETPWENT_R"):
+               bld.SAMBA_LIBRARY('nss_winbind',
+                                 source='winbind_nss_linux.c winbind_nss_netbsd.c',
+                                 deps='winbind-client', 
+                                 realname='libnss_winbind.so')
+elif (host_os.rfind('irix') > -1):
+       bld.SAMBA_LIBRARY('ns_winbind',
+                         source='winbind_nss_irix.c',
+                         deps='winbind-client', 
+                         realname='libns_winbind.so')
+
+elif Utils.unversioned_sys_platform() == 'sunos':
+       bld.SAMBA_LIBRARY('nss_winbind',
+                         source='winbind_nss_solaris.c winbind_nss_linux.c',
+                         deps='winbind-client',
+                         realname='nss_winbind.so.1',
+                         vnum='1')
+elif (host_os.rfind('hpux') > -1):
+       bld.SAMBA_LIBRARY('nss_winbind',
+                         source='winbind_nss_linux.c',
+                         deps='winbind-client', 
+                         realname='libnss_winbind.so')
+elif (host_os.rfind('aix') > -1):
        bld.SAMBA_LIBRARY('nss_winbind',
-               source='winbind_nss_solaris.c winbind_nss_linux.c',
-               deps='winbind-client',
-               realname='libnss_winbind.so.2',
-               vnum='2')
+                         source='winbind_nss_aix.c',
+                         deps='winbind-client', 
+                         realname='WINBIND')
 
 if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
        bld.SAMBA_LIBRARY('pamwinbind',
                source='pam_winbind.c',
-               deps='intl talloc wbclient winbind-client iniparser pam',
+               deps='talloc wbclient winbind-client tiniparser pam samba_intl',
                cflags='-DLOCALEDIR=\"%s/locale\"' % bld.env.DATADIR,
                realname='pam_winbind.so',
                install_path='${PAMMODULESDIR}'