@@ -431,6 +431,10 @@ can be built that way. \
431
431
}
432
432
STDOUT . WriteLine ( " " + arg . arg + pad + word_wrap_and_indent ( max_width + 5 , arg . helptext ) ) ;
433
433
}
434
+ STDOUT . WriteBlankLines ( 1 ) ;
435
+ STDOUT . WriteLine ( "Some influential environment variables:" ) ;
436
+ STDOUT . WriteLine ( " CFLAGS C compiler flags" ) ;
437
+ STDOUT . WriteLine ( " LDFLAGS linker flags" ) ;
434
438
WScript . Quit ( 1 ) ;
435
439
}
436
440
@@ -3207,6 +3211,8 @@ function toolset_setup_linker()
3207
3211
3208
3212
function toolset_setup_common_cflags ( )
3209
3213
{
3214
+ var envCFLAGS = WshShell . Environment ( "PROCESS" ) . Item ( "CFLAGS" ) ;
3215
+
3210
3216
// CFLAGS for building the PHP dll
3211
3217
DEFINE ( "CFLAGS_PHP" , "/D _USRDLL /D PHP7DLLTS_EXPORTS /D PHP_EXPORTS \
3212
3218
/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=" + WINVER ) ;
@@ -3218,6 +3224,10 @@ function toolset_setup_common_cflags()
3218
3224
/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 \
3219
3225
/D _USE_MATH_DEFINES" ) ;
3220
3226
3227
+ if ( envCFLAGS ) {
3228
+ ADD_FLAG ( "CFLAGS" , envCFLAGS ) ;
3229
+ }
3230
+
3221
3231
if ( VS_TOOLSET ) {
3222
3232
ADD_FLAG ( "CFLAGS" , " /FD " ) ;
3223
3233
@@ -3368,6 +3378,8 @@ function toolset_setup_intrinsic_cflags()
3368
3378
3369
3379
function toolset_setup_common_ldlags ( )
3370
3380
{
3381
+ var envLDFLAGS = WshShell . Environment ( "PROCESS" ) . Item ( "LDFLAGS" ) ;
3382
+
3371
3383
// General DLL link flags
3372
3384
DEFINE ( "DLL_LDFLAGS" , "/dll " ) ;
3373
3385
@@ -3376,6 +3388,10 @@ function toolset_setup_common_ldlags()
3376
3388
3377
3389
DEFINE ( "LDFLAGS" , "/nologo " ) ;
3378
3390
3391
+ if ( envLDFLAGS ) {
3392
+ ADD_FLAG ( "LDFLAGS" , envLDFLAGS ) ;
3393
+ }
3394
+
3379
3395
// we want msvcrt in the PHP DLL
3380
3396
ADD_FLAG ( "PHP_LDFLAGS" , "/nodefaultlib:libcmt" ) ;
3381
3397
0 commit comments