From: Christos Zoulas Date: Fri, 13 Feb 2009 18:48:05 +0000 (+0000) Subject: recent changes. X-Git-Tag: FILE5_01~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bacd2d4546837a5c6878499a5d9482434f100802;p=file recent changes. --- diff --git a/ChangeLog b/ChangeLog index b9d35795..f9336dd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-13 13:45 Christos Zoulas + + * look for struct option to determine if getopt.h is usable for IRIX. + + * sanitize cdf document strings + 2009-02-04 13:25 Christos Zoulas * fix OS/2 warnings. diff --git a/Makefile.am b/Makefile.am index 0300b9f4..6ecf0be3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +#ACLOCAL_AMFLAGS = -I m4 + EXTRA_DIST = MAINT SUBDIRS = src magic tests doc python diff --git a/acinclude.m4 b/acinclude.m4 index 31677b18..ff6a657d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -9,6 +9,7 @@ AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone, if test "$ac_cv_struct_tm_zone" = yes; then AC_DEFINE(HAVE_TM_ZONE,1,[HAVE_TM_ZONE]) fi + AC_CACHE_CHECK(for tzname, ac_cv_var_tzname, [AC_TRY_LINK( changequote(<<, >>)dnl @@ -29,6 +30,7 @@ AC_CACHE_CHECK([for tm_isdst in struct tm], ac_cv_struct_tm_isdst, if test "$ac_cv_struct_tm_isdst" = yes; then AC_DEFINE(HAVE_TM_ISDST,1,[HAVE_TM_ISDST]) fi + AC_CACHE_CHECK(for daylight, ac_cv_var_daylight, [AC_TRY_LINK( changequote(<<, >>)dnl @@ -42,3 +44,12 @@ changequote([, ])dnl AC_DEFINE(HAVE_DAYLIGHT,1,[HAVE_DAYLIGHT]) fi ]) + +AC_DEFUN([AC_STRUCT_OPTION_GETOPT_H], +[AC_CACHE_CHECK([for struct option in getopt], ac_cv_struct_option_getopt_h, +[AC_TRY_COMPILE([#include ], [struct option op; op.name;], + ac_cv_struct_option_getopt_h=yes, ac_cv_struct_option_getopt_h=no)]) +if test "$ac_cv_struct_option_getopt_h" = yes; then + AC_DEFINE(HAVE_STRUCT_OPTION,1,[HAVE_STRUCT_OPTION]) +fi +]) diff --git a/configure.ac b/configure.ac index 071ee281..4fea9fd8 100644 --- a/configure.ac +++ b/configure.ac @@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(file, 5.00, christos@astron.com) AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) +#AC_CONFIG_MACRO_DIR([m4]) AC_MSG_CHECKING(for builtin ELF support) AC_ARG_ENABLE(elf, @@ -82,6 +83,8 @@ AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_TYPE_MBSTATE_T +AC_STRUCT_OPTION_GETOPT_H + AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t]) AC_CHECK_SIZEOF(long long) AH_BOTTOM([ diff --git a/src/file.c b/src/file.c index 806d2ec6..91a5b416 100644 --- a/src/file.c +++ b/src/file.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: file.c,v 1.129 2008/12/03 18:05:18 christos Exp $") +FILE_RCSID("@(#)$File: file.c,v 1.130 2009/02/03 20:27:51 christos Exp $") #endif /* lint */ #include "magic.h" @@ -61,7 +61,7 @@ FILE_RCSID("@(#)$File: file.c,v 1.129 2008/12/03 18:05:18 christos Exp $") #include #endif -#ifdef HAVE_GETOPT_H +#if defined(HAVE_GETOPT_H) && defined(HAVE_STRUCT_OPTION) #include #else #include "mygetopt.h" diff --git a/src/getopt_long.c b/src/getopt_long.c index cb5c06a3..f0fb1b0d 100644 --- a/src/getopt_long.c +++ b/src/getopt_long.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: getopt_long.c,v 1.4 2008/11/04 16:38:28 christos Exp $") +FILE_RCSID("@(#)$File: getopt_long.c,v 1.5 2009/02/03 20:27:51 christos Exp $") #endif /* lint */ #include @@ -42,7 +42,7 @@ FILE_RCSID("@(#)$File: getopt_long.c,v 1.4 2008/11/04 16:38:28 christos Exp $") #define warnx printf #endif #include -#ifdef HAVE_GETOPT_H +#if defined(HAVE_GETOPT_H) && defined(HAVE_STRUCT_OPTION) #include #else #include "mygetopt.h"