Patch Samba wscript to omit unneeded functions
[jelmer/winexe.git] / source / wscript
index 3eb34d3c93adb449b717275d2ffacad42918faae..ca003c31b21ec1a8f0084c24aabefd88aaf15777 100644 (file)
@@ -17,10 +17,12 @@ def configure(ctx):
     print "Patching Samba files"
     # Don't include pyldb-util because we can't statically link it
     os.system('cd ' + samba + ' && sed -i "s/ pyldb-util / /" lib/ldb-samba/wscript_build')
-    # Patch Samba wscript to include this wscript in the samba waf build tree
+    # Patch Samba wscript to omit unneeded functions
+    os.system('cd ' + samba + ''' && grep -q "conf.ADD_CFLAGS('-ffunction-sections') # added by winexe waf" wscript || sed -i "s^\( *\)conf.env.toplevel_build = True^\\1conf.env.toplevel_build = True\\n\\1conf.ADD_CFLAGS('-ffunction-sections') # added by winexe waf\\n\\1conf.ADD_LDFLAGS('-Wl,--gc-sections') # added by winexe waf^" wscript''')
+    # Patch Samba wscript_build to include this wscript in the samba waf build tree
     os.system('cd ' + samba + ''' && grep -q "bld\.RECURSE('\.\./source') # added by winexe waf" wscript_build || sed -i "s^bld\.RECURSE('source3')^bld.RECURSE('source3')\\nbld.RECURSE('../source') # added by winexe waf^" wscript_build''')
 
-    print "Chaining to samba waf configure"
+    print "Chaining to Samba waf configure"
     os.system('cd ' + samba + ' && ./buildtools/bin/waf configure --bundled-libraries=ALL --nonshared-binary=winexe -C')
 
 @conf