From: Sangeetha <sangeetha.elumalai@timesys.com>
Date: Wed, 6 Aug 2025 15:02:55 +0530

diff --git a/SConscript b/SConscript
index 28105fa..4a7712d 100644
--- a/SConscript
+++ b/SConscript
@@ -2261,18 +2261,26 @@ env.Command(target="include/packet_names.h", source="include/packet_states.h",
 
 env.Textfile(target="include/gpsd_config.h", source=confdefs)
 
+ld_library_path = os.environ.get("LD_LIBRARY_PATH", "")
+
 env.Command(target="libgps/gps_maskdump.c",
             source=["maskaudit.py", "include/gps.h", "include/gpsd.h"],
             action='''
     rm -f $TARGET &&\
         $SC_PYTHON $SOURCE -c "${SRCDIR}" > $TARGET &&\
-        chmod a-w $TARGET''')
+        chmod a-w $TARGET''',
+    ENV={
+        'LD_LIBRARY_PATH': ld_library_path
+    })
 
 env.Command(target="libgps/ais_json.i", source="libgps/jsongen.py",
             action='''\
     rm -f $TARGET &&\
     $SC_PYTHON $SOURCE --ais --target=parser >$TARGET &&\
-    chmod a-w $TARGET''')
+    chmod a-w $TARGET''',
+    ENV={
+        'LD_LIBRARY_PATH': ld_library_path
+    })
 
 
 if env['systemd']:
@@ -2473,7 +2481,10 @@ env.Command('www/hardware.html',
              'www/hardware-tail.html'],
             ['cd %s/www; (cat hardware-head.html && PYTHONIOENCODING=utf-8 '
              '$SC_PYTHON gpscap.py && cat hardware-tail.html) '
-             '> hardware.html' % variantdir])
+             '> hardware.html' % variantdir],
+	    ENV={
+                'LD_LIBRARY_PATH': ld_library_path
+            })
 
 # doc to install in 'docdir'
 docinstall = env.Install(target=installdir('docdir'), source=doc_files)
-- 
2.25.1

