Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -32,11 +32,13 @@ have_sel_getName="yes" AC_DEFINE(HAVE_SEL_GETNAME, 1, [Whether we have sel_getName])]) test x"$have_sel_get_name" != x"yes" -a x"$have_sel_getName" != x"yes" && \ AC_ERROR(You need either sel_get_name or sel_getName in libobjc!) -AC_CHECK_FUNC(asprintf, AC_DEFINE(HAVE_ASPRINTF, 1, "Whether we have asprintf")) +AC_CHECK_FUNC(asprintf, [ + AC_DEFINE(HAVE_ASPRINTF, 1, "Whether we have asprintf") + AC_SUBST(ASPRINTF, "asprintf.c")]) AC_MSG_CHECKING(whether we have IPv6 support) AC_TRY_RUN([ #include #include Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,1 +1,2 @@ +ASPRINTF = @ASPRINTF@ TESTS = @TESTS@ Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -1,5 +1,7 @@ +include ../extra.mk + LIB = ${LIB_PREFIX}objfw${LIB_SUFFIX} LIB_MAJOR = 1 LIB_MINOR = 0 SRCS = OFArray.m \ @@ -10,11 +12,11 @@ OFListObject.m \ OFObject.m \ OFString.m \ OFTCPSocket.m \ OFXMLFactory.m \ - asprintf.c + ${ASPRINTF} INCLUDES = ${SRCS:.m=.h} \ OFMacros.h \ OFStream.h Index: src/asprintf.c ================================================================== --- src/asprintf.c +++ src/asprintf.c @@ -9,11 +9,10 @@ * the packaging of this file. */ #include "config.h" -#ifndef HAVE_ASPRINTF #include #include #include int @@ -29,6 +28,5 @@ if ((*strp = malloc((size_t)size + 1)) == NULL) return -1; return vsnprintf(*strp, (size_t)size + 1, fmt, args); } -#endif