by Paul Beach
IBPhoenix 20th October 2004

If you have any comments regarding this document please send to the author.

1. Software Required

To build Firebird sucessfully on HPUX we are going to need a number of various GNU tools and install them on the HPUX 11 System.

GNU GCC

http://hpux.connect.org.uk/ftp/hpux/Gnu/gcc-3.3.2/gcc-3.3.2-sd-11.00.depot.gz Must use at least GCC 3.3, as there is a known bug in GCC 3.2 in the compiler optimiser that "screws" up string handling.

Runtime Depends on

on your HP11 System as root:

# gunzip /depot_location/the_above_packages
# swinstall -s /depot_location/the_above_packages.depot

GNU autoconf

http://hpux.connect.org.uk/ftp/hpux/Gnu/autoconf-2.59/autoconf-2.59-sd-11.00.depot.gz

There is a problem in the previous version (2.57) in that it couldn't handle gettimeofday properly.

Runtime Depends on

# gunzip /depot_location/the_above_packages
# swinstall -s /depot_location/the_above_packages.depot

OK, that should take care of all the packages we need and their interelated dependencies.

2. Create a top level directory for the Firebird source code

e.g. mkdir /usr/firebird

Then copy firebird-1.5.0.4290.tar to the top level directory and untar it:

# tar -xvf firebird-1.5.0.4290.tar

This will create a directory under /usr/firebird called firebird-1.5.0.4290 You might want to make this something more convenient e.g.:

# mv firebird-1.5.0.4290 firebirdsrc

3. Then create a new user e.g. builder

make the owner and group of /usr/firebird the same as builder:

# chown -R builder /usr/firebird
# chgrp -R users /usr/firebird

4.Login as builder and cd to usr/firebird/firebirdsrc

Then run autoconf:

# autoconf

Its probable that you may see the following error:

configure.in:143: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.in:144: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
configure.in:145: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
# gunzip /depot_location/the_above_packages
# swinstall -s /depot_location/the_above_packages.depot

5. Now run

# autoreconf -vif

It gives a number of autoheader: missing template: errors, not sure how important they are, but running:

# autoconf

Now works without the above error...

6. Configure

# ./configure

This will stop before the end, because it is looking for a file called builds/posix/prefix.hpux Each specific platform type needs its own unique prefix file. Should look something like this (this may take a little time to get correct, so be prepared for modifications whilst you are testing the build)

 #
 # Compiler settings for HPUX 11 (PA-RISC)
 #
 # This file is processed by configure and the output written to
 # gen/make.platform which is included in src directory makefiles
 # before other common make files ie: make.[rules|defaults|shared.variables]
 #

 CXX=@CXX@
 CC=gcc
 LD=@CXX@

 # compile flags for GCC compiler
 PROD_FLAGS= -march=1.1 -pipe -p -fPIC -O3 -MMD -DNDEBUG -DHP11 -DHPUX -DUNIX -D_HPUX_SOURCE
-D_XOPEN_SOURCE_EXTENDED
 DEV_FLAGS=
 #Extra modules needed on this platform during bootstrap
 JRDBOOT_Extra_Files=isc_sync.cpp thd.cpp

 OS_ServerFiles=inet_server.cpp

 # When linking a shared libraray using HP's own linker from g++, make sure that the
 # libray is position independent (fPIC), don't try and link in libcrt0 by using nostartfiles
 # specifically request that g++ passes the -b (shared libary flag to the HPUX linker). For
 # some reason the gcc flag of -shared doesn't work.
 LIB_LINK_OPTIONS:= -fPIC -nostartfiles -Xlinker -b
 # Set the runtime path
 LIB_LINK_RPATH:= -Wl,+b
 # Pass the library name flag +h
 LIB_LINK_SONAME:= -Wl,+h
 EMBED_UTIL_TARGETS=gstat gds_drop gds_relay gsec fb_lock_print
 CLIENT_UTIL_TARGETS=gds_drop gds_delay gstat gsec fbguard fbmgr_bin fb_lock_print

 Physical_IO_Module=unix.cpp

You are also going to need the following: an architecure specific directory for hpux with a makefile,in, and the relevant make files for Classic, SuperServer and Misc e.g. src/install/arch-specific/hpux/makefile.in, along with the super, classic and misc subdirectories

