From b0b9c4dece61ec03c655d50c2eade45ca427e069 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 20 Oct 1997 23:36:30 +0000 Subject: [PATCH] ChangeLog, configure.in, configure: Added check to see if llseek is declared in unistd.h ChangeLog, llseek.c: Check HAVE_LLSEEK_PROTOTYPE to see whether or not we need to declare llseek(). --- ChangeLog | 5 +++ configure | 104 +++++++++++++++++++++++++++++++++------------------ configure.in | 19 +++++++++- lib/ext2fs/ChangeLog | 5 +++ lib/ext2fs/llseek.c | 4 +- 5 files changed, 98 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 064200b..c9d9a17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 20 19:30:45 1997 Theodore Ts'o + + * configure.in (HAVE_LLSEEK_PROTOTYPE): Added check to see if + llseek is declared in unistd.h + Sun Oct 19 19:09:30 1997 Theodore Ts'o * configure.in: Add tests for sys/stat.h, sys/time.h, and sys/types.h diff --git a/configure b/configure index 52a4632..cfd793e 100644 --- a/configure +++ b/configure @@ -32,7 +32,7 @@ ac_help="$ac_help ac_help="$ac_help --enable-checker build checker libraries" ac_help="$ac_help - --enable-gcc-wall enable GCC anal warnings" + --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)" ac_help="$ac_help --enable-dynamic-e2fsck build e2fsck dynamically" ac_help="$ac_help @@ -1855,6 +1855,38 @@ if test "$e2fsprogs_cv_struct_d_namlen" = yes; then EOF fi +echo $ac_n "checking whether llseek declared in unistd.h""... $ac_c" 1>&6 +echo "configure:1860: checking whether llseek declared in unistd.h" >&5 +if eval "test \"`echo '$''{'e2fsprogs_cv_have_llseek_prototype'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +extern int llseek(int); +; return 0; } +EOF +if { (eval echo configure:1872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + e2fsprogs_cv_have_llseek_prototype=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + e2fsprogs_cv_have_llseek_prototype=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$e2fsprogs_cv_have_llseek_prototype" 1>&6 +if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LLSEEK_PROTOTYPE 1 +EOF + +fi if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then # if cross-compiling, with no cached values, just assume something common. ac_cv_sizeof_short=2 @@ -1864,7 +1896,7 @@ if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then echo "configure: warning: Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4" 1>&2 fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1868: checking size of short" >&5 +echo "configure:1900: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1872,7 +1904,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1883,7 +1915,7 @@ main() exit(0); } EOF -if { (eval echo configure:1887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -1903,7 +1935,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1907: checking size of int" >&5 +echo "configure:1939: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1911,7 +1943,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1922,7 +1954,7 @@ main() exit(0); } EOF -if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -1942,7 +1974,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1946: checking size of long" >&5 +echo "configure:1978: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1950,7 +1982,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1961,7 +1993,7 @@ main() exit(0); } EOF -if { (eval echo configure:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -1981,7 +2013,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1985: checking size of long long" >&5 +echo "configure:2017: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1989,7 +2021,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2000,7 +2032,7 @@ main() exit(0); } EOF -if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -2028,19 +2060,19 @@ SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long echo $ac_n "checking whether struct stat has a st_flags field""... $ac_c" 1>&6 -echo "configure:2032: checking whether struct stat has a st_flags field" >&5 +echo "configure:2064: checking whether struct stat has a st_flags field" >&5 if eval "test \"`echo '$''{'e2fsprogs_cv_struct_st_flags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct stat stat; stat.st_flags = 0; ; return 0; } EOF -if { (eval echo configure:2044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* e2fsprogs_cv_struct_st_flags=yes else @@ -2062,12 +2094,12 @@ fi for ac_func in chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2066: checking for $ac_func" >&5 +echo "configure:2098: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2115,19 +2147,19 @@ fi done echo $ac_n "checking ino_t defined by sys/types.h""... $ac_c" 1>&6 -echo "configure:2119: checking ino_t defined by sys/types.h" >&5 +echo "configure:2151: checking ino_t defined by sys/types.h" >&5 if eval "test \"`echo '$''{'e2fsprogs_cv_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { ino_t ino; ino = 0; ; return 0; } EOF -if { (eval echo configure:2131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* e2fsprogs_cv_ino_t=yes else @@ -2148,17 +2180,17 @@ EOF fi ac_safe=`echo "linux/fs.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/fs.h""... $ac_c" 1>&6 -echo "configure:2152: checking for linux/fs.h" >&5 +echo "configure:2184: checking for linux/fs.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2197,7 +2229,7 @@ fi SOCKET_LIB='' echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:2201: checking for socket in -lsocket" >&5 +echo "configure:2233: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2205,7 +2237,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2238,12 +2270,12 @@ fi echo $ac_n "checking for optreset""... $ac_c" 1>&6 -echo "configure:2242: checking for optreset" >&5 +echo "configure:2274: checking for optreset" >&5 if eval "test \"`echo '$''{'ac_cv_have_optreset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2266,12 +2298,12 @@ EOF fi echo $ac_n "checking whether the ext2 ioctls compile""... $ac_c" 1>&6 -echo "configure:2270: checking whether the ext2 ioctls compile" >&5 +echo "configure:2302: checking whether the ext2 ioctls compile" >&5 if eval "test \"`echo '$''{'e2fsprogs_cv_ioctl_ext2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2279,7 +2311,7 @@ int main() { ioctl (0, EXT2_IOC_SETVERSION, 0); ; return 0; } EOF -if { (eval echo configure:2283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* e2fsprogs_cv_ioctl_ext2=yes else @@ -2319,20 +2351,20 @@ linux* | gnu*) ;; esac echo $ac_n "checking whether linker accepts -static""... $ac_c" 1>&6 -echo "configure:2323: checking whether linker accepts -static" >&5 +echo "configure:2355: checking whether linker accepts -static" >&5 if eval "test \"`echo '$''{'ac_cv_e2fsprogs_use_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" cat > conftest.$ac_ext < int main() { fflush(stdout); ; return 0; } EOF -if { (eval echo configure:2336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_e2fsprogs_use_static=yes else diff --git a/configure.in b/configure.in index 0b81ac9..8b86b5d 100644 --- a/configure.in +++ b/configure.in @@ -222,7 +222,7 @@ dnl dnl handle --enable-gcc-wall dnl AC_ARG_ENABLE([gcc-wall], -[ --enable-gcc-wall enable GCC anal warnings], +[ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)], if test "$enableval" = "no" then W=# @@ -335,6 +335,23 @@ if test "$e2fsprogs_cv_struct_d_namlen" = yes; then AC_DEFINE(HAVE_DIRENT_NAMLEN) fi dnl +dnl Check to see if llseek() is declared in unistd.h. On some libc's +dnl it is, and on others it isn't..... Thank you glibc developers.... +dnl +dnl Warning! Use of --enable-gcc-wall may throw off this test. +dnl +dnl +AC_MSG_CHECKING(whether llseek declared in unistd.h) +AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype, + AC_TRY_COMPILE( +[#include ], [extern int llseek(int);], + [e2fsprogs_cv_have_llseek_prototype=no], + [e2fsprogs_cv_have_llseek_prototype=yes])) +AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype) +if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then + AC_DEFINE(HAVE_LLSEEK_PROTOTYPE) +fi +dnl dnl Word sizes... dnl if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 3ae1415..e312c20 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 20 19:32:40 1997 Theodore Ts'o + + * llseek.c: Check HAVE_LLSEEK_PROTOTYPE to see whether or not we + need to declare llseek(). + Sun Oct 19 18:56:22 1997 Theodore Ts'o * Rename io.h to be ext2_io.h (avoid namespace collisions) diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c index 93409dd..40275e7 100644 --- a/lib/ext2fs/llseek.c +++ b/lib/ext2fs/llseek.c @@ -32,8 +32,8 @@ #endif #include -#if (__GLIBC__ == 2) -ext2_loff_t llseek (int fd, ext2_loff_t offset, int origin); +#ifndef HAVE_LLSEEK_PROTOTYPE +extern long long llseek (int fd, long long offset, int origin); #endif #define my_llseek llseek -- 1.8.3.1