aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--src/path.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index d9efd1f0c..b6b9c0c72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,9 @@ AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
-AC_CHECK_HEADER(langinfo.h,[enable_langinfo=yes;AC_DEFINE(HAVE_LANGINFO,1,[Define if nl_langinfo.h is present])],enable_langinfo=no)
+dnl doesn't work for systems that don't have CODESET like OpenBSD
+dnl AC_CHECK_HEADER(langinfo.h,[enable_langinfo=yes;AC_DEFINE(HAVE_LANGINFO,1,[Define if nl_langinfo.h is present])],enable_langinfo=no)
+AM_LANGINFO_CODESET
AC_CHECK_HEADER(locale.h,[enable_locale=yes;AC_DEFINE(HAVE_LOCALE,1,[Define if locale.h is present])],enable_locale=no)
if test x$enable_ipv6 = xyes; then
@@ -499,7 +501,7 @@ else
echo "locale support ................disabled"
fi
-if test x$enable_langinfo = xyes; then
+if test x$am_cv_langinfo_codeset = xyes; then
echo "langinfo support ..............enabled"
else
echo "langinfo support ..............disabled"
diff --git a/src/path.c b/src/path.c
index f93894c7b..d7b08d6be 100644
--- a/src/path.c
+++ b/src/path.c
@@ -29,7 +29,7 @@
#include <unistd.h>
#ifdef HAVE_LOCALE
-#ifdef HAVE_LANGINFO
+#ifdef HAVE_LANGINFO_CODESET
#include <locale.h>
#include <langinfo.h>
#endif
@@ -138,7 +138,7 @@ void initPaths(char * playlistDirArg, char * musicDirArg) {
charset = strdup(getConf()[CONF_FS_CHARSET]);
}
#ifdef HAVE_LOCALE
-#ifdef HAVE_LANGINFO
+#ifdef HAVE_LANGINFO_CODESET
else if((originalLocale = setlocale(LC_CTYPE,NULL))) {
char * temp;
char * currentLocale;