X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/feda5527b30d62874ed0e27056903543ba0c3ee0..c826013fb38c98861ef0fc5d4dc3fb3fb4f555be:/etc/prefix-gnulib-mk diff --git a/etc/prefix-gnulib-mk b/etc/prefix-gnulib-mk index e7f88382..56dfd497 100755 --- a/etc/prefix-gnulib-mk +++ b/etc/prefix-gnulib-mk @@ -50,7 +50,7 @@ sub prefix_assignment ($$) # Some variables are initialized by gnulib.mk, and we don't want # that. Change '=' to '+='. - if ($lhs_and_assign_op =~ /^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES|CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES|AM_CPPFLAGS|AM_GNU_GETTEXT) =/) + if ($lhs_and_assign_op =~ /^(SUBDIRS|EXTRA_DIST|BUILT_SOURCES|SUFFIXES|MOSTLYCLEANFILES|CLEANFILES|DISTCLEANFILES|MAINTAINERCLEANFILES|AM_CFLAGS|AM_CPPFLAGS|AM_GNU_GETTEXT) =/) { $lhs_and_assign_op =~ s/=/+=/; } @@ -73,9 +73,6 @@ sub prefix_assignment ($$) # lib_libbison_a_SOURCES. $lhs_and_assign_op =~ s/(libbison)/lib_$1/g; - # Do not use gl_LIBOBJS, but its prefixed version. - $rhs =~ s/gl_LIBOBJS/gl_PREFIXED_LIBOBJS/g; - return $lhs_and_assign_op . $rhs; } @@ -93,7 +90,7 @@ sub prefix ($) # Prefix all the occurrence of files in rules. If there is nothing # after in the :, it's probably a phony target, or a suffix rule. # Don't touch it. - s{^([\w.]+ *: *\w.*)$} + s{^([-\w+/]+\.[-\w.]+ *: *\S.*)$} {prefix_words($1)}gem; # Prefix files in variables. @@ -103,7 +100,7 @@ sub prefix ($) # These three guys escape all the other regular rules. s{(charset\.alias|ref-add\.sed|ref-del\.sed)}{$prefix$1}g; # Unfortunately, as a result we sometimes have lib/lib. - s{lib/lib/}{lib/}g; + s{($prefix){2}}{$1}g; # $(srcdir) is actually $(top_srcdir)/lib. s{\$\(srcdir\)}{\$(top_srcdir)/lib}g; @@ -112,6 +109,12 @@ sub prefix ($) # not work when we have a $@ with a directory in it. s{t-\$\@}{\$\@-t}g; + # Some AC_SUBST patterns remain and would better be Make macros. + s{\@(MKDIR_P)\@}{\$($1)}g; + + # Adjust paths in mkdir. + s{(\$\(MKDIR_P\))\s*(\w+)}{$1 $prefix$2}g; + return $_; } @@ -128,7 +131,7 @@ sub process ($) print $out $contents; } -process ("lib/gnulib.mk") +process ("${prefix}gnulib.mk") ### Setup "GNU" style for perl-mode and cperl-mode.