Of possible interest to anyone who builds all the Xorg packages using jhbuild 
with an Xorg-flavoured xorg/util/modular/xorg.modules

I have found in the past that,  of the packages still using autotools 
(autogen.sh , autoreconf,  etc),   which is still quite a lot,    many do not 
include an m4 directory.     And,   no matter what ACLOCAL-related environment 
variables I export,  autoreconf always fails,  because aclocal expects to find 
an m4 directory in the package root.

The following patch to aclocal version 1.18 (which is a perl program)
has solved the problem and saved me a lot of time in reducing need for manual 
intervention for the jhbuild build.

To use it
  .  Apply the patch directly to aclocal
  .  Before running jhbuild,     export ACLOCAL_PATH as e.g.
     Export ACLOCAL_PATH="${top_of_Xorg_tree}/xorg-build/share/aclocal"

_________________________________________________________________
--- aclocal-1.18  2025-07-12 08:12:09.000000000 -0400
+++ aclocal-1.18.symlink_cwd_m4_if_missing      2026-07-31 09:05:00.180344615 
-0400
@@ -368,6 +368,21 @@ sub scan_m4_dirs ($$@)

   foreach my $m4dir (@dirlist)
     {
+#    fix the "missing m4" problem when building certain xorg xcomponents :
+#    if  $m4dir is m4 (i.e. m4 in current dir) and does not exist and 
ACLOCAL_PATH is exported,
+#    then create a symlink m4 -> first or only item in ACLOCAL_PATH
+      if ($m4dir eq "m4") {
+          my $aclocal_path = $ENV{"ACLOCAL_PATH"};
+          if (-e $m4dir) {
+              print( "aclocal : $m4dir exists\n");
+          } elsif ($aclocal_path) {
+              my ($first) = split /:/, $aclocal_path;
+              my $link_result = `ln -s $first m4`;
+              print( "aclocal : symlink $m4dir created to $first\n");
+          } else {
+              print("aclocal : $m4dir does not exist and ACLOCAL_PATH not 
exported\n");
+          }
+      }
       if (! opendir (DIR, $m4dir))
      {
        # TODO: maybe avoid complaining only if errno == ENONENT?



Reply via email to