# Builds everything for ArX. # Note that SConstruct is created by running autoconf over # SConstruct.in # Copyright 2003, 2005 Walter Landry # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA import os import sys env=Environment(CXX='@CXX@',LINK='@CXX@',CPPPATH='#/src') cxxflags='@CXXFLAGS@' if len(cxxflags)!=0: env.Append(CXXFLAGS=Split('@CXXFLAGS@')) cppflags='@CPPFLAGS@' if len(cppflags)!=0: env.Append(CPPFLAGS=Split('@CPPFLAGS@')) ldflags='@LDFLAGS@' if len(ldflags)!=0: env.Append(LINKFLAGS=Split('@LDFLAGS@')) # Store the signatures in a single file, because otherwise the install # target will install the .sconsign file SConsignFile() ## ## We have to use these signatures to prevent spurious rebuilds ## TargetSignatures('content') ## SourceSignatures('MD5') extra_libs="@LIBS@" Export('extra_libs') pkgconfig="@ARXPKGCONFIG@ --libs --cflags gnome-vfs-2.0 glib-2.0" env.ParseConfig(pkgconfig) # We have to check for old versions of gnome-vfs-2.0, because older # versions (2.6 and earlier) break if you don't url-escape http uris, # and new versions break if you do. gnomevfs_version=os.popen("@ARXPKGCONFIG@ --modversion gnome-vfs-2.0").readline() if not(gnomevfs_version[0]>'2' or (gnomevfs_version[0]=='2' and gnomevfs_version[2]>='8')): env.Append(CPPFLAGS='-DARX_GNOMEVFS_MUST_ESCAPE_HTTP') ## Figure out where everything is going to be put once it is built. import re outer_environ=os.environ if outer_environ.has_key('prefix'): prefix=outer_environ['prefix'] else: prefix="@prefix@" exec_prefix="@exec_prefix@" bin_dir="@bindir@" lib_dir="@libdir@" if outer_environ.has_key('mandir'): man_dir=outer_environ['mandir']+"/man1" else: man_dir="@mandir@"+"/man1" exec_prefix=re.sub(r"\$\{prefix\}",prefix,exec_prefix) bin_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,bin_dir) lib_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,lib_dir) man_dir=re.sub(r"\$\{exec_prefix\}",exec_prefix,man_dir) env["prefix"]=prefix env["exec_prefix"]=exec_prefix env["bin_dir"]=bin_dir env["lib_dir"]=lib_dir env["man_dir"]=man_dir bin_objects=[] lib_objects=[] Export('bin_objects') Export('lib_objects') python_lib=[] python_py=[] python_include_dir='@PYTHON_INCLUDE_DIR@' Export('python_lib') Export('python_py') Export('python_include_dir') Export('env') BuildDir('build','src',duplicate=0) SConscript('build/SConscript') Default(None) Default(bin_objects) bin_install=env.Install(bin_dir,bin_objects) lib_install=env.Install(lib_dir,lib_objects) env.Alias('install',bin_install) # Install the docs and manpage doc_objects=[] man_objects=[] Export('doc_objects') Export('man_objects') SConscript('docs/SConscript') doc_dir=prefix+"/share/doc/arx" doc_install=env.Install(doc_dir,doc_objects) env.Alias('install',doc_install) man_install=env.Install(man_dir,man_objects) env.Alias('install',man_install) # Make the python binding python_dir=lib_dir+"/python"+sys.version[:3] python_lib_install=env.Install(python_dir,python_lib) python_py_install=env.Install(python_dir,python_py) env.Alias('python',python_lib_install) env.Alias('python',python_py_install) env.Alias('python',lib_install)