forked from rpavlik/gmtl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgmtl-config
executable file
·79 lines (69 loc) · 2.76 KB
/
gmtl-config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python
# ************************************************************* ggt-head beg
#
# GGT: Generic Graphics Toolkit
#
# Original Authors:
# Allen Bierbaum
#
# -----------------------------------------------------------------
# File: $RCSfile: gmtl-config,v $
# Date modified: $Date: 2007-06-26 19:04:10 $
# Version: $Revision: 1.2 $
# -----------------------------------------------------------------
#
# ********************************************************** ggt-head end
# ************************************************************** ggt-cpr beg
#
# GGT: The Generic Graphics Toolkit
# Copyright (C) 2001,2002 Allen Bierbaum
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# *********************************************************** ggt-cpr end
import os, sys
from optparse import OptionParser
parser = OptionParser(usage = "%prog [OPTIONS]",
description = "GMTL config option processor.")
parser.add_option("--prefix", action = "store_true",
help = "Print the installation prefix.")
parser.add_option("--version", action = "store_true",
help = "Print the installed GMTL's version number.")
parser.add_option("--cxxflags", action = "store_true",
help = "Pring the GMTL-specific flags for the C++ compiler.")
parser.add_option("--all", action = "store_true",
help = "Print all the flags used for compiling or linking.")
parser.add_option("--basedir", action = "store_true",
help = "For compatibility. (disabled in this wrapper)")
(options, pos_args) = parser.parse_args()
if 0 != len(pos_args):
parser.print_help()
# Build up flags for flagpoll
command_flags = " gmtl --concat"
if options.prefix:
command_flags += " --get-prefix"
elif options.version:
command_flags += " --modversion"
elif options.cxxflags:
if options.cxxflags:
command_flags += " --cflags"
if not options.all:
command_flags += " --no-deps"
else:
parser.print_help()
sys.exit(1)
command_line = "flagpoll " + command_flags
#print "Command: ", command_line
os.system(command_line)