Consultor Eletrônico



Kbase P83929: How to build the standard OpenEdge 4GL client or AppServer with customized objects
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/20/2005
Status: Verified

GOAL:

How to build the standard 4GL client or AppServer with customized objects in OpenEdge 10.x

GOAL:

How to link a new _progres executable to add a C function to it in OpenEdge 10.x

GOAL:

How to add a C function to in OpenEdge 10.x

GOAL:

How to use the OEBUILD in in OpenEdge 10.x

FACT(s) (Environment):

OpenEdge 10.x

FIX:

This steps demonstrate how to add a C function to OpenEdge 10.0x to print the string "Hello World".

1. Open a terminal and invoke a Bourne shell (/bin/sh) on the system where OpenEdge and the supported compiler and operating system is installed

2. Change to user 'root'

3. Set and export the variable DLC to the OpenEdge installation directory
> DLC=/usr/OpenEdge/dlc; export DLC

4. [Optional] Set and export the variable IMAGE to the full pathname and name of the executable to be generated.
By default the new executable _progres will be built in $DLC/oebuild/.
> IMAGE=/tmp/_progres; export IMAGE

5. Make sure that the variable PATH contains the directory to the supported compiler/linker
> echo $PATH

6. Unset the library path variable for your operating system.

> unset LIBPATH (IBM AIX)
OR
> unset SHLIB_PATH (HP-UX)
OR
> unset LD_LIBRARY_PATH (SCO Unixware)


7. Backup the original link options script and 4GL tie-in object.
> cp $DLC/oebuild/make/build_rx.sh $DLC/oebuild/make/build_rx.sh.orig
> cp $DLC/oebuild/obj/hlprodsp.o $DLC/oebuild/obj/hlprodsp.o.orig

8. Create a file named helloworld.c and put this code in it:

#include <stdio.h>
void helloworld (argc, argv)
{
printf("\nHello World\n");
}

9. Compile helloworld.c. (On Linux use gcc, intead cc)
> cc -c -o helloworld.o helloworld.c

10. Edit $DLC/oebuild/hlc/hlprodsp.c to tie in helloworld C functions to the 4GL.
Add the following line above the promsgd("Call Statement Failed"); line:

FUNCTEST("helloworld",helloworld);

11. Compile hlprodsp.c.
> cc -c -o $DLC/oebuild/obj/hlprodsp.o $DLC/oebuild/hlc/hlprodsp.c

12. Edit the build_rx.sh and scroll to the end of it adding a new line referencing the full pathname and name of the helloworld.o object under the $OEBUILD/obj/ut.o \ line
Note: Remember to put the back slash ( \ ) at the end of the line except for the last line in the series of connected parameters to the cc command. If it is the last line then there is no need for the closing slash because there is nothing that will follow.
<path to your helloworld.o>/helloworld.o \

13. Still in the build_rx.sh, look for the environment variable HLC_OBJS and make sure that it is pointing to the correct pathname of the hlprodsp.o object built in step 11.
HLC_OBJS=${HLC_OBJS:=${OEBUILD}/obj/hlprodsp.o}


14. Run the script:
$DLC/oebuild/make/build_rx.sh (The standard 4GL client)
> . $DLC/oebuild/make/build_rx.sh
15. Backup the original executable
> cp $DLC/bin/_progres $DLC/bin/_progres.orig
16. Copy the newly built executable.
> rm -f $DLC/bin/_progres
> cp -f $DLC/oebuild/_progres $DLC/bin/_progres

17. Change permissions to add SUID bit.
> chmod u+s $DLC/bin/_progres

18. Open a new Progress session and use the following code:
.
call helloworld..