Article 11526 of comp.lang.perl:
Path: ig.co.uk!demon!uknet!pipex!howland.reston.ans.net!agate!ames!cronkite.cisco.com!diablo.cisco.com!dsidlo
From: dsidlo@diablo.cisco.com (David Sidlo)
Newsgroups: comp.lang.perl
Subject: ORAPERL on HP-UX
Date: 3 Mar 1994 20:42:31 GMT
Organization: cisco Systems
Lines: 273
Distribution: world
Message-ID: <2l5i3n$1fm@cronkite.cisco.com>
NNTP-Posting-Host: diablo.cisco.com
Keywords: oraperl hp-ux hp perl

Implementation Notes of Oraperl onto "HP-UX A.09.00 U 9000/897"
----------------------------------------------------------------------
from: David Sidlo dsidlo@cisco.com

Copied Oracle Pro*C libraries into a directory on my (HP-UX machine).

Changed make file for Oraperl to Point to the Oracle Pro*C libraries
now located on my HP-machine.

Compiled a Perl V4.0.1.8.

I found the Perl for HP-UX at jaguar.jaguar.cs.utah.edu.

Tried to "make" but about 45 symbols were not found.

Created the following script to find the library files that had the needed
symbols:

        File: find_sym
        !
        !       #!/bin/csh
        !       #
        !
        !       foreach file (*.[ao])
        !
        !               echo --- $file ---
        !               nm $file | grep $1
        !
        !       end
        !
        +-----------------

Once I found the libaries that I needed I added them to the makefile.

In order to create uperl.o I changed perls make file as follows

--- New makefile:
< # uperl.o: $& tperly.o $(obj) hash.o
< #     -ld $(LARGE) $(LDFLAGS) -r $(obj) hash.o perly.o -o uperl.o
< uperl.o: $& tperly.o $(obj) hash.o
<       -ld $(LARGE) -r $(obj) hash.o perly.o -o uperl.o
--- Old makefile:
> # uperl.o: $& perly.o $(obj) hash.o
> #     -ld $(LARGE) $(LDFLAGS) -r $(obj) hash.o perly.o -o uperl.o

I had a problem with sprintf() and handled it with the following change.

--- New config.h
< /* #define    CHARSPRINTF     */
--- Old config.h
> #define       CHARSPRINTF     /**/


I had also created coraperl (oraperl with curses).
I could not find touchline() so I commented the function out of
curses.c

06% diff curses.c curses.c~
127,129c127
< /* 21Feb94 DGS: touchline() not supported
<     US_touchline, 
< */
---
>     US_touchline,
256,258c254
< /* 21Feb94 DGS: touchline() not supported
<     make_usub("touchline",    US_touchline,   usersub, filename); 
< */
---
>     make_usub("touchline",    US_touchline,   usersub, filename);
1133d1128
< /* 21Feb94 DGS: touchline() not supported
1148d1142
< */

After I got a clean compilation, "make test" was successfull.
sql.pl works fine.

- End of File -

I hope this is a help to anyone who wants to use oraperl.
So far I have found oraperl to be an excellent product.
Thanks goes to Kevin Stock!

- David Sidlo -

------------------ My Makefile for OraPerl ------------------------

# Makefile for Oraperl and Coraperl

SHELL=/bin/sh

# Change these to your ORACLE installation directory and Perl source directory
#
ORACLE_HOME     = /disk2/oracle/product/7.0.15
SRC             = /home2/dsidlo/c/perl/perl-4.036
ORACLE_7_LIBS   = /home2/dsidlo/c/oracle-7.lib

LIBHOME=$(ORACLE_7_LIBS)

LDFLAGS=-L$(LIBHOME)

LIBCORE=$(LIBHOME)/libcore.a

LLIBCORE=-lcore -lnlsrtl -lcore -lcv6

LLIBORA=-lora

OSNTAB= $(LIBHOME)/osntab.o

LIBOCIC= $(LIBHOME)/libocic.a

OTHERLIBS= -lcl -lm

LIBSQLNET=$(LIBHOME)/libsqlnet.a
LLIBSQLNET=-lsqlnet

NETLIBS=$(OSNTAB) $(LLIBSQLNET)

TTLIBS= $(NETLIBS) $(LLIBORA) $(LLIBSQLNET)

CLIBS=$(OTHERLIBS)

NDFOPT= $(ORACLE_HOME)/rdbms/lib/kpundf.o 

OCILDLIBS= $(LIBOCIC) $(TTLIBS) $(LLIBCORE)

# end of extract from oracle.mk

ALL_ORA_LDFLAGS = $(LDFLAGS)

# Note the inclusion of NDFOPT in the following. It causes oraperl to
# be linked in non-deferred mode. This is a workround for a bug present
# in both 7.0.12 and 7.0.13. The symptom of this bug is that when oraperl
# processes a select yielding more than 16 columns, the first column
# is processed incorrectly.

ALL_ORA_LIBS = $(NDFOPT) $(OCILDLIBS) $(CLIBS)

