mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
22 lines
424 B
Python
22 lines
424 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import subprocess, sys, shlex
|
||
|
|
||
|
cfile = sys.argv[1]
|
||
|
hfile = sys.argv[2]
|
||
|
yfile = sys.argv[3]
|
||
|
|
||
|
args = ['-d', '-v', '-ppriv_gst_parse_yy', yfile, '-o', cfile]
|
||
|
bison = [r'@BISON@'] + shlex.split(r'@BISON_ARGS@')
|
||
|
subprocess.check_call(bison + args)
|
||
|
|
||
|
prefix = '''
|
||
|
#ifdef HAVE_CONFIG_H
|
||
|
#include<config.h>
|
||
|
#endif
|
||
|
'''
|
||
|
|
||
|
contents = open(cfile).read()
|
||
|
content = prefix + contents
|
||
|
open(cfile, 'w').write(contents)
|