]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Modernize the cups-largefile autoconf source file.
authorMichael R Sweet <msweet@msweet.org>
Sat, 6 Mar 2021 16:08:59 +0000 (11:08 -0500)
committerMichael R Sweet <msweet@msweet.org>
Sat, 6 Mar 2021 16:08:59 +0000 (11:08 -0500)
config-scripts/cups-largefile.m4
configure

index 2470cc371980e6d48ef03edc56730627814ca144..4bf0ec1f8e2c07b4e8e658d1aecea91ad308bc3e 100644 (file)
@@ -1,10 +1,12 @@
 dnl
 dnl Large file support stuff for CUPS.
 dnl
-dnl Copyright 2007-2011 by Apple Inc.
-dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
+dnl Copyright © 2021 by OpenPrinting.
+dnl Copyright © 2007-2011 by Apple Inc.
+dnl Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 dnl
-dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more
+dnl information.
 dnl
 
 dnl Check for largefile support...
@@ -12,31 +14,38 @@ AC_SYS_LARGEFILE
 
 dnl Define largefile options as needed...
 LARGEFILE=""
-if test x$enable_largefile != xno; then
-       LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+AS_IF([test x$enable_largefile != xno], [
+    LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
 
-       if test x$ac_cv_sys_large_files = x1; then
-               LARGEFILE="$LARGEFILE -D_LARGE_FILES"
-       fi
+    AS_IF([test x$ac_cv_sys_large_files = x1], [
+       LARGEFILE="$LARGEFILE -D_LARGE_FILES"
+    ])
 
-       if test x$ac_cv_sys_file_offset_bits = x64; then
-               LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
-       fi
-fi
-AC_SUBST(LARGEFILE)
+    AS_IF([test x$ac_cv_sys_file_offset_bits = x64], [
+       LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
+    ])
+])
+AC_SUBST([LARGEFILE])
 
 dnl Check for "long long" support...
-AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
-       [if test "$GCC" = yes; then
-               ac_cv_c_long_long=yes
-       else
-               AC_TRY_COMPILE(,[long long int i;],
-                       ac_cv_c_long_long=yes,
-                       ac_cv_c_long_long=no)
-       fi])
+AC_CACHE_CHECK([for long long int], [ac_cv_c_long_long], [
+    AS_IF([test "$GCC" = yes], [
+       ac_cv_c_long_long="yes"
+    ], [
+       AC_COMPILE_IFELSE([
+           AC_LANG_PROGRAM([[ ]], [[long long int i;]])
+       ], [
+           ac_cv_c_long_long="yes"
+       ], [
+           ac_cv_c_long_long="no"
+       ])
+    ])
+])
 
-if test $ac_cv_c_long_long = yes; then
-       AC_DEFINE(HAVE_LONG_LONG)
-fi
+AS_IF([test $ac_cv_c_long_long = yes], [
+    AC_DEFINE([HAVE_LONG_LONG], [1], [Does the compiler support the long long type?])
+])
 
-AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
+AC_CHECK_FUNC([strtoll], [
+    AC_DEFINE([HAVE_STRTOLL], [1], [Do we have the strtoll function?])
+])
index 740b4b43d1b9b64b8079db0904c90bb9a8acbe3d..ae710b3935d23f6408ea68f63a9b97175df1d132 100755 (executable)
--- a/configure
+++ b/configure
 
 
 LARGEFILE=""
-if test x$enable_largefile != xno; then
-       LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+if test x$enable_largefile != xno
+then :
 
-       if test x$ac_cv_sys_large_files = x1; then
-               LARGEFILE="$LARGEFILE -D_LARGE_FILES"
-       fi
+    LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+
+    if test x$ac_cv_sys_large_files = x1
+then :
+
+       LARGEFILE="$LARGEFILE -D_LARGE_FILES"
+
+fi
+
+    if test x$ac_cv_sys_file_offset_bits = x64
+then :
+
+       LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
+
+fi
 
-       if test x$ac_cv_sys_file_offset_bits = x64; then
-               LARGEFILE="$LARGEFILE -D_FILE_OFFSET_BITS=64"
-       fi
 fi
 
 
@@ -10134,12 +10143,18 @@ if test ${ac_cv_c_long_long+y}
 then :
   printf %s "(cached) " >&6
 else $as_nop
-  if test "$GCC" = yes; then
-               ac_cv_c_long_long=yes
-       else
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+    if test "$GCC" = yes
+then :
+
+       ac_cv_c_long_long="yes"
+
+else $as_nop
+
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+
 int
 main (void)
 {
@@ -10147,28 +10162,42 @@ long long int i;
   ;
   return 0;
 }
+
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"
 then :
-  ac_cv_c_long_long=yes
+
+           ac_cv_c_long_long="yes"
+
 else $as_nop
-  ac_cv_c_long_long=no
+
+           ac_cv_c_long_long="no"
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-       fi
+
+fi
+
 fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_long_long" >&5
 printf "%s\n" "$ac_cv_c_long_long" >&6; }
 
-if test $ac_cv_c_long_long = yes; then
-       printf "%s\n" "#define HAVE_LONG_LONG 1" >>confdefs.h
+if test $ac_cv_c_long_long = yes
+then :
+
+
+printf "%s\n" "#define HAVE_LONG_LONG 1" >>confdefs.h
+
 
 fi
 
 ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll"
 if test "x$ac_cv_func_strtoll" = xyes
 then :
-  printf "%s\n" "#define HAVE_STRTOLL 1" >>confdefs.h
+
+
+printf "%s\n" "#define HAVE_STRTOLL 1" >>confdefs.h
+
 
 fi