diff options
author | Justin Erenkrantz <jerenkrantz@apache.org> | 2006-07-11 23:50:48 +0000 |
---|---|---|
committer | Justin Erenkrantz <jerenkrantz@apache.org> | 2006-07-11 23:50:48 +0000 |
commit | 9f27e92878299c660c1ccfd45101a084a237d3cb (patch) | |
tree | 29e0b210b9fdc70bf1a350ce3ede0ea6e1251622 /build/gen-build.py | |
parent | fe3452573fabf5b893b8f71a592bd8a67bae9785 (diff) | |
download | apr-9f27e92878299c660c1ccfd45101a084a237d3cb.tar.gz |
Allow mingw to use make for Win32 builds.
(make now does something on mingw, but it will need more patches to finish.)
N.B. this determines what 'special' files we need to include for Win32 builds
by looking at the libapr.dsp file we have locally.
Originally titled: [patch 03/17] build conf
Inspired by: John Mark Vandenberg
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@421038 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/gen-build.py')
-rwxr-xr-x | build/gen-build.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/build/gen-build.py b/build/gen-build.py index 8582741de..09161d6d7 100755 --- a/build/gen-build.py +++ b/build/gen-build.py @@ -20,7 +20,7 @@ import re # # legal platforms: aix, beos, netware, os2, os390, unix, win32 -# 'make' users: aix, beos, os2, os390, unix +# 'make' users: aix, beos, os2, os390, unix, win32 (mingw) # PLATFORMS = [ 'aix', 'beos', 'netware', 'os2', 'os390', 'unix', 'win32' ] MAKE_PLATFORMS = [ @@ -29,6 +29,7 @@ MAKE_PLATFORMS = [ ('beos', 'unix'), ('os2', 'unix'), ('os390', 'unix'), + ('win32', 'unix'), ] # note: MAKE_PLATFORMS is an ordered set. we want to generate unix symbols # first, so that the later platforms can reference them. @@ -65,6 +66,25 @@ def main(): # record the object symbols to build for each platform group = [ '$(OBJECTS_all)' ] + # If we're doing win32, we're going to look in the libapr.dsp file + # for those files that we have to manually add to our list. + inherit_parent = { } + if platform == 'win32': + for line in open('libapr.dsp').readlines(): + if line[:7] != 'SOURCE=': + continue + if line[7:].find('unix') != -1: + # skip the leading .\ and split it out + inherit_files = line[9:].strip().split('\\') + # change the .c to .lo + assert inherit_files[-1][-2:] == '.c' + inherit_files[-1] = inherit_files[-1][:-2] + '.lo' + # replace the \\'s with /'s + inherit_line = '/'.join(inherit_files) + if not inherit_parent.has_key(inherit_files[0]): + inherit_parent[inherit_files[0]] = [] + inherit_parent[inherit_files[0]].append(inherit_line) + for subdir in string.split(parser.get('options', 'platform_dirs')): path = '%s/%s' % (subdir, platform) if not os.path.exists(path): @@ -81,6 +101,9 @@ def main(): files = get_files(path + '/*.c') objects, _unused = write_objects(f, legal_deps, h_deps, files) + if inherit_parent.has_key(subdir): + objects = objects + inherit_parent[subdir] + symname = 'OBJECTS_%s_%s' % (subdir, platform) # and write the symbol for the whole group |