The easiest thing to do is to copy the files used to build linux and we can then modify them as we need to during the build process.

Note: configure.in is the main driver of the build process if you change it for your platform you will need to re-run autoconf. We need to create a specific hpux target in configure.in:

case $target in
*-*-hpux*)
MAKEFILE_PREFIX=hpux
PLATFORM=hpux
AC_DEFINE(hpux)
LOCK_MANAGER_FLG=Y
EDITLINE_FLG=N
SHRLIB_EXT=sl
;;

The generated Makefile to use for building individual elements of Firebird can be found once it has been created in the firebirdsrc diectory.

7. Lets try and build

# gmake > make.log 2>&1

Default is CLassic and with 64bit I/O enabled.

We are looking for errors during the build process, that will effectively halt the build until the code is corrected. This is likely to be different from platform to platform. Some will be generic i.e. effect everybody, whilst some are likely to be very platform specific.

a.

jrd/isc_ipc.cpp
In function void isc_signal2(int,void(*)(),void*,long unsigned int)
Line 727: Error invalid conversion from void(*)() to void(*)(int)

1.5 Line 217: static void isc_signal2(int, SIG_FPTR, void*, ULONG)
1.03 Line 317: static void isc_signal2(int, FPTR_VOID, void*, ULONG)
Common.h Line 466: typedef (*SIG_FPTR) ();

Within the #ifdef hpux Should be:

Common.h Line 466: typedef (*SIG_FPTR) (int);

b.

/usr/ccs/bin/ld: Unsatisfied symbols:
dlclose (code)
dlopen (code)
dlsym (code)
ISC_check_restart (code)
in gen/firebird/bin/gpre_boot

Need patch PHSS_30488 - a number of ld fixes including a number related to the above. Get patch file from the HP IT Resource Center at http://www5.itrc.hp.com/service/home/home.do Put the .tar file onto the HP system, untar, create a depot file and nstall. The above error should now be gone.

c.

/usr/ccs/bin/ld: Unsatisfied symbols:
ISC_check_restart (first referenced in ../temp/boot/.gpre/jrd/isc_ipc.o) (code)

Modify /builds/posix/prefix.hpux and add:

JRDBOOT_Extra_Files=isc_sync.cpp thd.cpp

d.

../src/remote/inet.cpp In function 'port* INET_connect (TExT*, PACKET*, ISC_STATUS*, short unsigned int, SCHAR*, short int)
inet.cpp 1071: error invalid conversion from socklen_t* to int*
inet.cpp 1154: error invalid conversion from socklen_t* to int*
../src/remote/inet.cpp In function 'port* aux_connect (port*, PACKET*, int(*)())
inet.cpp 1611: error invalid conversion from socklen_t* to int*
../src/remote/inet.cpp In function 'port* aux_request (port*, PACKET*, int(*)())
inet.cpp 1722: error invalid conversion from socklen_t* to int*
inet.cpp 1742: error invalid conversion from socklen_t* to int*
../src/remote/inet.cpp In function 'int check_host (port*, TEXT*, TEXT*, passwd)
inet.cpp 1820: error invalid conversion from socklen_t* to int*
../src/remote/inet.cpp In function 'int parse_line (TEXT*, TEXT*, TEXT*, TEXT*)
inet.cpp 2411: error innetgr undeclared (first use this function)
inet.cpp 2411: error (each undeclared identifier is reported once for each function it appears in)
../src/remote/inet.cpp In function 'port* select_accept (port*)
inet.cpp 2590: error invalid conversion from socklen_t* to int*

Oh boy, is this a good one...

On HP-UX 11 defines socklen_t but _uses_ it only when _XOPEN_SOURCE_EXTENDED is defined. If not defined then the test fails, defining socklen_t to 'int' aka BSD. So use -D_XOPEN_SOURCE_EXTENDED in prefix.hpux....

e.

../src/remote/inet.cpp -o ../temp/libfbstatic/remote/inet.o
../src/remote/inet.cpp in function int parse_line (TEXT*, TEXT*, TEXT*, TEXT*)
inet.cpp 2411: error innetgr undeclared (first use this function)
inet.cpp 2411: error (each undeclared identifier is reported once for each function it appears in)

Line 101 inet.cpp

#ifdef DARWIN
extern "C" int innetgr(const char *, const char *, const char *, const char *);
#endif

