<commit_before>#!/usr/bin/python

import os, sys
from glob import glob
os.chdir(os.path.dirname(__file__))

def sysExec(cmd):
    print " ".join(cmd)
    r = os.system(" ".join(cmd))
    if r != 0: sys.exit(r)

sysExec(["mkdir","-p","build"])
os.chdir("build")

staticChromaprint = False

ffmpegFiles = ["../ffmpeg.c"] + \
	(glob("../chromaprint/*.cpp") if staticChromaprint else [])

sysExec(["cc", "-std=c99", "-c"] + ffmpegFiles +
	[
		"-DHAVE_CONFIG_H",
		"-I", "/System/Library/Frameworks/Python.framework/Headers/",
		"-g",
	] +
	(["-I", "../chromaprint"] if staticChromaprint else [])
)

sysExec(["libtool", "-dynamic", "-o", "../ffmpeg.so"] +
	[os.path.splitext(os.path.basename(fn))[0] + ".o" for fn in ffmpegFiles] +
	[
		"-framework", "Python",
		"-lavformat", "-lavutil", "-lavcodec", "-lswresample", "-lportaudio",
		"-lc", "-lstdc++",
	] +
	([] if staticChromaprint else ["-lchromaprint"])
)

levelDbFiles = glob("../leveldb*.cc")

sysExec(["cc", "-c"] + levelDbFiles +
	[
		"-I", "/System/Library/Frameworks/Python.framework/Headers/",
		"-g",
	]
)<commit_msg>compile.py: add include path for Python for common Linux/Unix<commit_after>#!/usr/bin/python

import os, sys
from glob import glob
os.chdir(os.path.dirname(__file__))

def sysExec(cmd):
    print " ".join(cmd)
    r = os.system(" ".join(cmd))
    if r != 0: sys.exit(r)

sysExec(["mkdir","-p","build"])
os.chdir("build")

staticChromaprint = False

ffmpegFiles = ["../ffmpeg.c"] + \
	(glob("../chromaprint/*.cpp") if staticChromaprint else [])

sysExec(["cc", "-std=c99", "-c"] + ffmpegFiles +
	[
		"-DHAVE_CONFIG_H",
		"-I", "/System/Library/Frameworks/Python.framework/Headers/", # mac
		"-I", "/usr/include/python2.7", # common linux/unix
		"-g",
	] +
	(["-I", "../chromaprint"] if staticChromaprint else [])
)

sysExec(["libtool", "-dynamic", "-o", "../ffmpeg.so"] +
	[os.path.splitext(os.path.basename(fn))[0] + ".o" for fn in ffmpegFiles] +
	[
		"-framework", "Python",
		"-lavformat", "-lavutil", "-lavcodec", "-lswresample", "-lportaudio",
		"-lc", "-lstdc++",
	] +
	([] if staticChromaprint else ["-lchromaprint"])
)

levelDbFiles = glob("../leveldb*.cc")

sysExec(["cc", "-c"] + levelDbFiles +
	[
		"-I", "/System/Library/Frameworks/Python.framework/Headers/",
		"-g",
	]
)
{'fraction_non_alphanumeric': 0.2466784765279008, 'fraction_numerical': 0.0044286979627989375, 'mean_word_length': 3.826923076923077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3888119', 'n_tokens_mistral': 975, 'n_tokens_neox': 914, 'n_words': 161}