apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: [PATCH] DBD drivers as DSOs
Date Tue, 30 Jan 2007 01:34:02 GMT
On Mon, 2007-01-29 at 16:43 +0000, Joe Orton wrote:

> +LINK_MODULE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(ALL_CFLAGS) $(ALL_LDFLAGS)
-release $(APRUTIL_MAJOR_VERSION) -module -rpath $(APU_DSO_LIBDIR)

I needed to whack $(APRUTIL_LDFLAGS) into the above line to make things
link properly.

> +LDADD_dbd_pgsql = @LDADD_dbd_pgsql@
> +LDADD_dbd_oracle = @LDADD_dbd_oracle@
> +LDADD_dbd_sqlite2 = @LDADD_dbd_sqlite2@
> +LDADD_dbd_sqlite3 = @LDADD_dbd_sqlite3@

I added MySQL stuff here, since I build with that enabled too.
 
> +modules = dbd_pgsql dbd_sqlite2 dbd_sqlite3 dbd_oracle

Added MySQL above too.

> +[dbd_pgsql]
> +paths = dbd/apr_dbd_pgsql.c
> +target = dbd/apr_dbd_pgsql.la
> +
> +[dbd_sqlite2]
> +paths = dbd/apr_dbd_sqlite2.c
> +target = dbd/apr_dbd_sqlite2.la
> +
> +[dbd_sqlite3]
> +paths = dbd/apr_dbd_sqlite3.c
> +target = dbd/apr_dbd_sqlite3.la
> +
> +[dbd_oracle]
> +paths = dbd/apr_dbd_oracle.c
> +target = dbd/apr_dbd_oracle.la

And here, of course.
 
> Index: build/dbd.m4
> ===================================================================
> --- build/dbd.m4	(revision 501084)
> +++ build/dbd.m4	(working copy)

[..snip..]
 
> @@ -367,8 +364,40 @@
>    dnl Since we have already done the AC_CHECK_LIB tests, if we have it, 
>    dnl we know the library is there.
>    if test "$apu_have_oracle" = "1"; then
> -    APR_ADDTO(APRUTIL_EXPORT_LIBS,[-lclntsh])
> -    APR_ADDTO(APRUTIL_LIBS,[-lclntsh])
> +    LDADD_dbd_oracle="$LDADD_dbd_oracle -lclntsh"
>    fi
> +  AC_SUBST(LDADD_dbd_oracle)
>  ])
> -dnl

Fixed up the same for MySQL above.

Otherwise, looks good (FC6)! I tested with all 5 databases we support
and drivers got picked up just fine.

Also, ldd for libaprutil-1.so showed exactly what we want (no database
dependencies):

----------------------------------------
        linux-gate.so.1 =>  (0x00d29000)
        libdb-4.3.so => /lib/libdb-4.3.so (0x002c1000)
        libexpat.so.0 => /lib/libexpat.so.0 (0x00563000)
        libapr-1.so.0 => /home/groups/devel/run/apache/lib/libapr-1.so.0
(0x00a83000)
        libuuid.so.1 => /lib/libuuid.so.1 (0x001bb000)
        librt.so.1 => /lib/librt.so.1 (0x004ea000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00db7000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00110000)
        libdl.so.2 => /lib/libdl.so.2 (0x00127000)
        libc.so.6 => /lib/libc.so.6 (0x0093c000)
        /lib/ld-linux.so.2 (0x80000000)
----------------------------------------

And correct dependencies for drivers:

----------------------------------------
/home/groups/devel/run/apache/lib/apr-util-1/apr_dbd_mysql-1.so:
        linux-gate.so.1 =>  (0x007f9000)
        libmysqlclient_r.so.15 => /usr/lib/mysql/libmysqlclient_r.so.15
(0x00349000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00546000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x008de000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x007fe000)
        libm.so.6 => /lib/libm.so.6 (0x00110000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00137000)
        libssl.so.6 => /lib/libssl.so.6 (0x009ec000)
        libcrypto.so.6 => /lib/libcrypto.so.6 (0x0014e000)
        libc.so.6 => /lib/libc.so.6 (0x00559000)
        /lib/ld-linux.so.2 (0x80000000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x006d1000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00b5e000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x00280000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00aec000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00283000)
        libdl.so.2 => /lib/libdl.so.2 (0x00296000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00330000)
/home/groups/devel/run/apache/lib/apr-util-1/apr_dbd_oracle-1.so:
        linux-gate.so.1 =>  (0x0048f000)
        libnnz10.so
=> /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/libnnz10.so
(0x00d3e000)
        libclntsh.so.10.1
=> /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/libclntsh.so.10.1 (0x00f4d000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x005b2000)
        libc.so.6 => /lib/libc.so.6 (0x00144000)
        libdl.so.2 => /lib/libdl.so.2 (0x006bd000)
        libm.so.6 => /lib/libm.so.6 (0x00299000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00110000)
        /lib/ld-linux.so.2 (0x80000000)
/home/groups/devel/run/apache/lib/apr-util-1/apr_dbd_pgsql-1.so:
        linux-gate.so.1 =>  (0x00573000)
        libpq.so.4 => /usr/lib/libpq.so.4 (0x00ea7000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00bfb000)
        libc.so.6 => /lib/libc.so.6 (0x0035e000)
        libssl.so.6 => /lib/libssl.so.6 (0x00af8000)
        libcrypto.so.6 => /lib/libcrypto.so.6 (0x00110000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00242000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x002c8000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00acb000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x002f6000)
        /lib/ld-linux.so.2 (0x80000000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00326000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x0060b000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x0049b000)
        libdl.so.2 => /lib/libdl.so.2 (0x00657000)
        libz.so.1 => /usr/lib/libz.so.1 (0x0030d000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00787000)
/home/groups/devel/run/apache/lib/apr-util-1/apr_dbd_sqlite2-1.so:
        linux-gate.so.1 =>  (0x009eb000)
        libsqlite.so.0 => /usr/lib/libsqlite.so.0 (0x00d75000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x008fe000)
        libc.so.6 => /lib/libc.so.6 (0x00466000)
        /lib/ld-linux.so.2 (0x80000000)
/home/groups/devel/run/apache/lib/apr-util-1/apr_dbd_sqlite3-1.so:
        linux-gate.so.1 =>  (0x0074c000)
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00d5a000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0071b000)
        libc.so.6 => /lib/libc.so.6 (0x009e5000)
        /lib/ld-linux.so.2 (0x80000000)
----------------------------------------

The patch that I used is attached.

-- 
Bojan

Mime
View raw message