#!/bin/sh version=@VERSION@ prefix=@prefix@ exec_prefix=@exec_prefix@ datadir=@datadir@ CC=@CC@ shell=@shell@ TEMPLATES_DIR="${prefix}/share/gda/templates" TMPL_C_FILES="gda-srv-command.c gda-srv-connection.c gda-srv-recordset.c main-srv.c" TMPL_H_FILES="gda-srv.h" usage() { cat </${ARG_PROVIDER}/g" ${TEMPLATES_DIR}/${tmpl}.tmpl > ./${tmpl}` then echo "$0: error creating file ${tmpl}" exit 1 fi done mv gda-srv.h gda-${ARG_PROVIDER}.h echo The following files have been created: echo ${TMPL_C_FILES} gda-${ARG_PROVIDER}.h echo echo Now fill the gaps commented on these files } if test $# -lt 1 then usage 1 1>&2 fi # Read command-line options while test $# -gt 0 do case "$1" in -o) current_arg="" ARG_TARGET=$2 shift ;; -p) current_arg="" ARG_PROVIDER=$2 shift echo ${ARG_PROVIDER} ;; -f) current_arg="ARG_FILES" ;; -s) buildskels exit ;; --skels) buildskels exit ;; --version) echo "gda-buildserver version ${version}" echo "" echo "Copyright (C) The Free Software Foundation, 1998-2001" echo "Software developped by Rodrigo Moya " echo " and Brian Jepson " exit 0 ;; *) if test "$current_arg" = "ARG_FILES" then ARG_FILES="$ARG_FILES $1" fi ;; esac shift done # Set variables INCLUDE_FLAGS="@GDA_PROVIDER_CFLAGS@" LIBS_FLAGS="@GDA_PROVIDER_LIBS@" # Build the server cmd="$CC ${INCLUDE_FLAGS} -o ${ARG_TARGET} ${INCLUDE_FLAGS} ${ARG_FILES} ${LIBS_FLAGS}" echo $cmd if ! `$cmd` then echo "$0: error running $_" exit 1 else echo "Successfully generated provider ${ARG_TARGET}" fi # Clean up rm -f ${GENERATED_FILES} exit 0