#!/usr/bin/env python3 from distutils.core import setup, Extension import glob import os packages = ['glib-2.0', 'jack', 'fluidsynth', 'libusb-1.0', 'smf', 'sndfile'] eargs = os.popen("pkg-config --cflags %s" % (" ".join(packages)), "r").read().split() eargs.append("-std=c99") libs = os.popen("pkg-config --libs %s" % (" ".join(packages)), "r").read().split() libs.append("-luuid") csources = [ "app.c", "auxbus.c", "blob.c", "chorus.c", "cmd.c", "compressor.c", "config-api.c", "delay.c", "distortion.c", "dom.c", "eq.c", "engine.c", "errors.c", "fbr.c", "fifo.c", "fluid.c", "fuzz.c", "fxchain.c", "gate.c", "hwcfg.c", "instr.c", "io.c", "jackinput.c", "jackio.c", "layer.c", "master.c", "meter.c", "midi.c", "mididest.c", "module.c", "pattern.c", "pattern-maker.c", "phaser.c", "prefetch_pipe.c", "recsrc.c", "reverb.c", "rt.c", "sampler.c", "sampler_channel.c", "sampler_gen.c", "sampler_layer.c", "sampler_prg.c", "sampler_voice.c", "scene.c", "scripting.c", "seq.c", "seq-adhoc.c", "sfzloader.c", "sfzparser.c", "song.c", "streamplay.c", "streamrec.c", "tarfile.c", "tonectl.c", "tonewheel.c", "track.c", "usbaudio.c", "usbio.c", "usbmidi.c", "usbprobe.c", "wavebank.c" ] if '#define USE_SSE 1' in open('config.h').read(): eargs.append('-msse') eargs.append('-ffast-math') setup(name="CalfBox", version="0.04", description="Assorted music-related code", author="Krzysztof Foltman", author_email="wdev@foltman.com", url="http://repo.or.cz/w/calfbox.git", packages=["calfbox"], package_dir={'calfbox':'py'}, ext_modules=[ Extension('_cbox', csources, extra_compile_args = eargs, include_dirs=['.'], extra_link_args=libs, define_macros=[("_GNU_SOURCE","1"),("_POSIX_C_SOURCE", "199309L"),("USE_PYTHON","1"),("CALFBOX_AS_MODULE", "1")], undef_macros=['NDEBUG'], depends = ['setup.py'] ) ], ) ###And now the error log### [nils@fyps calfbox]$ LANG=ENG python setup.py build running build running build_py running build_ext building '_cbox' extension gcc -pthread -Wno-unused-result -Werror=declaration-after-statement -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -D_GNU_SOURCE=1 -D_POSIX_C_SOURCE=199309L -DUSE_PYTHON=1 -DCALFBOX_AS_MODULE=1 -UNDEBUG -I. -I/usr/include/python3.4m -c app.c -o build/temp.linux-x86_64-3.4/app.o -I/usr/include/libusb-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -std=c99 In file included from rt.h:26:0, from app.h:25, from app.c:19: fifo.h: In function 'cbox_fifo_write_atomic': fifo.h:114:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] uint32_t ofs = fifo->write_count - fifo->write_offset; ^ In file included from module.h:23:0, from app.c:30: dspmath.h: In function 'cerp': dspmath.h:66:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] float d0 = (f - 0); ^ app.c: In function 'app_process_cmd': app.c:88:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const char *obj = &cmd->command[1]; ^ app.c:136:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] int mcmd = CBOX_ARG_I(cmd, 1); ^ app.c:144:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct cbox_midi_buffer buf; ^ app.c:157:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const struct cbox_blob *blob = CBOX_ARG_B(cmd, 1); ^ app.c:199:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct cbox_meter *meter = cbox_meter_new(app.document, app.rt->io_env.srate); ^ app.c:209:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct cbox_engine *e = cbox_engine_new(app.document, NULL); ^ app.c: In function 'config_process_cmd': app.c:271:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct config_foreach_data cfd = {cmd->arg_types[0] == 's' ? CBOX_ARG_S(cmd, 0) : NULL, "/section", fb, error, TRUE}; ^ app.c:280:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct config_foreach_data cfd = {cmd->arg_types[1] == 's' ? CBOX_ARG_S(cmd, 1) : NULL, "/key", fb, error, TRUE}; ^ app.c:289:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const char *value = cbox_config_get_string(CBOX_ARG_S(cmd, 0), CBOX_ARG_S(cmd, 1)); ^ app.c: In function 'cbox_app_on_idle': app.c:337:13: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] int auto_reconnect = cbox_config_get_int("io", "auto_reconnect", 0); ^ app.c:341:17: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] GError *error2 = NULL; ^ cc1: some warnings being treated as errors error: command 'gcc' failed with exit status 1