Source
xxxxxxxxxx
91
91
import argparse
92
92
93
93
lib_ext = "dylib" if sys.platform == 'darwin' else 'so'
94
94
95
95
parser=argparse.ArgumentParser()
96
96
97
97
parser.add_argument('--version', help='version')
98
98
parser.add_argument('--debug', help='debug', action='store_true')
99
99
parser.add_argument('--relwithdebinfo', help='Release build with debug and optimization flags', action='store_true')
100
100
parser.add_argument('--stripsyms', help='Strip debug info out of the executable files from --relwithdebinfo. Used with release builds.', action='store_true')
101
-
parser.add_argument('--hasprevmake', help="Don't build any external (non-python) sources. Assume previously built via genmake+make.", action='store_true')
101
+
parser.add_argument('--prebuilt', help="Don't build any external (non-python) sources. Assume previously built via genmake+make.", action='store_true')
102
102
parser.add_argument('bdist_wheel', help='bdist_wheel')
103
103
104
104
args=parser.parse_args()
105
105
_debug_build_ = args.debug
106
106
_rel_with_deb_info_ = args.relwithdebinfo
107
107
_strip_syms_ = args.stripsyms
108
-
_hasprevmake = args.hasprevmake
108
+
_prebuilt_ = args.prebuilt
109
109
print("_debug_build_: " + str(_debug_build_))
110
110
print("_rel_with_deb_info_: " + str(_rel_with_deb_info_))
111
111
print("_strip_syms_: " + str(_strip_syms_))
112
+
print("_prebuilt_: " + str(_prebuilt_))
112
113
113
114
# Remove the "non-standard" arguments from sys.argv so as not to confuse dist_tools
114
115
if "--version" in sys.argv:
115
116
sys.argv.remove("--version")
116
117
if "--debug" in sys.argv:
117
118
sys.argv.remove("--debug")
118
119
if "--relwithdebinfo" in sys.argv:
119
120
sys.argv.remove("--relwithdebinfo")
120
121
if "--stripsyms" in sys.argv:
121
122
sys.argv.remove("--stripsyms")
122
-
if "--hasprevmake" in sys.argv:
123
-
sys.argv.remove("--hasprevmake")
123
+
if "--prebuilt" in sys.argv:
124
+
sys.argv.remove("--prebuilt")
124
125
125
126
module_name = 'casatools'
126
127
127
128
pyversion = float(sys.version_info[0]) + float(sys.version_info[1]) / 10.0
128
129
xml_jar_file = 'xml-casa-assembly-1.65.jar'
129
130
real_gnu = None
130
131
gxx_version_number = 0
131
132
gfortran_flag_additions = [ ]
132
133
133
134
if pyversion < 3:
1162
1163
[library_mangle[l] if l in library_mangle else l for l in libraries],
1163
1164
library_dirs+local_library_path, runtime_library_dirs, export_symbols,
1164
1165
debug, extra_preargs, extra_postargs, build_temp, target_lang)
1165
1166
1166
1167
self.linker_so = default_linker_so
1167
1168
1168
1169
# now redefine the _compile method. This gets executed for each
1169
1170
# object but distutils doesn't have the ability to change compilers
1170
1171
# based on source extension: we add it.
1171
1172
def _compile(obj, src, ext, cc_args, postargs, pp_opts):
1172
-
if _hasprevmake:
1173
+
if _prebuilt_:
1173
1174
# Don't rebuild external (non-python) sources
1174
1175
return
1175
1176
1176
1177
if ext == ".f" or ext == ".f90" :
1177
1178
print("fortran compile...")
1178
1179
if sys.platform == 'darwin' or sys.platform.startswith('linux'):
1179
1180
compiler_so = new_compiler_fortran
1180
1181
"""
1181
1182
if (ext == ".f90"):
1182
1183
cc_args = ["-O3", "-fPIC", "-c", "-ffree-form", "-ffree-line-length-none"]