summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-08-31 15:32:39 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-09-09 16:23:52 +0200
commit9dbdf62243f01f6aee41c2b5f2976c56da47f25d (patch)
treeaf01cdc80fee7ecc0c279d6a1b76d0678169d896 /src
parentb6198cdbb612c83e096602ea9f32f2c6065b59ec (diff)
downloadsssd-9dbdf62243f01f6aee41c2b5f2976c56da47f25d.tar.gz
sssd-9dbdf62243f01f6aee41c2b5f2976c56da47f25d.tar.xz
sssd-9dbdf62243f01f6aee41c2b5f2976c56da47f25d.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/build_macros.m414
-rw-r--r--src/external/libunistring.m431
2 files changed, 38 insertions, 7 deletions
diff --git a/src/build_macros.m4 b/src/build_macros.m4
index 8cd2d3cde..92d7c65d1 100644
--- a/src/build_macros.m4
+++ b/src/build_macros.m4
@@ -34,3 +34,17 @@ $3
])dnl
fi[]dnl
])])
+
+dnl SSS_AC_EXPAND_LIB_DIR() prepare variable sss_extra_libdir,
+dnl variable will contain expanded version of string "$libdir"
+dnl therefore this variable can be safely added to LDFLAGS as
+dnl "-L$sss_extra_libdir ".
+AC_DEFUN([SSS_AC_EXPAND_LIB_DIR],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_libdir=\"$libdir\"
+ ])
+ sss_extra_libdir="$additional_libdir"
+])
diff --git a/src/external/libunistring.m4 b/src/external/libunistring.m4
index 18ea3e62a..bbc92b332 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 "