# Perl Definitions, taken from $SRC/usub/Makefile
# Don't include the curses libraries here - they go in CURSELIB
#
GLOBINCS = 
LOCINCS = 
LIBS = -lcurses -ltermlib -lndbm -lm

# Oraperl Definitions

# Set DEBUG to -DDEBUGGING, -DPERL_DEBUGGING or leave blank (see orafns.h)
# If it is not blank, uncomment the definition of DBUG_O
#
DEBUG           = -DPERL_DEBUGGING
DBUG_O          = dbug/dbug.o

# Curses libraries, only required if you want to build Coraperl
# You may also need -ltermlib or -ltermcap
#
CURSELIB        = -lcurses

# Row cache size for SELECT statements.
# If you want to change the default, uncomment this and set the value you want
#
#CACHE          = -DCACHE_SIZE=5

# Bind variable padding.
# If you want binding an empty string to provoke an error, uncomment this line.
#
#BIND           = -DNO_BIND_PADDING

# Some system-specific things
#
# If your system library does not include strtoul, uncomment the next line
# STRTOUL       = strtoul.o
#
# If your malloc() returns anything other than a char *, set the appropriate
# type here (don't include the *)
# MALLOC_PTR_TYPE=void
#
# If you are using Perl v3 instead of v4, uncomment the next line
# STR_2MORTAL   = -Dstr_2mortal=str_2static

# Database, username and password to use for testing
#
TESTDATA        = dev sa donttell


#
#       Leave these blank lines so that patches to what is below
#       won't be upset by your changes to the setups above.
#


# From here on, you shouldn't need to change anything. If you do, let me know.

SRCS            = oracle.mus orafns.c getcursor.c colons.c usersub.c \
                  debug.c strtoul.c
OBJS            = oracle.o orafns.o getcursor.o colons.o debug.o $(STRTOUL)
OOBJS           = $(OBJS) usersub.o $(DBUG_O)
COBJS           = $(OBJS) cusersub.o $(DBUG_O)
HDRS            = patchlevel.h orafns.h
DEFS            = $(STRTOL) $(PUTENV) $(STR_2MORTAL) $(DEBUG) $(CACHE) $(BIND)

CFLAGS          = -Idbug -I$(SRC) $(GLOBINCS) $(LOCINCS) $(DEFS)
# CFLAGS                =-I. -O -Aa -D_HPUX_SOURCE +ESsfc +ESlit

oraperl: $(SRC)/uperl.o $(OOBJS)
        $(CC) $(ALL_ORA_LDFLAGS) -o oraperl $(SRC)/uperl.o $(OOBJS) \
        -lm $(ALL_ORA_LIBS) $(LIBS)

coraperl: $(SRC)/uperl.o $(COBJS) $(SRC)/usub/curses.o
        $(CC) $(ALL_ORA_LDFLAGS) -o coraperl \
        $(SRC)/uperl.o $(COBJS) $(SRC)/usub/curses.o \
        -lm $(ALL_ORA_LIBS) $(LIBS) $(CURSELIB)

all:    oraperl coraperl
test:   oraperl
        @oraperl -e '&ora_version'
        @(cd testdir ;                                                        \
          rm -f My-Results ;                                                  \
          echo "Testing oraperl, please wait ..." ;                           \
          for i in *.pl ; do ../oraperl $$i $(TESTDATA) ; done > My-Results ; \
          if cmp -s Standard-Results My-Results ;                             \
          then echo "Test successful" ;                                       \
          else echo "Test failed - compare My-Results with Standard-Results" ;\
          fi; echo)

# We use oraperl although perl would suffice, because we know where it is!

install:        oraperl install.pl
        @./oraperl ./install.pl ${SRC}

cusersub.c:     usersub.c
        @rm -f cusersub.c
        ln usersub.c cusersub.c

cusersub.o:     cusersub.c
        $(CC) -c $(CFLAGS) -DCURSES cusersub.c

oracle.c: $(SRC)/usub/mus oracle.mus
        $(SRC)/usub/mus oracle.mus >oracle.c
        
$(OOBJS) $(COBJS):      $(HDRS)

dbug/dbug.o:
        (cd dbug ; $(MAKE) dbug.o)
        @echo " (back to main directory)"

clean:
        (cd dbug ; $(MAKE) clean)
        @echo " (back to main directory)"
        rm -f nohup.out *.o oracle.c cusersub.c
        rm -f testdir/My-Results listing tags core

realclean clobber:      clean
        (cd dbug ; $(MAKE) clobber)
        (cd doc ; $(MAKE) clobber)
        @echo " (back to main directory)"
        rm -f oraperl coraperl

listing:
        pr -fn Makefile $(HDRS) $(SRCS) >listing

docs:
        (cd doc ; $(MAKE) docs)
        @echo " (back to main directory)"

shar:   clean
        shar -n oraperl-v2 -a -s kstock@encore.com -F -o :Part -l 64    \
                Readme [C-Q]* Row* [S-z]*






