- Timestamp:
- 07/15/06 09:49:51 (6 years ago)
- Location:
- branches/ithildin-scons
- Files:
-
- 1 added
- 2 edited
-
SConstruct (modified) (5 diffs)
-
build/options.default (added)
-
source/main.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ithildin-scons/SConstruct
r761 r764 11 11 ############################################################################### 12 12 # Initial setup (Python path tweaks etc) 13 import os, sys 14 sys.path.insert(0, os.path.realpath(os.path.dirname(sys.argv[0]))) 13 14 package_name = "ithildin" 15 package_version = "1.2.0" 15 16 16 17 EnsurePythonVersion(2,2) 17 18 EnsureSConsVersion(0,96,92) 19 20 import os, sys 21 # let's just stick the realpath() for ./build in there at the front. THis 22 # allows us to use our custom test code in the 'tests' module there. 23 sys.path.insert(0, os.path.realpath('./build')) 24 import tests 18 25 19 26 ############################################################################### … … 23 30 }) 24 31 32 # Perform some magic to get the repository version. If we have svn and we 33 # can use xml.dom.minidom let's go for it 34 try: 35 subversion = WhereIs('svn') 36 import xml.dom.minidom 37 if subversion: 38 dom = xml.dom.minidom.parseString( 39 os.popen('%s info --xml .' % subversion).read()) 40 e = dom.getElementsByTagName('entry')[0] 41 package_repository_version = int(e.getAttribute('revision')) 42 dom.unlink() 43 except: 44 # no luck eh, let's cheat 45 svnrev = "$Rev: 1 $" 46 package_repository_version = int(svnrev.split()[1]) 47 48 25 49 ############################################################################### 26 50 # Options 51 52 # Collect the list of modules we have shipped with 53 54 if not os.path.exists('build/options'): 55 env.Help(""" 56 You may save your build options in the file build/options with the format: 57 optionname = "optionvalue" 58 A sample options file is provided in build/options.default. 59 """) 60 27 61 opts = Options('build/options', ARGUMENTS) 28 62 opts.AddOptions( … … 34 68 ['kqueue', 'poll', 'select', 'auto']), 35 69 BoolOption('warnings', 'Compile with very aggressive warning settings', 0), 70 # Other path options are handled below 71 PathOption('prefix', 'Installation prefix', '/usr/local', 72 tests.PathIsDirCreateAccess), 36 73 ) 37 38 74 opts.Update(env) 39 75 76 # Now take a look in prefix for the stuff we care about: bin, etc, lib, 77 # include, share. If these already exist we make our defaults 78 # $prefix/etc/ithildin etc. Otherwise we make them $prefix/etc (assuming 79 # this is a lone installation location). This is an automated version of 80 # the old --disable-dir-suffix autoconf macro from 1.1 and lower. 81 # 82 # XXX: this is all dumb in Windows where installations will be totally 83 # different. 84 85 # Okay, let's make some dumb guesses: If the name already contains 86 # 'package' in it let's go ahead and not add that again. If the name is 87 # standard (/usr, /usr/local, /opt) let's add it there. Other than that we 88 # aren't too smart. :) 89 if env['prefix'] == '/usr' or env['prefix'] == '/opt': 90 # /usr and /opt need special handling to stuff things in /etc 91 sysconfdir = '/etc' 92 else: 93 sysconfdir = env['prefix'] + '/etc' 94 95 dir_suffix = '' 96 if not package_name in env['prefix']: 97 dir_suffix = '/' + package_name 98 # let's add one more, if it's in $HOME/<something> let's guess that they 99 # don't want that nasty dir_suffix. This could be so wrong as to be absurd, 100 # but I believe it is what most will want. 101 if (os.environ.has_key('HOME') and os.environ['HOME'] in env['prefix']): 102 dir_suffix = '' 103 104 opts.AddOptions( 105 PathOption('bindir', "Binary installation directory", 106 env['prefix'] + '/bin', tests.PathIsDirCreateAccess), 107 PathOption('sysconfdir', "Configuration file installation directory", 108 sysconfdir + dir_suffix, tests.PathIsDirCreateAccess), 109 PathOption('libdir', "Library installation directory", 110 env['prefix'] + '/lib' + dir_suffix, tests.PathIsDirCreateAccess), 111 PathOption('includedir', 'C header installation directory', 112 env['prefix'] + '/include', tests.PathIsDirCreateAccess), 113 PathOption('datadir', "Miscellaneous file installation directory", 114 env['prefix'] + '/share' + dir_suffix, tests.PathIsDirCreateAccess), 115 ) 116 opts.Update(env) 117 40 118 env.Help(opts.GenerateHelpText(env)) 41 119 … … 43 121 # Feature tests 44 122 45 import tests46 123 conf = env.Configure(config_h = 'include/ithildin/config.h', 47 124 custom_tests = tests.tests) … … 198 275 env.Append(LIBPATH = '#/lib') 199 276 200 env.Export('env') 277 env.AlwaysBuild(env.Alias('update', '#/.svn', '%s update' % subversion)) 278 279 env.Export(['env', 'package_name', 'package_version', 280 'package_repository_version']) 201 281 env.SConscript('lib/SConscript') 202 282 env.SConscript('source/SConscript') -
branches/ithildin-scons/source/main.c
r761 r764 83 83 84 84 me.started = me.now = time(NULL); 85 /*86 85 strncpy(me.conf_path, PACKAGE_PATH_SYSCONF, PATH_MAX); 87 86 strncpy(me.lib_path, PACKAGE_PATH_LIB "/modules", PATH_MAX); … … 90 89 sprintf(me.version, "%s-%s", PACKAGE_NAME, PACKAGE_VERSION); 91 90 me.revision = PACKAGE_REPOSITORY_VERSION; 92 */93 91 me.fork = 1; /* by default we fork */ 94 92 … … 303 301 strncpy(me.conf_path, optarg, PATH_MAX); 304 302 break; 305 /*306 303 case 'v': 307 304 printf("%s (r%d)\n", me.version, me.revision); … … 318 315 319 316 exit(0); 320 */321 317 case '?': 322 318 printf(usage, me.execname);
Note: See TracChangeset
for help on using the changeset viewer.
