summaryrefslogtreecommitdiff
path: root/source3/aclocal.m4
diff options
context:
space:
mode:
Diffstat (limited to 'source3/aclocal.m4')
-rw-r--r--source3/aclocal.m4115
1 files changed, 84 insertions, 31 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4
index f470e2e8b0..21358e2a71 100644
--- a/source3/aclocal.m4
+++ b/source3/aclocal.m4
@@ -64,7 +64,6 @@ AC_DEFUN(SMB_MODULE,
else
AC_MSG_RESULT([not])
fi
- MODULES_CLEAN="$MODULES_CLEAN $2 $3"
])
AC_DEFUN(SMB_SUBSYSTEM,
@@ -533,59 +532,83 @@ AC_DEFUN(jm_ICONV,
jm_cv_func_iconv="no"
jm_cv_lib_iconv=no
jm_cv_giconv=no
+ jm_save_LIBS="$LIBS"
+ LIBS="$LIBS -lbiconv"
AC_TRY_LINK([#include <stdlib.h>
-#include <giconv.h>],
- [iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);],
+#include <biconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
jm_cv_func_iconv=yes
- jm_cv_giconv=yes)
+ jm_cv_biconv=yes
+ jm_cv_include="biconv.h"
+ jm_cv_lib_iconv="yes")
+ LIBS="$jm_save_LIBS"
- if test "$jm_cv_func_iconv" != yes; then
+ if test "$jm_cv_func_iconv" != yes; then
AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
+#include <giconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
- jm_cv_func_iconv=yes)
+ jm_cv_func_iconv=yes
+ jm_cv_include="giconv.h"
+ jm_cv_giconv="yes")
- if test "$jm_cv_lib_iconv" != yes; then
+ if test "$jm_cv_func_iconv" != yes; then
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ jm_cv_include="iconv.h"
+ jm_cv_func_iconv=yes)
+
+ if test "$jm_cv_lib_iconv" != yes; then
+ jm_save_LIBS="$LIBS"
+ LIBS="$LIBS -lgiconv"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <giconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ jm_cv_lib_iconv=yes
+ jm_cv_func_iconv=yes
+ jm_cv_include="giconv.h"
+ jm_cv_giconv=yes)
+ LIBS="$jm_save_LIBS"
+
+ if test "$jm_cv_func_iconv" != yes; then
jm_save_LIBS="$LIBS"
- LIBS="$LIBS -lgiconv"
+ LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
-#include <giconv.h>],
+#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
jm_cv_lib_iconv=yes
- jm_cv_func_iconv=yes
- jm_cv_giconv=yes)
+ jm_cv_include="iconv.h"
+ jm_cv_func_iconv=yes)
LIBS="$jm_save_LIBS"
-
- if test "$jm_cv_func_iconv" != yes; then
- jm_save_LIBS="$LIBS"
- LIBS="$LIBS -liconv"
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
- [iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);],
- jm_cv_lib_iconv=yes
- jm_cv_func_iconv=yes)
- LIBS="$jm_save_LIBS"
fi
fi
fi
-
+ fi
if test "$jm_cv_func_iconv" = yes; then
if test "$jm_cv_giconv" = yes; then
AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
AC_MSG_RESULT(yes)
ICONV_FOUND=yes
else
- AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
- AC_MSG_RESULT(yes)
- ICONV_FOUND=yes
+ if test "$jm_cv_biconv" = yes; then
+ AC_DEFINE(HAVE_BICONV, 1, [What header to include for iconv() function: biconv.h])
+ AC_MSG_RESULT(yes)
+ ICONV_FOUND=yes
+ else
+ AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
+ AC_MSG_RESULT(yes)
+ ICONV_FOUND=yes
+ fi
fi
else
AC_MSG_RESULT(no)
@@ -594,7 +617,11 @@ AC_DEFUN(jm_ICONV,
if test "$jm_cv_giconv" = yes; then
LIBS="$LIBS -lgiconv"
else
- LIBS="$LIBS -liconv"
+ if test "$jm_cv_biconv" = yes; then
+ LIBS="$LIBS -lbiconv"
+ else
+ LIBS="$LIBS -liconv"
+ fi
fi
fi
])
@@ -678,3 +705,29 @@ dnl AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN([AC_DISABLE_STATIC],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
+
+dnl AC_TRY_RUN_STRICT(PROGRAM,CFLAGS,CPPFLAGS,LDFLAGS,
+dnl [ACTION-IF-TRUE],[ACTION-IF-FALSE],
+dnl [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
+AC_DEFUN( [AC_TRY_RUN_STRICT],
+[
+ old_CFLAGS="$CFLAGS";
+ CFLAGS="$2";
+ export CFLAGS;
+ old_CPPFLAGS="$CPPFLAGS";
+ CPPFLAGS="$3";
+ export CPPFLAGS;
+ old_LDFLAGS="$LDFLAGS";
+ LDFLAGS="$4";
+ export LDFLAGS;
+ AC_TRY_RUN([$1],[$5],[$6],[$7]);
+ CFLAGS="$old_CFLAGS";
+ old_CFLAGS="";
+ export CFLAGS;
+ CPPFLAGS="$old_CPPFLAGS";
+ old_CPPFLAGS="";
+ export CPPFLAGS;
+ LDFLAGS="$old_LDFLAGS";
+ old_LDFLAGS="";
+ export LDFLAGS;
+])