]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
slight tweat to pgsql version detection using awk instead of sed for bsd portability
authorKen Rice <krice@freeswitch.org>
Mon, 19 May 2014 17:38:02 +0000 (12:38 -0500)
committerKen Rice <krice@freeswitch.org>
Mon, 19 May 2014 17:38:09 +0000 (12:38 -0500)
configure.ac

index 7673f61141812436da22de9bb48ee2ea0e1ecdab..77394f74ddecd96c10354d24190d522fc9d77b3e 100644 (file)
@@ -551,10 +551,10 @@ if test x"$enable_core_pgsql_support" = x"yes" ; then
             POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`"
             POSTGRESQL_LIBDIR="-L`$PG_CONFIG --libdir`"
             POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq"
-            POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
-            POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL ([0-9]+).[0-9]+.?[0-9]+?#\1#'`
-            POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.([0-9]+).?[0-9]+?#\1#'`
-            POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.[0-9]+.?([0-9]+)?#\1#'` 
+            POSTGRESQL_VERSION=`$PG_CONFIG --version | awk '{ print $NF }'`
+            POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $1 }'`
+            POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $2 }'`
+            POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | awk '{ print $NF }' | awk -F. '{ print $3 }'`
         else
             AC_MSG_ERROR([no usable pkg-config or pg_config; please install libpq devel package or equivalent])
         fi