aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/f2c.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-03-28 22:25:04 +0300
committeralexv-smirnov <alex@ydb.tech>2023-03-28 22:25:04 +0300
commitb8a17f9b1c166d2e9a26b99348a4c29d972caf55 (patch)
tree1a2d881f1a9452b9c6103dbf69d73da7624e98e5 /build/scripts/f2c.py
parent25659221f18577ea38430a8ec3349836f5626b6a (diff)
downloadydb-b8a17f9b1c166d2e9a26b99348a4c29d972caf55.tar.gz
Revert ymake build from ydb oss export
Diffstat (limited to 'build/scripts/f2c.py')
-rw-r--r--build/scripts/f2c.py58
1 files changed, 0 insertions, 58 deletions
diff --git a/build/scripts/f2c.py b/build/scripts/f2c.py
deleted file mode 100644
index 7021e1391f..0000000000
--- a/build/scripts/f2c.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import sys
-import subprocess
-import argparse
-import os
-
-
-header = '''\
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-parameter"
-#pragma GCC diagnostic ignored "-Wmissing-braces"
-#pragma GCC diagnostic ignored "-Wuninitialized"
-#pragma GCC diagnostic ignored "-Wreturn-type"
-#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-#endif
-
-'''
-
-footer = '''
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-'''
-
-
-def mkdir_p(directory):
- if not os.path.exists(directory):
- os.makedirs(directory)
-
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser()
-
- parser.add_argument('-t', '--tool')
- parser.add_argument('-c', '--input')
- parser.add_argument('-o', '--output')
-
- args = parser.parse_args()
- tmpdir = args.output + '.f2c'
- mkdir_p(tmpdir)
- # should parse includes, really
- p = subprocess.Popen(
- [args.tool, '-w', '-R', '-a', '-I' + os.path.dirname(args.input), '-T' + tmpdir],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
- stdout, stderr = p.communicate(input=open(args.input).read())
- ret = p.wait()
-
- if ret:
- print >>sys.stderr, 'f2c failed: %s, %s' % (stderr, ret)
- sys.exit(ret)
-
- if 'Error' in stderr:
- print >>sys.stderr, stderr
-
- with open(args.output, 'w') as f:
- f.write(header)
- f.write(stdout)
- f.write(footer)