We're including config.h everywhere, so we should pass compatible compiler options.
[calfbox.git] / setup.py
blobd1b6a09c23560232555749ceacdb592851e42b87
1 #!/usr/bin/env python3
3 from distutils.core import setup, Extension
4 import glob
5 import os
7 packages = ['glib-2.0', 'jack', 'fluidsynth', 'libusb-1.0', 'smf', 'sndfile']
9 eargs = os.popen("pkg-config --cflags %s" % (" ".join(packages)), "r").read().split()
10 eargs.append("-std=c99")
12 libs = os.popen("pkg-config --libs %s" % (" ".join(packages)), "r").read().split()
13 libs.append("-luuid")
15 csources = [
16 "app.c",
17 "auxbus.c",
18 "blob.c",
19 "chorus.c",
20 "cmd.c",
21 "compressor.c",
22 "config-api.c",
23 "delay.c",
24 "distortion.c",
25 "dom.c",
26 "eq.c",
27 "engine.c",
28 "errors.c",
29 "fbr.c",
30 "fifo.c",
31 "fluid.c",
32 "fuzz.c",
33 "fxchain.c",
34 "gate.c",
35 "hwcfg.c",
36 "instr.c",
37 "io.c",
38 "jackinput.c",
39 "jackio.c",
40 "layer.c",
41 "master.c",
42 "meter.c",
43 "midi.c",
44 "mididest.c",
45 "module.c",
46 "pattern.c",
47 "pattern-maker.c",
48 "phaser.c",
49 "prefetch_pipe.c",
50 "recsrc.c",
51 "reverb.c",
52 "rt.c",
53 "sampler.c",
54 "sampler_channel.c",
55 "sampler_gen.c",
56 "sampler_layer.c",
57 "sampler_prg.c",
58 "sampler_voice.c",
59 "scene.c",
60 "scripting.c",
61 "seq.c",
62 "sfzloader.c",
63 "sfzparser.c",
64 "song.c",
65 "streamplay.c",
66 "streamrec.c",
67 "tonectl.c",
68 "tonewheel.c",
69 "track.c",
70 "usbaudio.c",
71 "usbio.c",
72 "usbmidi.c",
73 "usbprobe.c",
74 "wavebank.c"
77 if '#define USE_SSE 1' in open('config.h').read():
78 eargs.append('-msse')
79 eargs.append('-ffast-math')
81 setup(name="CalfBox",
82 version="0.04", description="Assorted music-related code",
83 author="Krzysztof Foltman", author_email="wdev@foltman.com",
84 url="http://repo.or.cz/w/calfbox.git",
85 packages=["calfbox"],
86 package_dir={'calfbox':'py'},
87 ext_modules=[
88 Extension('_cbox', csources,
89 extra_compile_args = eargs,
90 include_dirs=['.'],
91 extra_link_args=libs,
92 define_macros=[("_GNU_SOURCE","1"),("_POSIX_C_SOURCE", "199309L"),("USE_PYTHON","1"),("CALFBOX_AS_MODULE", "1")],
93 undef_macros=['NDEBUG'],
94 depends = ['setup.py']