diff --git a/api/Makefile.am b/api/Makefile.am index ab778af..a52a351 100644 --- a/api/Makefile.am +++ b/api/Makefile.am @@ -1,14 +1,18 @@ # $Id$ +if BUILD_SNPRINTF +SRCS_SNPRINTF = snprintf.c +endif + lib_LTLIBRARIES = libepplet.la include_HEADERS = epplet.h -libepplet_la_SOURCES = epplet.c snprintf.c +libepplet_la_SOURCES = epplet.c $(SRCS_SNPRINTF) libepplet_la_DEPENDENCIES = $(top_builddir)/config.h epplet.h -libepplet_la_LDFLAGS = -version-info 1:0:0 +libepplet_la_LDFLAGS = -version-info 2:0:0 INCLUDES = -I$(top_srcdir) $(X_CFLAGS) -DEROOT=\"@EROOT@\" LDADD = -L$(libdir) -L$(prefix)/lib $(LIBS) $(X_LIBS) -EXTRA_DIST = epplet.h.in +EXTRA_DIST = epplet.h.in snprintf.c diff --git a/api/epplet.h.in b/api/epplet.h.in index c6ead79..92fba18 100644 --- a/api/epplet.h.in +++ b/api/epplet.h.in @@ -41,18 +41,15 @@ #define __sun__ #endif -#if defined(HAVE_VARARGS_H) && !defined(HAVE_STDARG_H) -#include -int Evsnprintf(char *str, size_t count, const char *fmt, va_list args); -int Esnprintf(va_alist); - +#define HAVE_SNPRINTF @HAVE_SNPRINTF@ +#if HAVE_SNPRINTF +#define Evsnprintf vsnprintf +#define Esnprintf snprintf #else -/* If they don't have stdarg.h, they have bigger problems.... */ -#include -int Evsnprintf(char *str, size_t count, const char *fmt, va_list args); -int Esnprintf(char *str, size_t count, const char *fmt,...); - -#endif +int Evsnprintf(char *str, size_t count, const char *fmt, + va_list args); +int Esnprintf(char *str, size_t count, const char *fmt, ...); +#endif /* HAVE_SNPRINTF */ /****************************************************************************/ /* Data structures & primitives */ diff --git a/configure.in b/configure.in index 70ca602..9b17296 100644 --- a/configure.in +++ b/configure.in @@ -86,7 +86,9 @@ AC_TYPE_UID_T dnl# Checks for library functions. AC_TYPE_SIGNAL -dnl#AC_CHECK_FUNCS() +AC_CHECK_FUNCS(snprintf, x=1, x=0) +AC_SUBST(HAVE_SNPRINTF, $x) +AM_CONDITIONAL(BUILD_SNPRINTF, test "x$x" = "x0") # ok enlightenment d00ds want to ignore civilization and install # everything in one place. The rest of use prefer sanity.