Skip to content

Instantly share code, notes, and snippets.

@depressed-pho
Created January 16, 2013 13:32
Show Gist options
  • Save depressed-pho/4547173 to your computer and use it in GitHub Desktop.
Save depressed-pho/4547173 to your computer and use it in GitHub Desktop.
AC_SYS_LARGEFILE bug
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "[email protected]"
/* Define to the full name of this package. */
#define PACKAGE_NAME "ac-sys-largefile-bug"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "ac-sys-largefile-bug 0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ac-sys-largefile-bug"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0"
/* Define to sizeof(ino_t) */
#define SIZEOF_INO_T 4
/* 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 */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to sizeof(ino_t) */
#undef SIZEOF_INO_T
/* 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
AC_INIT([ac-sys-largefile-bug], [0], [[email protected]])
AC_CONFIG_HEADERS([config.h])
AC_SYS_LARGEFILE
AC_MSG_CHECKING([for sizeof(ino_t)])
AC_COMPUTE_INT([SIZEOF_INO_T], [sizeof(ino_t)], [#include <sys/stat.h>])
AC_DEFINE_UNQUOTED([SIZEOF_INO_T], [$SIZEOF_INO_T], [Define to sizeof(ino_t)])
AC_MSG_RESULT([$SIZEOF_INO_T])
AC_OUTPUT
% uname -a
Darwin aria.cielonegro.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh
% autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David J. MacKenzie and Akim Demaille.
% ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for sizeof(ino_t)... 4
configure: creating ./config.status
config.status: creating config.h
% gcc -o main main.c
% ./main
SIZEOF_INO_T in config.h: 4
sizeof(ino_t) in actuality: 8
#include "config.h"
#include <stdio.h>
#include <sys/stat.h>
int main() {
printf("SIZEOF_INO_T in config.h: %d\n", SIZEOF_INO_T);
printf("sizeof(ino_t) in actuality: %d\n", sizeof(ino_t));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment