]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_corosync: Fix linking issue with Corosync 2.x
authorMatt Jordan <mjordan@digium.com>
Fri, 6 Oct 2017 15:51:17 +0000 (10:51 -0500)
committerMatt Jordan <mjordan@digium.com>
Fri, 6 Oct 2017 20:47:41 +0000 (15:47 -0500)
At some point in time in the history of Corosync (certainly within the
2.x branch), the corosync_cfg_state_track function was removed.
Unfortunately, the cfg library is only linked if this function is
present. Without the cfg library being linked to res_corosync, loading
of res_corosync will fail.

This patch makes it so that detecting corosync's core libraries,
determined by the COROSYNC external library checks, links both the cpg
and cfg libraries with res_corosync.

Change-Id: I674e9e1c8fea11c3bf81154aaa7c1fd43f945465

configure
configure.ac

index 368e6b453e0a6ea9f80e718941386734fbd2c216..59bc3b10b1512ee8ccdd3e2d562bfb3efe1986da 100755 (executable)
--- a/configure
+++ b/configure
@@ -31953,7 +31953,7 @@ if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcpg ${pbxlibdir} -lcpg $LIBS"
+LIBS="-lcpg ${pbxlibdir} -lcpg -lcfg $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -31995,7 +31995,7 @@ fi
 
    # now check for the header.
    if test "${AST_COROSYNC_FOUND}" = "yes"; then
-      COROSYNC_LIB="${pbxlibdir} -lcpg -lcpg"
+      COROSYNC_LIB="${pbxlibdir} -lcpg -lcpg -lcfg"
       # if --with-COROSYNC=DIR has been specified, use it.
       if test "x${COROSYNC_DIR}" != "x"; then
          COROSYNC_INCLUDE="-I${COROSYNC_DIR}/include"
index cf4518c2103371769b6c0c67864da8d23a1b784f..9f95786e113dfec60ebc12d114edd6635a005acd 100644 (file)
@@ -2425,7 +2425,7 @@ fi
 
 AST_EXT_LIB_CHECK([CODEC2], [codec2], [codec2_create], [codec2/codec2.h])
 
-AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcpg])
+AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcpg -lcfg])
 AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg])
 
 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])