From d6bcd104af8a6480a48ecc7b0e781b73101e7f5a Mon Sep 17 00:00:00 2001 From: Clint Talbert Date: Wed, 13 Apr 2011 15:54:21 -0700 Subject: [PATCH] Switching to scons buildsystem --- README.txt | 8 ++++++++ SConstruct | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ linux/SConscript | 6 ++++++ 3 files changed, 63 insertions(+) create mode 100644 README.txt create mode 100644 SConstruct create mode 100644 linux/SConscript diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..64a0daf --- /dev/null +++ b/README.txt @@ -0,0 +1,8 @@ +This is a little native events c library that can be called from JS using +JS ctypes. In order to build the library, you need to install +scons: http://www.scons.org/doc/production/HTML/scons-user.html#chap-build-install + +Then, in this directory type: +scons + +This is obviously, still under construction. More info to come. diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..e39a3d5 --- /dev/null +++ b/SConstruct @@ -0,0 +1,49 @@ +import sys +# TODO: I'm quite certain the Configuration settings can handle this, but +# I can't seem to make it work, so punting for now... +def is_mac(): + if sys.platform == 'darwin': + return True + return False + +def is_linux(): + if sys.platform == 'linux2': + return True + return False + +def is_windows(): + if (sys.platform == 'win32' or + sys.platform == 'cygwin'): + return True + return False + +subdirs = [] +env = Environment() + +if is_mac(): + print "No Mac Support" +elif is_linux(): + subdirs.append('linux') + + # This is necessary to get gtk to compile and link properly + env.ParseConfig('pkg-config --cflags --libs gtk+-2.0') +elif is_windows(): + print "No Windows Support" +else: + print "Your OS is not recognized" + +# Export the environment to our dependent SConscripts +Export('env') + +# Make our subdirectories +objs = [] +for subdir in subdirs: + o = SConscript('%s/SConscript' % subdir) + objs.append(o) + +# Append our files in the top level directory: +objs.append('native_events.c') + +# Make the library +env.Library('native_events', objs) + diff --git a/linux/SConscript b/linux/SConscript new file mode 100644 index 0000000..6fa3e72 --- /dev/null +++ b/linux/SConscript @@ -0,0 +1,6 @@ +Import('env') + +objs = [] +objs.append(env.Object('linux_events.cpp')) +objs.append(env.Object('linux_utils.cpp')) +Return('objs')