]> Savannah Git Hosting - gnulib.git/commitdiff
mountlist: Replace a configure-time error with a compile-time error.
authorBruno Haible <bruno@clisp.org>
Fri, 21 Mar 2025 10:46:43 +0000 (11:46 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 21 Mar 2025 10:46:43 +0000 (11:46 +0100)
Reported by Yury V. Zaytsev <yury@shurup.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00080.html>.

* m4/mountlist.m4 (gl_MOUNTLIST): Instead of aborting the configuration,
define MOUNTED_NOT_PORTED.
* lib/mountlist.c (read_file_system_list): Err out if MOUNTED_NOT_PORTED
is defined.
* modules/mountlist (configure.ac, Makefile.am): Compile mountlist.c on
all platforms.

ChangeLog
lib/mountlist.c
m4/mountlist.m4
modules/mountlist

index 1d681ea6e2ac777e38ab25286544e351e01aaaa0..6cd99afd0d42ab226cb26d036c74ad8cceae0266 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2025-03-21  Bruno Haible  <bruno@clisp.org>
+
+       mountlist: Replace a configure-time error with a compile-time error.
+       Reported by Yury V. Zaytsev <yury@shurup.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2025-03/msg00080.html>.
+       * m4/mountlist.m4 (gl_MOUNTLIST): Instead of aborting the configuration,
+       define MOUNTED_NOT_PORTED.
+       * lib/mountlist.c (read_file_system_list): Err out if MOUNTED_NOT_PORTED
+       is defined.
+       * modules/mountlist (configure.ac, Makefile.am): Compile mountlist.c on
+       all platforms.
+
 2025-03-21  Bruno Haible  <bruno@clisp.org>
 
        setlocale-null: Fix autoconf warning.
index 2ed4b138ba2262ec2a19547fa68ff402ea0d5278..d52d4ffca72e3e9053b275dc0ed5fce3fee78c4c 100644 (file)
@@ -1096,7 +1096,7 @@ read_file_system_list (bool need_fs_type)
   }
 #endif /* MOUNTED_INTERIX_STATVFS */
 
-#if defined _WIN32 && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__  /* native Windows */
 /* Don't assume that UNICODE is not defined.  */
 # undef GetDriveType
 # define GetDriveType GetDriveTypeA
@@ -1287,6 +1287,10 @@ read_file_system_list (bool need_fs_type)
   }
 #endif
 
+#if MOUNTED_NOT_PORTED
+# error "Please port gnulib mountlist.c to your platform!"
+#endif
+
   *mtail = NULL;
   return mount_list;
 
index 0b8e3f1da2bfd4f1eb044bc65708d3ab7b1fa01f..e7eac2e9ed5f9e9ee1a921425a686841fb76405f 100644 (file)
@@ -1,5 +1,5 @@
 # mountlist.m4
-# serial 17
+# serial 18
 dnl Copyright (C) 2002-2006, 2009-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -325,12 +325,11 @@ int getmntinfo (struct statfs **, int);
   fi
 
   if test -z "$ac_list_mounted_fs"; then
-    AC_MSG_ERROR([could not determine how to read list of mounted file systems])
-    # FIXME -- no need to abort building the whole package
-    # Can't build mountlist.c or anything that needs its functions
+    AC_DEFINE([MOUNTED_NOT_PORTED], [1],
+      [Define if we don't know how to determine the list of mounted file systems.])
   fi
 
-  if test $ac_list_mounted_fs = found; then
+  if test "$ac_list_mounted_fs" = found; then
     gl_cv_list_mounted_fs=yes
   else
     gl_cv_list_mounted_fs=no
index 016ff2dd6fc9029c53e021d8cf975a15c786807f..b4acef36e620051fbe4c30c5a94d1a000d42dda9 100644 (file)
@@ -20,15 +20,10 @@ xalloc
 
 configure.ac:
 gl_MOUNTLIST
-gl_CONDITIONAL([GL_COND_OBJ_MOUNTLIST], [test $gl_cv_list_mounted_fs = yes])
-AM_COND_IF([GL_COND_OBJ_MOUNTLIST], [
-  gl_PREREQ_MOUNTLIST_EXTRA
-])
+gl_PREREQ_MOUNTLIST_EXTRA
 
 Makefile.am:
-if GL_COND_OBJ_MOUNTLIST
 lib_SOURCES += mountlist.c
-endif
 
 Include:
 "mountlist.h"