We enable the config.h again and check if getrpcbynumber and
getrpcbyname exists on the building patform. If it does not exist, then
provide those functions.
This is needed for musl libc.
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
aclocal
libtoolize --force --copy
-#autoheader
+autoheader
automake --add-missing --copy --gnu # -Wall
autoconf # -Wall
fi
AC_PROG_CC
-m4_pattern_allow(AM_CONFIG_HEADERS(config.h))
+AC_CONFIG_HEADERS([config.h])
AC_PROG_LIBTOOL
AC_HEADER_DIRENT
AC_PREFIX_DEFAULT(/usr)
AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([nsl], [yp_get_default_domain])
-
+AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
AC_OUTPUT(libtirpc.pc)
+
+
#include <libc_private.h>
#endif
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*
* Internet version.
*/
return (d);
}
-#ifdef GQ
+#if !HAVE_GETRPCBYNYMBER
struct rpcent *
getrpcbynumber(number)
int number;
endrpcent();
return (p);
}
+#endif /* !HAVE_GETRPCBYNUMBER */
+#if !HAVE_GETRPCBYNAME
struct rpcent *
getrpcbyname(name)
const char *name;
endrpcent();
return (rpc);
}
-#endif /* GQ */
+#endif /* !HAVE_GETRPCBYNAME */
void
setrpcent(f)