Change to:

#if (defined DARWIN || defined HPUX)
extern "C" int innetgr(const char *, const char *, const char *, const char *);
#endif

f.

../src/remote/xdr.cpp:46:2 #error Define SWAP_DOUBLE for your platform correctly!
../src/remote/xdr.cpp:962 error ntohl indeclared first use this function
../src/remote/xdr.cpp:962 Each undeclared identifier is reported only once for each function it appears in.
../src/remote/xdr.cpp in function int mem_putlong (XDR*, SLONG*)
../src/remote/xdr.cpp:1060 error htonl undeclared first use this function.

Line 45 xdr.cpp

#if !defined(sparc) && !defined (PowerPc)
#error "Define SWAP_DOUBLE for your platform correctly!"
#endif

Needs to be checked for all supported platforms: simplest way to check, select abs(2.0/3.0) from rdb$database from correct client.

Modified to:

#if !defined(sparc) && !defined (PowerPc) && !defined(hpux)
#error "Define SWAP_DOUBLE for your platform correctly!"
#endif

g.

../src/remote/xdr.cpp in function int mem_getlong (XDR* SLONG*)
../src/remote/xdr.cpp:962 error ntohl undeclared first use this function
../src/remote/xdr.cpp:962 Each undeclared identifier is reported only once for each function it appears in.
../src/remote/xdr.cpp in function int mem_putlong (XDR* SLONG*)
../src/remote/xdr.cpp:1060 error htonl undeclared first use this function.

HP-UX header files for the ntohs and ntohl functions are different. On Tru64 UNIX, the routines are defined in the following header file:

On HP-UX, the routines are defined in the following header file:

For _XOPEN_SOURCE_EXTENDED only, the routines are defined in the following header file:

<arpa/inet.h>

Line 29
after #include <string.h>
#ifdef HP11
Add #include <arpa/inet.h>
#endif

h.

../src/burp/canonical.cpp in function int burp_getlong (XDR*, SLONG*)
../src/burp/canonical.cpp:326 error ntohl undeclared first use this function
../src/burp/canonical.cpp:326 Each undeclared identifier is reported only once for each function it appears in.
../src/burp/canonical.cpp in function int burp_putlong (XDR*, SLONG*)
../src/burp/canonical.cpp:420 error htonl undeclared first use this function.

See g.

Line 36
after #include <string.h>
#ifdef HP11
Add #include <arpa/inet.h>
#endif

i.

Part of intl contains .c file and HP will try and compile these using its own native cc compiler, this is not wanted, since we have already set the compile flags to be for gcc and the native cc compiler is going to complain excessively.You can fix the cc issue by setting CC=gcc in prefix.hpux.

However there seems to be something nastily wrong with the way that gcc talks to the HPUX linker when you are creating shared libraries.

for example in Makefile.in.intl

libfbintl : $(LIBFBINTL_SO)

$(LIBFBINTL_SO): LINK_PROD=libintl.$(SHRLIB_EXT).1
$(LIBFBINTL_SO): $(INTL_Objects)
# $(LIB_LINK) -Wl,-soname,libintl.$(SHRLIB_EXT).1 -Wl,-rpath,/usr/lib -o $@ $^
$(LIB_LINK) $(LIB_LINK_OPTIONS) $(LIB_LINK_SONAME_LINE) $(LIB_LINK_RPATH_LINE) -o $@ $^
# -$(LN) $(@F) $(LIBFBINTL_SOBASENAME)
# -$(LN) $(notdir $(LIBFBINTL_SOBASENAME)) $(LIBFBINTL_SONAME)

LIB_LINK translates to LIB_LINK= $(CC) if you are not using UseLibToolForLink so CC=gcc

LIB_LINK_OPTIONS allow you to pass specific linker platform options for building a shared library LIB_LINK_SONAME_LINE comes from make.rules which picks up LIB_LINK_SONAME which is the flag used to create an "internal" libray name i.e. give it a version number -soname for linux

LIB_LINK_RPATH_LINE comes from make.rules which picks up LIB_LINK_RPATH the runtime path specification -rpath for linux so we need to set these up in prefix.hpux e.g. LIB_LINK_OPTIONS

