Skip to content

Mac OS X setup.py possible fix #3

@Bemmu

Description

@Bemmu

On Mac OS X I could not get setup.py to work until changing it as follows.

I didn't have the confidence to post this as a pull request, as I haven't tested these on other systems than my own (Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64), and fear these changes may have broken the library in some way. So I'm putting this as an issue, as something to try on a Mac OS X system.

if os.name == 'posix':

    libpath = '.libs'
    if os.uname()[0] == 'Darwin':
        libpath = 'lib'

        # When installed with brew, the libraries are in for example:
        # /usr/local/Cellar/libevent/2.1.8/lib (note: NOT .libs)
    else:
        # Also no rt library available on Mac OS X

        # enable thread support
        libraries.append('rt')

    extra_link_args.extend([
        os.path.join(LIBEVENT_ROOT, libpath, 'libevent.a'),
        os.path.join(LIBEVENT_ROOT, libpath, 'libevent_pthreads.a'),
    ])
    libraries.append('pthread')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions