--- SConstruct
+++ SConstruct
@@ -151,10 +151,10 @@
                  "Assume a source layout instead of install layout",
                  True),
     )
-
-env = Environment(variables=opts,
-                  tools=('default', 'textfile',),
-                  CPPPATH=['.', ],
-                  )
+extra_environment = { 'ENV': {'PATH': os.environ['PATH'], },}
+if os.environ.get('LD'): extra_environment['LINK'] = os.environ['LD']
+if os.environ.get('LDFLAGS'): extra_environment['LINKFLAGS'] = os.environ['LDFLAGS']
+if os.environ.get('CFLAGS'): extra_environment['CFLAGS'] = os.environ['CFLAGS']
+env = Environment(variables=opts, tools=('default', 'textfile',), CPPPATH=['.', ], **extra_environment)
 
 env.Append(BUILDERS = {
