httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r729552 - in /httpd/sandbox/mod_mbox-3: ./ SConstruct
Date Fri, 26 Dec 2008 23:12:13 GMT
Author: pquerna
Date: Fri Dec 26 15:12:12 2008
New Revision: 729552

URL: http://svn.apache.org/viewvc?rev=729552&view=rev
Log:
Add build system based on SCons.

Added:
    httpd/sandbox/mod_mbox-3/SConstruct
Modified:
    httpd/sandbox/mod_mbox-3/   (props changed)

Propchange: httpd/sandbox/mod_mbox-3/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 26 15:12:12 2008
@@ -1,3 +1,4 @@
+build.py
 config.in
 Makefile.in
 Makefile

Added: httpd/sandbox/mod_mbox-3/SConstruct
URL: http://svn.apache.org/viewvc/httpd/sandbox/mod_mbox-3/SConstruct?rev=729552&view=auto
==============================================================================
--- httpd/sandbox/mod_mbox-3/SConstruct (added)
+++ httpd/sandbox/mod_mbox-3/SConstruct Fri Dec 26 15:12:12 2008
@@ -0,0 +1,71 @@
+
+import subprocess
+from os.path import join as pjoin
+
+EnsureSConsVersion(1, 1, 0)
+
+
+opts = Options('build.py')
+
+opts.Add(PathOption('APXS', 'Path apxs','/usr/local/bin/apxs'))
+
+env = Environment(options=opts)
+
+def apxs_query(path, key):
+    cmd = [path, "-q", key]
+    s = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+    out = s.communicate()[0]
+    s.wait()
+    return out.strip()
+
+apr_config = apxs_query(env["APXS"], 'APR_CONFIG')
+apu_config = apxs_query(env["APXS"], 'APU_CONFIG')
+
+env.ParseConfig(apr_config + ' --cflags --cppflags --includes --ldflags')
+env.ParseConfig(apu_config + ' --includes  --ldflags')
+
+# TODO: Move to httpd-config when it comes out !
+env.ParseConfig(env['APXS'] + ' -q EXTRA_CFLAGS')
+env.ParseConfig(env['APXS'] + ' -q EXTRA_CPPFLAGS')
+env.ParseConfig(env['APXS'] + ' -q EXTRA_LIBS')
+env.ParseConfig(env['APXS'] + ' -q EXTRA_LIBS')
+
+env.AppendUnique(CPPPATH = [apxs_query(env['APXS'], 'exp_includedir')])
+if env['PLATFORM'] == 'darwin':
+    env.AppendUnique(LINKFLAGS = ['-undefined', 'dynamic_lookup'])
+
+env.AppendUnique(CPPFLAGS = "-DNO_MBOX_SEARCH")
+libsources = [pjoin('module-2.0', x) for x in Split("""
+    mbox_search.c
+    mbox_cache.c
+    mbox_parse.c
+    mbox_sort.c
+    mbox_thread.c
+    mbox_externals.c
+""")]
+
+lib = env.StaticLibrary(target = "libmbox", source = [ libsources])
+
+modsources = [pjoin('module-2.0', x) for x in Split("""
+    mod_mbox.c
+    mod_mbox_file.c
+    mod_mbox_out.c
+    mod_mbox_search.c
+    mod_mbox_index.c
+    mod_mbox_cte.c
+    mod_mbox_mime.c
+""")]
+
+module = env.LoadableModule(target = "mod_mbox.so", source = [modsources, libsources])
+
+util = env.Program(target = 'mod-mbox-util', source = ['module-2.0/mod-mbox-util.c', lib])
+
+mod_path = apxs_query(env["APXS"], 'exp_libexecdir')
+bin_path = apxs_query(env["APXS"], 'exp_bindir')
+imod = env.Install(mod_path, source = [module])
+bmod = env.Install(bin_path, source = [util])
+env.Alias('install', imod)
+
+targets = [module, util]
+
+env.Default(targets)



Mime
View raw message