7 # Script for automating backend testing.
16 if [[ "$COMMAND" == "" ]]; then
17 echo "Error: You did not give me a command to run!"
22 if [[ "$BACKEND" == "" ]]; then
23 echo "Error: You did not give me backend name!"
28 if [[ "$BACKEND" == "all" ]]; then
30 { while read BACKEND
; do
31 if [ -d "$BACKEND" ]; then
32 "$SCRIPT_DIR/$SCRIPT_NAME" \
33 "$BACKEND" "$COMMAND" "${ARGS[@]:2}"
36 done } < <( ls -1 |
egrep -v "$ALL_BACKENDS_FILTER" )
40 if [ ! -d "$BACKEND_DIR/$BACKEND" ]; then
41 echo "Error: Backend \"$BACKEND\" does not exist!"
45 cd "$BACKEND_DIR/$BACKEND"
48 declare -x PKG_CONFIG_PATH
="$SCRIPT_TMP_DIR:$PKG_CONFIG_PATH"
49 #echo "PKG_CONFIG_PATH: $PKG_CONFIG_PATH"
52 --config|config|conf
) backend_conf
"${ARGS[@]:2}";;
53 --make|
make) backend_make
"${ARGS[@]:2}";;
54 --install|
install|inst
) backend_install
"${ARGS[@]:2}";;
55 --clean|clean
) backend_clean
"${ARGS[@]:2}";;
56 --src|src
) backend_src
"${ARGS[@]:1}";;
57 *) echo "Error: Unknown command \"$COMMAND\"";
66 echo "Usage: $SCRIPT_NAME BACKEND COMMAND [ options ]"
67 echo " $SCRIPT_NAME all COMMAND [ options ]"
69 echo "If BACKEND is all, then COMMAND is executed for all backends"
70 echo "excepth those which match this regex: \"$ALL_BACKENDS_FILTER\"."
73 echo " --config | config | conf [ options ]"
74 echo " Congigure backend. Options are passed to ./configure script."
76 echo " Compile backend."
77 echo " --install | install | inst"
78 echo " Install backend to \"$INSTALL_DIR\"."
79 echo " --clean | clean"
80 echo " Clean backend."
82 echo " Show a list of backend source code files."
90 if [ -e './autogen.sh' ]; then
91 backend_print_title
"AUTOGEN"
96 backend_print_title
"CONFIGURE"
97 .
/configure
--prefix="$INSTALL_DIR" --enable-debug=yes "$@"
103 if [ ! -e "Makefile" ]; then
106 generic_make backend_print_title
"$@"
112 backend_print_title
"INSTALL"
119 generic_clean backend_print_title
123 # Prints a list of backend sources and headers.
127 backend_print_title
"SOURCES"
128 echo -n "$BACKEND""_SOURCES = "
129 cd "$BACKEND_DIR/$BACKEND"
130 find |
egrep '\.[ch]$' |
sort | scripts_src_pad
134 backend_print_title
()
136 print_title
`echo "$BACKEND" | tr a-z A-Z `" $1"