Disable fix for long path on Windows(R) OS

The TEMP file setup is currently unavailable on the Windows(R)
operating system because the RANLIBCOM variable is missing.
For now, restrict the fix to POSIX(TM) operating systems.

Signed-off-by: Quoc Khanh Le <QuocKhanh.Le@arm.com>
Change-Id: Ia347a488efea5eceba9a11bde88fda2dcf88c1d5
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11743
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Ramy Elgammal <ramy.elgammal@arm.com>
diff --git a/SConscript b/SConscript
index 069e090..5763f56 100644
--- a/SConscript
+++ b/SConscript
@@ -153,29 +153,31 @@
 def build_library(name, build_env, sources, static=False, libs=[]):
     cloned_build_env = build_env.Clone()
 
-    #Set up to use temp file for long command when building and linking libraries
-    cloned_build_env['TEMPFILE'] = SCons.Platform.TempFileMunge
+    #The following set up only works for posix system, RANLIBCOM isn't available on win32 HOST_OS
+    if cloned_build_env['HOST_OS'] == 'posix':
+        #Set up to use temp file for long command when building and linking libraries
+        cloned_build_env['TEMPFILE'] = SCons.Platform.TempFileMunge
 
-    #To use temp file for any command, the following pattern should be used:
-    #   env['COMMAND'] = "{$TEMPFILE('$COMMANDSTRING')}"
-    #See: https://github.com/SCons/scons/blob/05f2992377844bbfec9bcd4a9c7f5479c634b91b/SCons/Platform/__init__.py#L147
-    #The commands' string are taken from https://github.com/SCons/scons
-    #The commands' explanations are taken from Scons userguide
+        #To use temp file for any command, the following pattern should be used:
+        #   env['COMMAND'] = "{$TEMPFILE('$COMMANDSTRING')}"
+        #See: https://github.com/SCons/scons/blob/05f2992377844bbfec9bcd4a9c7f5479c634b91b/SCons/Platform/__init__.py#L147
+        #The commands' string are taken from https://github.com/SCons/scons
+        #The commands' explanations are taken from Scons userguide
 
-    #The command line used to compile C++ source file to an object file
-    cloned_build_env['CXXCOM'] = "${TEMPFILE('"+ cloned_build_env['CXXCOM'] + "')}"
-    #The command line used to compile C++ source file to a shared-library object file
-    cloned_build_env['SHCXXCOM'] = "${TEMPFILE('"+ cloned_build_env['SHCXXCOM'] + "')}"
-    #The command line used to generate a static library from object files
-    cloned_build_env['ARCOM'] = "${TEMPFILE('"+ cloned_build_env['ARCOM'] + "')}"
-    #The command line used to link object files into an executable
-    cloned_build_env['LINKCOM'] = "${TEMPFILE('"+ cloned_build_env['LINKCOM'] + "')}"
-    #The command line used to link programs using shared libraries
-    cloned_build_env['SHLINKCOM'] = "${TEMPFILE('"+ cloned_build_env['SHLINKCOM'] + "')}"
-    #The command line used to index a static library archive
-    cloned_build_env['RANLIBCOM'] = "${TEMPFILE('"+ cloned_build_env['RANLIBCOM'] + "')}"
-    #Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files
-    cloned_build_env['TEMPFILEDIR'] = cloned_build_env['build_dir']
+        #The command line used to compile C++ source file to an object file
+        cloned_build_env['CXXCOM'] = "${TEMPFILE('"+ cloned_build_env['CXXCOM'] + "')}"
+        #The command line used to compile C++ source file to a shared-library object file
+        cloned_build_env['SHCXXCOM'] = "${TEMPFILE('"+ cloned_build_env['SHCXXCOM'] + "')}"
+        #The command line used to generate a static library from object files
+        cloned_build_env['ARCOM'] = "${TEMPFILE('"+ cloned_build_env['ARCOM'] + "')}"
+        #The command line used to link object files into an executable
+        cloned_build_env['LINKCOM'] = "${TEMPFILE('"+ cloned_build_env['LINKCOM'] + "')}"
+        #The command line used to link programs using shared libraries
+        cloned_build_env['SHLINKCOM'] = "${TEMPFILE('"+ cloned_build_env['SHLINKCOM'] + "')}"
+        #The command line used to index a static library archive
+        cloned_build_env['RANLIBCOM'] = "${TEMPFILE('"+ cloned_build_env['RANLIBCOM'] + "')}"
+        #Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files
+        cloned_build_env['TEMPFILEDIR'] = cloned_build_env['build_dir']
 
     if env['os'] == 'android' and static == False:
         cloned_build_env["LINKFLAGS"].remove('-pie')
diff --git a/tests/SConscript b/tests/SConscript
index aa5a85a..fe9d687 100644
--- a/tests/SConscript
+++ b/tests/SConscript
@@ -188,25 +188,27 @@
     test_env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS'])
 
 if test_env['validation_tests']:
-    #Set up to use temp file for long command when building and linking libraries
-    test_env['TEMPFILE'] = SCons.Platform.TempFileMunge
+    #The following set up only works for posix system, RANLIBCOM env variable isn't available on win32 HOST_OS
+    if test_env['HOST_OS'] == 'posix':
+        #Set up to use temp file for long command when building and linking libraries
+        test_env['TEMPFILE'] = SCons.Platform.TempFileMunge
 
