Subject: bug#10677: [Chris Leyon] Re: bug#10677: 24.0.93; missing pathmax.h on Solaris

From: Chong Yidong <[email-masked]>
Date: Thu, 02 Feb 2012 09:49:41 +0800

Subject: Re: bug#10677: 24.0.93; missing pathmax.h on Solaris
From: Chris Leyon <[email-masked]>
To: Chong Yidong <[email-masked]>
Date: Wed, 1 Feb 2012 10:43:00 -0500

On Wed, Feb 1, 2012 at 03:18, Chong Yidong <[email-masked]> wrote:
> Hi Chris,
>
> Could you try the following patch (from Paul Eggert) and see if it fixes
> your problem?  Please let me know whether it works or not.
>
> (You need to run autoconf again after applying this patch.)
>
> Thanks.

The patch mostly worked.  However, autoconf gave an error about a
"possibly undefined macro" for the new symbol gl_PATHMAX.  I added a
`m4_pattern_allow' command to m4/gl-comp.m4 and that made autoconf
happy.  I am attaching my diff for gl-comp.m4.

After applying the patch & running autoconf, configure, make, the
compilation proceeds further but unfortunately now encounters an error
on the statement `verify (INT_MAX <= PTRDIFF_MAX)'.

gcc -std=gnu99 -c  -Demacs -DHAVE_CONFIG_H  -I.
-I/home/leyon/morocco/emacs-24.0.93/src -I../lib
-I/home/leyon/morocco/emacs-24.0.93/src/../lib
-I/usr/openwin/include     -I/usr/include/libxml2
-Wimplicit-function-declaration -Wold-style-definition
-Wdeclaration-after-statement  -g -O2 alloc.c
alloc.c:766: error: negative width in bit-field `_gl_verify_error_if_negative'
gmake[1]: *** [alloc.o] Error 1
gmake[1]: Leaving directory `/home/leyon/morocco/emacs-24.0.93/src'
gmake: *** [src] Error 2
diff -u /home/leyon/morocco/emacs-24.0.93/m4/gl-comp.m4.\~1\~ /home/leyon/morocco/emacs-24.0.93/m4/gl-comp.m4
--- /home/leyon/morocco/emacs-24.0.93/m4/gl-comp.m4.~1~	2011-10-13 20:40:36.000000000 -0400
+++ /home/leyon/morocco/emacs-24.0.93/m4/gl-comp.m4	2012-02-01 10:15:21.056039600 -0500
@@ -65,6 +65,8 @@
   # Code from module mktime:
   # Code from module multiarch:
   # Code from module nocrash:
+  # Code from module pathmax:
+  m4_pattern_allow([^gl_PATHMAX$])
   # Code from module pthread_sigmask:
   # Code from module readlink:
   # Code from module signal-h:
@@ -217,6 +219,7 @@
 gl_UNISTD_H
   gl_gnulib_enabled_dosname=false
   gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
+  gl_gnulib_enabled_pathmax=false
   gl_gnulib_enabled_sigprocmask=false
   gl_gnulib_enabled_stat=false
   gl_gnulib_enabled_strtoll=false
@@ -236,6 +239,13 @@
       gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true
     fi
   }
+  func_gl_gnulib_m4code_pathmax ()
+  {
+    if ! $gl_gnulib_enabled_pathmax; then
+gl_PATHMAX
+      gl_gnulib_enabled_pathmax=true
+    fi
+  }
   func_gl_gnulib_m4code_sigprocmask ()
   {
     if ! $gl_gnulib_enabled_sigprocmask; then
@@ -262,6 +272,9 @@
         func_gl_gnulib_m4code_dosname
       fi
       if test $REPLACE_STAT = 1; then
+        func_gl_gnulib_m4code_pathmax
+      fi
+      if test $REPLACE_STAT = 1; then
         func_gl_gnulib_m4code_verify
       fi
     fi
@@ -326,6 +339,7 @@
   m4_pattern_allow([^gl_GNULIB_ENABLED_])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_sigprocmask], [$gl_gnulib_enabled_sigprocmask])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
@@ -502,6 +516,7 @@
   lib/md5.h
   lib/mktime-internal.h
   lib/mktime.c
+  lib/pathmax.h
   lib/pthread_sigmask.c
   lib/readlink.c
   lib/sha1.c
@@ -552,6 +567,7 @@
   m4/mktime.m4
   m4/multiarch.m4
   m4/nocrash.m4
+  m4/pathmax.m4
   m4/pthread_sigmask.m4
   m4/readlink.m4
   m4/sha1.m4

Diff finished.  Wed Feb  1 10:15:34 2012