Make sure the 'g++ -print-file-name' code does not break if gcc doesn't know anything about the libstdc++.so file.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 21 Apr 2009 10:55:07 +0100
changeset 4387 dff0992d7cce
parent 4386 2e79cbd62d28
child 4388 fd90dd412e67
Make sure the 'g++ -print-file-name' code does not break if gcc doesn't know anything about the libstdc++.so file.
wscript
--- a/wscript	Tue Apr 21 09:58:58 2009 +0200
+++ b/wscript	Tue Apr 21 10:55:07 2009 +0100
@@ -253,9 +253,10 @@
             env.append_value("LINKFLAGS", "-Wl,--enable-auto-import")
         cxx, = env['CXX']
         p = subprocess.Popen([cxx, '-print-file-name=libstdc++.so'], stdout=subprocess.PIPE)
-        libstdcxx = p.stdout.read().strip()
+        libstdcxx_location = os.path.dirname(p.stdout.read().strip())
         p.wait()
-        conf.env.append_value('NS3_MODULE_PATH', os.path.dirname(libstdcxx))
+        if libstdcxx_location:
+            conf.env.append_value('NS3_MODULE_PATH', libstdcxx_location)
 
     conf.sub_config('src')
     conf.sub_config('utils')