#! /bin/sh /usr/share/dpatch/dpatch-run
## 16_cred_for_kfreebsd.dpatch by VDR dai (deb) <d+deb@vdr.jp>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNp uim-1.5.7.ORIG/configure uim-1.5.7/configure
--- uim-1.5.7.ORIG/configure 2009-11-23 02:33:06.000000000 +0900
+++ uim-1.5.7/configure 2010-05-27 16:32:56.000000000 +0900
@@ -32995,6 +32995,70 @@ _ACEOF
fi
+{ $as_echo "$as_me:$LINENO: checking for struct cmsgcred" >&5
+$as_echo_n "checking for struct cmsgcred... " >&6; }
+if test "${ac_cv_have_struct_cmsgcred+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int
+main ()
+{
+ struct cmsgcred s;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_struct_cmsgcred="yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_struct_cmsgcred="no"
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_cmsgcred" >&5
+$as_echo "$ac_cv_have_struct_cmsgcred" >&6; }
+if test "x$ac_cv_have_struct_cmsgcred" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRUCT_CMSGCRED 1
+_ACEOF
+
+fi
+
{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5
$as_echo_n "checking for struct sockaddr_in6... " >&6; }
if test "${ac_cv_have_struct_sockaddr_in6+set}" = set; then
diff -urNp uim-1.5.7.ORIG/configure.ac uim-1.5.7/configure.ac
--- uim-1.5.7.ORIG/configure.ac 2009-11-21 21:55:15.000000000 +0900
+++ uim-1.5.7/configure.ac 2010-05-27 16:32:46.000000000 +0900
@@ -613,6 +613,23 @@ if test "x$ac_cv_have_struct_sockaddr_st
[define if you have struct sockaddr_storage data type])
fi
+dnl cred related
+AC_CACHE_CHECK([for struct cmsgcred], ac_cv_have_struct_cmsgcred, [
+ AC_TRY_COMPILE(
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+ ],
+ [ struct cmsgcred s; ],
+ [ ac_cv_have_struct_cmsgcred="yes" ],
+ [ ac_cv_have_struct_cmsgcred="no" ]
+ )
+])
+if test "x$ac_cv_have_struct_cmsgcred" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_CMSGCRED, 1,
+ [define if you have struct cmsgcred data type])
+fi
+
AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
AC_TRY_COMPILE(
[
diff -urNp uim-1.5.7.ORIG/uim/config.h.in uim-1.5.7/uim/config.h.in
--- uim-1.5.7.ORIG/uim/config.h.in 2009-11-23 02:33:01.000000000 +0900
+++ uim-1.5.7/uim/config.h.in 2010-05-27 16:32:53.000000000 +0900
@@ -283,6 +283,9 @@
/* define if you have struct addrinfo data type */
#undef HAVE_STRUCT_ADDRINFO
+/* define if you have struct cmsgcred data type */
+#undef HAVE_STRUCT_CMSGCRED
+
/* define if you have struct in6_addr data type */
#undef HAVE_STRUCT_IN6_ADDR