compile question

[email protected] (Dave Viner) Fri, 30 Mar 2001 17:27:00 -0800
Newsgroups perl.dbi.oracle-oci
Message-ID <[email protected]>
in compiling the OCI.so shared object, the OTHERLDFLAGS contains a -YP
directive and a -Qy directive.  according to my gcc man page these directives
do the following:


       -YP,dirs
              Search the directories dirs, and no others, for li-
              braries  specified with `-l'.  You can separate di-
              rectory entries  in  dirs  from  one  another  with
              colons.

and

       -Qy    Identify the versions of each tool used by the com-
              piler, in a .ident assembler directive in the  out-
              put.


but they are System V Options only.  so for someone like me (a FreeBSD user),
i'm screwed.  i don't know enough about compilers to know if i can get around
these with other directives.  is there an alternative to these?

dave

btw - i'm attaching an initial stab at a patch for bsd.  at least it makes it
to the compilation of the c files.  not wonderous, but something is more than
nothing


-- 
once you're married, you'll understand the importance of fresh produce.
    - tony soprano
bsd.patch1 (text/plain, 3.7 KB)
--- Oracle-OCI-0.01/boot	Fri Mar 30 17:14:41 2001
+++ orig/Oracle-OCI-0.01/boot	Sun Mar 25 13:59:01 2001
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/ksh
 set -x
 
 # ###########################################################################
@@ -12,7 +12,7 @@
 #	the generated Makefile of a *working* DBD::Oracle that
 #	has been *built recently on the same platform*:
 #
-dynamic_lib='OTHERLDFLAGS=>q[ -L${ORACLE_HOME}/lib/ -L${ORACLE_HOME}/rdbms/lib -lclntsh ${ORACLE_HOME}/lib/nautab.o ${ORACLE_HOME}/lib/naeet.o ${ORACLE_HOME}/lib/naect.o ${ORACLE_HOME}/lib/naedhs.o  `cat ${ORACLE_HOME}/lib/ldflags`     -ln8 -lnl8 -lnro8 `cat ${ORACLE_HOME}/lib/ldflags`     -ln8 -lnl8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8 -lmm -lnls8  -lcore8 -lnls8 -lcore8  -lnls8 `cat ${ORACLE_HOME}/lib/ldflags`     -ln8 -lnl8 -lnro8 `cat ${ORACLE_HOME}/lib/ldflags`     -ln8 -lnl8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8   -ltrace8 -lnls8  -lcore8 -lnls8 -lcore8  -lnls8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8 -lnls8  -lcore8 -lnls8 -lcore8  -lnls8   `cat ${ORACLE_HOME}/lib/sysliblist` `if [ -f /usr/lib/libsched.so ] ; then echo -lsched ; else true; fi` -R/opt/SUNWcluster/lib:${ORACLE_HOME}/lib  -YP,:/opt/mysql/mysql/lib:/usr/dt/lib:/opt/SUNWcluster/lib:/usr/ccs/lib:/usr/lib  -Qy -lc -laio -lposix4 -lkstat -lm  -lthread]'
+dynamic_lib='OTHERLDFLAGS=>q[ -L/home/oracle/product/8.1.5/lib/ -L/home/oracle/product/8.1.5/rdbms/lib -lclntsh /home/oracle/product/8.1.5/lib/nautab.o /home/oracle/product/8.1.5/lib/naeet.o /home/oracle/product/8.1.5/lib/naect.o /home/oracle/product/8.1.5/lib/naedhs.o  `cat /home/oracle/product/8.1.5/lib/ldflags`     -ln8 -lnl8 -lnro8 `cat /home/oracle/product/8.1.5/lib/ldflags`     -ln8 -lnl8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8 -lmm -lnls8  -lcore8 -lnls8 -lcore8  -lnls8 `cat /home/oracle/product/8.1.5/lib/ldflags`     -ln8 -lnl8 -lnro8 `cat /home/oracle/product/8.1.5/lib/ldflags`     -ln8 -lnl8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8   -ltrace8 -lnls8  -lcore8 -lnls8 -lcore8  -lnls8 -lclient8 -lvsn8 -lcommon8 -lskgxp8 -lgeneric8 -lnls8  -lcore8 -lnls8 -lcore8  -lnls8   `cat /home/oracle/product/8.1.5/lib/sysliblist` `if [ -f /usr/lib/libsched.so ] ; then echo -lsched ; else true; fi` -R/opt/SUNWcluster/lib:/home/oracle/product/8.1.5/lib  -YP,:/opt/mysql/mysql/lib:/usr/dt/lib:/opt/SUNWcluster/lib:/usr/ccs/lib:/usr/lib  -Qy -lc -laio -lposix4 -lkstat -lm  -lthread]'
 
 #
 # ---	perl regex of OCI* functions for h2xs to skip/ignore:
@@ -45,16 +45,8 @@
 then
 /bin/rm -rf Oracle/OCI/*
 
-# h2xs options:
-#  -d turn debugging on
-#  -O overwrite extensions directory
-#  -n module name
-#  -F additional flags to C preprocessor
-#  -M selects functions and macros to process
-#  -k omit const in XS code even if there in C
-#  -x automatically generate XSUBs
-perl h2xs -d -O -n Oracle::OCI \
-	-F "-I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/rdbms/public -I$ORACLE_HOME/network/public" \
+./h2xs -d -O -n Oracle::OCI \
+	-F "-I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/network/public" \
 	-M "^OCI(?!TypeArrayByName\b|StmtGetBindInfo\b|TypeArrayByRef\b|EnvCallback\b$skip_funcs)" \
 	-k -x \
 	$ORACLE_HOME/rdbms/demo/oci.h \
@@ -76,12 +68,6 @@
 ln -s ../../XSUB.h
 mkdir t && ln -s ../../../connect.t t/connect.t
 
-echo
-echo "Editing h2xs.typemap"
-## remove the ** and make them *
-perl -p -i.bak -w \
-  -e 's/OCITrans\s+\*\*/OCITrans \*/;'  \
-  h2xs.typemap
 
 echo
 echo "Editing OCI.xs..."
@@ -100,7 +86,6 @@
   -e 's/^sword$/sword_status/;'	\
   -e '$types{do{($a=$1)=~tr/\t //d;$a} }++ if m/^\t(\w+[\s\*]*)\s+[\&\s]*\w+$/;'	\
   -e 'END{ open T,">types.dat" or die $!; print T Dumper(\%types); }'	\
-  -e 's/\[]//; ' \
   OCI.xs
 # gdiff -u OCI.xs.bak OCI.xs | grep '^[-+]'