By default, DBStep builds static libraries, not shared libraries.
Patch follows:
--- dbstep-0.3.1.orig/src/Makefile.am +++ dbstep-0.3.1/src/Makefile.am @@ -1,5 +1,5 @@ #SUBDIRS = sqlite mysql pgsql fbird -lib_LIBRARIES = libdbstep.a +lib_LTLIBRARIES = libdbstep.la
include_HEADERS = \ dbstep.h dbstep_db.h dbstep_query.h dbstep_record.h dbstep_types.h \ @@ -11,7 +11,7 @@ fbird/fbird_dbstep_db_impl.h fbird/fbird_dbstep_query.h \ odbc/odbc_dbstep_db_impl.h odbc/odbc_dbstep_query.h
-libdbstep_a_SOURCES = \ +libdbstep_la_SOURCES = \ dbstep_db.cpp dbstep_query.cpp dbstep_field.cpp dbstep_record.cpp \ dbstep_datetime.cpp genError.cpp stlGenError.cpp \ dbstep_params.cpp dbstep_db_impl.cpp \
Following on from the shared libraries... a way to configure dependent software. Easiest way is with pkg-config.
Sample PostgreSQL-only dbstep.pc follows, then the patch it depends on to set up the PG_INCLUDEDIR autoconf variable.
prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include
Name: DBStep Description: C++ object/relational mapping library Version: 0.3.1 Libs: -L${libdir} -ldbstep -lpq Cflags: -I${includedir}/dbstep -I@PG_INCLUDEDIR@
--- dbstep-0.3.1.orig/configure.in +++ dbstep-0.3.1/configure.in @@ -120,9 +120,14 @@ AM_CONDITIONAL(PGSQL_SUPPORT, true)
if test [ $with_pgsql != "yes" ] ; then - CPPFLAGS="$CPPFLAGS -I$with_pgsql/include" + PG_INCLUDEDIR="$with_pgsql/include" LDFLAGS="$LDFLAGS -L$with_pgsql/lib" + elif pg_config --help >/dev/null 2>&1; then + PG_INCLUDEDIR="`pg_config --includedir`" + LDFLAGS="$LDFLAGS -L`pg_config --libdir`" fi + AC_SUBST(PG_INCLUDEDIR) + CPPFLAGS="$CPPFLAGS -I$PG_INCLUDEDIR" ], [ AC_MSG_RESULT(no)
Log in to post a comment.
By default, DBStep builds static libraries, not shared libraries.
Patch follows:
--- dbstep-0.3.1.orig/src/Makefile.am
+++ dbstep-0.3.1/src/Makefile.am
@@ -1,5 +1,5 @@
#SUBDIRS = sqlite mysql pgsql fbird
-lib_LIBRARIES = libdbstep.a
+lib_LTLIBRARIES = libdbstep.la
include_HEADERS = \ dbstep.h dbstep_db.h dbstep_query.h dbstep_record.h dbstep_types.h \ @@ -11,7 +11,7 @@
fbird/fbird_dbstep_db_impl.h fbird/fbird_dbstep_query.h \ odbc/odbc_dbstep_db_impl.h odbc/odbc_dbstep_query.h
-libdbstep_a_SOURCES = \ +libdbstep_la_SOURCES = \ dbstep_db.cpp dbstep_query.cpp dbstep_field.cpp dbstep_record.cpp \ dbstep_datetime.cpp genError.cpp stlGenError.cpp \ dbstep_params.cpp dbstep_db_impl.cpp \
Following on from the shared libraries... a way to configure dependent software. Easiest way is with pkg-config.
Sample PostgreSQL-only dbstep.pc follows, then the patch it depends on to set up the PG_INCLUDEDIR autoconf variable.
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: DBStep
Description: C++ object/relational mapping library
Version: 0.3.1
Libs: -L${libdir} -ldbstep -lpq
Cflags: -I${includedir}/dbstep -I@PG_INCLUDEDIR@
--- dbstep-0.3.1.orig/configure.in
+++ dbstep-0.3.1/configure.in
@@ -120,9 +120,14 @@
AM_CONDITIONAL(PGSQL_SUPPORT, true)
if test [ $with_pgsql != "yes" ] ; then
- CPPFLAGS="$CPPFLAGS -I$with_pgsql/include"
+ PG_INCLUDEDIR="$with_pgsql/include"
LDFLAGS="$LDFLAGS -L$with_pgsql/lib"
+ elif pg_config --help >/dev/null 2>&1; then
+ PG_INCLUDEDIR="`pg_config --includedir`"
+ LDFLAGS="$LDFLAGS -L`pg_config --libdir`"
fi
+ AC_SUBST(PG_INCLUDEDIR)
+ CPPFLAGS="$CPPFLAGS -I$PG_INCLUDEDIR"
],
[
AC_MSG_RESULT(no)