Subject: How to have databases/php4-sybase ?
To: None <netbsd-users@netbsd.org>
From: Lista de NetBSD Users <list10@sepc.edu.mx>
List: netbsd-users
Date: 11/04/2002 20:45:37
Hello

I am trying compile php4-sybase and I have some problems
(and I dont know exactly what am I doing)

(NetBSD-1.6/i386 and a 2 weeks old pkgsrc.tar.gz)

My advance is the following:

1) download the free files sybase-ase-11.9.2-3.i386.rpm and
   sybase-openclient-11.1.1-3.i386.rpm.
2) install these files with the rpm utility with the
   command "rpm -i --nodeps --ignoreos <file.rpm>"
   in /opt/sybase-11.9.2
3) move this directory to /home/sybase (the default place)

4) copy the entire directory databases/php4-filepro to
   databases/php4-sybase.

5) edit php4-sybase/Makefile... this is:
------------------------------------------------
# $NetBSD: Makefile,v 1.4 2002/02/28 06:16:59 jlam Exp $

MODNAME=                sybase_ct
CATEGORIES+=            databases
PKGREVISION=            # empty
COMMENT=                PHP4 extension for sybase database access

USE_BUILDLINK_ONLY=     YES

.include "../../www/php4/Makefile.module"

CONFIGURE_ARGS+=        --with-${MODNAME}=shared
# CONFIGURE_ARGS+=       --with-sybase-ct=/opt/sybase-11.9.2

.include "../../mk/bsd.pkg.mk"
------------------------------------------------
6) compile with the command "make"
   (the listing of compilation is at end this mail message)
   * The C compiler found the needed include files in
     /home/sybase/include
   * but seems it cant find the libraries of
     /home/sybase/lib
------------------------------------------------
victoria# ls -l /home/sybase/lib
total 3007
-r-xr-xr-x  1 root  wheel     3703 Jul 12  1999 examples.so
-r-xr-xr-x  1 root  wheel   117616 Oct  3  2000 libblk.a
-r-xr-xr-x  1 root  wheel   534854 Oct  3  2000 libcomn.a
-r-xr-xr-x  1 root  wheel    81606 Oct  3  2000 libcs.a
-r-xr-xr-x  1 root  wheel   674134 Oct  3  2000 libct.a
-r-xr-xr-x  1 root  wheel    51072 Oct  3  2000 libintl.a
-r-xr-xr-x  1 root  wheel  1238520 Oct  3  2000 libsybdb.a
-r-xr-xr-x  1 root  wheel   282926 Oct  3  2000 libsybtcl.a
-r-xr-xr-x  1 root  wheel     6260 Sep  5  2000 sybsyesp.so
-r-xr-xr-x  1 root  wheel    18237 Sep  5  2000 xpsmsgs.so
------------------------------------------------
I will move temporarly these libs to /usr/pkg/lib in order
to compile php4-sybase (here i dont know what am i doing)

Question
*Does I need the linux emulation for this compilation?
*Does somebody have experiences with this php module in NetBSD?
*Does somebody have comments to help with this problem?

Thanks in advance

Heron Gallegos


The listing.......
victoria# make
=> Checksum OK for php-4.2.3.tar.gz.
===> Extracting for php-sybase_ct-4.2.3
===> Required installed package php>=4.2.3: php-4.2.3 found
===> Required installed package automake>=1.7: automake-1.7 found
===> Required installed package autoconf>=2.50: autoconf-2.54 found
===> Required installed package libtool-base>=1.4.20010614nb9: libtool-base-1.4.20010614nb9 found
===> Patching for php-sybase_ct-4.2.3
===> Configuring for php-sybase_ct-4.2.3
autoheader: `config.h.in' is created
You should update your `aclocal.m4' by running aclocal.
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for i386--netbsdelf-gcc... cc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking whether cc understands -c and -o together... yes
checking for PHP prefix... /usr/pkg
checking for PHP includes... -I/usr/pkg/include/php -I/usr/pkg/include/php/main -I/usr/pkg/include/php/Zend -I/usr/pkg/include/php/TSRM
checking for PHP extension directory... /usr/pkg/lib/php/20020429
checking for Sybase-CT support... yes, shared
checking for netg_errstr in -ltcl... no
checking for insck__getVdate in -linsck... no
checking for bsd_tcp in -linsck... no
checking build system type... i386-pc-netbsdelf1.6
checking host system type... i386--netbsdelf
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognise dependant libraries... match_pattern /lib[^/\.]+\.so$
checking for i386--netbsdelf-ranlib... no
checking for ranlib... ranlib
checking for i386--netbsdelf-strip... no
checking for strip... strip
checking for working mkdir -p... yes
creating config_vars.mk
fastgen.sh: creating Makefile
configure: creating ./config.status
config.status: creating config.h
===> Building for php-sybase_ct-4.2.3
/bin/sh /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/libtool --mode=compile cc -I. -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/ -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/main -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct -I/usr/pkg/include/php -I/usr/pkg/include/php/main -I/usr/pkg/include/php/Zend -I/usr/pkg/include/php/TSRM -I/home/sybase/include  -DHAVE_CONFIG_H  -prefer-pic  -c php_sybase_ct.c && touch php_sybase_ct.slo
mkdir .libs
cc -I. -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/ -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/main -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct -I/usr/pkg/include/php -I/usr/pkg/include/php/main -I/usr/pkg/include/php/Zend -I/usr/pkg/include/php/TSRM -I/home/sybase/include -DHAVE_CONFIG_H -c php_sybase_ct.c  -fPIC -DPIC -o .libs/php_sybase_ct.o
cc -I. -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/ -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/main -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct -I/usr/pkg/include/php -I/usr/pkg/include/php/main -I/usr/pkg/include/php/Zend -I/usr/pkg/include/php/TSRM -I/home/sybase/include -DHAVE_CONFIG_H -c php_sybase_ct.c  -fPIC -DPIC -o php_sybase_ct.o >/dev/null 2>&1
/bin/sh /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/libtool --mode=link cc -I. -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/ -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/main -I/usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct -I/usr/pkg/include/php -I/usr/pkg/include/php/main -I/usr/pkg/include/php/Zend -I/usr/pkg/include/php/TSRM -I/home/sybase/include  -DHAVE_CONFIG_H    -Wl,-E  -Wl,-R/usr/pkg/lib -o sybase_ct.la -avoid-version -module -rpath /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules  php_sybase_ct.lo  -lsybtcl -lintl -lcomn -lct -lcs -L/home/sybase/lib

*** Warning: This library needs some functionality provided by -lsybtcl.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This library needs some functionality provided by -lcomn.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This library needs some functionality provided by -lct.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This library needs some functionality provided by -lcs.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module sybase_ct.  Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.
ar cru .libs/sybase_ct.a  php_sybase_ct.o
ranlib .libs/sybase_ct.a
creating sybase_ct.la
(cd .libs && rm -f sybase_ct.la && ln -s ../sybase_ct.la sybase_ct.la)
/bin/sh /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/libtool --mode=install cp sybase_ct.la /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules
cp .libs/sybase_ct.lai /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules/sybase_ct.la
cp .libs/sybase_ct.a /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules/sybase_ct.a
ranlib /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules/sybase_ct.a
chmod 644 /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules/sybase_ct.a
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
victoria#
victoria# ls -l /usr/pkgsrc/databases/php4-sybase/work/php-4.2.3/ext/sybase_ct/modules
total 33
-rw-r--r--  1 root  staff  32036 Nov  4 20:15 sybase_ct.a
-rw-r--r--  1 root  staff    767 Nov  4 20:15 sybase_ct.la
victoria#