From f7fb54d0cd22c361298c772ce025a47f7937631d Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Thu, 4 Jul 2013 22:02:47 -0500 Subject: [PATCH] fix libuuid detection --- acinclude.m4 | 1 + build/config/uuid.m4 | 17 +++++++++++++++++ configure.in | 6 +++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 build/config/uuid.m4 diff --git a/acinclude.m4 b/acinclude.m4 index aeba17b5c3..58b5500a80 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -6,6 +6,7 @@ m4_include([build/config/ac_gcc_archflag.m4]) m4_include([build/config/ac_gcc_x86_cpuid.m4]) m4_include([build/config/ax_lib_mysql.m4]) m4_include([build/config/ax_check_java.m4]) +m4_include([build/config/uuid.m4]) m4_include([build/config/erlang.m4]) m4_include([build/config/odbc.m4]) m4_include([build/config/sched_setaffinity.m4]) diff --git a/build/config/uuid.m4 b/build/config/uuid.m4 new file mode 100644 index 0000000000..ecfa719b5e --- /dev/null +++ b/build/config/uuid.m4 @@ -0,0 +1,17 @@ +AC_DEFUN([CHECK_LIBUUID], + [ + PKG_CHECK_MODULES([LIBUUID], [uuid >= 1.41.2], + [LIBUUID_FOUND=yes], [LIBUUID_FOUND=no]) + if test "$LIBUUID_FOUND" = "no" ; then + PKG_CHECK_MODULES([LIBUUID], [uuid], + [LIBUUID_FOUND=yes], [LIBUUID_FOUND=no]) + if test "$LIBUUID_FOUND" = "no" ; then + AC_MSG_ERROR([libuuid development files required]) + else + LIBUUID_INCLUDEDIR=$(pkg-config --variable=includedir uuid) + LIBUUID_CFLAGS+=" -I$LIBUUID_INCLUDEDIR/uuid " + fi + fi + AC_SUBST([LIBUUID_CFLAGS]) + AC_SUBST([LIBUUID_LIBS]) + ]) diff --git a/configure.in b/configure.in index fd52b959ff..41310491c3 100644 --- a/configure.in +++ b/configure.in @@ -405,6 +405,10 @@ if test "x$enable_core_odbc_support" != "xno"; then AC_CHECK_LIB([odbc], [SQLDisconnect],, AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent])) fi +CHECK_LIBUUID +SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS" +SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS" + AC_ARG_ENABLE(core-pgsql-support, [AS_HELP_STRING([--enable-core-pgsql-support], [Compile with PGSQL Support])],,[enable_core_pgsql_support="no"]) @@ -414,7 +418,7 @@ AC_PATH_PROG([PG_CONFIG], [pg_config], [no]) if test "$PG_CONFIG" != "no"; then AC_MSG_CHECKING([for PostgreSQL libraries]) POSTGRESQL_CXXFLAGS="`$PG_CONFIG --cppflags` -I`$PG_CONFIG --includedir`" - POSTGRESQL_LDFLAGS="`$PG_CONFIG --ldflags` -L`$PG_CONFIG --libdir` -lpq" + POSTGRESQL_LDFLAGS="`$PG_CONFIG --ldflags|sed 's/ -Wl,--as-needed//g'` -L`$PG_CONFIG --libdir` -lpq" POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'` POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | sed -re 's#PostgreSQL ([0-9]+).[0-9]+.[0-9]+#\1#'` POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | sed -re 's#PostgreSQL [0-9]+.([0-9]+).[0-9]+#\1#'`