if you are using gcc regardless of the platform using -shared should pass the appropriate flag for shared libraries to the linker on HPUX this would be -b. However trial and error shows this not to work, so we used the -Xlinker -b flag to force gcc to pass the shared library flag.

LIB_LINK_RPATH should be +b for HP
LIB_LINK_SONAME should be +h for HP

so one would expect:

LIB_LINK_OPTIONS = -Xlinker -b
LIB_LINK_RPATH = -Wl,+b
LIB_LINK_SONAME = -Wl,+h
LIB_LINK_RPATH = +b

Should basically work, see initial comments re. prefix.hpux, and the set up. This took some trial and error to set up correctly.

j.

When using the native link command rather than linking through gcc, we get an error stating that that the stdc++ library can't be found. This is located in /usr/local/lib, so we can symbolically link this library into /usr/lib e.g.:

ln -s /usr/local/lib/libstdc++.a /usr/lib/libstdc++.a
ln -s /usr/local/lib/libstdc++.sl /usr/lib/libstdc++.sl

k.

src/utilities/drop.cpp in function void remove_resource (TEXT*, long int, long_int, TEXT*)
src/utilities/drop.cpp:241 error ISC_map_file undeclared, first use this function
src/utilities/drop.cpp:241 error each undeclared identifier is reported only once for each function it appears in.
drop.cpp needs the definition of ISC_map_file from ../jrd/isc_s_proto.h so after
#include "../jrd/isc_proto.h add
#include "..../jrd/isc_s_proto.h"

You will now get an error that the call to the ISC_map_file function is wrong. Defined in 1.5 in isc_s_proto.h as:

extern UCHAR *DLL_EXPORT ISC_map_file(ISC_STATUS *,
TEXT *,
void (*)(void *, struct sh_mem *, int),
void *, SLONG, struct sh_mem *);

Being used as:

if (!ISC_map_file
(status_vector, expanded_filename, dummy_init, 0, shm_length, &shmem_data))
{
ib_printf("\n***Unable to access %s resources:\n", label);
gds__print_status(status_vector);
return;
}

Obviously the change to the function definition and its usage here wasn't picked up. Try modifying the above to:

if (!ISC_map_file
(status_vector,
expanded_filename,
(void (*) (void *, sh_mem*, int)) dummy_init, 0, shm_length, &shmem_data))
{
ib_printf("\n***Unable to access %s resources:\n", label);
gds__print_status(status_vector);
return;
}

l.

g++ ../tmp/libfbclient/jrd/alt.cpp
In file included from ../src/common/classes/alloc.h:37,
from ../src/include/firebird.h:75,
from ../src/jrd/alt.cpp:33:
../src/common/classes/locks.h:83: error: 'pthread_spinlock_t' is used as a type, but is not defined as a type.
../src/common/classes/locks.h: In constructor `Firebird::Spinlock::Spinlock()':
../src/common/classes/locks.h:86: error: `spinlock' undeclared (first use this function)
../src/common/classes/locks.h:86: error: (Each undeclared identifier is reported only once for each function it appears in.)
../src/common/classes/locks.h:86: error: `pthread_spin_init' undeclared (first use this function)
../src/common/classes/locks.h: In destructor `Firebird::Spinlock::~Spinlock()':
../src/common/classes/locks.h:90: error: `pthread_spin_destroy' undeclared (first use this function)
../src/common/classes/locks.h: In member function `void
Firebird::Spinlock::enter()':
../src/common/classes/locks.h:94: error: `pthread_spin_lock' undeclared (first use this function)
../src/common/classes/locks.h: In member function `void
Firebird::Spinlock::leave()':
../src/common/classes/locks.h:98: error: `pthread_spin_unlock' undeclared (first use this function)

in common/classes/locks.h line 80:

if !defined(SOLARIS) && !defined(DARWIN) && !defined(FREEBSD)

Amend to:

if !defined(SOLARIS) && !defined(DARWIN) && !defined(FREEBSD) && !defined(HP11)

m.

If you run gmake after a code modification, i.e. continue the build and you see the error:

/usr/ccs/bin/ld: Can't create ../gen/firebird/bin/fb_lock_mgr
/usr/ccs/bin/ld: Text file busy
collect2: ld returned 1 exit status
  • su to root, run ps-eaf and look for the fb_lock_mgr process running.
  • kill -9 the process id.
  • re-run gmake.

n.

g++ ../src/jrd/isc_sync.cpp
../src/jrd/isc_sync.cpp: In function `SLONG ISC_event_clear(event*)':
../src/jrd/isc_sync.cpp:868: error: invalid conversion from `SCHAR*' to `int'

