if [ "$arg_preload_libust" = "1" ];
then
- if [ -n "${LIBUST_PATH%libust.so}" ] ; then
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${LIBUST_PATH%libust.so}"
+ if [ -n "${LIBUST_PATH%libust.so}" ];
+ then
+ if [ -n "$LD_LIBRARY_PATH" ];
+ then
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${LIBUST_PATH%libust.so}"
+ else
+ export LD_LIBRARY_PATH="${LIBUST_PATH%libust.so}"
+ fi
+ fi
+ if [ -n "$LIBUST_PATH" ];
+ then
+ if [ -n "$LD_PRELOAD" ];
+ then
+ export LD_PRELOAD="$LD_PRELOAD:$LIBUST_PATH"
+ else
+ export LD_PRELOAD="$LIBUST_PATH"
+ fi
fi
- export LD_PRELOAD="$LD_PRELOAD:$LIBUST_PATH"
fi
- if [ "$arg_ld_std_ust" = "1" ];
+ if [ "$arg_ld_std_ust" = "1" ] && [ -n "${LIBUST_PATH%libust.so}" ];
then
- if [ -n "$${LIBUST_PATH%libust.so}" ] ; then
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${LIBUST_PATH%libust.so}"
+ if [ -n "$LD_LIBRARY_PATH" ];
+ then
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${LIBUST_PATH%libust.so}"
+ else
+ export LD_LIBRARY_PATH="${LIBUST_PATH%libust.so}"
fi
fi
- if [ "$arg_preload_malloc" = "1" ];
+ if [ "$arg_preload_malloc" = "1" ] && [ -n "$LIBMALLOCWRAP_PATH" ];
then
- export LD_PRELOAD="$LD_PRELOAD:$LIBMALLOCWRAP_PATH"
+ if [ -n "$LD_PRELOAD" ];
+ then
+ export LD_PRELOAD="$LD_PRELOAD:$LIBMALLOCWRAP_PATH"
+ else
+ export LD_PRELOAD="$LIBMALLOCWRAP_PATH"
+ fi
fi
- if [ "$arg_preload_fork" = "1" ];
+ if [ "$arg_preload_fork" = "1" ] && [ -n "$LIBINTERFORK_PATH" ];
then
- export LD_PRELOAD="$LD_PRELOAD:$LIBINTERFORK_PATH"
+ if [ -n "$LD_PRELOAD" ];
+ then
+ export LD_PRELOAD="$LD_PRELOAD:$LIBINTERFORK_PATH"
+ else
+ export LD_PRELOAD="$LIBINTERFORK_PATH"
+ fi
fi
# Execute the command