On HP-UX 11, the ldexp function requires linking against libm.
Moreover, instead of strtoull declared in <stdlib.h> we have
__strtoull declared in <inttypes.h>. Add configure tests to
find these.
check_PROGRAMS = test/crossparse test/normalize test/randomdecl
check_LIBRARIES = libtest.a
check_PROGRAMS = test/crossparse test/normalize test/randomdecl
check_LIBRARIES = libtest.a
-libtest_a_SOURCES = test/testlib.c test/rng.c common/src/help.c
+libtest_a_SOURCES = test/testlib.c common/src/help.c
$(libtest_a_OBJECTS): $(gnulib_headers)
$(libtest_a_OBJECTS): $(gnulib_headers)
-test_randomdecl_SOURCES = test/randomdecl.c test/declgen.c
-test_randomdecl_LDADD = libtest.a libcdecl.la libgnu.la
+test_randomdecl_SOURCES = test/randomdecl.c test/declgen.c test/rng.c
+test_randomdecl_LDADD = libtest.a libcdecl.la libgnu.la $(LDEXP_LIBM)
$(test_randomdecl_OBJECTS): $(gnulib_headers)
test_crossparse_LDADD = libtest.a libcdecl.la libgnu.la
$(test_randomdecl_OBJECTS): $(gnulib_headers)
test_crossparse_LDADD = libtest.a libcdecl.la libgnu.la
+ * Improved portability of the test suite.
* Various bug fixes and improvements.
Release 1.1:
* Various bug fixes and improvements.
Release 1.1:
AC_CONFIG_TESTDIR([.], [test:.])
DX_PROG_AUTOTEST
AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
AC_CONFIG_TESTDIR([.], [test:.])
DX_PROG_AUTOTEST
AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
+AC_CHECK_FUNCS_ONCE([strtoull __strtoull])
AC_CONFIG_FILES([
Makefile
AC_CONFIG_FILES([
Makefile
/intmax_t.m4
/inttypes.m4
/inttypes_h.m4
/intmax_t.m4
/inttypes.m4
/inttypes_h.m4
/lib-ld.m4
/lib-link.m4
/lib-prefix.m4
/lib-ld.m4
/lib-link.m4
/lib-prefix.m4
# getopt-gnu \
# gettext-h \
# gitlog-to-changelog \
# getopt-gnu \
# gettext-h \
# gitlog-to-changelog \
# localcharset \
# lock \
# mbswidth \
# localcharset \
# lock \
# mbswidth \
getopt-gnu
gettext-h
gitlog-to-changelog
getopt-gnu
gettext-h
gitlog-to-changelog
localcharset
lock
mbswidth
localcharset
lock
mbswidth
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <float.h>
#include <errno.h>
#include <limits.h>
#include <float.h>
+#if HAVE_STRTOULL
+# define STRTOULL strtoull
+#elif HAVE___STRTOULL
+/* HP-UX 11 has __strtoull in <inttypes.h> */
+# define STRTOULL __strtoull
+#else
+/*
+ * Just fall back to strtoul -- in the worst case we just lose the ability
+ * to set all 64 bits of the seed.
+ */
+# define STRTOULL strtoul
+#endif
+
struct test_rng *test_rng_alloc(const char *seed_str)
{
unsigned long long seed;
struct test_rng *test_rng_alloc(const char *seed_str)
{
unsigned long long seed;
- seed = strtoull(seed_str, &end, 0);
+ seed = STRTOULL(seed_str, &end, 0);
if (*end != 0) {
fprintf(stderr, "%s: invalid seed\n", seed_str);
return NULL;
if (*end != 0) {
fprintf(stderr, "%s: invalid seed\n", seed_str);
return NULL;