isc_EVENT_CLEAR UNIX (not NeXt, Not Solaris, Not Posix Threads)
ret = semctl(event->event_semid, event->event_emnum, SETVAL, arg);
../src/jrd/isc_sync.cpp: In function `int ISC_event_init(event*, int, int)':
../src/jrd/isc_sync.cpp:913: error: incompatible types in assignment of `int' to `SCHAR[1]'

ISC_event_init UNIX (not NeXt, Not Solaris, Not Posix Threads)
event->event_semnum = 0;
../src/jrd/isc_sync.cpp:917: error: incompatible types in assignment of `int' to `SCHAR[1]'
event->event_semnum = semnum;

../src/jrd/isc_sync.cpp: In function `int ISC_event_post(event*)':
../src/jrd/isc_sync.cpp:947: error: invalid conversion from `SCHAR*' to `int'
ISC_event_post UNIX (not NeXt, Not Solaris, Not Posix Threads)
ret = semctl(event->event_semid,event->event_event_semnum, SETVAL,arg);

../src/jrd/isc_sync.cpp: In function `int ISC_event_wait(short int, event**, SLONG*, long int, void (*)(), void*)':
../src/jrd/isc_sync.cpp:1034: error: invalid conversion from `SCHAR*' to `int'

ISC_event_wait UNIX (not NeXt, Not Solaris, Not Posix Threads)
*semnum++ =(*event++)->event_semnum;

../src/jrd/isc_sync.cpp: In function `int ISC_mutex_init(mtx*, long int)':
../src/jrd/isc_sync.cpp:3401: error: 'struct mtx' has no member named ' mtx_semid'
../src/jrd/isc_sync.cpp:3402: error: 'struct mtx' has no member named ' mtx_semnum'
../src/jrd/isc_sync.cpp: In function `int ISC_mutex_lock(mtx*)':
../src/jrd/isc_sync.cpp:3431: error: 'struct mtx' has no member named ' mtx_semnum'
../src/jrd/isc_sync.cpp:3436: error: 'struct mtx' has no member named ' mtx_semid'
../src/jrd/isc_sync.cpp: In function `int ISC_mutex_lock_cond(mtx*)':
../src/jrd/isc_sync.cpp:3465: error: 'struct mtx' has no member named ' mtx_semnum'
../src/jrd/isc_sync.cpp:3470: error: 'struct mtx' has no member named ' mtx_semid'
../src/jrd/isc_sync.cpp: In function `int ISC_mutex_unlock(mtx*)':
../src/jrd/isc_sync.cpp:3499: error: 'struct mtx' has no member named ' mtx_semnum'
../src/jrd/isc_sync.cpp:3504: error: 'struct mtx' has no member named ' mtx_semid'

firebird.h defines MULTI_THREAD 1 within a macro specific to check if thread synchronisation is needed:

SUPERSERVER, SUPERCLIENT, WIN_NT, SOLARIS_MT, VMS

in thd.h

#ifdef MULTI_THREAD
#define ANY_THREADING 1
#endif
#ifdef V4_THREADING
#define ANY_THREADING 1
#endif

Thats it...

isc.h defines two structures based on ANY_THREADING:

#ifdef ANY_THREADING
typedef struct mtx {
THD_MUTEX_STRUCT mtx_mutex[1];
} MTX_T, *MTX;
#else
typedef struct mtx {
SLONG mtx_semid;
SSHORT mtx_semnum;
SCHAR mtx_use_count;
SCHAR mtx_wait;
} MTX_T, *MTX;
#endif /* ANY_THREADING */

#ifdef ANY_THREADING
typedef struct event
{
SLONG event_semid;
SLONG event_count;
THD_MUTEX_STRUCT event_mutex[1];
THD_COND_STRUCT event_semnum[1];
} EVENT_T, *EVENT;
#else
typedef struct event
{
SLONG event_semid;
SLONG event_count;
SSHORT event_semnum;
} EVENT_T, *EVENT;
#endif /* ANY_THREADING */

