After you rebuild
ipldd11a.SOLIBSUFFIX,
you must install it in the
$INFORMIXDIR/lib directory.
To store the shared library in a different location, such as
/usr/lib,
set the HPL_DYNAMIC_LIB_PATH configuration parameter to the appropriate
path in the
plconfig file.
Important: For
security reasons, you should keep all shared libraries used by the
database server in directories under $INFORMIXDIR.
To
build the shared-library file:
- Use the following code as a template to prepare a makefile. You can copy a template for the makefile from the $INFORMIXDIR/incl/hpl directory.
########################################################
# Makefile for building onpload shared library
#
LD = ld
# link flag for building dynamic library, may be different
# for your platform, see the man page for ld, the link
# editor.
LDSOFLAGS = -G
# where to find plcstdrv.h
INCL = $INFORMIXDIR/incl/hpl
# SOLIBSUFFIX is the shared library suffix for your
# platform. For Solaris it is "so"
SOLIBSUFFIX = so
PLCDLIBSO = ipldd11a.$(SOLIBSUFFIX)
.c.o:
$(CC) $(CFLAGS) -I$(INCL) -c $<
#
# plcstdrv.c contains the custom driver table, required
# plcstcnv.c contains the custom function table, required
# your_custom_driver.c contains your custom driver
#routines, optional
# your_custom_conversion.c contains your custom
#conversion functions, optional
#
SOOBJS = plcsrdrv.o plcsrcnv.o your_custom_driver.o
your_custom_function.o
solib: $(SOOBJS)
$(LD) -o $(PLCDLIBSO) $(LDSOFLAGS) $(SOOBJS)
################ end of makefile ######################
- Include the following files in the makefile.
File |
Description |
plcstdrv.c |
Prepares the custom driver tables. |
plcstcnv.c |
Prepares the custom-conversion function tables. |
your_custom_driver.c |
Contains your user-specific driver functions |
your_custom_functions.c |
Contains your user-specific conversion functions |
Custom-conversion functions describes
the plcstcnv.c and the your_custom_functions.c files.
- Run make by using the makefile.
The makefile builds the shared-library file ipldd11a.SOLIBSUFFIX,
where SOLIBSUFFIX is the shared-library suffix for your operating
system.
The HPL uses the same library for both custom-conversion
functions and custom drivers, so when you rebuild the library, you
must also link the custom-conversion code.
- Install the shared library in the appropriate path for
your operating system.
For example, on Solaris you
must install the shared library in the $INFORMIXDIR/lib directory,
or in the directory specified by the HPLDYNAMICLIB configuration variable
in the plconfig file. You can move ipldd11a.SOLIBSUFFIX into
the shared-library directory, or you can use a link. For administrative
purposes, a link might be clearer.
- Set the owner and group of the shared-library files to informix.
Set the permission bits to 0755 (octal).
Tip: When the libraries are updated, the letter
before the decimal (here, the letter a) changes to indicate that the
library has changed. If you do not find ipldd11a,
look for ipldd11b or ipldd11c.