Building perl and libs on HP-UX

runrig on 2008-03-14T21:53:01

I must keep this somewhere in one place semi-permanent...boring stuff plus hoops to jump through to get XML(LibXML and LibXSLT), and DBD::Oracle and DBD::Sybase working on HP-UX (I have no explanation for having to run 'perl Makefile.PL' over and over). I don't remember if I needed to use 'chatr' to change some of the shared libraries to get them to load:



---------------------------------------- Notes on Building perl 5.10.0 and various libraries on HP-UX (11.11)

All of the following was installed under /users/foo Adjust all prefix parameters accordingly to install in another directory (or remove to install in default location). ----------------------------------------

First perl itself:

> which cc must be /opt/softbench/bin/cc compiler (default HP /usr/bin/cc compiler will not work) (gcc compiler can work, but everything here was done with softbench compiler).

# Add prefix to install in non-standard path sh Configure -Dprefix=/users/foo

keep default of building non-threaded perl, but add '-lcl -lpthread' to beginning of libraries to include. (So that DBD::Oracle will build dynamically later).

make make test make install

---------------------------------------- XML::LibXML and XML::LibXSLT: ---------------------------------------- First install shared libraries:

install binaries of zlib(libz), iconv, and gettext libraries, unless you really feel like building them (install in local directory if necessary..e.g./users/foo/lib and include files in /users/foo/include).

Build source for libxml library: Set env variables: export CC=cc export LDFLAGS="-L/users/foo/lib -I/users/foo/include"

./configure --prefix=/users/foo --without-threads --without-thread-alloc --with-iconv=/users/foo --with-zlib=/users/foo

make make install

# Fix permission on config info file: chmod +x /users/foo/bin/xml2-config

---------------------------------------- Build source for libxslt library: Set env variables: export CC=cc export LDFLAGS="-L/users/foo/lib -I/users/foo/include"

./configure --prefix=/users/foo make make install

# Fix permission on config info file: chmod +x /users/foo/bin/xslt-config

---------------------------------------- Build source for XML::LibXML::Common: perl Makefile.PL (doesn't always work first time..repeat until Makefile is created)

make make test make install ---------------------------------------- Build source for XML::NamespaceSupport:

perl Makefile.PL make make test make install ---------------------------------------- Build source for XML::SAX:

perl Makefile.PL make make test make install ---------------------------------------- Build source for XML::LibXML:

perl Makefile.PL (repeat until Makefile is created) make make test make install ---------------------------------------- Build source for XML::LibXSLT:

Change the following lines (this might be fixed in a future version): #xsystem("$Config{make} $file test 'OTHERLDFLAGS=$opt'"); xsystem("$Config{make} $file test");

#$result = try_link(<<"SRC", $libs); $result = try_link(<<"SRC", undef);

perl Makefile.PL LIBS=-L/users/foo/lib INC="-I/users/foo/include -I/users/foo/include/libxml2" make make test (a couple of tests, e.g. exslt tests, will fail, install exslt library if you need exslt) make install ---------------------------------------- Build source for DBI

perl Makefile.PL make make test (many tests are skipped) make install ---------------------------------------- Build source for DBD::Oracle (1.20)

perl Makefile.PL

edit Makefile: # Look for $(LD) -Wl,+b"$(LD_RUN_PATH)" $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \ # Remove "-Wl," $(LD) +b"$(LD_RUN_PATH)" $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \

make make test (many 'connects' fail unless you set env vars for a test db) (many charset tests skipped on old versions of Oracle) make install ---------------------------------------- Build source for DBD::Sybase (1.08)

Edit Sybase.pm: # Look for: sub dl_load_flags { if($^O eq 'aix') { 0x00 } else { 0x01 }} # Change to: sub dl_load_flags { if($^O eq 'aix') { 0x00 } else { 0x00 }}

update: patch to display line numbers on RaiseError: *** ../DBD-Sybase-1.08/dbdimp.c Thu Apr 19 11:31:19 2007 --- dbdimp.c Thu Jun 19 14:09:45 2008 *************** *** 545,550 **** --- 545,551 ---- else retcode = CS_SUCCEED;

+ sv_catpv(DBIc_ERRSTR(imp_dbh), " "); return retcode; } else { if(srvmsg->msgnumber) {

perl Makefile.PL (prompts for test server/db and user/passwd) make make test make install