build: enable real cacheing with waf configure -C
authorAndrew Tridgell <tridge@samba.org>
Sun, 21 Mar 2010 00:17:37 +0000 (11:17 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:59 +0000 (20:26 +1000)
buildtools/wafsamba/samba_autoconf.py
lib/replace/wscript

index 1c1095ea475647e61a520d35a7cf25e155282ba5..fc8027c5f237727c00075a6871c447c8b24be79c 100644 (file)
@@ -428,3 +428,14 @@ def CHECK_CC_ENV(conf):
         if len(conf.env.CC) == 1:
             # make for nicer logs if just a single command
             conf.env.CC = conf.env.CC[0]
+
+@conf
+def ENABLE_CONFIGURE_CACHE(conf):
+    '''enable cache of configure results'''
+    if os.environ.get('WAFCACHE'):
+        # already setup
+        return
+    cache_path = os.path.join(conf.blddir, '.confcache')
+    mkdir_p(cache_path)
+    Options.cache_global = os.environ['WAFCACHE'] = cache_path
+
index f6c19030913c266f6248c955cf1e53b3a9431a7b..dc00790436d1e7a92b3b85cd5e12cffcbe2dd5a4 100644 (file)
@@ -38,7 +38,9 @@ def set_options(opt):
     opt.add_option('--timestamp-dependencies',
                    help=("use file timestamps instead of content for build dependencies (BROKEN)"),
                    action="store_true", dest='timestamp_dependencies', default=False)
-    opt.add_option('-C', action='store_true', help='dummy option for autoconf compatibility')
+    opt.add_option('-C',
+                   help='enable configure cacheing',
+                   action='store_true', dest='enable_configure_cache')
     opt.add_option('--pedantic',
                   help=("Enable even more compiler warnings"),
                   action='store_true', dest='pedantic', default=False)
@@ -48,15 +50,18 @@ def configure(conf):
     conf.env.hlist = []
     conf.env.srcdir = conf.srcdir
 
-    # during the configure checks we want the waf dependency checker
-    # to go into system includes. This ensures that if you add/remove
-    # a system library, that 'waf configure' will detect that, and
-    # it won't be fooled by the waf cache
-    preproc.go_absolute = True
-
     if Options.options.timestamp_dependencies:
         conf.ENABLE_TIMESTAMP_DEPENDENCIES()
 
+    if Options.options.enable_configure_cache:
+        conf.ENABLE_CONFIGURE_CACHE()
+    else:
+        # during the configure checks we want the waf dependency checker
+        # to go into system includes. This ensures that if you add/remove
+        # a system library, that 'waf configure' will detect that, and
+        # it won't be fooled by the waf cache
+        preproc.go_absolute = True
+
     # load our local waf extensions
     conf.check_tool('wafsamba', tooldir=conf.srcdir + "/buildtools/wafsamba")