Friday 12 November 2010

script to compile external function on AIX to link in JDE functions

I use the script below to compile an OSA program on AIX for 812 release.  This should be pasted into a ksh script and made executable.

You can then run it as you JDE user, it should find most things dynamically. Actually, there are heaps of paths that you are going to need to change.

#!/usr/bin/ksh
if [ $# -ne 3 ]
  then
    echo "Your parameter count of $# is wrong"
    echo "USAGE $0 <source module> <FULL PACKAGE> <output filename>"
    echo "Note this is WITHOUT extensions for the sourcefilename"
    echo "eg:  $0 CUBOutput DV9FA libCUBOSA.sl"
    exit
fi

SOURCE=$1
FULLPACKAGE=$2
OUTPUT=$3

cc -qalign=natural -qflag=I:I -c -O2 -DKERNEL -DPRODUCTION_VERSION -DNATURAL_ALIGNMENT -DUSESPECIALGPA4BB -DUSETABLEHEADERFROMINCLUDEA -I/apps/j
deapp/e812/packages/${FULLPACKAGE}/include/ -I/apps/jdeapp/e812/system/include -I/apps/jdeapp/e812/system/include/xml -I/apps/jdeapp/e812/system
/includev $SOURCE.c -o $SOURCE.o
if [ $? -ne 0 ]
  then
    echo "Compilation failed, please fix errors and try again"
    exit
fi
ls -l $SOURCE.o

ld -b32 /lib/crt0.o -bpT:0x10000000 -bpD:0x20000000  -bI:/apps/jdeapp/e812/system/bin32/funclist.imp -bM:SRE -bexpall -brtl -lc -lm -bnoentry -L
. -L/apps/jdeapp/e812/system/lib -ljdelib -lcallobj -lerror -lgentext -ljdb -ljde_erk -ljdecache -ljdeddapi -ljdeknet -ljderepl -ljdeschr -ljdes
ec -ljdespec -ljdetam -llanguage -lmisc -lpackage -lport -lqueueknl -lruntime -lsrc -ltransmon -lube -lworkflow -ljdesaw -ljdenet -lowver -ljdeu
nicode -lv_verify -lxerceswrapper -ltextsearch -lxmlpublisher -bloadmap:loadmap -o $OUTPUT $SOURCE.o -L/usr/vac/lib -lxlopt -L/usr/lib/threads -
lpthreads -lc
if [ $? -ne 0 ]
  then
    echo "Linking failed, please fix errors and try again"
    exit
fi

1 comment:

Unknown said...

I read your blog.I thought it was great.. Hope you have a great day. God bless.

Books and Manual
www.imarksweb.org