[icinga-checkins] icinga.org: icinga-core/master: idoutils: fix solaris <= lacks asprintf ( Julian Wiesner) #1048

git at icinga.org git at icinga.org
Mon Jan 10 16:19:18 CET 2011


Module: icinga-core
Branch: master
Commit: 492a577e6f8afbbb8295446995d8a1f19711c7b1
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=492a577e6f8afbbb8295446995d8a1f19711c7b1

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Jan  5 17:40:26 2011 +0100

idoutils: fix solaris <= lacks asprintf (Julian Wiesner) #1048

refs #1048

---

 Changelog                       |    2 ++
 configure                       |   31 +++++++++++++++++++++++++++++++
 configure.in                    |    8 ++++++++
 module/idoutils/src/Makefile.in |    6 +++++-
 4 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/Changelog b/Changelog
index 665a1c7..7f6e836 100644
--- a/Changelog
+++ b/Changelog
@@ -70,6 +70,8 @@ FIXES
 
 * idoutils: fix unescape display name (Matthieu Kermagoret) #1027
 * idoutils: fix ido2db needs to check for empty command arguments on Solaris (Julian Wiesner) #1047
+* idoutils: fix solaris <= lacks asprintf (Julian Wiesner) #1048
+
 
 1.2.1 - 25/10/2010
 
diff --git a/configure b/configure
index c4f305d..a830261 100755
--- a/configure
+++ b/configure
@@ -655,6 +655,7 @@ icinga_user
 THREADLIBS
 OTHERLIBS
 SOCKETLIBS
+SNPRINTF_O_IDO
 SNPRINTF_O
 EGREP
 GREP
@@ -4362,6 +4363,35 @@ else
 fi
 
 
+ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
+if test "x$ac_cv_func_vsnprintf" = x""yes; then :
+
+else
+  SNPRINTF_O_IDO=../../../common/snprintf.o
+fi
+
+ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
+if test "x$ac_cv_func_snprintf" = x""yes; then :
+
+else
+  SNPRINTF_O_IDO=../../../common/snprintf.o
+fi
+
+ac_fn_c_check_func "$LINENO" "asprintf" "ac_cv_func_asprintf"
+if test "x$ac_cv_func_asprintf" = x""yes; then :
+
+else
+  SNPRINTF_O_IDO=../../../common/snprintf.o
+fi
+
+ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
+if test "x$ac_cv_func_vasprintf" = x""yes; then :
+
+else
+  SNPRINTF_O_IDO=../../../common/snprintf.o
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C99 vsnprintf" >&5
 $as_echo_n "checking for C99 vsnprintf... " >&6; }
 if test "${ac_cv_HAVE_C99_VSNPRINTF+set}" = set; then :
@@ -4419,6 +4449,7 @@ fi
 
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5
 $as_echo_n "checking for library containing getservbyname... " >&6; }
 if test "${ac_cv_search_getservbyname+set}" = set; then :
diff --git a/configure.in b/configure.in
index e3632a4..acb2670 100644
--- a/configure.in
+++ b/configure.in
@@ -61,11 +61,18 @@ else
     fi
 fi
 
+dnl base/Makefile.in
 AC_CHECK_FUNC(vsnprintf,,SNPRINTF_O=../common/snprintf.o)
 AC_CHECK_FUNC(snprintf,,SNPRINTF_O=../common/snprintf.o)
 AC_CHECK_FUNC(asprintf,,SNPRINTF_O=../common/snprintf.o)
 AC_CHECK_FUNC(vasprintf,,SNPRINTF_O=../common/snprintf.o)
 
+dnl module/idoutils/src/Makefile.in
+AC_CHECK_FUNC(vsnprintf,,SNPRINTF_O_IDO=../../../common/snprintf.o)
+AC_CHECK_FUNC(snprintf,,SNPRINTF_O_IDO=../../../common/snprintf.o)
+AC_CHECK_FUNC(asprintf,,SNPRINTF_O_IDO=../../../common/snprintf.o)
+AC_CHECK_FUNC(vasprintf,,SNPRINTF_O_IDO=../../../common/snprintf.o)
+
 AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[
 AC_TRY_RUN([
 #include <sys/types.h>
@@ -98,6 +105,7 @@ fi
 
 dnl AC_CHECK_FUNC(snprintf,AC_DEFINE(HAVE_SNPRINTF),SNPRINTF_O=../common/snprintf.o)
 AC_SUBST(SNPRINTF_O)
+AC_SUBST(SNPRINTF_O_IDO)
 
 
 dnl Checks for library functions.
diff --git a/module/idoutils/src/Makefile.in b/module/idoutils/src/Makefile.in
index b086707..7fcabfa 100644
--- a/module/idoutils/src/Makefile.in
+++ b/module/idoutils/src/Makefile.in
@@ -39,9 +39,13 @@ MATHLIBS=-lm
 OTHERLIBS=@OTHERLIBS@
 THREADLIBS=@THREADLIBS@
 
+# asprintf for Solaris friends ;) 
+SNPRINTF_O_IDO=@SNPRINTF_O_IDO@
+
+
 COMMON_INC=$(CORE_INCLUDE)/config.h $(SRC_INCLUDE)/common.h $(SRC_INCLUDE)/io.h $(SRC_INCLUDE)/protoapi.h $(SRC_INCLUDE)/utils.h
 COMMON_SRC=io.c utils.c
-COMMON_OBJS=io.o utils.o
+COMMON_OBJS=io.o utils.o ${SNPRINTF_O_IDO}
 
 IDO_INC=$(SRC_INCLUDE)/ido2db.h $(SRC_INCLUDE)/db.h
 IDO_SRC=db.c





More information about the icinga-checkins mailing list