Re: gda-buildserver



On Mon, 26 Jun 2000, Rodrigo Moya wrote:
[...]

> perfect! I forgot to tell you the other day that the templates have all
> function names called gda_<provider-name>_..., so another thing the
> script should do when called with the --skels flag is to replace these
> <provider-name> string with the name of the provider. So I would add
> another flag (only valid if used with --skels) to specify the provider
> name (oracle, odbc...).
> 
> But I leave up to you how to do this. These are just ideas.
>

I've attached the diffs to the cvs version that support the following
features:

  * single letter flags have been changed to -f and -o instead of
    --f and --o (-- are usually reserved for long names of flags).

  * -s and --skels flags now create skeletons, but exit after
    creating the skeletons instead of trying to compile the newly
    created empty skeletons.

  * -p flag (example: -p MY_PROVIDER --skels) now replaces provider
    name in source code.  I don't think there's anything that forces
    you to use this flag, but unpredictable things will happen if
    you don't use it with --skels.

I created a new set of skeletons with:

  gda-buildserver -p TEST --skels

Then I tried compiling my empty skeletons with:

  gda-buildserver -o foo -f main-srv.c

but I get errors about gda-TEST.h not being defined.  If I touch
this file, and try to compile, I get a lot of errors about undeclared
items in main-srv.c: 

main-srv.c:21: parse error before `*'
main-srv.c:21: `NULL' undeclared here (not in a function)
main-srv.c:21: warning: data definition has no type or storage class
main-srv.c:22: parse error before `server_impl_functions'
main-srv.c:24: `gda_TEST_connection_new' undeclared here (not in a
function)
main-srv.c:24: initializer element for `server_impl_functions' is not
constant
main-srv.c:25: `gda_TEST_connection_open' undeclared here (not in a
function)
main-srv.c:25: warning: excess elements in scalar initializer after
`server_impl_functions'
main-srv.c:26: `gda_TEST_connection_close' undeclared here (not in a
function)
main-srv.c:26: warning: excess elements in scalar initializer after
`server_impl_functions'
main-srv.c:27: `gda_TEST_connection_begin_transaction' undeclared here
(not in a function)
main-srv.c:27: warning: excess elements in scalar initializer after
`server_impl_functions'
main-srv.c:28: `gda_TEST_connection_commit_transaction' undeclared here
(not in a function)
main-srv.c:28: warning: excess elements in scalar initializer after
`server_impl_functions'

and so on with more errors...

Cheers,

--
Brian Jepson * (bjepson@jepstone.net)  *  http://www.jepstone.net/

*** gda-buildserver.in.orig	Tue Jun 27 22:11:21 2000
--- gda-buildserver.in	Tue Jun 27 22:12:11 2000
***************
*** 16,25 ****
  usage()
  {
  	cat <<EOF
! Usage: gda-buildserver [OPTIONS] --o target -f object_files
  Options:
! 	[--skels]     Generate server implementation skeletons
! 	[--version]   Display script version
  EOF
  
  	exit $1
--- 16,25 ----
  usage()
  {
  	cat <<EOF
! Usage: gda-buildserver [OPTIONS] -o target -f object_files
  Options:
!   [-p PROVIDER --skels] Generate server implementation skeletons for PROVIDER
!   [--version]           Display script version
  EOF
  
  	exit $1
***************
*** 29,35 ****
  {
  	for tmpl in ${TMPL_C_FILES} ${TMPL_H_FILES}
  	do
! 		if ! `cp ${TEMPLATES_DIR}/${tmpl}.tmpl ./${tmpl}`
  		then
  			echo "$0: error creating file ${tmpl}"
  			exit 1
--- 29,35 ----
  {
  	for tmpl in ${TMPL_C_FILES} ${TMPL_H_FILES}
  	do
! 		if ! `sed -e "s/<provider-name>/${ARG_PROVIDER}/g" ${TEMPLATES_DIR}/${tmpl}.tmpl > ./${tmpl}`
  		then
  			echo "$0: error creating file ${tmpl}"
  			exit 1
***************
*** 48,61 ****
  while test $# -gt 0
  do
  	case "$1" in
! 	--o)
  		current_arg="ARG_TARGET"
  		;;
! 	--f)
  		current_arg="ARG_FILES"
  		;;
  	--skels)
  		buildskels
  		;;
  	--version)
  		echo "gda-buildserver version ${version}"
--- 48,71 ----
  while test $# -gt 0
  do
  	case "$1" in
! 	-o)
  		current_arg="ARG_TARGET"
  		;;
! 	-p)
! 		ARG_PROVIDER=$2
! 		shift
! 		echo ${ARG_PROVIDER}
! 		;;
! 	-f)
  		current_arg="ARG_FILES"
  		;;
+ 	-s)
+ 		buildskels
+ 		exit
+ 		;;
  	--skels)
  		buildskels
+ 		exit
  		;;
  	--version)
  		echo "gda-buildserver version ${version}"
***************
*** 78,99 ****
  done
  
  # Set variables
! INCLUDE_FLAGS="-I$(prefix)/include/gda @GNOME_INCLUDEDIR@"
! IDL_FLAGS="$(shell $(GNOME_CONFIG) --cflags idl))"
! LIBS_FLAGS="@GNORBA_LIBS@ @INTLLIBS@ -L$(prefix)/lib -lgda-srv"
  GENERATED_C_FILES="gda-skels.c gda-common.c"
  GENERATED_O_FILES="gda-skels.o gda-common.o"
  GENERATED_FILES="$GENERATED_C_FILES gda-stubs.c gda.h"
  
  # Generate and compile ORBit files
! if ! `orbit-idl -I${datadir}/idl $(IDL_FLAGS) ${datadir}/idl/gda.idl`
  then
  	echo "$0: error compiling IDL files"
  	exit 1
  fi
  for f in ${GENERATED_C_FILES}
  do
! 	if ! `$CC $(INCLUDE_FLAGS) -c $f`
  	then
  		echo "$0: error compiling $f"
  		exit 1
--- 88,109 ----
  done
  
  # Set variables
! INCLUDE_FLAGS="-I${prefix}/include/gda @GNOME_INCLUDEDIR@"
! IDL_FLAGS=`${GNOME_CONFIG} --cflags idl`
! LIBS_FLAGS="@GNORBA_LIBS@ @INTLLIBS@ -L${prefix}/lib -lgda-server -lgda-common"
  GENERATED_C_FILES="gda-skels.c gda-common.c"
  GENERATED_O_FILES="gda-skels.o gda-common.o"
  GENERATED_FILES="$GENERATED_C_FILES gda-stubs.c gda.h"
  
  # Generate and compile ORBit files
! if ! `orbit-idl -I${datadir}/idl ${IDL_FLAGS} ${datadir}/idl/gda.idl`
  then
  	echo "$0: error compiling IDL files"
  	exit 1
  fi
  for f in ${GENERATED_C_FILES}
  do
! 	if ! `$CC ${INCLUDE_FLAGS} -c $f`
  	then
  		echo "$0: error compiling $f"
  		exit 1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]