This repository has been archived by the owner on May 4, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
build: fix gcc 3.x build
Detect gcc version, -fvisibility is a gcc 4.x switch.
- Loading branch information
1 parent
d15b88a
commit cb6cd92
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
|
||
def DoMain(*args): | ||
cc = os.environ.get('CC', 'gcc') | ||
stdin, stderr = os.pipe() | ||
subprocess.call([cc, '-v'], stderr=stderr) | ||
output = os.read(stdin, 4096) | ||
match = re.search("\ngcc version (\d+\.\d+\.\d+)", output) | ||
if match: | ||
print(match.group(1)) | ||
|
||
|
||
if __name__ == '__main__': | ||
DoMain(*sys.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters