Harald Klimach avatar Harald Klimach committed 299c141

Define a subconfiguration routine to make a clean recursion from including
projects easier.

Comments (0)

Files changed (1)

     conf.env['FCSHLIB_MARKER'] = ''
     conf.vars = ['FC_NAME', 'FC_VERSION', 'FCFLAGS'] # Recompilation if any of these change
     conf.check_fortran()
-    conf.check_cc(function_name='mkstemp', header_name=['stdlib.h', 'unistd.h'], define_name='LUA_USE_MKSTEMP', mandatory=False)
-    conf.check_cc(function_name='popen', header_name=['stdio.h'], define_name='LUA_USE_POPEN', mandatory=False)
+    subconf(conf)
 
     # Flags for the default (production) variant
     conf.env['FCFLAGS'] = fcopts[conf.env.FC_NAME, 'optimize'] + fcopts[conf.env.FC_NAME, 'warn']
     conf.env['FCFLAGS'] = fcopts[conf.env.FC_NAME, 'standard'] + fcopts[conf.env.FC_NAME, 'warn'] + fcopts[conf.env.FC_NAME, 'w2e'] + fcopts[conf.env.FC_NAME, 'debug']
     conf.env['LINKFLAGS'] = conf.env['FCFLAGS']
 
+def subconf(conf):
+    conf.check_cc(function_name='mkstemp',
+                  header_name=['stdlib.h', 'unistd.h'],
+                  defines=['LUA_USE_MKSTEMP=1'],
+                  define_name='HASLUA',
+                  uselib_store='MKSTEMP', mandatory=False)
+    conf.check_cc(function_name='popen',
+                  header_name=['stdio.h'],
+                  defines=['LUA_USE_POPEN=1'],
+                  define_name='HASLUA',
+                  uselib_store='POPEN', mandatory=False)
+
 def build(bld):
     core_sources = ['external/lua-5.2.0/src/lapi.c',
                     'external/lua-5.2.0/src/lcode.c',
         features = 'c',
         source = core_sources + lib_sources,
         defines = ['LUA_ANSI'],
+        use = ['MKSTEMP', 'POPEN'],
         target = 'luaobjs')
 
     bld(
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.