check if timegm is present before emulating

This commit is contained in:
Lev Walkin 2014-09-17 02:27:01 -07:00
parent eace46c5db
commit 04fbe62bbc
5 changed files with 28 additions and 11 deletions

View File

@ -45,6 +45,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `timegm' function. */
#undef HAVE_TIMEGM
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

31
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for asn1c 0.9.27.
# Generated by GNU Autoconf 2.69 for asn1c 0.9.28.
#
# Report bugs to <vlm@lionet.info>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='asn1c'
PACKAGE_TARNAME='asn1c'
PACKAGE_VERSION='0.9.27'
PACKAGE_STRING='asn1c 0.9.27'
PACKAGE_VERSION='0.9.28'
PACKAGE_STRING='asn1c 0.9.28'
PACKAGE_BUGREPORT='vlm@lionet.info'
PACKAGE_URL=''
@ -1320,7 +1320,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures asn1c 0.9.27 to adapt to many kinds of systems.
\`configure' configures asn1c 0.9.28 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1390,7 +1390,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of asn1c 0.9.27:";;
short | recursive ) echo "Configuration of asn1c 0.9.28:";;
esac
cat <<\_ACEOF
@ -1501,7 +1501,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
asn1c configure 0.9.27
asn1c configure 0.9.28
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1924,7 +1924,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by asn1c $as_me 0.9.27, which was
It was created by asn1c $as_me 0.9.28, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2739,7 +2739,7 @@ fi
# Define the identity of the package.
PACKAGE='asn1c'
VERSION='0.9.27'
VERSION='0.9.28'
cat >>confdefs.h <<_ACEOF
@ -13302,6 +13302,17 @@ _ACEOF
fi
done
for ac_func in timegm
do :
ac_fn_c_check_func "$LINENO" "timegm" "ac_cv_func_timegm"
if test "x$ac_cv_func_timegm" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_TIMEGM 1
_ACEOF
fi
done
ac_config_files="$ac_config_files skeletons/tests/Makefile libasn1compiler/Makefile libasn1parser/Makefile libasn1print/Makefile asn1c/tests/Makefile libasn1fix/Makefile doc/docsrc/Makefile skeletons/Makefile examples/Makefile asn1c/Makefile doc/Makefile asn1c.spec Makefile"
@ -13840,7 +13851,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by asn1c $as_me 0.9.27, which was
This file was extended by asn1c $as_me 0.9.28, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -13906,7 +13917,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
asn1c config.status 0.9.27
asn1c config.status 0.9.28
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -91,6 +91,7 @@ AC_SEARCH_LIBS(getopt, iberty)
AC_CHECK_FUNCS(strtoimax strtoll)
AC_CHECK_FUNCS(mergesort)
AC_CHECK_FUNCS(mkstemps)
AC_CHECK_FUNCS(timegm)
AC_OUTPUT( \
skeletons/tests/Makefile \

View File

@ -128,6 +128,7 @@ static long GMTOFF(struct tm a){
tzset(); \
} while(0); } while(0);
#ifndef HAVE_TIMEGM
#ifdef _EMULATE_TIMEGM
static time_t timegm(struct tm *tm) {
time_t tloc;
@ -138,6 +139,7 @@ static time_t timegm(struct tm *tm) {
return tloc;
}
#endif /* _EMULATE_TIMEGM */
#endif
#ifndef __ASN_INTERNAL_TEST_MODE__

View File

@ -1,4 +1,4 @@
<!-- XML DTD generated by asn1c-0.9.27 -->
<!-- XML DTD generated by asn1c-0.9.28 -->
<!-- ASN.1 module
ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4)