@@ -431,6 +431,10 @@ can be built that way. \
431431}
432432STDOUT . WriteLine ( " " + arg . arg + pad + word_wrap_and_indent ( max_width + 5 , arg . helptext ) ) ;
433433}
434+ STDOUT . WriteBlankLines ( 1 ) ;
435+ STDOUT . WriteLine ( "Some influential environment variables:" ) ;
436+ STDOUT . WriteLine ( " CFLAGS C compiler flags" ) ;
437+ STDOUT . WriteLine ( " LDFLAGS linker flags" ) ;
434438WScript . Quit ( 1 ) ;
435439}
436440
@@ -3207,6 +3211,8 @@ function toolset_setup_linker()
32073211
32083212function toolset_setup_common_cflags ( )
32093213{
3214+ var envCFLAGS = WshShell . Environment ( "PROCESS" ) . Item ( "CFLAGS" ) ;
3215+
32103216// CFLAGS for building the PHP dll
32113217DEFINE ( "CFLAGS_PHP" , "/D _USRDLL /D PHP7DLLTS_EXPORTS /D PHP_EXPORTS \
32123218/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=" + WINVER ) ;
@@ -3218,6 +3224,10 @@ function toolset_setup_common_cflags()
32183224/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 \
32193225/D _USE_MATH_DEFINES" ) ;
32203226
3227+ if ( envCFLAGS ) {
3228+ ADD_FLAG ( "CFLAGS" , envCFLAGS ) ;
3229+ }
3230+
32213231if ( VS_TOOLSET ) {
32223232ADD_FLAG ( "CFLAGS" , " /FD " ) ;
32233233
@@ -3368,6 +3378,8 @@ function toolset_setup_intrinsic_cflags()
33683378
33693379function toolset_setup_common_ldlags ( )
33703380{
3381+ var envLDFLAGS = WshShell . Environment ( "PROCESS" ) . Item ( "LDFLAGS" ) ;
3382+
33713383// General DLL link flags
33723384DEFINE ( "DLL_LDFLAGS" , "/dll " ) ;
33733385
@@ -3376,6 +3388,10 @@ function toolset_setup_common_ldlags()
33763388
33773389DEFINE ( "LDFLAGS" , "/nologo " ) ;
33783390
3391+ if ( envLDFLAGS ) {
3392+ ADD_FLAG ( "LDFLAGS" , envLDFLAGS ) ;
3393+ }
3394+
33793395// we want msvcrt in the PHP DLL
33803396ADD_FLAG ( "PHP_LDFLAGS" , "/nodefaultlib:libcmt" ) ;
33813397
0 commit comments