-    #To use temp file for any command, the following pattern should be used:
-    #   env['COMMAND'] = "{$TEMPFILE('$COMMANDSTRING')}"
-    #See: https://github.com/SCons/scons/blob/05f2992377844bbfec9bcd4a9c7f5479c634b91b/SCons/Platform/__init__.py#L147
-    #The commands' string are taken from https://github.com/SCons/scons
-    #The commands' explanations are taken from Scons userguide
+        #To use temp file for any command, the following pattern should be used:
+        #   env['COMMAND'] = "{$TEMPFILE('$COMMANDSTRING')}"
+        #See: https://github.com/SCons/scons/blob/05f2992377844bbfec9bcd4a9c7f5479c634b91b/SCons/Platform/__init__.py#L147
+        #The commands' string are taken from https://github.com/SCons/scons
+        #The commands' explanations are taken from Scons userguide
 
-    #The command line used to compile C++ source file to an object files
-    test_env['CXXCOM'] = "${TEMPFILE('"+ test_env['CXXCOM'] + "')}"
-    #The command line used to generate a static library from object files
-    test_env['ARCOM'] = "${TEMPFILE('"+ test_env['ARCOM'] + "')}"
-    #The command line used to index a static library archive
-    test_env['RANLIBCOM'] = "${TEMPFILE('"+ test_env['RANLIBCOM'] + "')}"
-    #The command line used to link object files into an executable
-    test_env['LINKCOM'] = "${TEMPFILE('"+ test_env['LINKCOM'] + "')}"
-    #Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files
-    test_env['TEMPFILEDIR'] = test_env['build_dir']
+        #The command line used to compile C++ source file to an object files
+        test_env['CXXCOM'] = "${TEMPFILE('"+ test_env['CXXCOM'] + "')}"
+        #The command line used to generate a static library from object files
+        test_env['ARCOM'] = "${TEMPFILE('"+ test_env['ARCOM'] + "')}"
+        #The command line used to index a static library archive
+        test_env['RANLIBCOM'] = "${TEMPFILE('"+ test_env['RANLIBCOM'] + "')}"
+        #The command line used to link object files into an executable
+        test_env['LINKCOM'] = "${TEMPFILE('"+ test_env['LINKCOM'] + "')}"
+        #Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files
+        test_env['TEMPFILEDIR'] = test_env['build_dir']
 
     arm_compute_validation_framework = test_env.StaticLibrary('arm_compute_validation_framework', Glob('validation/reference/*.cpp') + Glob('validation/*.cpp'), LINKFLAGS=test_env['LINKFLAGS'], CXXFLAGS=test_env['CXXFLAGS'], LIBS= [ arm_compute_test_framework ])
     Depends(arm_compute_validation_framework , arm_compute_test_framework)
diff --git a/tests/framework/SConscript b/tests/framework/SConscript
index 65fd5d5..cca5169 100644
--- a/tests/framework/SConscript
+++ b/tests/framework/SConscript
@@ -75,23 +75,25 @@
 else:
     framework_env.Append(CPPDEFINES = ['MALI_ENABLED'])
 
-#Set up to use temp file for long command when building and linking libraries
-framework_env['TEMPFILE'] = SCons.Platform.TempFileMunge
+#The following set up only works for posix system, RANLIBCOM env variable isn't available on win32 HOST_OS
+if framework_env['HOST_OS'] == 'posix':
+    #Set up to use temp file for long command when building and linking libraries
+    framework_env['TEMPFILE'] = SCons.Platform.TempFileMunge
 
-#To use temp file for any command, the following pattern should be used:
-#   env['COMMAND'] = "{$TEMPFILE('$COMMANDSTRING')}"
-#See: https://github.com/SCons/scons/blob/05f2992377844bbfec9bcd4a9c7f5479c634b91b/SCons/Platform/__init__.py#L147
-#The commands' string are taken from https://github.com/SCons/scons
-#The commands' explanations are taken from Scons userguide
+    #To use temp file for any command, the following pattern should be used:
+    #   env['COMMAND'] = "{$TEMPFILE('$COMMANDSTRING')}"
+    #See: https://github.com/SCons/scons/blob/05f2992377844bbfec9bcd4a9c7f5479c634b91b/SCons/Platform/__init__.py#L147
+    #The commands' string are taken from https://github.com/SCons/scons
+    #The commands' explanations are taken from Scons userguide
 
-#The command line used to compile C++ source file to an object file
-framework_env['CXXCOM'] = "${TEMPFILE('"+ framework_env['CXXCOM'] + "')}"
-#The command line used to generate a static library from object files
-framework_env['ARCOM'] = "${TEMPFILE('"+ framework_env['ARCOM'] + "')}"
-#The command line used to index a static library archive
-framework_env['RANLIBCOM'] = "${TEMPFILE('"+ framework_env['RANLIBCOM'] + "')}"
-#Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files
-framework_env['TEMPFILEDIR'] = framework_env['build_dir']
+    #The command line used to compile C++ source file to an object file
+    framework_env['CXXCOM'] = "${TEMPFILE('"+ framework_env['CXXCOM'] + "')}"
+    #The command line used to generate a static library from object files
+    framework_env['ARCOM'] = "${TEMPFILE('"+ framework_env['ARCOM'] + "')}"
+    #The command line used to index a static library archive
+    framework_env['RANLIBCOM'] = "${TEMPFILE('"+ framework_env['RANLIBCOM'] + "')}"
+    #Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files
+    framework_env['TEMPFILEDIR'] = framework_env['build_dir']
 
 arm_compute_test_framework = framework_env.StaticLibrary('arm_compute_test_framework', files)