The Classic build is picking up the ANY_THREADING structures. And I don't think it should be.... I think I have found it... its not SUPERSERVER thats causing the problem, but a definition of SUPERCLIENT...

In ../jrd/thd.h

There are the following declarations:

#If (defined(HPUX) && defined(SUPERSERVER))
#define POSIX_THREADS 1
#endif

That should be fine for HPUX 11 (not for HP10.20) but we won't go into HP's faltering attempts to implement POSIX threads...

Under it we have a:

#if (defined(PLATFORM) && defined(SUPERCLIENT))
#define POSIX_THREADS 1
#endif

To build a thread safe gds shared library (client) for Linux...

This was also in 1.03, but somewhere in the new autoconf / configure rebuild, a number of Makefile.in's for example:

define CFLAGS:= -DSUPERCLIENT as a prerequisite for building them...
Makefile.in.client.gdef
Makefile.in.client.gpre
Makefile.in.client.isql
Makefile.in.client.qli
Makefile.in.client.util
Makefile.in.client.intl
Makefile.in.libfbclient

Not someting that was required in 1.03... i.e. you could, or could not choose posix threads for the client....

So we can amend thd.h to support POSIX_THREADS for HPUX for the client:

#if (defined(HPUX) && defined(SUPERCLIENT))
#define POSIX_THREADS 1
#endif

This should get the right definitions to call isc_sync.cpp with the correct event and mutex definitions for POSIX rather than for non POSIX (UNIX) for example...

o.

g++ ../src/extlib/fbudf/fbudf.cpp
/usr/include/sys/time.h: in function ISC_TIMESTAMP* getExactTimestamp(IS_TIMESTAMP*)
/usr/include/sys/time.h:485 error too few arguments to function int gettimeofday (timeval* void*)
src/extlib/fbudf/fbudf.cpp:537 error at this point in file

in prefix.hpux add -D_HPUX_SOURCE to pick up the correct gettimeofday function that supports timezones. Still doesn't work, although a useful flag to add. Seems that http://hpux.connect.org.uk/ftp/hpux/Gnu/autoconf-2.57/autoconf-2.57-sd-11.00.depot.gz is fundamentally flawed when it comes to handling gettimeofday on HP11 download. get http://hpux.connect.org.uk/ftp/hpux/Gnu/autoconf-2.59/autoconf-2.59-sd-11.00.depot.gz

8. Install

a.

Now lets work out, how to build an installable version of the software:

src/install/arch-specific

Needs a hpux for classic and superserver, so we need:

src/install/arch-specific/hpux/classic
src/install/arch-specific/hpux/super

so copy:

src/install/arch-specific/linux to src/install/arch-specific/hpux

Modify LINUX, to hpux in the configure.in install section for testing. amend linux lines to hpux e.g.:

arch-specific/linux -> arch_specific/hpux

Dump the rpm stuff, and specific linux xinetd stuff too. We want a plain vanilla tar install:

# autoconf
# ./configure
# gmake install

b.

makeInstallImage.sh
cp: illegal option --d

Change src/install/arch-specific/hpux/classic/makeInstallImage.sh.in references to cp -df e.g.:

cp -df $BuiltFBDir/lib/libfbembed.so* $DestDir/lib
cp -df $BuiltFBDir/lib/libfbclient.so* $DestDir/lib

to:

cp -f $BuiltFBDir/lib/libfbembed.sl* $DestDir/lib
cp -f $BuiltFBDir/lib/libfbclient.sl* $DestDir/lib

cp -d is not a known flag for HPUX!

c.

Cannot access firebird/lib/libib_util.so: No such file or directory
Cannot access firebird/lib/libfbintl.so: No such file or directory
Cannot access firebird/UDF/ib_udf.so: No such file or directory
Cannot access firebird/UDF/fb_udf.so: No such file or directory

change the library extension in src/install/arch-specific/hpux/classic/makeInstallImage.sh.in from so to HP's sl

d.

in gen/Makefile.install

(cd ../gen/FirebirdCS-1.5.0.4290-0.hppa2.0w; cd ../buildroot; tar -cf buildroot.tar.gz .) ./buildroot.tar.gz: file changed size
gmake[2]: *** [buildTarDir] Error 5
gmake[2]: leaving directory '/usr/firebird/firebirdsrc/src'
gmake[1]: *** [install] Error 2
gmake[1]: leaving directory '/usr/firebird/firebirdsrc/src'
gmake: *** [install] Error

