summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-10-21 09:15:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:31 -0500
commit5a4b133d1ce7ec5043a092396072be5374b3cf24 (patch)
treea833be78d4a09fad8d469eeaf2b8810cc4ed86cc
parentce37cdb593f796fbd8778cb1a563bfa7bcc7befc (diff)
downloadsamba-5a4b133d1ce7ec5043a092396072be5374b3cf24.tar.gz
samba-5a4b133d1ce7ec5043a092396072be5374b3cf24.tar.bz2
samba-5a4b133d1ce7ec5043a092396072be5374b3cf24.zip
r19438: try to fix up the build breakages on BSD systems due to incorrectly
detecting iconv.h (This used to be commit e6baa13e1f9c35f95021512b713cebba680b2a72)
-rw-r--r--source4/lib/charset/config.m413
-rw-r--r--source4/lib/replace/system/iconv.h6
2 files changed, 11 insertions, 8 deletions
diff --git a/source4/lib/charset/config.m4 b/source4/lib/charset/config.m4
index ce278a6e4c..fb845aa67c 100644
--- a/source4/lib/charset/config.m4
+++ b/source4/lib/charset/config.m4
@@ -1,5 +1,6 @@
-dnl SMB_CHECK_ICONV(action-if-found,action-if-not-found)
+dnl SMB_CHECK_ICONV(hdr, msg, action-if-found,action-if-not-found)
AC_DEFUN(SMB_CHECK_ICONV,[
+ AC_MSG_CHECKING($2)
AC_TRY_RUN([#include <stdlib.h>
#include <$1>
@@ -9,7 +10,7 @@ int main()
if (cd == 0 || cd == (iconv_t)-1) return -1;
return 0;
}
- ],[$2],[$3])
+ ],[AC_MSG_RESULT(yes); $3],[AC_MSG_RESULT(no); $4])
])
dnl SMB_CHECK_ICONV_DIR(dir,action-if-found,action-if-not-found)
@@ -22,9 +23,9 @@ AC_DEFUN(SMB_CHECK_ICONV_DIR,
LDFLAGS="-L$1/lib"
LIBS=-liconv
- SMB_CHECK_ICONV(iconv.h,[ AC_DEFINE(HAVE_ICONV_H,1,[Whether iconv.h is present]) $2 ], [
+ SMB_CHECK_ICONV(iconv.h,Whether iconv.h is present,[ AC_DEFINE(HAVE_ICONV_H,1,[Whether iconv.h is present]) $2 ], [
LIBS=-lgiconv
- SMB_CHECK_ICONV(giconv.h,[AC_DEFINE(HAVE_GICONV_H,1,[Whether giconv.h is present]) $2],[$3])
+ SMB_CHECK_ICONV(giconv.h,Whether giconv.h is present, [AC_DEFINE(HAVE_GICONV_H,1,[Whether giconv.h is present]) $2],[$3])
])
CPPFLAGS="$save_CPPFLAGS"
@@ -52,7 +53,9 @@ AC_ARG_WITH(libiconv,
])
if test x$ICONV_FOUND = xno; then
- SMB_CHECK_ICONV(iconv.h,[AC_DEFINE(HAVE_ICONV_H,1,[Whether iconv.h is present]) ICONV_FOUND=yes])
+ SMB_CHECK_ICONV(iconv.h,
+ [Whether iconv.h is present],
+ [AC_DEFINE(HAVE_ICONV_H,1,[Whether iconv.h is present]) ICONV_FOUND=yes])
fi
for i in $LOOK_DIRS ; do
diff --git a/source4/lib/replace/system/iconv.h b/source4/lib/replace/system/iconv.h
index abc2d6f4e1..f01d135dd1 100644
--- a/source4/lib/replace/system/iconv.h
+++ b/source4/lib/replace/system/iconv.h
@@ -35,11 +35,11 @@
#endif
#ifdef HAVE_NATIVE_ICONV
-#if defined(HAVE_ICONV)
+#if defined(HAVE_ICONV_H)
#include <iconv.h>
-#elif defined(HAVE_GICONV)
+#elif defined(HAVE_GICONV_H)
#include <giconv.h>
-#elif defined(HAVE_BICONV)
+#elif defined(HAVE_BICONV_H)
#include <biconv.h>
#endif
#endif /* HAVE_NATIVE_ICONV */