@@ -2610,9 +2610,20 @@ function toolset_setup_compiler()
2610
2610
ERROR ( "Unsupported MS C++ Compiler, VC11 (2011) minimum is required" ) ;
2611
2611
}
2612
2612
2613
- AC_DEFINE ( 'COMPILER' , COMPILER_NAME , "Detected compiler version" ) ;
2614
- DEFINE ( "PHP_COMPILER_SHORT" , VC_VERSIONS_SHORT [ VCVERS ] ) ;
2615
- AC_DEFINE ( 'PHP_COMPILER_ID' , VC_VERSIONS_SHORT [ VCVERS ] , "Compiler compatibility ID" ) ;
2613
+ if ( undefined == COMPILER_NAME ) {
2614
+ var tmp = probe_binary ( PHP_CL ) ;
2615
+ COMPILER_NAME = "MSVC " + tmp + ", untested" ;
2616
+
2617
+ WARNING ( "Using unknown MSVC version " + tmp ) ;
2618
+
2619
+ AC_DEFINE ( 'COMPILER' , COMPILER_NAME , "Detected compiler version" ) ;
2620
+ DEFINE ( "PHP_COMPILER_SHORT" , tmp ) ;
2621
+ AC_DEFINE ( 'PHP_COMPILER_ID' , tmp , "Compiler compatibility ID" ) ;
2622
+ } else {
2623
+ AC_DEFINE ( 'COMPILER' , COMPILER_NAME , "Detected compiler version" ) ;
2624
+ DEFINE ( "PHP_COMPILER_SHORT" , VC_VERSIONS_SHORT [ VCVERS ] ) ;
2625
+ AC_DEFINE ( 'PHP_COMPILER_ID' , VC_VERSIONS_SHORT [ VCVERS ] , "Compiler compatibility ID" ) ;
2626
+ }
2616
2627
} else if ( CLANG_TOOLSET ) {
2617
2628
CLANGVERS = COMPILER_NUMERIC_VERSION ;
2618
2629
@@ -2732,8 +2743,15 @@ function toolset_get_compiler_name()
2732
2743
var version ;
2733
2744
2734
2745
if ( VS_TOOLSET ) {
2746
+ var name = undefined ;
2747
+
2735
2748
version = probe_binary ( PHP_CL ) . substr ( 0 , 5 ) . replace ( '.' , '' ) ;
2736
- return VC_VERSIONS [ version ] ;
2749
+
2750
+ if ( undefined != VC_VERSIONS [ version ] ) {
2751
+ name = VC_VERSIONS [ version ] ;
2752
+ }
2753
+
2754
+ return name ;
2737
2755
} else if ( CLANG_TOOLSET || ICC_TOOLSET ) {
2738
2756
var command = 'cmd /c ""' + PHP_CL + '" -v"' ;
2739
2757
var full = execute ( command + '" 2>&1"' ) ;
0 commit comments