]>
Commit | Line | Data |
---|---|---|
39bee6bc AF |
1 | --- subvertpy-0.7.2/setup.py.wiget 2010-03-11 15:15:17.000000000 +0100 |
2 | +++ subvertpy-0.7.2/setup.py 2010-03-11 15:21:02.000000000 +0100 | |
3 | @@ -76,6 +76,26 @@ def apr_config(arg): | |
4 | res = run_cmd(apr_config_cmd, arg) | |
5 | return res | |
6 | ||
7 | +def apu_config(arg): | |
8 | + apu_config_cmd = os.getenv("APU_CONFIG") | |
9 | + if apu_config_cmd is None: | |
10 | + cmds = ["apu-1-config", "/usr/local/apr-utils/bin/apu-1-config", | |
11 | + "/opt/local/bin/apu-1-config", ] | |
12 | + for cmd in cmds: | |
13 | + try: | |
14 | + res = run_cmd(cmd, arg) | |
15 | + apu_config_cmd = cmd | |
16 | + break | |
17 | + except CommandException, e: | |
18 | + if not e.not_found(): | |
19 | + raise | |
20 | + else: | |
21 | + raise Exception("apu-config not found." | |
22 | + " Please set APU_CONFIG environment variable") | |
23 | + else: | |
24 | + res = run_cmd(apu_config_cmd, arg) | |
25 | + return res | |
26 | + | |
27 | ||
28 | def apr_build_data(): | |
29 | """Determine the APR header file location.""" | |
30 | @@ -84,6 +104,13 @@ def apr_build_data(): | |
31 | raise Exception("APR development headers not found") | |
32 | return (includedir,) | |
33 | ||
34 | +def apu_build_data(): | |
35 | + """Determine the APR-UTILS header file location.""" | |
36 | + includedir = apu_config("--includedir") | |
37 | + if not os.path.isdir(includedir): | |
38 | + raise Exception("APR-UTILS development headers not found") | |
39 | + return (includedir,) | |
40 | + | |
41 | ||
42 | def svn_build_data(): | |
43 | """Determine the Subversion header file location.""" | |
44 | @@ -108,8 +135,9 @@ def is_keychain_provider_available(): | |
45 | Checks for the availability of the Keychain simple authentication provider in Subversion by compiling a simple test program. | |
46 | """ | |
47 | abd = apr_build_data() | |
48 | + aubd = apu_build_data() | |
49 | sbd = svn_build_data() | |
50 | - gcc_command_args = ['gcc'] + ['-I' + inc for inc in sbd[0]] + ['-L' + lib for lib in sbd[1]] + ['-I' + abd[0], '-lsvn_subr-1', '-x', 'c', '-'] | |
51 | + gcc_command_args = ['gcc'] + ['-I' + inc for inc in sbd[0]] + ['-L' + lib for lib in sbd[1]] + ['-I' + abd[0], '-I' + aubd[0], '-lsvn_subr-1', '-x', 'c', '-'] | |
52 | (gcc_in, gcc_out, gcc_err) = os.popen3(gcc_command_args) | |
53 | gcc_in.write(""" | |
54 | #include <svn_auth.h> | |
55 | @@ -223,10 +251,11 @@ if os.name == "nt": | |
56 | return includes, lib_dirs, aprlibs+libs, | |
57 | ||
58 | (apr_includedir, ) = apr_build_data() | |
59 | +(apu_includedir, ) = apu_build_data() | |
60 | (svn_includedirs, svn_libdirs, extra_libs) = svn_build_data() | |
61 | ||
62 | def SvnExtension(name, *args, **kwargs): | |
63 | - kwargs["include_dirs"] = [apr_includedir] + svn_includedirs + ["subvertpy"] | |
64 | + kwargs["include_dirs"] = [apr_includedir, apu_includedir] + svn_includedirs + ["subvertpy"] | |
65 | kwargs["library_dirs"] = svn_libdirs | |
66 | if os.name == 'nt': | |
67 | # on windows, just ignore and overwrite the libraries! |