@@ -1007,23 +1007,28 @@ AC_SUBST([GETOPT_PATH])
10071007dnl ===============================================
10081008dnl Libraries
10091009dnl ===============================================
1010- AC_CHECK_LIB ( socket , socket ) dnl -lsocket
1011- AC_CHECK_LIB ( c , dlopen ) dnl if dlopen is in libc...
1012- AC_CHECK_LIB ( dl , dlopen ) dnl -ldl (for Linux)
1013- AC_CHECK_LIB ( rt , sched_getscheduler ) dnl -lrt (for Tru64)
1014- AC_CHECK_LIB ( gnugetopt , getopt_long ) dnl -lgnugetopt ( if available )
1015- AC_CHECK_LIB ( pam , pam_start ) dnl -lpam (if available)
1010+ AC_SEARCH_LIBS ( [ socket] , [ socket] )
1011+
1012+ save_LIBS="$LIBS"
1013+ DL_LIBS=""
1014+ LIBS=""
1015+ AC_SEARCH_LIBS ( [ dlopen] , [ dl] ,
1016+ [ test "$ac_cv_search_dlopen" = "none required" || DL_LIBS="$LIBS"] )
1017+ AC_SUBST ( DL_LIBS )
1018+ LIBS="$save_LIBS"
1019+
1020+ save_LIBS="$LIBS"
1021+ PAM_LIBS=""
1022+ LIBS=""
1023+ AC_SEARCH_LIBS ( [ pam_start] , [ pam] ,
1024+ [ test "$ac_cv_search_pam_start" = "none required" || PAM_LIBS="$LIBS"] )
1025+ AC_SUBST ( PAM_LIBS )
1026+ LIBS="$save_LIBS"
10161027
10171028PKG_CHECK_MODULES([ UUID] , [ uuid] ,
10181029 [ CPPFLAGS="${CPPFLAGS} ${UUID_CFLAGS}"
10191030 LIBS="${LIBS} ${UUID_LIBS}"] )
10201031
1021- AC_CHECK_FUNCS ( [ sched_setscheduler] )
1022- AS_IF ( [ test x"$ac_cv_func_sched_setscheduler" != x"yes"] ,
1023- [ PC_LIBS_RT=""] ,
1024- [ PC_LIBS_RT="-lrt"] )
1025- AC_SUBST ( PC_LIBS_RT )
1026-
10271032# Require minimum glib version
10281033PKG_CHECK_MODULES([ GLIB] , [ glib-2.0 >= 2.42.0] ,
10291034 [ CPPFLAGS="${CPPFLAGS} ${GLIB_CFLAGS}"
@@ -1032,15 +1037,6 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.42.0],
10321037# Check whether high-resolution sleep function is available
10331038AC_CHECK_FUNCS ( [ nanosleep usleep] )
10341039
1035- #
1036- # Where is dlopen?
1037- #
1038- AS_IF ( [ test x"$ac_cv_lib_c_dlopen" = x"yes"] ,
1039- [ LIBADD_DL=""] ,
1040- [ test x"$ac_cv_lib_dl_dlopen" = x"yes"] ,
1041- [ LIBADD_DL=-ldl] ,
1042- [ LIBADD_DL=${lt_cv_dlopen_libs}] )
1043-
10441040PKG_CHECK_MODULES(LIBXML2, [ libxml-2.0 >= 2.9.2] ,
10451041 [ CPPFLAGS="${CPPFLAGS} ${LIBXML2_CFLAGS}"
10461042 LIBS="${LIBS} ${LIBXML2_LIBS}"] )
@@ -1189,6 +1185,7 @@ dnl ========================================================================
11891185REQUIRE_FUNC([ alphasort] )
11901186REQUIRE_FUNC([ getopt] )
11911187REQUIRE_FUNC([ scandir] )
1188+ REQUIRE_FUNC([ sched_getscheduler] )
11921189REQUIRE_FUNC([ setenv] )
11931190REQUIRE_FUNC([ strndup] )
11941191REQUIRE_FUNC([ strnlen] )
@@ -1258,45 +1255,20 @@ dnl ncurses takes precedence.
12581255dnl
12591256AC_CHECK_HEADERS ( [ curses.h curses/curses.h ncurses.h ncurses/ncurses.h] )
12601257
1261- dnl Although n-library is preferred, only look for it if the n-header was found.
1262- CURSESLIBS=''
1263- PC_NAME_CURSES=""
1264- PC_LIBS_CURSES=""
1265- AS_IF ( [ test x"$ac_cv_header_ncurses_h" = x"yes"] , [
1266- AC_CHECK_LIB ( ncurses , printw ,
1267- [ AC_DEFINE ( HAVE_LIBNCURSES ,1 , have ncurses library ) ] )
1268- CURSESLIBS=`$PKG_CONFIG --libs ncurses` || CURSESLIBS='-lncurses'
1269- PC_NAME_CURSES="ncurses"
1270- ] )
1271-
1272- AS_IF ( [ test x"$ac_cv_header_ncurses_ncurses_h" = x"yes"] , [
1273- AC_CHECK_LIB ( ncurses , printw ,
1274- [ AC_DEFINE ( HAVE_LIBNCURSES ,1 , have ncurses library ) ] )
1275- CURSESLIBS=`$PKG_CONFIG --libs ncurses` || CURSESLIBS='-lncurses'
1276- PC_NAME_CURSES="ncurses"
1277- ] )
1278-
1279- dnl Only look for non-n-library if there was no n-library.
1280- AS_IF ( [ test x"$CURSESLIBS" = x"" && test x"$ac_cv_header_curses_h" = x"yes"] , [
1281- AC_CHECK_LIB ( curses , printw ,
1282- [ CURSESLIBS='-lcurses'; AC_DEFINE ( HAVE_LIBCURSES ,1 , have curses library ) ] )
1283- PC_LIBS_CURSES="$CURSESLIBS"
1284- ] )
1285-
1286- dnl Only look for non-n-library if there was no n-library.
1287- AS_IF ( [ test x"$CURSESLIBS" = x"" && test x"$ac_cv_header_curses_curses_h" = x"yes"] , [
1288- AC_CHECK_LIB ( curses , printw ,
1289- [ CURSESLIBS='-lcurses'; AC_DEFINE ( HAVE_LIBCURSES ,1 , have curses library ) ] )
1290- PC_LIBS_CURSES="$CURSESLIBS"
1291- ] )
1292-
1293- AS_IF ( [ test x"$CURSESLIBS" != x""] ,
1294- [ PCMK_FEATURES="$PCMK_FEATURES ncurses"] )
1258+ save_LIBS="$LIBS"
1259+ found_curses=0
1260+ CURSES_LIBS=""
1261+ LIBS=""
1262+ AC_SEARCH_LIBS ( [ printw] , [ ncurses curses] ,
1263+ [ test "$ac_cv_search_printw" = "none required" || CURSES_LIBS="$LIBS"
1264+ found_curses=1] ,
1265+ [ found_curses=0] )
1266+ LIBS="$save_LIBS"
12951267
12961268dnl Check for printw() prototype compatibility
1297- AS_IF ( [ test x"$CURSESLIBS" != x"" && cc_supports_flag -Wcast-qual] , [
1298- ac_save_LIBS=$LIBS
1299- LIBS="$CURSESLIBS "
1269+ AS_IF ( [ test $found_curses -eq 1 && cc_supports_flag -Wcast-qual] , [
1270+ ac_save_LIBS=" $LIBS"
1271+ LIBS="$CURSES_LIBS "
13001272
13011273 # avoid broken test because of hardened build environment in Fedora 23+
13021274 # - https://fedoraproject.org/wiki/Changes/Harden_All_Packages
@@ -1314,12 +1286,18 @@ AS_IF([test x"$CURSESLIBS" != x"" && cc_supports_flag -Wcast-qual], [
13141286# include <ncurses/ncurses.h>
13151287#elif defined(HAVE_CURSES_H)
13161288# include <curses.h>
1289+ #elif defined(HAVE_CURSES_CURSES_H)
1290+ # include <curses/curses.h>
13171291#endif
13181292 ] ,
13191293 [ printw((const char *)"Test");]
13201294 ) ] ,
1321- [ AC_MSG_RESULT ( [ yes] ) ] ,
1295+ [ AC_MSG_RESULT ( [ yes] )
1296+ PCMK_FEATURES="$PCMK_FEATURES ncurses"
1297+ ] ,
13221298 [
1299+ found_curses=0
1300+ CURSES_LIBS=""
13231301 AC_MSG_RESULT ( [ no] )
13241302 AC_MSG_WARN ( m4_normalize ( [ Disabling curses because the printw()
13251303 function of your (n)curses library is old.
@@ -1328,18 +1306,15 @@ AS_IF([test x"$CURSESLIBS" != x"" && cc_supports_flag -Wcast-qual], [
13281306 recommended, available from
13291307 https://invisible-island.net/ncurses/)
13301308 ] ) )
1331- AC_DEFINE ( [ HAVE_INCOMPATIBLE_PRINTW] , [ 1] ,
1332- [ Define to 1 if curses library has incompatible printw()] )
13331309 ]
13341310 )
13351311
1336- LIBS=$ac_save_LIBS
1312+ LIBS=" $ac_save_LIBS"
13371313 cc_restore_flags
13381314] )
13391315
1340- AC_SUBST ( CURSESLIBS )
1341- AC_SUBST ( PC_NAME_CURSES )
1342- AC_SUBST ( PC_LIBS_CURSES )
1316+ AC_DEFINE_UNQUOTED ( [ PCMK__ENABLE_CURSES] , [ $found_curses] , [ have ncurses library] )
1317+ AC_SUBST ( CURSES_LIBS )
13431318
13441319dnl ========================================================================
13451320dnl Profiling and GProf
@@ -1404,8 +1379,18 @@ AS_IF([test x"$cross_compiling" != x"yes"],
14041379 [ CPPFLAGS="$CPPFLAGS -I${prefix}/include/heartbeat"] )
14051380AC_CHECK_HEADERS ( [ stonith/stonith.h] ,
14061381 [
1407- AC_CHECK_LIB ( [ pils] , [ PILLoadPlugin] )
1408- AC_CHECK_LIB ( [ plumb] , [ G_main_add_IPC_Channel] )
1382+ save_LIBS="$LIBS"
1383+ STONITH_LIBS=""
1384+ LIBS=""
1385+ AC_SEARCH_LIBS ( [ PILLoadPlugin] , [ pils] ,
1386+ [ test "$ac_cv_search_PILLoadPlugin" = "none required" || STONITH_LIBS="$LIBS"] )
1387+
1388+ LIBS=""
1389+ AC_SEARCH_LIBS ( [ G_main_add_IPC_Channel] , [ plumb] ,
1390+ [ test "$ac_cv_search_G_main_add_IPC_Channel" = "none required" || STONITH_LIBS="$STONITH_LIBS $LIBS"] )
1391+ AC_SUBST ( STONITH_LIBS )
1392+ LIBS="$save_LIBS"
1393+
14091394 PCMK_FEATURES="$PCMK_FEATURES lha"
14101395 ] )
14111396AM_CONDITIONAL([ BUILD_LHA_SUPPORT] , [ test x"$ac_cv_header_stonith_stonith_h" = x"yes"] )
@@ -2047,6 +2032,8 @@ AC_CONFIG_FILES(Makefile \
20472032 lib/common/tests/strings/Makefile \
20482033 lib/common/tests/utils/Makefile \
20492034 lib/common/tests/xml/Makefile \
2035+ lib/common/tests/xml_comment/Makefile \
2036+ lib/common/tests/xml_element/Makefile \
20502037 lib/common/tests/xpath/Makefile \
20512038 lib/fencing/Makefile \
20522039 lib/libpacemaker.pc \
0 commit comments