aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-08-26 21:52:12 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-08-26 21:52:12 +0300
commit0b4ff99fec136012af7a54f179bdf601e55e6274 (patch)
tree8a366d55be5cf40ff0c50e7fe5e36fa9a3104d14
parent8e34526a147a2e07c08c950b9f28c2e2132b6fd3 (diff)
downloadegawk-0b4ff99fec136012af7a54f179bdf601e55e6274.tar.gz
egawk-0b4ff99fec136012af7a54f179bdf601e55e6274.tar.bz2
egawk-0b4ff99fec136012af7a54f179bdf601e55e6274.zip
Use config.h properly. Add AC_SYS_LARGEFILE.
-rw-r--r--extension/ChangeLog8
-rw-r--r--extension/configh.in11
-rwxr-xr-xextension/configure202
-rw-r--r--extension/configure.ac1
-rw-r--r--extension/filefuncs.c5
-rw-r--r--extension/fnmatch.c8
-rw-r--r--extension/fork.c6
-rw-r--r--extension/ordchr.c7
-rw-r--r--extension/readdir.c7
-rw-r--r--extension/readfile.c6
-rw-r--r--extension/revoutput.c6
-rw-r--r--extension/revtwoway.c8
-rw-r--r--extension/rwarray.c4
-rw-r--r--extension/rwarray0.c4
-rw-r--r--extension/testext.c5
-rw-r--r--extension/time.c6
16 files changed, 275 insertions, 19 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index be3cf086..74ad26a4 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,11 @@
+2012-08-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac (AC_SYS_LARGEFILE): Added. Needed for consistency
+ with gawk, to get the same size struct stat everywhere.
+ * filefuncs.c, fnmatch.c, fork.c, ordchr.c, readdir.c, readfile.c,
+ revoutput.c, revtwoway.c, rwarray.c, rwarray0.c, testext.c,
+ time.c: Move include of config.h to top (or add it!)
+
2012-08-24 Arnold D. Robbins <arnold@skeeve.com>
* filefuncs.c, fnmatch.c, fork.c, ordchr.c, readdir.c, readfile.c,
diff --git a/extension/configh.in b/extension/configh.in
index 571b7a7e..e621a139 100644
--- a/extension/configh.in
+++ b/extension/configh.in
@@ -128,6 +128,17 @@
/* Version number of package */
#undef VERSION
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
diff --git a/extension/configure b/extension/configure
index 7030c8b1..632c0d76 100755
--- a/extension/configure
+++ b/extension/configure
@@ -771,6 +771,7 @@ with_gnu_ld
enable_rpath
with_libiconv_prefix
with_libintl_prefix
+enable_largefile
enable_static
enable_shared
with_pic
@@ -1411,6 +1412,7 @@ Optional Features:
--disable-dependency-tracking
speeds up one-time build
--disable-rpath do not hardcode runtime library paths
+ --disable-largefile omit support for large files
--enable-static[=PKGS] build static libraries [default=no]
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-fast-install[=PKGS]
@@ -6257,6 +6259,206 @@ unknown)
;;
esac
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+
+
+fi
+
# Check whether --enable-static was given.
if test "${enable_static+set}" = set; then :
enableval=$enable_static; p=${PACKAGE-default}
diff --git a/extension/configure.ac b/extension/configure.ac
index 4869584b..9a3ddd98 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -37,6 +37,7 @@ AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.1])
AM_PROG_AR
+AC_SYS_LARGEFILE
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
dnl AC_PROG_INSTALL
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index 9f498706..89eaffc7 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -30,6 +30,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
@@ -40,7 +44,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
#include "gawkapi.h"
#include "gettext.h"
diff --git a/extension/fnmatch.c b/extension/fnmatch.c
index 6a4d4635..727c9daf 100644
--- a/extension/fnmatch.c
+++ b/extension/fnmatch.c
@@ -27,16 +27,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
-#include <assert.h>
-#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
+
#include "gawkapi.h"
#include "gettext.h"
diff --git a/extension/fork.c b/extension/fork.c
index 9f9fc086..6f96e4ba 100644
--- a/extension/fork.c
+++ b/extension/fork.c
@@ -26,6 +26,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
@@ -36,7 +40,7 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
+
#include "gawkapi.h"
#include "gettext.h"
diff --git a/extension/ordchr.c b/extension/ordchr.c
index 5abb6236..7e3eda5e 100644
--- a/extension/ordchr.c
+++ b/extension/ordchr.c
@@ -29,16 +29,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
-#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
+
#include "gawkapi.h"
#include "gettext.h"
diff --git a/extension/readdir.c b/extension/readdir.c
index 6ce7bea7..220d1725 100644
--- a/extension/readdir.c
+++ b/extension/readdir.c
@@ -27,9 +27,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#define _BSD_SOURCE
#include <stdio.h>
-#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -38,8 +41,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
-
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#else
diff --git a/extension/readfile.c b/extension/readfile.c
index 5abb5763..7d5f78af 100644
--- a/extension/readfile.c
+++ b/extension/readfile.c
@@ -31,6 +31,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
@@ -41,7 +45,7 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
+
#include "gawkapi.h"
#include "gettext.h"
diff --git a/extension/revoutput.c b/extension/revoutput.c
index bb195a29..7430e61b 100644
--- a/extension/revoutput.c
+++ b/extension/revoutput.c
@@ -27,6 +27,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -35,8 +39,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
-
#include "gawkapi.h"
#include "gettext.h"
diff --git a/extension/revtwoway.c b/extension/revtwoway.c
index 9ce0c733..0c1d9b00 100644
--- a/extension/revtwoway.c
+++ b/extension/revtwoway.c
@@ -27,9 +27,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
-#include <assert.h>
-#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -37,8 +39,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
-
#include "gawkapi.h"
#include "gettext.h"
diff --git a/extension/rwarray.c b/extension/rwarray.c
index 371078ed..d8a54fde 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -27,6 +27,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
diff --git a/extension/rwarray0.c b/extension/rwarray0.c
index c511ce00..c50c6a38 100644
--- a/extension/rwarray0.c
+++ b/extension/rwarray0.c
@@ -27,6 +27,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
diff --git a/extension/testext.c b/extension/testext.c
index d0215d9d..bb62fa01 100644
--- a/extension/testext.c
+++ b/extension/testext.c
@@ -24,6 +24,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
@@ -34,7 +38,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
#include "gawkapi.h"
static const gawk_api_t *api; /* for convenience macros to work */
diff --git a/extension/time.c b/extension/time.c
index 24c7572f..89811c41 100644
--- a/extension/time.c
+++ b/extension/time.c
@@ -25,6 +25,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
@@ -34,7 +38,7 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
+
#include "gawkapi.h"
#include "gettext.h"