pgpool2.git / summary / log / commit / refs
commit 95a874ce94abc2859f53ecbd005d3332db423b48
Author: Tatsuo Ishii <ishii@postgresql.org>
Commit: Muhammad Usama <m.usama@gmail.com>
Date: Tue Jan 07 00:23:24 2014 +0000
Fix compilation on Mac OS X.
Mac OS X has strlcpy and it conflicts with pgpool-II's own version of
it. Soltion is, adding checking to configure. Patch contributed by
Usama.
Makefile.in | 2 +-
aclocal.m4 | 4 ++--
configure | 14 ++++++++++++++
configure.in | 2 ++
src/include/config.h.in | 6 ++++++
src/include/pool.h | 6 ++++--
6 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index a90d94f7f..ea70e1e33 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -545,7 +545,7 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
+ chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
diff --git a/aclocal.m4 b/aclocal.m4
index b1ee1d34c..a2e6b5068 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
diff --git a/configure b/configure
index 8c360551e..8ab539319 100755
--- a/configure
+++ b/configure
@@ -12419,6 +12419,20 @@ _ACEOF
fi
+for ac_func in strlcat, strlcpy
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if test "${ac_cv_header_stdc+set}" = set; then :
diff --git a/configure.in b/configure.in
index a28a5b7ec..934542a2f 100644
--- a/configure.in
+++ b/configure.in
@@ -65,6 +65,8 @@ AC_CHECK_LIB(PW, main)
AC_CHECK_LIB(resolv, main)
AC_CHECK_LIB(crypt, main)
+AC_CHECK_FUNCS([strlcat, strlcpy])
+
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
diff --git a/src/include/config.h.in b/src/include/config.h.in
index c578dd9e4..b5c76852d 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -167,6 +167,12 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strlcat,' function. */
+#undef HAVE_STRLCAT_
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
/* Define to 1 if you have the `strtok' function. */
#undef HAVE_STRTOK
diff --git a/src/include/pool.h b/src/include/pool.h
index bb3700a1e..1f25ccbfb 100644
--- a/src/include/pool.h
+++ b/src/include/pool.h
@@ -6,7 +6,7 @@
* pgpool: a language independent connection pool server for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2003-2013 PgPool Global Development Group
+ * Copyright (c) 2003-2014 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
@@ -614,7 +614,9 @@ extern void ClientAuthentication(POOL_CONNECTION *frontend);
extern void pool_getnameinfo_all(SockAddr *saddr, char *remote_host, char *remote_port);
/* strlcpy.c */
-//extern size_t strlcpy(char *dst, const char *src, size_t siz);
+#ifndef HAVE_STRLCPY
+extern size_t strlcpy(char *dst, const char *src, size_t siz);
+#endif
/* ps_status.c */
extern bool update_process_title;
[parent: bcac62968cf5]