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}"
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 ]"
70 echo " --config | config | conf [ options ]"
71 echo " Congigure backend. Options are passed to ./configure script."
73 echo " Compile backend."
74 echo " --install | install | inst"
75 echo " Install backend to \"$INSTALL_DIR\"."
76 echo " --clean | clean"
77 echo " Clean backend."
79 echo " Show a list of backend source code files."
87 if [ -e './autogen.sh' ]; then
88 backend_print_title
"AUTOGEN"
93 backend_print_title
"CONFIGURE"
94 .
/configure
--prefix="$INSTALL_DIR" --enable-debug=yes "$@"
100 if [ ! -e "Makefile" ]; then
103 generic_make backend_print_title
"$@"
109 backend_print_title
"INSTALL"
116 generic_clean backend_print_title
120 # Prints a list of backend sources and headers.
124 backend_print_title
"SOURCES"
125 echo -n "$BACKEND""_SOURCES = "
126 cd "$BACKEND_DIR/$BACKEND"
127 find |
egrep '\.[ch]$' |
sort | scripts_src_pad
131 backend_print_title
()
133 print_title
`echo "$BACKEND" | tr a-z A-Z `" $1"