modify:

(cd ../gen/FirebirdCS-1.5.0.4290-0.hppa2.0w; cd ../buildroot; tar -cf buildroot.tar.gz usr)

Seems tar is trying to tar the tar file its creating, not bright, but it does throw an error, so use the usr directory instead of .

Also seems sensible to get rid of the .gz extensions in the Makefile, because HP does tar seperately to gzip....

OK. Now we have fixed the Makefile that was created, we now need to track down the file that creates it and correct that...

So start at src/arch-specific/hpux (thats where we copied the Linux install stuff originally) we now need to make it specific to hpux.

While we are at it, get rid of the bit in Makefile.in that calls the install as part of the make process, we are building as builder, and the install runs as root, so we want to run the install separately.

Note

Any changes you make whilst playing in the "live" environment will need to be reflected in src/install/arch-specific/hpux..

Makefile.in uses (for classic tar install)
makeInstallImage.sh.in
preinstall.sh.in
tarMainInstall.sh.in
tarinstall.sh.in
postinstall.sh.in

9. Install

Now: Log on as root, goto the directory where the installation kit "should" have been created e.g. gen/FirebirdCS-1.5.0.4290-0.hppa2.0w and run ./install.sh to install Firebird on our system:

install.sh calls:
scripts/preinstall.sh
scripts/tarinstall.sh
scripts/postinstall.sh

Play with these scripts, until you are satisfied that they are installing Firebird correctly, then relect the changes back to the original install files in src/install/arch-specific/hpux.. Hopefully you will get a successful install, that can be simply tested by using ISQL to test a local and remote connection... as Root try:

cd /usr/local/firebird/bin
# ./isql
ISQL> connect ../examples/employee.fdb:
# ./isql
ISQL> connect 'localhost:/usr/local/firebird/examples/employee.fdb' user SYSDBA password masterkey;
(or whatever the password was set to during the install process)

10. Additional

a,

If you try and run any Firebird executable e.g. gsec, isql etc on HPUX you will get a core dump with the following error:

dld.sl can't open shared library ../gen/firebird/lib/libfbembed.sl.1
No such file or directory.

I'm open to suggestions on this one. I could use SHLIB_PATH for running firebird, but this would have to be set for everybody who uses it at runtime. or we can try and build the "proper" location of libfbembed.sl.1 into the executable...

a chatr on any of the Firebird executables in the bin directory shows:

shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic ../gen/firebird/lib/libfbembed.sl.1
dynamic /usr/local/lib/libstdc++.sl
dynamic /usr/lib/libxcurses.1
dynamic /usr/lib/libm.2
dynamic /usr/lib/libc.2
shared library binding:
deferred

It seems the HPUX linker (LD) binds the exact path of the library into the executable when it links.

Its possible that use of the GNU libtoolforlink may cure the problem, or that I can do some fancy work in configure.in to handle it (the problem is seen elsewhere in Open Source land). However the simplest solution seems to be:

  1. Build Firebird.

  2. Install Firebird (so all the libraries are now in the right place via links)

  3. Then change make.defaults so that:

    FBCLIENT_LINK = -L$(LIB) -lfbclient
    FBEMBED_LINK = -L(SLIB) -lfbembded
    

    becomes:

    FBCLIENT_LINK = -lfbclient
    FBEMBED_LINK = - -lfbembded
    

so that libfbembed.sl.1 is picked up from /usr/lib and reflected as such by chatr. This effectively means building Firebird twice, because for the boot build to work under 1.5 the above libraries have to be found in the boot build path for the build to complete sucessfully. This explain why the best way to build Firebird under 1.0x was to have a running version of Firebird installed on the system. That way the build picks up the existing library paths for the binaries. This is not a problem on Linux :-). If anybody has any better suggestions on doing this. It would be appreciated if you would let me know.

b,

libstdc++.sl.1 is going to have to be shipped with your build. HPUX does not have this library installed by default (its a GNU library after all) and Firebird will need the same version on any deployment platform, as the one you used to create the build.

Like this post? Share on: TwitterFacebookEmail


Related Articles


Author

Paul Beach

Reading Time

~14 min read

Published

Category

Articles

Tags