Changeset 988 for vendor/current/buildtools/wafsamba/samba3.py
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/buildtools/wafsamba/samba3.py
r740 r988 5 5 from optparse import SUPPRESS_HELP 6 6 from samba_utils import os_path_relpath, TO_LIST 7 from samba_autoconf import library_flags 8 7 9 8 10 def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True, 9 11 with_name="with", without_name="without"): 12 if default is None: 13 default_str = "auto" 14 elif default is True: 15 default_str = "yes" 16 elif default is False: 17 default_str = "no" 18 else: 19 default_str = str(default) 20 10 21 if help == (): 11 help = ("Build with %s support " % option)22 help = ("Build with %s support (default=%s)" % (option, default_str)) 12 23 if dest is None: 13 24 dest = "with_%s" % option.replace('-', '_') … … 47 58 def s3_fix_kwargs(bld, kwargs): 48 59 '''fix the build arguments for s3 build rules to include the 49 60 necessary includes, subdir and cflags options ''' 50 61 s3dir = os.path.join(bld.env.srcdir, 'source3') 51 62 s3reldir = os_path_relpath(s3dir, bld.curdir) … … 53 64 # the extra_includes list is relative to the source3 directory 54 65 extra_includes = [ '.', 'include', 'lib' ] 55 if bld.env.use_intree_heimdal: 66 # local heimdal paths only included when USING_SYSTEM_KRB5 is not set 67 if not bld.CONFIG_SET("USING_SYSTEM_KRB5"): 56 68 extra_includes += [ '../source4/heimdal/lib/com_err', 69 '../source4/heimdal/lib/krb5', 57 70 '../source4/heimdal/lib/gssapi', 58 '../source4/heimdal_build' ] 71 '../source4/heimdal_build', 72 '../bin/default/source4/heimdal/lib/asn1' ] 59 73 60 if not bld.CONFIG_SET('USING_SYSTEM_TDB'): 74 if bld.CONFIG_SET('USING_SYSTEM_TDB'): 75 (tdb_includes, tdb_ldflags, tdb_cpppath) = library_flags(bld, 'tdb') 76 extra_includes += tdb_cpppath 77 else: 61 78 extra_includes += [ '../lib/tdb/include' ] 62 79 63 if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'): 80 if bld.CONFIG_SET('USING_SYSTEM_TEVENT'): 81 (tevent_includes, tevent_ldflags, tevent_cpppath) = library_flags(bld, 'tevent') 82 extra_includes += tevent_cpppath 83 else: 64 84 extra_includes += [ '../lib/tevent' ] 65 85 66 if not bld.CONFIG_SET('USING_SYSTEM_TALLOC'): 86 if bld.CONFIG_SET('USING_SYSTEM_TALLOC'): 87 (talloc_includes, talloc_ldflags, talloc_cpppath) = library_flags(bld, 'talloc') 88 extra_includes += talloc_cpppath 89 else: 67 90 extra_includes += [ '../lib/talloc' ] 68 91 69 if not bld.CONFIG_SET('USING_SYSTEM_POPT'): 92 if bld.CONFIG_SET('USING_SYSTEM_POPT'): 93 (popt_includes, popt_ldflags, popt_cpppath) = library_flags(bld, 'popt') 94 extra_includes += popt_cpppath 95 else: 70 96 extra_includes += [ '../lib/popt' ] 71 97 … … 80 106 kwargs['includes'] = includes 81 107 82 # some S3 code assumes that CONFIGFILE is set83 cflags = ['-DCONFIGFILE="%s"' % bld.env['CONFIGFILE']]84 if 'cflags' in kwargs:85 cflags += TO_LIST(kwargs['cflags'])86 kwargs['cflags'] = cflags87 88 108 # these wrappers allow for mixing of S3 and S4 build rules in the one build 89 109 90 110 def SAMBA3_LIBRARY(bld, name, *args, **kwargs): 91 s3_fix_kwargs(bld, kwargs) 92 kwargs['allow_undefined_symbols'] = True 93 return bld.SAMBA_LIBRARY(name, *args, **kwargs) 111 s3_fix_kwargs(bld, kwargs) 112 return bld.SAMBA_LIBRARY(name, *args, **kwargs) 94 113 Build.BuildContext.SAMBA3_LIBRARY = SAMBA3_LIBRARY 95 114 96 115 def SAMBA3_MODULE(bld, name, *args, **kwargs): 97 s3_fix_kwargs(bld, kwargs) 98 kwargs['allow_undefined_symbols'] = True 99 return bld.SAMBA_MODULE(name, *args, **kwargs) 116 s3_fix_kwargs(bld, kwargs) 117 return bld.SAMBA_MODULE(name, *args, **kwargs) 100 118 Build.BuildContext.SAMBA3_MODULE = SAMBA3_MODULE 101 119 102 120 def SAMBA3_SUBSYSTEM(bld, name, *args, **kwargs): 103 104 121 s3_fix_kwargs(bld, kwargs) 122 return bld.SAMBA_SUBSYSTEM(name, *args, **kwargs) 105 123 Build.BuildContext.SAMBA3_SUBSYSTEM = SAMBA3_SUBSYSTEM 106 124 107 125 def SAMBA3_BINARY(bld, name, *args, **kwargs): 108 109 126 s3_fix_kwargs(bld, kwargs) 127 return bld.SAMBA_BINARY(name, *args, **kwargs) 110 128 Build.BuildContext.SAMBA3_BINARY = SAMBA3_BINARY 129 130 def SAMBA3_PYTHON(bld, name, *args, **kwargs): 131 s3_fix_kwargs(bld, kwargs) 132 return bld.SAMBA_PYTHON(name, *args, **kwargs) 133 Build.BuildContext.SAMBA3_PYTHON = SAMBA3_PYTHON
Note:
See TracChangeset
for help on using the changeset viewer.