@@ -291,6 +291,22 @@ envopt() {
291
291
fi
292
292
}
293
293
294
+ to_llvm_triple () {
295
+ case $1 in
296
+ i686-w64-mingw32) echo i686-pc-windows-gnu ;;
297
+ x86_64-w64-mingw32) echo x86_64-pc-windows-gnu ;;
298
+ * ) echo $1 ;;
299
+ esac
300
+ }
301
+
302
+ to_gnu_triple () {
303
+ case $1 in
304
+ i686-pc-windows-gnu) echo i686-w64-mingw32 ;;
305
+ x86_64-pc-windows-gnu) echo x86_64-w64-mingw32 ;;
306
+ * ) echo $1 ;;
307
+ esac
308
+ }
309
+
294
310
msg " looking for configure programs"
295
311
need_cmd cmp
296
312
need_cmd mkdir
@@ -350,37 +366,40 @@ case $CFG_OSTYPE in
350
366
# instead, msys defines $MSYSTEM which is MINGW32 on i686 and
351
367
# MINGW64 on x86_64.
352
368
CFG_CPUTYPE=i686
353
- CFG_OSTYPE=w64-mingw32
369
+ CFG_OSTYPE=pc-windows-gnu
354
370
if [ " $MSYSTEM " = MINGW64 ]
355
371
then
356
372
CFG_CPUTYPE=x86_64
357
- CFG_OSTYPE=w64-mingw32
358
373
fi
359
374
;;
360
375
376
+ MSYS* )
377
+ CFG_OSTYPE=pc-windows-gnu
378
+ ;;
379
+
361
380
# Thad's Cygwin identifers below
362
381
363
382
# Vista 32 bit
364
383
CYGWIN_NT-6.0)
365
- CFG_OSTYPE=pc-mingw32
384
+ CFG_OSTYPE=pc-windows-gnu
366
385
CFG_CPUTYPE=i686
367
386
;;
368
387
369
388
# Vista 64 bit
370
389
CYGWIN_NT-6.0-WOW64)
371
- CFG_OSTYPE=w64-mingw32
390
+ CFG_OSTYPE=pc-windows-gnu
372
391
CFG_CPUTYPE=x86_64
373
392
;;
374
393
375
394
# Win 7 32 bit
376
395
CYGWIN_NT-6.1)
377
- CFG_OSTYPE=pc-mingw32
396
+ CFG_OSTYPE=pc-windows-gnu
378
397
CFG_CPUTYPE=i686
379
398
;;
380
399
381
400
# Win 7 64 bit
382
401
CYGWIN_NT-6.1-WOW64)
383
- CFG_OSTYPE=w64-mingw32
402
+ CFG_OSTYPE=pc-windows-gnu
384
403
CFG_CPUTYPE=x86_64
385
404
;;
386
405
@@ -466,7 +485,6 @@ opt llvm-assertions 1 "build LLVM with assertions"
466
485
opt debug 1 " build with extra debug fun"
467
486
opt ratchet-bench 0 " ratchet benchmarks"
468
487
opt fast-make 0 " use .gitmodules as timestamp for submodule deps"
469
- opt mingw-cross 0 " cross-compile for win32 using mingw"
470
488
opt ccache 0 " invoke gcc/clang via ccache to reuse object files between builds"
471
489
opt local-rust 0 " use an installed rustc rather than downloading a snapshot"
472
490
opt llvm-static-stdcpp 0 " statically link to libstdc++ for LLVM"
@@ -487,7 +505,6 @@ valopt llvm-root "" "set LLVM root"
487
505
valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
488
506
valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
489
507
valopt android-cross-path " /opt/ndk_standalone" " Android NDK standalone path"
490
- valopt mingw32-cross-path " " " MinGW32 cross compiler path"
491
508
492
509
# Many of these are saved below during the "writing configuration" step
493
510
# (others are conditionally saved).
@@ -501,12 +518,18 @@ valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
501
518
valopt_nosave mandir " ${CFG_PREFIX} /share/man" " install man pages in PATH"
502
519
valopt_nosave release-channel " dev" " the name of the release channel to build"
503
520
521
+ # Temporarily support old triples until buildbots get updated
522
+ CFG_BUILD=$( to_llvm_triple $CFG_BUILD )
523
+ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
524
+ CFG_HOST=$( to_llvm_triple $CFG_HOST )
525
+ CFG_TARGET=$( to_llvm_triple $CFG_TARGET )
526
+
504
527
# On windows we just store the libraries in the bin directory because
505
528
# there's no rpath. This is where the build system itself puts libraries;
506
529
# --libdir is used to configure the installation directory.
507
530
# FIXME: This needs to parameterized over target triples. Do it in platform.mk
508
531
CFG_LIBDIR_RELATIVE=lib
509
- if [ " $CFG_OSTYPE " = " pc-mingw32 " ] || [ " $CFG_OSTYPE " = " w64-mingw32 " ]
532
+ if [ " $CFG_OSTYPE " = " pc-windows-gnu " ]
510
533
then
511
534
CFG_LIBDIR_RELATIVE=bin
512
535
fi
632
655
fi
633
656
634
657
BIN_SUF=
635
- if [ " $CFG_OSTYPE " = " pc-mingw32 " ] || [ " $CFG_OSTYPE " = " w64-mingw32 " ]
658
+ if [ " $CFG_OSTYPE " = " pc-windows-gnu " ]
636
659
then
637
660
BIN_SUF=.exe
638
661
fi
@@ -1100,12 +1123,15 @@ do
1100
1123
1101
1124
if [ ${do_reconfigure} -ne 0 ]
1102
1125
then
1103
- msg " configuring LLVM for $t "
1126
+ # LLVM's configure doesn't recognize the new Windows triples yet
1127
+ gnu_t=$( to_gnu_triple $t )
1128
+
1129
+ msg " configuring LLVM for $gnu_t "
1104
1130
1105
1131
LLVM_TARGETS=" --enable-targets=x86,x86_64,arm,mips"
1106
- LLVM_BUILD=" --build=$t "
1107
- LLVM_HOST=" --host=$t "
1108
- LLVM_TARGET=" --target=$t "
1132
+ LLVM_BUILD=" --build=$gnu_t "
1133
+ LLVM_HOST=" --host=$gnu_t "
1134
+ LLVM_TARGET=" --target=$gnu_t "
1109
1135
1110
1136
# Disable unused LLVM features
1111
1137
LLVM_OPTS=" $LLVM_DBG_OPTS $LLVM_ASSERTION_OPTS --disable-docs --enable-bindings=none"
1119
1145
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.)
1120
1146
# Also note that pthreads works badly on mingw-w64 systems: #8996
1121
1147
case " $CFG_BUILD " in
1122
- (* -mingw32 )
1148
+ (* -windows- * )
1123
1149
LLVM_OPTS=" $LLVM_OPTS --disable-pthreads"
1124
1150
;;
1125
1151
esac
@@ -1269,6 +1295,7 @@ putvar CFG_HOST
1269
1295
putvar CFG_TARGET
1270
1296
putvar CFG_LIBDIR_RELATIVE
1271
1297
putvar CFG_DISABLE_MANAGE_SUBMODULES
1298
+ putvar CFG_ANDROID_CROSS_PATH
1272
1299
putvar CFG_MANDIR
1273
1300
1274
1301
# Avoid spurious warnings from clang by feeding it original source on
0 commit comments