summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac15
-rw-r--r--src/build_macros.m414
-rw-r--r--src/external/libunistring.m431
3 files changed, 45 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index 39f6a319..cdf46d4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,16 +157,15 @@ m4_include([src/external/libndr_nbt.m4])
WITH_UNICODE_LIB
if test x$unicode_lib = xlibunistring; then
- m4_include([src/external/libunistring.m4])
- AC_DEFINE_UNQUOTED(HAVE_LIBUNISTRING, 1, [Using libunistring for unicode])
- UNICODE_LIBS=-lunistring
- AC_SUBST(UNICODE_LIBS)
+ m4_include([src/external/libunistring.m4])
+ AC_DEFINE_UNQUOTED(HAVE_LIBUNISTRING, 1, [Using libunistring for unicode])
+ UNICODE_LIBS=$UNISTRING_LIBS
else
- m4_include([src/external/glib.m4])
- AC_DEFINE_UNQUOTED(HAVE_GLIB2, 1, [Using libunistring for unicode])
- UNICODE_LIBS=$GLIB2_LIBS
- AC_SUBST(UNICODE_LIBS)
+ m4_include([src/external/glib.m4])
+ AC_DEFINE_UNQUOTED(HAVE_GLIB2, 1, [Using glib2 for unicode])
+ UNICODE_LIBS=$GLIB2_LIBS
fi
+AC_SUBST(UNICODE_LIBS)
WITH_LIBNL
diff --git a/src/build_macros.m4 b/src/build_macros.m4
index 8cd2d3cd..92d7c65d 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 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 "