All pastes #27846 Raw Edit

Stuff

public text v1 · immutable
#27846 ·published 2005-11-07 05:02 UTC
rendered paste body
Index: configure.ac
===================================================================
--- configure.ac        (revision 833)
+++ configure.ac        (working copy)
@@ -736,21 +736,21 @@

 AM_CONDITIONAL([WANT_RES_SQLITE],[test -n "${want_res_sqlite}"])

-#postgresql -- first need to check if it is there and than can check for if someone wants res_config_pgsql and cdr_pgsql
+dnl postgresql -- first need to check if it is there and than can check for if someone wants res_config_pgsql and cdr_pgsql
 CT_CHECK_POSTGRES_DB

-AC_ARG_ENABLE(res_config_pgsql,
-       [AC_HELP_STRING([--enable-res_config_pgsql],[enable res_config_pgsql (default = no)])],
-[   AC_MSG_RESULT(yes)
-    if test -n "${PQINCPATH}" && test -n "${PQLIBPATH}"
-    then
-       WANT_RES_CONFIG_PGSQL=yes
-    fi],
-[   AC_MSG_RESULT(no)
-])
+AC_ARG_WITH(res_config_pgsql,
+       [AC_HELP_STRING([--with-res_config_pgsql],[Build and install res_config_pgsql (default = no)])],,
+       [with_res_config_pgsql="no"])

-AM_CONDITIONAL([WANT_RES_CONFIG_PGSQL],[test -n "${WANT_RES_CONFIG_PGSQL}"])
+AM_CONDITIONAL([WANT_RES_CONFIG_PGSQL],[test "$with_res_config_pgsql" = "yes"])

+AC_ARG_WITH(cdr_pgsql,
+       [AC_HELP_STRING([--with-cdr_pgsql],[Build and install cdr_pgsql (default = no)])],,
+       [with_cdr_pgsql="no"])
+
+AM_CONDITIONAL([WANT_CDR_PGSQL],[test "$with_cdr_pgsql" = "yes"])
+
 #res_odbc
 AC_ARG_ENABLE(res_odbc,
        [AC_HELP_STRING([--enable-res_odbc],[build res_odbc (default=no)])],
Index: cdr/Makefile.am
===================================================================
--- cdr/Makefile.am     (revision 833)
+++ cdr/Makefile.am     (working copy)
@@ -8,3 +8,11 @@
 cdr_custom_la_LDFLAGS  = -module -avoid-version -no-undefined
 cdr_csv_la_LIBADD      = ${top_srcdir}/corelib/libopenpbx.la
 cdr_custom_la_LIBADD   = ${top_srcdir}/corelib/libopenpbx.la
+
+if WANT_CDR_PGSQL
+opbxmod_LTLIBRARIES    += cdr_pgsql.la
+cdr_pgsql_la_SOURCES   = cdr_pgsql.c
+cdr_pgsql_la_CFLAGS    = $(AM_CFLAGS) @PQINCPATH@
+cdr_pgsql_la_LDFLAGS   = -module -avoid-version -no-undefined
+cdr_pgsql_la_LIBADD    = @PQLIBPATH@ -lpq ${top_srcdir}/corelib/libopenpbx.la
+endif WANT_CDR_PGSQL