STACKMGMT_EXECS=( $STACKMGMT_EXEC_installed ../stackManagement/release/example_diameter_stackManagement ../stackManagement/debug/example_diameter_stackManagement )
# Dynamic library:
-DYNLIB_installed=/usr/local/lib/libanna_dynamicLauncherProcedure.so
-DYNLIBS=( $DYNLIB_installed ../../../dynamic/launcher/default/release/libanna_dynamicLauncherProcedure.so ../../../dynamic/launcher/default/debug/libanna_dynamicLauncherProcedure.so )
+#DYNLIB_installed=/usr/local/lib/libanna_dynamicLauncherProcedure.so
+#DYNLIBS=( $DYNLIB_installed ../../../dynamic/launcher/default/release/libanna_dynamicLauncherProcedure.so ../../../dynamic/launcher/default/debug/libanna_dynamicLauncherProcedure.so )
#############
# FUNCTIONS #
0> launcher.trace
rm -f counters/* test-reports/*
# Execution line:
-export LD_LIBRARY_PATH=\$PWD
+export LD_LIBRARY_PATH=\$PWD/dynlibs
./\$EXE --services services.xml --cntDir counters --tmDir test-reports $other &
echo \$! > .pid
EOF
done
[ -z "$available" ] && _exit "Anna Diameter Launcher (ADML) is not installed neither linked. See README.md (Install section)."
+# Dynamic library variant:
+dynlib_variant=
+[ -f ./release/example_diameter_launcher ] && dynlib_variant=release
+[ -f ./debug/example_diameter_launcher ] && dynlib_variant=debug
+[ -z "$dynlib_variant" ] && _exit "Unknown dynamic library variant"
+
# Dictionary creation:
available=
for STACKMGMT_EXEC in ${STACKMGMT_EXECS[@]}; do
STACKMGMT_EXEC=`readlink -f $STACKMGMT_EXEC`
# Dynamic library:
-available=
-for DYNLIB in ${DYNLIBS[@]}; do
- echo -n "Looking dynamic library at '$DYNLIB' ... "
- [ -x $DYNLIB ] && { available=yes ; echo "available !" ; break ; }
- echo "not found"
-done
-[ -z "$available" ] && _exit "Anna Diameter Launcher Dynamic Procedure Library (ADML) is not installed neither linked. See README.md (Install section)."
+#available=
+#for DYNLIB in ${DYNLIBS[@]}; do
+# echo -n "Looking dynamic library at '$DYNLIB' ... "
+# [ -x $DYNLIB ] && { available=yes ; echo "available !" ; break ; }
+# echo "not found"
+#done
+#[ -z "$available" ] && _exit "Anna Diameter Launcher Dynamic Procedure Library (ADML) is not installed neither linked. See README.md (Install section)."
[ ! -d $SETUPS_DIR ] && _exit "Diameter stacks not found ($SETUPS_DIR)."
mkdir -p $DPATH/DTDs
mkdir -p $DPATH/counters
mkdir -p $DPATH/test-reports
-cp $DYNLIB $DPATH
+
+# Dynamic libs:
+mkdir -p $DPATH/dynlibs
+cd ../../../dynamic/launcher
+DYNLIBS=( $(find . -name "*.so") )
+for dl in ${DYNLIBS[@]}
+do
+ dir=$(dirname $dl | xargs dirname)
+ mkdir -p $DPATH/dynlibs/$dir
+ cp $dir/$dynlib_variant/*.so $DPATH/dynlibs/$dir
+done
+cd - >/dev/null
+cp ./resources/scripts/select_dynlib.sh $DPATH/dynlibs/select.sh
+cd $DPATH/dynlibs
+ln -s default/libanna_dynamicLauncherProcedure.so
+cd - >/dev/null
[ "$option" = "b" ] && mkdir -p $DPATH/services
ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml
cd - >/dev/null
+if [ "$option" = "s" ]
+then
+ cd $DPATH
+ ln -s services_example services
+ mv run.sh .run-one.sh
+ mv run_all.sh run.sh
+ mv operation.sh .operation-one.sh
+ mv operation_all.sh operation.sh
+ rm dictionary.xml
+ cd - >/dev/null
+fi
+
# Help:
echo
echo "Go to '$DPATH' and see README file"
$DEPLOY_SCR b $target/ADML-serverGx
$DEPLOY_SCR b $target/ADML-serverRx
echo "Configuring ..."
- cd $target/ADML-st-client
- ln -s services_example services
- mv run.sh .run-one.sh
- mv run_all.sh run.sh
- mv operation.sh .operation-one.sh
- mv operation_all.sh operation.sh
- rm dictionary.xml
- cd - >/dev/null
+# cd $target/ADML-st-client
+# ln -s services_example services
+# mv run.sh .run-one.sh
+# mv run_all.sh run.sh
+# mv operation.sh .operation-one.sh
+# mv operation_all.sh operation.sh
+# rm dictionary.xml
+# cd - >/dev/null
cd $target/ADML-serverGx
echo s | ./configure.sh >/dev/null
sed -i 's/3868/3869/' services.xml
--- /dev/null
+#!/bin/bash
+echo
+echo "------------------------------------------------"
+echo "Dynamic library selection for launcher procedure"
+echo "------------------------------------------------"
+cd $(dirname $0)
+option=$1
+rm -f libanna_dynamicLauncherProcedure.so
+if [ -z "$option" ]
+then
+ echo " (you could provide directly the path to the .so file)"
+ echo
+ echo "Available options:"
+ tmpfile=$(mktemp)
+ find . -name "*.so" > $tmpfile
+ echo
+ for line in $(cat $tmpfile); do echo " $line" ; done
+ dflt=$(grep "^./default/" $tmpfile)
+ echo
+ echo -n "Paste your selection [$dflt]: "
+ read option
+ [ -z "$option" ] && option=$dflt
+ rm $tmpfile
+fi
+
+[ ! -f $option ] && { echo -e "\nInvalid file !\n" ; exit 1 ; }
+ln -sf $option libanna_dynamicLauncherProcedure.so
+echo
+echo "Library enabled"
+echo
+