Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

do not check certain features on non-64 systems

  • Loading branch information...
commit b40ec41655a6f59705df247d71754aa42505485b 1 parent 1550e5c
Lev Walkin authored
3  asn1c/tests/Makefile.am
View
@@ -4,6 +4,9 @@ dist_check_SCRIPTS = check-assembly.sh
TESTS_ENVIRONMENT= CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh
TESTS = check-*.c
+if TEST_64BIT
+TESTS += check64-*.c
+endif
EXTRA_DIST = \
check-*.c* \
3  asn1c/tests/Makefile.in
View
@@ -33,6 +33,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
+@TEST_64BIT_TRUE@am__append_1 = check64-*.c
subdir = asn1c/tests
DIST_COMMON = README $(dist_check_SCRIPTS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -174,7 +175,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
dist_check_SCRIPTS = check-assembly.sh
TESTS_ENVIRONMENT = CC="${CC}" CFLAGS="${TESTSUITE_CFLAGS} ${CFLAGS} -Wno-error=unused-variable" CXXFLAGS="${CXXFLAGS}" ./check-assembly.sh
-TESTS = check-*.c
+TESTS = check-*.c $(am__append_1)
EXTRA_DIST = \
check-*.c* \
data-62 \
8 asn1c/tests/check-134.-gen-PER.c → asn1c/tests/check64-134.-gen-PER.c
View
@@ -12,13 +12,6 @@
#include <T.h>
-#ifndef _LP64
-int main() {
- assert(sizeof(void *) < 8);
- return;
-}
-#else /* 64-bit platform */
-
static unsigned long i2ul(const INTEGER_t *i) {
unsigned long l;
int ret = asn_INTEGER2ulong(i, &l);
@@ -167,4 +160,3 @@ int main() {
return 0;
}
-#endif /* 64-bit platform */
40 configure
View
@@ -635,6 +635,8 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+TEST_64BIT_FALSE
+TEST_64BIT_TRUE
TESTSUITE_CFLAGS
ADD_CFLAGS
LEXLIB
@@ -13096,6 +13098,40 @@ _ACEOF
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long is longer than 32 bit" >&5
+$as_echo_n "checking size of long is longer than 32 bit... " >&6; }
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "confdefs.h"
+#include <sys/types.h>
+
+int
+main ()
+{
+switch (0) case 0: case (sizeof ($1) >= 8):;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ WIDE_LONG=yes
+else
+ WIDE_LONG=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WIDE_LONG" >&5
+$as_echo "$WIDE_LONG" >&6; }
+ if test x$WIDE_LONG = xyes; then
+ TEST_64BIT_TRUE=
+ TEST_64BIT_FALSE='#'
+else
+ TEST_64BIT_TRUE='#'
+ TEST_64BIT_FALSE=
+fi
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getopt" >&5
$as_echo_n "checking for library containing getopt... " >&6; }
if ${ac_cv_search_getopt+:} false; then :
@@ -13320,6 +13356,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${TEST_64BIT_TRUE}" && test -z "${TEST_64BIT_FALSE}"; then
+ as_fn_error $? "conditional \"TEST_64BIT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
11 configure.ac
View
@@ -62,6 +62,17 @@ AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_CHECK_TYPE(intmax_t, int64_t)
+dnl Test if we should check features that depend on 64-bitness.
+AC_MSG_CHECKING(size of long is longer than 32 bit)
+AS_VAR_PUSHDEF([WIDE_LONG], [WIDE_LONG])
+AC_TRY_COMPILE([#include "confdefs.h"
+#include <sys/types.h>
+], [switch (0) case 0: case (sizeof ($1) >= 8):;],
+ WIDE_LONG=yes, WIDE_LONG=no)
+AC_MSG_RESULT($WIDE_LONG)
+AM_CONDITIONAL([TEST_64BIT], [test x$WIDE_LONG = xyes])
+AS_VAR_POPDEF([WIDE_LONG])
+
dnl For mingw
AC_SEARCH_LIBS(getopt, iberty)
Please sign in to comment.
Something went wrong with that request. Please try again.