Skip to content

Commit

Permalink
try detecting if libmxml needs also libpthread
Browse files Browse the repository at this point in the history
  • Loading branch information
tjko committed Aug 12, 2015
1 parent ad53df8 commit cd9fc53
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 22 deletions.
12 changes: 9 additions & 3 deletions config/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ AC_ARG_WITH(libmxml, [ --with-libmxml=DIR libmxml is installed in ],

dnl Checks for libraries.

AC_CHECK_LIB(mxml, mxmlLoadFile, ,[
echo "Cannot find libmxml or you have too old version (2.6 or later required)."
exit 1
dnl AC_CHECK_LIB(mxml, mxmlLoadFile, ,[
dnl echo "Cannot find libmxml or you have too old version (2.6 or later required)."
dnl exit 1
dnl ])

AC_SEARCH_LIBS([mxmlLoadFile], [mxml],,[
AC_SEARCH_LIBS([mxmlLoadFile], [mxml],,[
AC_MSG_ERROR([cannot find libmxml])
],[pthread])
])

dnl AC_CHECK_LIB(m, round)
Expand Down
108 changes: 89 additions & 19 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3325,13 +3325,13 @@ fi



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mxmlLoadFile in -lmxml" >&5
$as_echo_n "checking for mxmlLoadFile in -lmxml... " >&6; }
if ${ac_cv_lib_mxml_mxmlLoadFile+:} false; then :

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mxmlLoadFile" >&5
$as_echo_n "checking for library containing mxmlLoadFile... " >&6; }
if ${ac_cv_search_mxmlLoadFile+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmxml $LIBS"
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
Expand All @@ -3350,28 +3350,98 @@ return mxmlLoadFile ();
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_mxml_mxmlLoadFile=yes
else
ac_cv_lib_mxml_mxmlLoadFile=no
for ac_lib in '' mxml; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_mxmlLoadFile=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
conftest$ac_exeext
if ${ac_cv_search_mxmlLoadFile+:} false; then :
break
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mxml_mxmlLoadFile" >&5
$as_echo "$ac_cv_lib_mxml_mxmlLoadFile" >&6; }
if test "x$ac_cv_lib_mxml_mxmlLoadFile" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBMXML 1
done
if ${ac_cv_search_mxmlLoadFile+:} false; then :

else
ac_cv_search_mxmlLoadFile=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mxmlLoadFile" >&5
$as_echo "$ac_cv_search_mxmlLoadFile" >&6; }
ac_res=$ac_cv_search_mxmlLoadFile
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

else

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mxmlLoadFile" >&5
$as_echo_n "checking for library containing mxmlLoadFile... " >&6; }
if ${ac_cv_search_mxmlLoadFile+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mxmlLoadFile ();
int
main ()
{
return mxmlLoadFile ();
;
return 0;
}
_ACEOF
for ac_lib in '' mxml; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib pthread $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_mxmlLoadFile=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_mxmlLoadFile+:} false; then :
break
fi
done
if ${ac_cv_search_mxmlLoadFile+:} false; then :

LIBS="-lmxml $LIBS"
else
ac_cv_search_mxmlLoadFile=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mxmlLoadFile" >&5
$as_echo "$ac_cv_search_mxmlLoadFile" >&6; }
ac_res=$ac_cv_search_mxmlLoadFile
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

else

echo "Cannot find libmxml or you have too old version (2.6 or later required)."
exit 1
as_fn_error $? "cannot find libmxml" "$LINENO" 5

fi


fi

Expand Down

0 comments on commit cd9fc53

Please sign in to comment.