Merged build_config branch into trunk:
[debian/gnuradio] / run_tests.sh.in
index 1562eeec6dc3ca2cfac9365c2759f45ea981013c..35e24d794ee9825851ec1a6c3d4030a016d42f88 100644 (file)
@@ -75,50 +75,56 @@ do
     fi
 done
 
-# Add the grlibdir paths to the front of any PATH variable
-if [ "$grlibdir" != "" ]
-then
-    # For OS/X
-    if [ "$DYLD_LIBRARY_PATH" = "" ]
-    then
-       DYLD_LIBRARY_PATH=$grlibdir
-    else
-       DYLD_LIBRARY_PATH=$grlibdir:$DYLD_LIBRARY_PATH
-    fi
-
-    # For Win32
-    if [ "$PATH" = "" ]
-    then
-       PATH=$grlibdir
-    else
-       PATH=$grlibdir:$PATH
-    fi
-fi
+# Add 'mylibdir' to the start of the library load path, to get local
+# (to this component) created libraries
 
 # Where to find pre-installed libraries
 withlibdirs=@with_LIBDIRPATH@
 
-# Add the withdirs paths to the end of any PATH variable
-if [ "$withlibdirs" != "" ]
-then
-    # For OS/X
+case "@host_os@" in
+  darwin*)
+    # Special Code for executing on Darwin / Mac OS X only
     if [ "$DYLD_LIBRARY_PATH" = "" ]
     then
-       DYLD_LIBRARY_PATH=$withlibdirs
+       DYLD_LIBRARY_PATH=$mylibdir
     else
+       DYLD_LIBRARY_PATH=$mylibdir:$DYLD_LIBRARY_PATH
+    fi
+    # DYLD_LIBRARY_PATH will not be empty now
+    # Add the grlibdir paths to the front of any library load variable
+    if [ "$grlibdir" != "" ]
+    then
+       DYLD_LIBRARY_PATH=$grlibdir:$DYLD_LIBRARY_PATH
+    fi
+    # Add the withdirs paths to the end of any library load variable
+    if [ "$withlibdirs" != "" ]
+    then
        DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$withlibdirs
     fi
-
-    # For Win32
+    export DYLD_LIBRARY_PATH
+    ;;
+  cygwin*|win*|mingw*)
+    # Special Code for executing on Win32 variants only
     if [ "$PATH" = "" ]
     then
-       PATH=$withlibdirs
+       PATH=$mylibdir
     else
+       PATH=$mylibdir:$PATH
+    fi
+    # PATH will not be empty now
+    # Add the grlibdir paths to the front of any library load variable
+    if [ "$grlibdir" != "" ]
+    then
+       PATH=$grlibdir:$PATH
+    fi
+    # Add the withdirs paths to the end of any library load variable
+    if [ "$withlibdirs" != "" ]
+    then
        PATH=$PATH:$withlibdirs
     fi
-fi
-
-export DYLD_LIBRARY_PATH
+    export PATH
+    ;;
+esac
 
 # Don't load user or system prefs
 GR_DONT_LOAD_PREFS=1