From 9dbdf62243f01f6aee41c2b5f2976c56da47f25d Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 31 Aug 2013 15:32:39 +0200 Subject: AUTOTOOLS: Refactor unicode library detection If $libdir is not in default library path libunistring cannot be found. (pkg-config can not be used in this case). This patch helps to search libunistring in "$libdir" directory. In refactoring part, indentation was updated to be more readable and some duplicated parts were removed. --- src/external/libunistring.m4 | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'src/external/libunistring.m4') diff --git a/src/external/libunistring.m4 b/src/external/libunistring.m4 index 18ea3e62..bbc92b33 100644 --- a/src/external/libunistring.m4 +++ b/src/external/libunistring.m4 @@ -1,14 +1,31 @@ -AC_CHECK_HEADERS(unistr.h, - [AC_CHECK_LIB([unistring], [u8_strlen], [ UNISTRING_LIBS="-lunistring" ], [AC_MSG_ERROR([No usable libunistring library found])])], +SSS_AC_EXPAND_LIB_DIR() + +AC_CHECK_HEADERS([unistr.h], + [AC_CHECK_LIB([unistring], + [u8_strlen], + [UNISTRING_LIBS="-lunistring"], + [AC_MSG_ERROR([No usable libunistring library found])], + [-L$sss_extra_libdir])], [AC_MSG_ERROR([libunistring header files are not installed])] ) -AC_CHECK_HEADERS(unicase.h, - [AC_CHECK_LIB([unistring], [u8_casecmp], [ UNISTRING_LIBS="-lunistring" ], [AC_MSG_ERROR([No usable libunistring library found])])], +AC_CHECK_HEADERS([unicase.h], + [AC_CHECK_LIB([unistring], + [u8_casecmp], + [UNISTRING_LIBS="-lunistring"], + [AC_MSG_ERROR([No usable libunistring library found])], + [-L$sss_extra_libdir])], [AC_MSG_ERROR([libunistring header files are not installed])] ) -AC_CHECK_HEADERS(unistr.h, - [AC_CHECK_LIB([unistring], [u8_check], [ UNISTRING_LIBS="-lunistring" ], [AC_MSG_ERROR([No usable libunistring library found])])], +AC_CHECK_HEADERS([unistr.h], + [AC_CHECK_LIB([unistring], + [u8_check], + [UNISTRING_LIBS="-lunistring"], + [AC_MSG_ERROR([No usable libunistring library found])], + [-L$sss_extra_libdir])], [AC_MSG_ERROR([libunistring header files are not installed])] -) \ No newline at end of file +) + + +UNISTRING_LIBS="-L$sss_extra_libdir $UNISTRING_LIBS " -- cgit