@@ -45,6 +45,14 @@ function bazel_clean_and_fetch() {
45
45
-//tensorflow/examples/android/..."
46
46
}
47
47
48
+ function sed_hyphen_i() {
49
+ if is_macos; then
50
+ sed -i ' ' " $@ "
51
+ else
52
+ sed -i " $@ "
53
+ fi
54
+ }
55
+
48
56
# Delete any leftover BUILD files from the Makefile build, which would interfere
49
57
# with Bazel parsing.
50
58
MAKEFILE_DOWNLOAD_DIR=tensorflow/contrib/makefile/downloads
173
181
fi
174
182
175
183
if [ " $TF_NEED_JEMALLOC " == " 1" ]; then
176
- sed -i -e " s/WITH_JEMALLOC = False/WITH_JEMALLOC = True/" tensorflow/core/platform/default/build_config.bzl
184
+ sed_hyphen_i -e " s/WITH_JEMALLOC = False/WITH_JEMALLOC = True/" tensorflow/core/platform/default/build_config.bzl
177
185
else
178
- sed -i -e " s/WITH_JEMALLOC = True/WITH_JEMALLOC = False/" tensorflow/core/platform/default/build_config.bzl
186
+ sed_hyphen_i -e " s/WITH_JEMALLOC = True/WITH_JEMALLOC = False/" tensorflow/core/platform/default/build_config.bzl
179
187
fi
180
188
181
189
while [ " $TF_NEED_GCP " == " " ]; do
@@ -202,10 +210,10 @@ if [ "$TF_NEED_GCP" == "1" ]; then
202
210
fi
203
211
204
212
# Update Bazel build configuration.
205
- sed -i -e " s/WITH_GCP_SUPPORT = False/WITH_GCP_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
213
+ sed_hyphen_i -e " s/WITH_GCP_SUPPORT = False/WITH_GCP_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
206
214
else
207
215
# Update Bazel build configuration.
208
- sed -i -e " s/WITH_GCP_SUPPORT = True/WITH_GCP_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
216
+ sed_hyphen_i -e " s/WITH_GCP_SUPPORT = True/WITH_GCP_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
209
217
fi
210
218
211
219
while [ " $TF_NEED_HDFS " == " " ]; do
@@ -224,10 +232,10 @@ done
224
232
225
233
if [ " $TF_NEED_HDFS " == " 1" ]; then
226
234
# Update Bazel build configuration.
227
- sed -i -e " s/WITH_HDFS_SUPPORT = False/WITH_HDFS_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
235
+ sed_hyphen_i -e " s/WITH_HDFS_SUPPORT = False/WITH_HDFS_SUPPORT = True/" tensorflow/core/platform/default/build_config.bzl
228
236
else
229
237
# Update Bazel build configuration.
230
- sed -i -e " s/WITH_HDFS_SUPPORT = True/WITH_HDFS_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
238
+ sed_hyphen_i -e " s/WITH_HDFS_SUPPORT = True/WITH_HDFS_SUPPORT = False/" tensorflow/core/platform/default/build_config.bzl
231
239
fi
232
240
233
241
# # Enable XLA.
@@ -243,10 +251,10 @@ done
243
251
244
252
if [ " $TF_ENABLE_XLA " == " 1" ]; then
245
253
# Update Bazel build configuration.
246
- sed -i -e " s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = True/" tensorflow/core/platform/default/build_config_root.bzl
254
+ sed_hyphen_i -e " s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = True/" tensorflow/core/platform/default/build_config_root.bzl
247
255
else
248
256
# Update Bazel build configuration.
249
- sed -i -e " s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = False/" tensorflow/core/platform/default/build_config_root.bzl
257
+ sed_hyphen_i -e " s/^WITH_XLA_SUPPORT = [FT].*/WITH_XLA_SUPPORT = False/" tensorflow/core/platform/default/build_config_root.bzl
250
258
fi
251
259
252
260
0 commit comments