Diff of /branches/branch-1-2/MySQLdb/setup.py [r380] .. [r381] Maximize Restore

  Switch to unified view

a/branches/branch-1-2/MySQLdb/setup.py b/branches/branch-1-2/MySQLdb/setup.py
...
...
65
        f = popen("mysql_config --%s" % what)
65
        f = popen("mysql_config --%s" % what)
66
        data = f.read().strip().split()
66
        data = f.read().strip().split()
67
        if f.close(): data = []
67
        if f.close(): data = []
68
        return data
68
        return data
69
69
70
    def stripquotes(s):
71
        if s[0] in ("'", '"') and s[0] == s[-1]:
72
            return s[1:-1]
73
        return s
74
    
70
    include_dirs = [ i[2:] for i in config('include') if i.startswith('-i') ]
75
    include_dirs = [ i[2:] for i in config('include') if i.startswith('-i') ]
71
76
72
    if mysqlclient == "mysqlclient":
77
    if mysqlclient == "mysqlclient":
73
        libs = config("libs")
78
        libs = config("libs")
74
    elif mysqlclient == "mysqlclient_r":
79
    elif mysqlclient == "mysqlclient_r":
75
        libs = config("libs_r")
80
        libs = config("libs_r")
76
    elif mysqlclient == "mysqld":
81
    elif mysqlclient == "mysqld":
77
        libs = config("embedded")
82
        libs = config("embedded")
78
    library_dirs = [ i[2:] for i in libs if i.startswith("-L") ]
83
    library_dirs = [ stripquotes(i[2:]) for i in libs if i.startswith("-L") ]
79
    libraries = [ i[2:] for i in libs if i.startswith("-l") ]
84
    libraries = [ stripquotes(i[2:]) for i in libs if i.startswith("-l") ]
80
85
81
    # Workaround for a pre-4.1.9 bug
86
    # Workaround for a pre-4.1.9 bug
82
    if "z" not in libraries:
87
    if "z" not in libraries:
83
        libraries.append("z")
88
        libraries.append("z")
84
89