On 11/27/2016 06:18 PM, Bruno Haible wrote:
John,

I added

   AC_CONFIG_LIBOBJ_DIR([libgnu])

to my configure.ac file.  Maybe gnulib-tool could do this automatically
if --non-recursive-makefile is specified?

gnulib-tool does not rely on AC_LIBOBJ and friends, because these autoconf
macros assume that there is only one lib/ dir, whereas it is possible to
have several gnulib-tool invocations in the scope of a single configure.ac
file. Instead, the gnulib-tool generated gl_INIT method provides its own
definition of AC_LIBOBJ for the scope of the modules and .m4 expansions
that it pulls in.

Therefore you should not need this
    AC_CONFIG_LIBOBJ_DIR([libgnu])
invocation.

I don't currently see how to make it work without using this macro.

it demonstrates what changes need to be made.

This is very good to see.

I'm attaching a new patch that fixes a few more things and seems to work for me with Octave.

One thing I don't like is to put directory names into the *.m4 files;
this is
  1. against the principle that *.m4 files should determine properties
     of the platform, whereas Makefile.am contains file names,
  2. a problem w.r.t. the requirement above to be able to use
     several gnulib-tool invocations.

So, instead of replacing
    LIMITS_H=limits.h
by
    LIMITS_H=libgnu/limits.h
I would prefer to replace
    AC_SUBST([LIMITS_H])
by
    gl_FILENAME_SUBST([LIMITS_H])

Here gl_FILENAME_SUBST is a (yet to be written) autoconf macro that takes

If that's better, it should be easy to change, though I don't have any more time to devote to this at the moment.

What I have now is

  LIMITS_H=${gl_REL_SOURCE_BASE}limits.h

With gl_REL_SOURCE_BASE defined to be "$sourcebase/" for non-recursive builds or "" otherwise.

It should be done by gnulib-tool:
  1. because it can already be done at this stage,
  2. so that different gnulib-tool invocations in the scope of a single
     configure file work.

I think I have this working, at least for the Makefile.am snippets in the module files now.

It seems like that would be easy enough just by arranging
to do something like

   gl_SOURCEBASE=$sourcebase
   AC_SUBST(gl_SOURCEBASE)

in the configure script and then using this variable in the snippets
where you used @FILE@ above.

There is a variable gl_source_base in the configure script, set at the
beginning of gl_INIT. You can use it as a shell variable. But it is not
(and cannot be) AC_SUBSTable.

I defined a separate variable because it needs to be either empty or $sourcebase/ (with the /) and I believe that the existing variable doesn't have the trailing slash.

Current patch attached. Again, I only attempted to fix the module and m4 files that are needed by Octave.

jwe

diff --git a/gnulib-tool b/gnulib-tool
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -253,6 +253,7 @@ Options for --import, --add/remove-impor
       --source-base=DIRECTORY
                             Directory relative to --dir where source code is
                             placed (default \"lib\").
+      --non-recursive-makefile  Generate non-recursive makefile snippet.
       --m4-base=DIRECTORY   Directory relative to --dir where *.m4 macros are
                             placed (default \"m4\").
       --po-base=DIRECTORY   Directory relative to --dir where *.po files are
@@ -1011,6 +1012,7 @@ func_determine_path_separator
 # - verbose         integer, default 0, inc/decremented by --verbose/--quiet
 # - libname, supplied_libname  from --lib
 # - sourcebase      from --source-base
+# - non_recursive   from --non-recursive-makefile
 # - m4base          from --m4-base
 # - pobase          from --po-base
 # - docbase         from --doc-base
@@ -1062,6 +1064,8 @@ func_determine_path_separator
   libname=libgnu
   supplied_libname=
   sourcebase=
+  non_recursive=false
+  libamprefix=
   m4base=
   pobase=
   docbase=
@@ -1185,6 +1189,9 @@ func_determine_path_separator
         fi
         sourcebase=$1
         shift ;;
+      --non-recursive-makefile )
+        non_recursive=true
+        shift ;;
       --source-base=* )
         sourcebase=`echo "X$1" | sed -e 's/^X--source-base=//'`
         shift ;;
@@ -1427,6 +1434,10 @@ func_determine_path_separator
       echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
       func_exit 1
     fi
+    if $non_recursive && test -z "$makefile_name"; then
+      echo "you must use --makefile-name with --non-recursive-makefile" 1>2
+      func_exit 1
+    fi
   fi
   if test -n "$pobase" && test -z "$po_domain"; then
     echo "gnulib-tool: together with --po-base, you need to specify 
--po-domain" 1>&2
@@ -2353,7 +2364,7 @@ func_get_automake_snippet_conditional ()
 {
   if ! $modcache; then
     func_lookup_file "modules/$1"
-    sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file"
+    sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" | sed 
"s,@gl_REL_SOURCE_BASE@,${relsourcebase},g"
   else
     func_cache_lookup_module "$1"
     # Output the field's value, including the final newline (if any).
@@ -2365,7 +2376,7 @@ func_get_automake_snippet_conditional ()
       eval "field_set=\"\$${cachevar}_makefile_set\""
       if test -n "$field_set"; then
         eval "field_value=\"\$${cachevar}_makefile\""
-        echo "${field_value}"
+        echo "${field_value}" | sed "s,@gl_REL_SOURCE_BASE@,${relsourcebase},g"
       fi
     fi
   fi
@@ -2397,7 +2408,7 @@ func_get_automake_snippet_unconditional 
       already_mentioned_files=` \
         { if ! $modcache; then
             func_lookup_file "modules/$1"
-            sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file"
+            sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" | 
sed "s,@gl_REL_SOURCE_BASE@,${relsourcebase},g"
           else
             func_cache_lookup_module "$1"
             if $have_associative; then
@@ -2408,7 +2419,7 @@ func_get_automake_snippet_unconditional 
               eval 'field_set="$'"${cachevar}"'_makefile_set"'
               if test -n "$field_set"; then
                 eval 'field_value="$'"${cachevar}"'_makefile"'
-                echo "${field_value}"
+                echo "${field_value}" | sed 
"s,@gl_REL_SOURCE_BASE@,${relsourcebase},g"
               fi
             fi
           fi
@@ -2416,7 +2427,7 @@ func_get_automake_snippet_unconditional 
         | combine_lines \
         | sed -n -e "$sed_extract_mentioned_files" | sed -e 's/#.*//'`
       all_files=`func_get_filelist $1`
-      func_filter_filelist lib_files "$nl" "$all_files" 'lib/' '' 'lib/' ''
+      func_filter_filelist lib_files "$nl" "$all_files" 'lib/' '' 'lib/' '' 
"$sourcebase/" ''
       # Remove $already_mentioned_files from $lib_files.
       echo "$lib_files" | LC_ALL=C sort -u > "$tmp"/lib-files
       extra_files=`for f in $already_mentioned_files; do echo $f; done \
@@ -3423,6 +3434,14 @@ func_emit_lib_Makefile_am ()
     perhapsLT=
     sed_eliminate_LDFLAGS='/^lib_LDFLAGS[       ]*+=/d'
   fi
+  if test -n "$sourcebase"; then
+    relsourcebase="$sourcebase/"
+  fi
+  libamprefix="${libname}_${libext}"
+  if $non_recursive; then
+    ## Trailing slash already removed from sourcebase above.
+    libamprefix="`echo "$sourcebase" | LC_ALL=C sed -e 
's/[^a-zA-Z0-9_]/_/g'`_${libamprefix}"
+  fi
   if $for_test; then
     # When creating a package for testing: Attempt to provoke failures,
     # especially link errors, already during "make" rather than during
@@ -3457,19 +3476,19 @@ func_emit_lib_Makefile_am ()
             sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \
                 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \
                 -e "$sed_eliminate_LDFLAGS" \
-                -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \
+                -e 's,lib_\([A-Z][A-Z]*\),'"${libamprefix}_"'\1,g' \
                 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \
                 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \
                 -e "$sed_transform_check_PROGRAMS" \
                 -e "$sed_replace_include_guard_prefix"
           if test "$module" = 'alloca'; then
-            echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@"
-            echo "${libname}_${libext}_DEPENDENCIES += @${perhapsLT}ALLOCA@"
+            echo "${libamprefix}_LIBADD += @${perhapsLT}ALLOCA@"
+            echo "${libamprefix}_DEPENDENCIES += @${perhapsLT}ALLOCA@"
           fi
-        } | combine_lines "${libname}_${libext}_SOURCES" > "$tmp"/amsnippet1
+        } | combine_lines "${libamprefix}_SOURCES" > "$tmp"/amsnippet1
         {
           func_get_automake_snippet_unconditional "$module" |
-            LC_ALL=C sed -e 
's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g'
+            LC_ALL=C sed -e 's,lib_\([A-Z][A-Z]*\),'"${libamprefix}_"'\1,g'
         } > "$tmp"/amsnippet2
         # Skip the contents if it's entirely empty.
         if grep '[^     ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; 
then
@@ -3511,7 +3530,6 @@ func_emit_lib_Makefile_am ()
     if test -n "$uses_subdirs"; then
       subdir_options=' subdir-objects'
     fi
-    echo "AUTOMAKE_OPTIONS = 1.9.6 gnits${subdir_options}"
   fi
   echo
   if test -z "$makefile_name"; then
@@ -3532,7 +3550,7 @@ func_emit_lib_Makefile_am ()
     echo "BUILT_SOURCES ="
     echo "SUFFIXES ="
   fi
-  echo "MOSTLYCLEANFILES $assign core *.stackdump"
+  echo "MOSTLYCLEANFILES $assign ${relsourcebase}core 
${relsourcebase}*.stackdump"
   if test -z "$makefile_name"; then
     echo "MOSTLYCLEANDIRS ="
     echo "CLEANFILES ="
@@ -3568,9 +3586,16 @@ func_emit_lib_Makefile_am ()
     echo "AM_CPPFLAGS =$cppflags_part1$cppflags_part2"
     echo "AM_CFLAGS ="
   else
+    if $non_recursive; then
+      echo "${libamprefix}_CPPFLAGS = -I$sourcebase -I\$(srcdir)/$sourcebase"
+    fi
     if test -n "$cppflags_part1$cppflags_part2"; then
       echo
-      echo "AM_CPPFLAGS +=$cppflags_part1$cppflags_part2"
+      if $non_recursive; then
+        echo "${libamprefix}_CPPFLAGS += $cppflags_part1$cppflags_part2"
+      else
+        echo "AM_CPPFLAGS +=$cppflags_part1$cppflags_part2"
+      fi
     fi
   fi
   echo
@@ -3585,19 +3610,19 @@ func_emit_lib_Makefile_am ()
     :
   else
     # By default, the generated library should not be installed.
-    echo "noinst_${perhapsLT}LIBRARIES += $libname.$libext"
+    echo "noinst_${perhapsLT}LIBRARIES += ${relsourcebase}$libname.$libext"
   fi
   echo
-  echo "${libname}_${libext}_SOURCES ="
+  echo "${libamprefix}_SOURCES ="
   # Here we use $(LIBOBJS), not @LIBOBJS@. The value is the same. However,
   # automake during its analysis looks for $(LIBOBJS), not for @LIBOBJS@.
-  echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
-  echo "${libname}_${libext}_DEPENDENCIES = 
\$(${macro_prefix}_${perhapsLT}LIBOBJS)"
-  echo "EXTRA_${libname}_${libext}_SOURCES ="
+  echo "${libamprefix}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
+  echo "${libamprefix}_DEPENDENCIES = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
+  echo "EXTRA_${libamprefix}_SOURCES ="
   if test "$libtool" = true; then
-    echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
-    echo "${libname}_${libext}_LDFLAGS += -no-undefined"
-    # Synthesize an ${libname}_${libext}_LDFLAGS augmentation by combining
+    echo "${libamprefix}_LDFLAGS = \$(AM_LDFLAGS)"
+    echo "${libamprefix}_LDFLAGS += -no-undefined"
+    # Synthesize an ${libamprefix}_LDFLAGS augmentation by combining
     # the link dependencies of all modules.
     for module in $modules; do
       func_verify_nontests_module
@@ -3607,7 +3632,7 @@ func_emit_lib_Makefile_am ()
     done \
       | LC_ALL=C sed -e '/^$/d' -e 's/ when linking with libtool.*//' \
       | LC_ALL=C sort -u \
-      | LC_ALL=C sed -e 's/^/'"${libname}_${libext}"'_LDFLAGS += /'
+      | LC_ALL=C sed -e 's/^/'"${libamprefix}_"'LDFLAGS += /'
   fi
   echo
   if test -n "$pobase"; then
@@ -3617,7 +3642,7 @@ func_emit_lib_Makefile_am ()
   cat "$tmp"/allsnippets \
     | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g'
   echo
-  echo "mostlyclean-local: mostlyclean-generic"
+  echo "gnulib-mostlyclean-local: mostlyclean-generic"
   echo "       @for dir in '' \$(MOSTLYCLEANDIRS); do \\"
   echo "         if test -n \"\$\$dir\" && test -d \$\$dir; then \\"
   echo "           echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
@@ -4006,8 +4031,8 @@ func_emit_initmacro_end ()
   echo "      # Remove the extension."
   echo "      sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'"
   echo "      for i in \`for i in \$${macro_prefix_arg}_LIBOBJS; do echo 
\"\$i\"; done | sed -e \"\$sed_drop_objext\" | sort | uniq\`; do"
-  echo "        ${macro_prefix_arg}_libobjs=\"\$${macro_prefix_arg}_libobjs 
\$i.\$ac_objext\""
-  echo "        
${macro_prefix_arg}_ltlibobjs=\"\$${macro_prefix_arg}_ltlibobjs \$i.lo\""
+  echo "        ${macro_prefix_arg}_libobjs=\"\$${macro_prefix_arg}_libobjs 
${relsourcebase}\$i.\$ac_objext\""
+  echo "        
${macro_prefix_arg}_ltlibobjs=\"\$${macro_prefix_arg}_ltlibobjs 
${relsourcebase}${libamprefix}-\$i.lo\""
   echo "      done"
   echo "    fi"
   echo "    AC_SUBST([${macro_prefix_arg}_LIBOBJS], 
[\$${macro_prefix_arg}_libobjs])"
@@ -5454,6 +5479,14 @@ s,//*$,/,'
     if test -n "$uses_subdirs"; then
       echo "  AC_REQUIRE([AM_PROG_CC_C_O])"
     fi
+    if $non_recursive; then
+      echo "  gl_REL_SOURCE_BASE=$relsourcebase"
+      echo "  AC_CONFIG_LIBOBJ_DIR([$sourcebase])"
+      echo "  m4_pattern_allow([^gl_REL_SOURCE_BASE\$])dnl a variable"
+    else
+      echo "  gl_REL_SOURCE_BASE="
+      echo "  m4_pattern_allow([^gl_REL_SOURCE_BASE\$])dnl a variable"
+    fi
     for module in $final_modules; do
       func_verify_module
       if test -n "$module"; then
@@ -5818,12 +5851,11 @@ func_create_testdir ()
   if test -z "$modules"; then
     # All modules together.
     # Except config-h, which breaks all modules which use HAVE_CONFIG_H.
-    # Except non-recursive-gnulib-prefix-hack, which represents a nonstandard
     # way of using Automake.
     # Except ftruncate, mountlist, which abort the configuration on mingw. 
FIXME.
     # Except lib-ignore, which leads to link errors when Sun C++ is used. 
FIXME.
     modules=`func_all_modules`
-    modules=`for m in $modules; do case $m in config-h | 
non-recursive-gnulib-prefix-hack | ftruncate | mountlist | lib-ignore) ;; *) 
echo $m;; esac; done`
+    modules=`for m in $modules; do case $m in config-h | ftruncate | mountlist 
| lib-ignore) ;; *) echo $m;; esac; done`
   fi
   specified_modules="$modules"
 
diff --git a/m4/alloca.m4 b/m4/alloca.m4
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -26,14 +26,14 @@ AC_DEFUN([gl_FUNC_ALLOCA],
       AC_DEFINE([HAVE_ALLOCA], [1],
         [Define to 1 if you have 'alloca' after including <alloca.h>,
          a header that may be supplied by this distribution.])
-      ALLOCA_H=alloca.h
+      ALLOCA_H=${gl_REL_SOURCE_BASE}alloca.h
     else
       dnl alloca exists as a library function, i.e. it is slow and probably
       dnl a memory leak. Don't define HAVE_ALLOCA in this case.
       ALLOCA_H=
     fi
   else
-    ALLOCA_H=alloca.h
+    ALLOCA_H=${gl_REL_SOURCE_BASE}alloca.h
   fi
   AC_SUBST([ALLOCA_H])
   AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
diff --git a/m4/argz.m4 b/m4/argz.m4
--- a/m4/argz.m4
+++ b/m4/argz.m4
@@ -27,7 +27,7 @@ AC_CHECK_TYPES([error_t],
 #endif])
 
 ARGZ_H=
-AC_CHECK_FUNC([argz_replace], [], [ARGZ_H=argz.h])
+AC_CHECK_FUNC([argz_replace], [], [ARGZ_H=${gl_REL_SOURCE_BASE}argz.h])
 
 dnl if have system argz functions, allow forced use of
 dnl libltdl-supplied implementation (and default to do so
@@ -70,7 +70,7 @@ AS_IF([test -z "$ARGZ_H"],
      AS_IF([test "$lt_cv_sys_argz_works" = yes],
         [AC_DEFINE([HAVE_WORKING_ARGZ], [1],
                    [This value is set to 1 to indicate that the system argz 
facility works])],
-        [ARGZ_H=argz.h])])
+        [ARGZ_H=${gl_REL_SOURCE_BASE}argz.h])])
 
 AC_SUBST([ARGZ_H])
 AM_CONDITIONAL([GL_GENERATE_ARGZ_H], [test -n "$ARGZ_H"])
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -21,7 +21,7 @@ AC_DEFUN([gl_ASSERT_H],
        [gl_cv_static_assert=yes],
        [gl_cv_static_assert=no])])
   if test $gl_cv_static_assert = no; then
-    ASSERT_H=assert.h
+    ASSERT_H=${gl_REL_SOURCE_BASE}assert.h
     gl_NEXT_HEADERS([assert.h])
   fi
   AC_SUBST([ASSERT_H])
diff --git a/m4/float_h.m4 b/m4/float_h.m4
--- a/m4/float_h.m4
+++ b/m4/float_h.m4
@@ -12,14 +12,14 @@ AC_DEFUN([gl_FLOAT_H],
   REPLACE_FLOAT_LDBL=0
   case "$host_os" in
     aix* | beos* | openbsd* | mirbsd* | irix*)
-      FLOAT_H=float.h
+      FLOAT_H=${gl_REL_SOURCE_BASE}float.h
       ;;
     freebsd*)
       case "$host_cpu" in
 changequote(,)dnl
         i[34567]86 )
 changequote([,])dnl
-          FLOAT_H=float.h
+          FLOAT_H=${gl_REL_SOURCE_BASE}float.h
           ;;
         x86_64 )
           # On x86_64 systems, the C compiler may still be generating
@@ -29,14 +29,14 @@ changequote([,])dnl
              yes
              #endif],
             [],
-            [FLOAT_H=float.h])
+            [FLOAT_H=${gl_REL_SOURCE_BASE}float.h])
           ;;
       esac
       ;;
     linux*)
       case "$host_cpu" in
         powerpc*)
-          FLOAT_H=float.h
+          FLOAT_H=${gl_REL_SOURCE_BASE}float.h
           ;;
       esac
       ;;
@@ -85,7 +85,7 @@ int main ()
       REPLACE_ITOLD=1
       dnl We add the workaround to <float.h> but also to <math.h>,
       dnl to increase the chances that the fix function gets pulled in.
-      FLOAT_H=float.h
+      FLOAT_H=${gl_REL_SOURCE_BASE}float.h
       ;;
   esac
 
diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4
--- a/m4/fnmatch.m4
+++ b/m4/fnmatch.m4
@@ -127,7 +127,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
     dnl don't do "make distclean".
     rm -f "$gl_source_base/fnmatch.h"
   else
-    FNMATCH_H=fnmatch.h
+    FNMATCH_H=${gl_REL_SOURCE_BASE}fnmatch.h
   fi
   AC_SUBST([FNMATCH_H])
   AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"])
diff --git a/m4/getopt.m4 b/m4/getopt.m4
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -354,7 +354,7 @@ dnl is ambiguous with environment values
 
 AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
-  GETOPT_H=getopt.h
+  GETOPT_H=${gl_REL_SOURCE_BASE}getopt.h
   AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
     [Define to rpl_ if the getopt replacement functions and variables
      should be used.])
diff --git a/m4/glob.m4 b/m4/glob.m4
--- a/m4/glob.m4
+++ b/m4/glob.m4
@@ -10,7 +10,7 @@ dnl with or without modifications, as lo
 
 AC_DEFUN([gl_GLOB],
 [ GLOB_H=
-  AC_CHECK_HEADERS([glob.h], [], [GLOB_H=glob.h])
+  AC_CHECK_HEADERS([glob.h], [], [GLOB_H=${gl_REL_SOURCE_BASE}glob.h])
 
   if test -z "$GLOB_H"; then
     AC_CACHE_CHECK([for GNU glob interface version 1],
@@ -22,7 +22,7 @@ char a[_GNU_GLOB_INTERFACE_VERSION == 1 
         [gl_cv_gnu_glob_interface_version_1=no])])
 
     if test "$gl_cv_gnu_glob_interface_version_1" = "no"; then
-      GLOB_H=glob.h
+      GLOB_H=${gl_REL_SOURCE_BASE}glob.h
     fi
   fi
 
@@ -49,7 +49,7 @@ if (glob ("conf*-globtest", 0, NULL, &fo
       fi])
 
     if test $gl_cv_glob_lists_symlinks = no; then
-      GLOB_H=glob.h
+      GLOB_H=${gl_REL_SOURCE_BASE}glob.h
     fi
   fi
 
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4
--- a/m4/limits-h.m4
+++ b/m4/limits-h.m4
@@ -24,7 +24,7 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
   if test "$gl_cv_header_limits_width" = yes; then
     LIMITS_H=
   else
-    LIMITS_H=limits.h
+    LIMITS_H=${gl_REL_SOURCE_BASE}limits.h
   fi
   AC_SUBST([LIMITS_H])
   AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
diff --git a/m4/pthread.m4 b/m4/pthread.m4
--- a/m4/pthread.m4
+++ b/m4/pthread.m4
@@ -42,10 +42,10 @@ AC_DEFUN([gl_PTHREAD_CHECK],
    if test $ac_cv_header_pthread_h != yes ||
       test $ac_cv_type_pthread_t != yes ||
       test $ac_cv_type_pthread_spinlock_t != yes; then
-     PTHREAD_H='pthread.h'
+     PTHREAD_H='${gl_REL_SOURCE_BASE}pthread.h'
      AC_LIBOBJ([pthread])
    elif test $gl_cv_header_pthread_h_pollution = yes; then
-     PTHREAD_H=pthread.h
+     PTHREAD_H=${gl_REL_SOURCE_BASE}pthread.h
    else
      PTHREAD_H=
    fi
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
--- a/m4/stdarg.m4
+++ b/m4/stdarg.m4
@@ -40,7 +40,7 @@ void (*func) (va_list, va_list) = va_cop
       ], [gl_aixcc=yes], [gl_aixcc=no])
     if test $gl_aixcc = yes; then
       dnl Provide a substitute <stdarg.h> file.
-      STDARG_H=stdarg.h
+      STDARG_H=${gl_REL_SOURCE_BASE}stdarg.h
       gl_NEXT_HEADERS([stdarg.h])
       dnl Fallback for the case when <stdarg.h> contains only macro 
definitions.
       if test "$gl_cv_next_stdarg_h" = '""'; then
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -10,12 +10,12 @@ AC_DEFUN([gl_STDDEF_H],
   AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   STDDEF_H=
-  AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h],
+  AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; 
STDDEF_H=${gl_REL_SOURCE_BASE}stddef.h],
     [[#include <stddef.h>
     ]])
   if test $gt_cv_c_wchar_t = no; then
     HAVE_WCHAR_T=0
-    STDDEF_H=stddef.h
+    STDDEF_H=${gl_REL_SOURCE_BASE}stddef.h
   fi
   AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
     [gl_cv_decl_null_works],
@@ -26,7 +26,7 @@ AC_DEFUN([gl_STDDEF_H],
       [gl_cv_decl_null_works=no])])
   if test $gl_cv_decl_null_works = no; then
     REPLACE_NULL=1
-    STDDEF_H=stddef.h
+    STDDEF_H=${gl_REL_SOURCE_BASE}stddef.h
   fi
   AC_SUBST([STDDEF_H])
   AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -297,7 +297,7 @@ static const char *macro_values[] =
   HAVE_C99_STDINT_H=0
   HAVE_SYS_BITYPES_H=0
   HAVE_SYS_INTTYPES_H=0
-  STDINT_H=stdint.h
+  STDINT_H=${gl_REL_SOURCE_BASE}stdint.h
   if test "$gl_cv_header_working_stdint_h" = yes; then
     HAVE_C99_STDINT_H=1
     dnl Now see whether the system <stdint.h> works without
@@ -355,7 +355,7 @@ int32_t i32 = INT32_C (0x7fffffff);
   fi
 
   # The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
-  LIMITS_H=limits.h
+  LIMITS_H=${gl_REL_SOURCE_BASE}limits.h
   AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
 
   AC_SUBST([HAVE_C99_STDINT_H])
diff --git a/m4/sysexits.m4 b/m4/sysexits.m4
--- a/m4/sysexits.m4
+++ b/m4/sysexits.m4
@@ -33,10 +33,10 @@ AC_DEFUN([gl_SYSEXITS],
           }
         ]])],
       [SYSEXITS_H=],
-      [SYSEXITS_H=sysexits.h])
+      [SYSEXITS_H=${gl_REL_SOURCE_BASE}sysexits.h])
   else
     HAVE_SYSEXITS_H=0
-    SYSEXITS_H=sysexits.h
+    SYSEXITS_H=${gl_REL_SOURCE_BASE}sysexits.h
   fi
   AC_SUBST([HAVE_SYSEXITS_H])
   AC_SUBST([SYSEXITS_H])
diff --git a/modules/alloca-opt b/modules/alloca-opt
--- a/modules/alloca-opt
+++ b/modules/alloca-opt
@@ -18,17 +18,17 @@ BUILT_SOURCES += $(ALLOCA_H)
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
 if GL_GENERATE_ALLOCA_H
-alloca.h: alloca.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@alloca.h: @gl_rel_source_b...@alloca.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/alloca.in.h; \
+         cat $(srcdir)/@gl_rel_source_b...@alloca.in.h; \
        } > $@-t && \
        mv -f $@-t $@
 else
-alloca.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@alloca.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += alloca.h alloca.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@alloca.h @gl_REL_SOURCE_BASE@alloca.h-t
 
 Include:
 <alloca.h>
diff --git a/modules/allocator b/modules/allocator
--- a/modules/allocator
+++ b/modules/allocator
@@ -10,7 +10,7 @@ Depends-on:
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += allocator.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@allocator.c
 
 Include:
 "allocator.h"
diff --git a/modules/areadlink b/modules/areadlink
--- a/modules/areadlink
+++ b/modules/areadlink
@@ -12,7 +12,7 @@ readlink
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += areadlink.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@areadlink.c
 
 Include:
 "areadlink.h"
diff --git a/modules/areadlink-with-size b/modules/areadlink-with-size
--- a/modules/areadlink-with-size
+++ b/modules/areadlink-with-size
@@ -14,7 +14,7 @@ unistd
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += areadlink-with-size.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@areadlink-with-size.c
 
 Include:
 "areadlink.h"
diff --git a/modules/base64 b/modules/base64
--- a/modules/base64
+++ b/modules/base64
@@ -14,7 +14,7 @@ configure.ac:
 gl_FUNC_BASE64
 
 Makefile.am:
-lib_SOURCES += base64.h base64.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@base64.h @gl_REL_SOURCE_BASE@base64.c
 
 Include:
 "base64.h"
diff --git a/modules/bitrotate b/modules/bitrotate
--- a/modules/bitrotate
+++ b/modules/bitrotate
@@ -12,7 +12,7 @@ stdint
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += bitrotate.h bitrotate.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@bitrotate.h @gl_REL_SOURCE_BASE@bitrotate.c
 
 Include:
 "bitrotate.h"
diff --git a/modules/c-ctype b/modules/c-ctype
--- a/modules/c-ctype
+++ b/modules/c-ctype
@@ -12,7 +12,7 @@ stdbool
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += c-ctype.h c-ctype.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@c-ctype.h @gl_REL_SOURCE_BASE@c-ctype.c
 
 Include:
 "c-ctype.h"
diff --git a/modules/canonicalize b/modules/canonicalize
--- a/modules/canonicalize
+++ b/modules/canonicalize
@@ -28,7 +28,7 @@ gl_MODULE_INDICATOR_FOR_TESTS([canonical
 gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
 
 Makefile.am:
-lib_SOURCES += canonicalize.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@canonicalize.c
 
 Include:
 "canonicalize.h"
diff --git a/modules/careadlinkat b/modules/careadlinkat
--- a/modules/careadlinkat
+++ b/modules/careadlinkat
@@ -14,7 +14,7 @@ configure.ac:
 AC_CHECK_FUNCS_ONCE([readlinkat])
 
 Makefile.am:
-lib_SOURCES += careadlinkat.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@careadlinkat.c
 
 Include:
 "careadlinkat.h"
diff --git a/modules/cloexec b/modules/cloexec
--- a/modules/cloexec
+++ b/modules/cloexec
@@ -14,7 +14,7 @@ configure.ac:
 gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
 
 Makefile.am:
-lib_SOURCES += cloexec.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@cloexec.c
 
 Include:
 "cloexec.h"
diff --git a/modules/configmake b/modules/configmake
--- a/modules/configmake
+++ b/modules/configmake
@@ -1,4 +1,4 @@
-Description:
+qDescription:
 Access from source code to variables set by "configure" or "make".
 
 Files:
@@ -14,7 +14,7 @@ Makefile.am:
 # provided by autoconf 2.59c+ or 2.70.
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
-configmake.h: Makefile
+@gl_REL_SOURCE_BASE@configmake.h: Makefile
        $(AM_V_GEN)rm -f $@-t && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          echo '#define PREFIX "$(prefix)"'; \
@@ -48,8 +48,8 @@ configmake.h: Makefile
        } | sed '/""/d' > $@-t && \
        mv -f $@-t $@
 
-BUILT_SOURCES += configmake.h
-CLEANFILES += configmake.h configmake.h-t
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@configmake.h
+CLEANFILES += @gl_REL_SOURCE_BASE@configmake.h 
@gl_REL_SOURCE_BASE@configmake.h-t
 
 Include:
 /* Include only after all system include files.  */
diff --git a/modules/crypto/md2 b/modules/crypto/md2
--- a/modules/crypto/md2
+++ b/modules/crypto/md2
@@ -11,7 +11,7 @@ minmax
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += md2.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@md2.c
 
 Include:
 "md2.h"
diff --git a/modules/crypto/md4 b/modules/crypto/md4
--- a/modules/crypto/md4
+++ b/modules/crypto/md4
@@ -14,7 +14,7 @@ configure.ac:
 gl_MD4
 
 Makefile.am:
-lib_SOURCES += md4.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@md4.c
 
 Include:
 "md4.h"
diff --git a/modules/crypto/md5 b/modules/crypto/md5
--- a/modules/crypto/md5
+++ b/modules/crypto/md5
@@ -17,7 +17,7 @@ configure.ac:
 gl_MD5
 
 Makefile.am:
-lib_SOURCES += md5.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@md5.c
 
 Include:
 "md5.h"
diff --git a/modules/crypto/sha1 b/modules/crypto/sha1
--- a/modules/crypto/sha1
+++ b/modules/crypto/sha1
@@ -17,7 +17,7 @@ configure.ac:
 gl_SHA1
 
 Makefile.am:
-lib_SOURCES += sha1.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@sha1.c
 
 Include:
 "sha1.h"
diff --git a/modules/crypto/sha256 b/modules/crypto/sha256
--- a/modules/crypto/sha256
+++ b/modules/crypto/sha256
@@ -17,7 +17,7 @@ configure.ac:
 gl_SHA256
 
 Makefile.am:
-lib_SOURCES += sha256.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@sha256.c
 
 Include:
 "sha256.h"
diff --git a/modules/crypto/sha512 b/modules/crypto/sha512
--- a/modules/crypto/sha512
+++ b/modules/crypto/sha512
@@ -18,7 +18,7 @@ configure.ac:
 gl_SHA512
 
 Makefile.am:
-lib_SOURCES += sha512.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@sha512.c
 
 Include:
 "sha512.h"
diff --git a/modules/dirent b/modules/dirent
--- a/modules/dirent
+++ b/modules/dirent
@@ -16,11 +16,11 @@ configure.ac:
 gl_DIRENT_H
 
 Makefile.am:
-BUILT_SOURCES += dirent.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@dirent.h
 
 # We need the following in order to create <dirent.h> when the system
 # doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@dirent.h: @gl_rel_source_b...@dirent.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -53,10 +53,10 @@ dirent.h: dirent.in.h $(top_builddir)/co
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/dirent.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@dirent.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += dirent.h dirent.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@dirent.h @gl_REL_SOURCE_BASE@dirent.h-t
 
 Include:
 <dirent.h>
diff --git a/modules/dirname b/modules/dirname
--- a/modules/dirname
+++ b/modules/dirname
@@ -16,7 +16,7 @@ gl_DIRNAME
 gl_MODULE_INDICATOR([dirname])
 
 Makefile.am:
-lib_SOURCES += dirname.c basename.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@dirname.c @gl_REL_SOURCE_BASE@basename.c
 
 Include:
 "dirname.h"
diff --git a/modules/dirname-lgpl b/modules/dirname-lgpl
--- a/modules/dirname-lgpl
+++ b/modules/dirname-lgpl
@@ -18,7 +18,7 @@ configure.ac:
 gl_DIRNAME_LGPL
 
 Makefile.am:
-lib_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@dirname-lgpl.c 
@gl_REL_SOURCE_BASE@basename-lgpl.c @gl_REL_SOURCE_BASE@stripslash.c
 
 Include:
 "dirname.h"
diff --git a/modules/errno b/modules/errno
--- a/modules/errno
+++ b/modules/errno
@@ -17,7 +17,7 @@ BUILT_SOURCES += $(ERRNO_H)
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
 if GL_GENERATE_ERRNO_H
-errno.h: errno.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@errno.h: @gl_rel_source_b...@errno.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -31,14 +31,14 @@ errno.h: errno.in.h $(top_builddir)/conf
              -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
              -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
              -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
-             < $(srcdir)/errno.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@errno.in.h; \
        } > $@-t && \
        mv $@-t $@
 else
-errno.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@errno.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += errno.h errno.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@errno.h @gl_REL_SOURCE_BASE@errno.h-t
 
 Include:
 <errno.h>
diff --git a/modules/exitfail b/modules/exitfail
--- a/modules/exitfail
+++ b/modules/exitfail
@@ -11,7 +11,7 @@ stdlib
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += exitfail.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@exitfail.c
 
 Include:
 "exitfail.h"
diff --git a/modules/fcntl-h b/modules/fcntl-h
--- a/modules/fcntl-h
+++ b/modules/fcntl-h
@@ -19,11 +19,11 @@ configure.ac:
 gl_FCNTL_H
 
 Makefile.am:
-BUILT_SOURCES += fcntl.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@fcntl.h
 
 # We need the following in order to create <fcntl.h> when the system
 # doesn't have one that works with the given compiler.
-fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@fcntl.h: @gl_rel_source_b...@fcntl.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -43,10 +43,10 @@ fcntl.h: fcntl.in.h $(top_builddir)/conf
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/fcntl.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@fcntl.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@fcntl.h @gl_REL_SOURCE_BASE@fcntl.h-t
 
 Include:
 <fcntl.h>
diff --git a/modules/fd-hook b/modules/fd-hook
--- a/modules/fd-hook
+++ b/modules/fd-hook
@@ -11,7 +11,7 @@ unistd
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += fd-hook.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@fd-hook.c
 
 Include:
 "fd-hook.h"
diff --git a/modules/file-set b/modules/file-set
--- a/modules/file-set
+++ b/modules/file-set
@@ -15,7 +15,7 @@ xalloc-die
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += file-set.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@file-set.c
 
 Include:
 "file-set.h"
diff --git a/modules/filemode b/modules/filemode
--- a/modules/filemode
+++ b/modules/filemode
@@ -15,7 +15,7 @@ configure.ac:
 gl_FILEMODE
 
 Makefile.am:
-lib_SOURCES += filemode.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@filemode.c
 
 Include:
 "filemode.h"
diff --git a/modules/filenamecat-lgpl b/modules/filenamecat-lgpl
--- a/modules/filenamecat-lgpl
+++ b/modules/filenamecat-lgpl
@@ -13,7 +13,7 @@ configure.ac:
 gl_FILE_NAME_CONCAT_LGPL
 
 Makefile.am:
-lib_SOURCES += filenamecat-lgpl.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@filenamecat-lgpl.c
 
 Include:
 "filenamecat.h"
diff --git a/modules/float b/modules/float
--- a/modules/float
+++ b/modules/float
@@ -25,7 +25,7 @@ BUILT_SOURCES += $(FLOAT_H)
 # We need the following in order to create <float.h> when the system
 # doesn't have one that works with the given compiler.
 if GL_GENERATE_FLOAT_H
-float.h: float.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@float.h: @gl_rel_source_b...@float.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -34,14 +34,14 @@ float.h: float.in.h $(top_builddir)/conf
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
              -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
-             < $(srcdir)/float.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@float.in.h; \
        } > $@-t && \
        mv $@-t $@
 else
-float.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@float.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += float.h float.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@float.h @gl_REL_SOURCE_BASE@float.h-t
 
 Include:
 <float.h>
diff --git a/modules/fnmatch b/modules/fnmatch
--- a/modules/fnmatch
+++ b/modules/fnmatch
@@ -34,18 +34,18 @@ BUILT_SOURCES += $(FNMATCH_H)
 # We need the following in order to create <fnmatch.h> when the system
 # doesn't have one that supports the required API.
 if GL_GENERATE_FNMATCH_H
-fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+@gl_REL_SOURCE_BASE@fnmatch.h: @gl_rel_source_b...@fnmatch.in.h 
$(top_builddir)/config.status $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             < $(srcdir)/fnmatch.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@fnmatch.in.h; \
        } > $@-t && \
        mv -f $@-t $@
 else
-fnmatch.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@fnmatch.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@fnmatch.h 
@gl_REL_SOURCE_BASE@fnmatch.h-t
 
 Include:
 <fnmatch.h>
diff --git a/modules/getopt-posix b/modules/getopt-posix
--- a/modules/getopt-posix
+++ b/modules/getopt-posix
@@ -31,7 +31,7 @@ BUILT_SOURCES += $(GETOPT_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+@gl_REL_SOURCE_BASE@getopt.h: @gl_rel_source_b...@getopt.in.h 
$(top_builddir)/config.status $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -41,10 +41,10 @@ getopt.h: getopt.in.h $(top_builddir)/co
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             < $(srcdir)/getopt.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@getopt.in.h; \
        } > $@-t && \
        mv -f $@-t $@
-MOSTLYCLEANFILES += getopt.h getopt.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@getopt.h @gl_REL_SOURCE_BASE@getopt.h-t
 
 Include:
 <unistd.h>
diff --git a/modules/getprogname b/modules/getprogname
--- a/modules/getprogname
+++ b/modules/getprogname
@@ -14,7 +14,7 @@ configure.ac:
 gl_FUNC_GETPROGNAME
 
 Makefile.am:
-lib_SOURCES += getprogname.h getprogname.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@getprogname.h 
@gl_REL_SOURCE_BASE@getprogname.c
 
 Include:
 "getprogname.h"
diff --git a/modules/gettext-h b/modules/gettext-h
--- a/modules/gettext-h
+++ b/modules/gettext-h
@@ -11,7 +11,7 @@ AC_SUBST([LIBINTL])
 AC_SUBST([LTLIBINTL])
 
 Makefile.am:
-lib_SOURCES += gettext.h
+lib_SOURCES += @gl_REL_SOURCE_BASE@gettext.h
 
 Include:
 "gettext.h"
diff --git a/modules/glob b/modules/glob
--- a/modules/glob
+++ b/modules/glob
@@ -45,21 +45,21 @@ BUILT_SOURCES += $(GLOB_H)
 # We need the following in order to create <glob.h> when the system
 # doesn't have one that works with the given compiler.
 if GL_GENERATE_GLOB_H
-glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@glob.h: @gl_rel_source_b...@glob.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/glob.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@glob.in.h; \
        } > $@-t && \
        mv -f $@-t $@
 else
-glob.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@glob.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += glob.h glob.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@glob.h @gl_REL_SOURCE_BASE@glob.h-t
 
 Include:
 <glob.h>
diff --git a/modules/hard-locale b/modules/hard-locale
--- a/modules/hard-locale
+++ b/modules/hard-locale
@@ -14,7 +14,7 @@ configure.ac:
 gl_HARD_LOCALE
 
 Makefile.am:
-lib_SOURCES += hard-locale.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@hard-locale.c
 
 Include:
 "hard-locale.h"
diff --git a/modules/hash b/modules/hash
--- a/modules/hash
+++ b/modules/hash
@@ -14,7 +14,7 @@ xalloc-oversized
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += hash.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@hash.c
 
 Include:
 "hash.h"
diff --git a/modules/hash-pjw b/modules/hash-pjw
--- a/modules/hash-pjw
+++ b/modules/hash-pjw
@@ -10,7 +10,7 @@ Depends-on:
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += hash-pjw.h hash-pjw.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@hash-pjw.h @gl_REL_SOURCE_BASE@hash-pjw.c
 
 Include:
 "hash-pjw.h"
diff --git a/modules/hash-triple b/modules/hash-triple
--- a/modules/hash-triple
+++ b/modules/hash-triple
@@ -13,7 +13,7 @@ same-inode
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += hash-triple.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@hash-triple.c
 
 Include:
 "hash-triple.h"
diff --git a/modules/limits-h b/modules/limits-h
--- a/modules/limits-h
+++ b/modules/limits-h
@@ -17,7 +17,7 @@ BUILT_SOURCES += $(LIMITS_H)
 # We need the following in order to create <limits.h> when the system
 # doesn't have one that is compatible with GNU.
 if GL_GENERATE_LIMITS_H
-limits.h: limits.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@limits.h: @gl_rel_source_b...@limits.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -25,14 +25,14 @@ limits.h: limits.in.h $(top_builddir)/co
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
-             < $(srcdir)/limits.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@limits.in.h; \
        } > $@-t && \
        mv $@-t $@
 else
-limits.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@limits.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += limits.h limits.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@limits.h @gl_REL_SOURCE_BASE@limits.h-t
 
 Include:
 <limits.h>
diff --git a/modules/localcharset b/modules/localcharset
--- a/modules/localcharset
+++ b/modules/localcharset
@@ -28,7 +28,7 @@ LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETA
 AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
 
 Makefile.am:
-lib_SOURCES += localcharset.h localcharset.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@localcharset.h 
@gl_REL_SOURCE_BASE@localcharset.c
 
 # We need the following in order to install a simple file in $(libdir)
 # which is shared with other installed packages. We use a list of referencing
@@ -37,7 +37,7 @@ lib_SOURCES += localcharset.h localchars
 # On systems with glibc-2.1 or newer, the file is redundant, therefore we
 # avoid installing it.
 
-all-local: charset.alias ref-add.sed ref-del.sed
+all-local: @gl_REL_SOURCE_BASE@charset.alias @gl_rel_source_b...@ref-add.sed 
@gl_rel_source_b...@ref-del.sed
 
 charset_alias = $(DESTDIR)$(libdir)/charset.alias
 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
@@ -59,12 +59,12 @@ install-exec-localcharset: all-local
          $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
        fi ; \
        if test -f $(charset_alias); then \
-         sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
+         sed -f @gl_rel_source_b...@ref-add.sed $(charset_alias) > 
$(charset_tmp) ; \
          $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
          rm -f $(charset_tmp) ; \
        else \
          if $$need_charset_alias; then \
-           sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
+           sed -f @gl_rel_source_b...@ref-add.sed 
@gl_REL_SOURCE_BASE@charset.alias > $(charset_tmp) ; \
            $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
            rm -f $(charset_tmp) ; \
          fi ; \
@@ -73,7 +73,7 @@ install-exec-localcharset: all-local
 uninstall-local: uninstall-localcharset
 uninstall-localcharset: all-local
        if test -f $(charset_alias); then \
-         sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
+         sed -f @gl_rel_source_b...@ref-del.sed $(charset_alias) > 
$(charset_tmp); \
          if grep '^# Packages using this file: $$' $(charset_tmp) \
              > /dev/null; then \
            rm -f $(charset_alias); \
@@ -83,18 +83,18 @@ uninstall-localcharset: all-local
          rm -f $(charset_tmp); \
        fi
 
-charset.alias: config.charset
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
-       mv t-$@ $@
+@gl_REL_SOURCE_BASE@charset.alias: @gl_REL_SOURCE_BASE@config.charset
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       $(SHELL) $(srcdir)/@gl_REL_SOURCE_BASE@config.charset '$(host)' > $@-t 
&& \
+       mv $@-t $@
 
 SUFFIXES += .sed .sin
 .sin.sed:
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
-       mv t-$@ $@
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > $@-t && \
+       mv $@-t $@
 
-CLEANFILES += charset.alias ref-add.sed ref-del.sed
+CLEANFILES += @gl_REL_SOURCE_BASE@charset.alias 
@gl_rel_source_b...@ref-add.sed @gl_rel_source_b...@ref-del.sed
 
 Include:
 "localcharset.h"
diff --git a/modules/lock b/modules/lock
--- a/modules/lock
+++ b/modules/lock
@@ -14,7 +14,7 @@ gl_LOCK
 gl_MODULE_INDICATOR([lock])
 
 Makefile.am:
-lib_SOURCES += glthread/lock.h glthread/lock.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@glthread/lock.h 
@gl_REL_SOURCE_BASE@glthread/lock.c
 
 Include:
 "glthread/lock.h"
diff --git a/modules/malloca b/modules/malloca
--- a/modules/malloca
+++ b/modules/malloca
@@ -18,7 +18,7 @@ configure.ac:
 gl_MALLOCA
 
 Makefile.am:
-lib_SOURCES += malloca.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@malloca.c
 
 Include:
 "malloca.h"
diff --git a/modules/math b/modules/math
--- a/modules/math
+++ b/modules/math
@@ -18,12 +18,12 @@ configure.ac:
 gl_MATH_H
 
 Makefile.am:
-BUILT_SOURCES += math.h
-lib_SOURCES += math.c
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@math.h
+lib_SOURCES += @gl_REL_SOURCE_BASE@math.c
 
 # We need the following in order to create <math.h> when the system
 # doesn't have one that works with the given compiler.
-math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@math.h: @gl_rel_source_b...@math.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -75,7 +75,7 @@ math.h: math.in.h $(top_builddir)/config
              -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \
              -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \
              -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \
-             < $(srcdir)/math.in.h | \
+             < $(srcdir)/@gl_rel_source_b...@math.in.h | \
          sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \
              -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \
              -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \
@@ -294,7 +294,7 @@ math.h: math.in.h $(top_builddir)/config
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += math.h math.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@math.h @gl_REL_SOURCE_BASE@math.h-t
 
 Include:
 <math.h>
diff --git a/modules/minmax b/modules/minmax
--- a/modules/minmax
+++ b/modules/minmax
@@ -11,7 +11,7 @@ configure.ac:
 gl_MINMAX
 
 Makefile.am:
-lib_SOURCES += minmax.h
+lib_SOURCES += @gl_REL_SOURCE_BASE@minmax.h
 
 Include:
 "minmax.h"
diff --git a/modules/nproc b/modules/nproc
--- a/modules/nproc
+++ b/modules/nproc
@@ -15,7 +15,7 @@ configure.ac:
 gl_NPROC
 
 Makefile.am:
-lib_SOURCES += nproc.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@nproc.c
 
 Include:
 "nproc.h"
diff --git a/modules/openat-die b/modules/openat-die
--- a/modules/openat-die
+++ b/modules/openat-die
@@ -14,7 +14,7 @@ snippet/_Noreturn
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += openat-die.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@openat-die.c
 
 Include:
 "openat.h"
diff --git a/modules/progname b/modules/progname
--- a/modules/progname
+++ b/modules/progname
@@ -12,7 +12,7 @@ AC_CHECK_DECLS([program_invocation_name]
 AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
 
 Makefile.am:
-lib_SOURCES += progname.h progname.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@progname.h @gl_REL_SOURCE_BASE@progname.c
 
 Include:
 "progname.h"
diff --git a/modules/same b/modules/same
--- a/modules/same
+++ b/modules/same
@@ -19,7 +19,7 @@ configure.ac:
 gl_SAME
 
 Makefile.am:
-lib_SOURCES += same.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@same.c
 
 Include:
 "same.h"
diff --git a/modules/save-cwd b/modules/save-cwd
--- a/modules/save-cwd
+++ b/modules/save-cwd
@@ -18,7 +18,7 @@ configure.ac:
 gl_SAVE_CWD
 
 Makefile.am:
-lib_SOURCES += save-cwd.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@save-cwd.c
 
 Include:
 "save-cwd.h"
diff --git a/modules/sigaction b/modules/sigaction
--- a/modules/sigaction
+++ b/modules/sigaction
@@ -21,7 +21,7 @@ fi
 gl_SIGNAL_MODULE_INDICATOR([sigaction])
 
 Makefile.am:
-lib_SOURCES += sig-handler.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@sig-handler.c
 
 Include:
 <signal.h>
diff --git a/modules/signal-h b/modules/signal-h
--- a/modules/signal-h
+++ b/modules/signal-h
@@ -16,11 +16,11 @@ configure.ac:
 gl_SIGNAL_H
 
 Makefile.am:
-BUILT_SOURCES += signal.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@signal.h
 
 # We need the following in order to create <signal.h> when the system
 # doesn't have a complete one.
-signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@signal.h: @gl_rel_source_b...@signal.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -47,10 +47,10 @@ signal.h: signal.in.h $(top_builddir)/co
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/signal.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@signal.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += signal.h signal.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@signal.h @gl_REL_SOURCE_BASE@signal.h-t
 
 Include:
 <signal.h>
diff --git a/modules/size_max b/modules/size_max
--- a/modules/size_max
+++ b/modules/size_max
@@ -11,7 +11,7 @@ configure.ac:
 gl_SIZE_MAX
 
 Makefile.am:
-lib_SOURCES += size_max.h
+lib_SOURCES += @gl_REL_SOURCE_BASE@size_max.h
 
 Include:
 "size_max.h"
diff --git a/modules/snippet/arg-nonnull b/modules/snippet/arg-nonnull
--- a/modules/snippet/arg-nonnull
+++ b/modules/snippet/arg-nonnull
@@ -17,19 +17,19 @@ Makefile.am:
 # present in all Makefile.am that need it. This is ensured by the applicability
 # 'all' defined above.
 
-BUILT_SOURCES += arg-nonnull.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@arg-nonnull.h
 # The arg-nonnull.h that gets inserted into generated .h files is the same as
 # build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
 # off.
-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+@gl_REL_SOURCE_BASE@arg-nonnull.h: 
$(top_srcdir)/build-aux/snippet/arg-nonnull.h
        $(AM_V_GEN)rm -f $@-t $@ && \
        sed -n -e '/GL_ARG_NONNULL/,$$p' \
          < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
          > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@arg-nonnull.h 
@gl_REL_SOURCE_BASE@arg-nonnull.h-t
 
-ARG_NONNULL_H=arg-nonnull.h
+ARG_NONNULL_H=@gl_REL_SOURCE_BASE@arg-nonnull.h
 
 Include:
 
diff --git a/modules/snippet/c++defs b/modules/snippet/c++defs
--- a/modules/snippet/c++defs
+++ b/modules/snippet/c++defs
@@ -17,18 +17,18 @@ Makefile.am:
 # present in all Makefile.am that need it. This is ensured by the applicability
 # 'all' defined above.
 
-BUILT_SOURCES += c++defs.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@c++defs.h
 # The c++defs.h that gets inserted into generated .h files is the same as
 # build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+@gl_REL_SOURCE_BASE@c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
        $(AM_V_GEN)rm -f $@-t $@ && \
        sed -n -e '/_GL_CXXDEFS/,$$p' \
          < $(top_srcdir)/build-aux/snippet/c++defs.h \
          > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@c++defs.h 
@gl_REL_SOURCE_BASE@c++defs.h-t
 
-CXXDEFS_H=c++defs.h
+CXXDEFS_H=@gl_REL_SOURCE_BASE@c++defs.h
 
 Include:
 
diff --git a/modules/snippet/warn-on-use b/modules/snippet/warn-on-use
--- a/modules/snippet/warn-on-use
+++ b/modules/snippet/warn-on-use
@@ -13,19 +13,19 @@ Depends-on:
 configure.ac:
 
 Makefile.am:
-BUILT_SOURCES += warn-on-use.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@warn-on-use.h
 # The warn-on-use.h that gets inserted into generated .h files is the same as
 # build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
 # off.
-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+@gl_REL_SOURCE_BASE@warn-on-use.h: 
$(top_srcdir)/build-aux/snippet/warn-on-use.h
        $(AM_V_GEN)rm -f $@-t $@ && \
        sed -n -e '/^.ifndef/,$$p' \
          < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
          > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@warn-on-use.h 
@gl_REL_SOURCE_BASE@warn-on-use.h-t
 
-WARN_ON_USE_H=warn-on-use.h
+WARN_ON_USE_H=@gl_REL_SOURCE_BASE@warn-on-use.h
 
 Include:
 
diff --git a/modules/sockets b/modules/sockets
--- a/modules/sockets
+++ b/modules/sockets
@@ -17,7 +17,7 @@ configure.ac:
 AC_REQUIRE([gl_SOCKETS])
 
 Makefile.am:
-lib_SOURCES += sockets.h sockets.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@sockets.h @gl_REL_SOURCE_BASE@sockets.c
 
 Include:
 "sockets.h"
diff --git a/modules/stdalign b/modules/stdalign
--- a/modules/stdalign
+++ b/modules/stdalign
@@ -16,17 +16,17 @@ BUILT_SOURCES += $(STDALIGN_H)
 # We need the following in order to create <stdalign.h> when the system
 # doesn't have one that works.
 if GL_GENERATE_STDALIGN_H
-stdalign.h: stdalign.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stdalign.h: @gl_rel_source_b...@stdalign.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/stdalign.in.h; \
+         cat $(srcdir)/@gl_rel_source_b...@stdalign.in.h; \
        } > $@-t && \
        mv $@-t $@
 else
-stdalign.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stdalign.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += stdalign.h stdalign.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@stdalign.h 
@gl_REL_SOURCE_BASE@stdalign.h-t
 
 Include:
 <stdalign.h>
diff --git a/modules/stdbool b/modules/stdbool
--- a/modules/stdbool
+++ b/modules/stdbool
@@ -17,17 +17,17 @@ BUILT_SOURCES += $(STDBOOL_H)
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
 if GL_GENERATE_STDBOOL_H
-stdbool.h: stdbool.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stdbool.h: @gl_rel_source_b...@stdbool.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; 
\
+         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < 
$(srcdir)/@gl_rel_source_b...@stdbool.in.h; \
        } > $@-t && \
        mv $@-t $@
 else
-stdbool.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stdbool.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@stdbool.h 
@gl_REL_SOURCE_BASE@stdbool.h-t
 
 Include:
 <stdbool.h>
diff --git a/modules/stddef b/modules/stddef
--- a/modules/stddef
+++ b/modules/stddef
@@ -18,7 +18,7 @@ BUILT_SOURCES += $(STDDEF_H)
 # We need the following in order to create <stddef.h> when the system
 # doesn't have one that works with the given compiler.
 if GL_GENERATE_STDDEF_H
-stddef.h: stddef.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stddef.h: @gl_rel_source_b...@stddef.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -29,14 +29,14 @@ stddef.h: stddef.in.h $(top_builddir)/co
              -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
              -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
              -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
-             < $(srcdir)/stddef.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@stddef.in.h; \
        } > $@-t && \
        mv $@-t $@
 else
-stddef.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stddef.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += stddef.h stddef.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@stddef.h @gl_REL_SOURCE_BASE@stddef.h-t
 
 Include:
 <stddef.h>
diff --git a/modules/stdint b/modules/stdint
--- a/modules/stdint
+++ b/modules/stdint
@@ -27,7 +27,7 @@ BUILT_SOURCES += $(STDINT_H)
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
 if GL_GENERATE_STDINT_H
-stdint.h: stdint.in.h $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stdint.h: @gl_rel_source_b...@stdint.in.h 
$(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -58,14 +58,14 @@ stdint.h: stdint.in.h $(top_builddir)/co
              -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
              -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
              -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
-             < $(srcdir)/stdint.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@stdint.in.h; \
        } > $@-t && \
        mv $@-t $@
 else
-stdint.h: $(top_builddir)/config.status
+@gl_REL_SOURCE_BASE@stdint.h: $(top_builddir)/config.status
        rm -f $@
 endif
-MOSTLYCLEANFILES += stdint.h stdint.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@stdint.h @gl_REL_SOURCE_BASE@stdint.h-t
 
 Include:
 <stdint.h>
diff --git a/modules/stdio b/modules/stdio
--- a/modules/stdio
+++ b/modules/stdio
@@ -19,11 +19,11 @@ configure.ac:
 gl_STDIO_H
 
 Makefile.am:
-BUILT_SOURCES += stdio.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@stdio.h
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@stdio.h: @gl_rel_source_b...@stdio.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -84,7 +84,7 @@ stdio.h: stdio.in.h $(top_builddir)/conf
              -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
              -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
              -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
-             < $(srcdir)/stdio.in.h | \
+             < $(srcdir)/@gl_rel_source_b...@stdio.in.h | \
          sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
              -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
              -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
@@ -139,7 +139,7 @@ stdio.h: stdio.in.h $(top_builddir)/conf
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += stdio.h stdio.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@stdio.h @gl_REL_SOURCE_BASE@stdio.h-t
 
 Include:
 <stdio.h>
diff --git a/modules/stdlib b/modules/stdlib
--- a/modules/stdlib
+++ b/modules/stdlib
@@ -18,11 +18,11 @@ configure.ac:
 gl_STDLIB_H
 
 Makefile.am:
-BUILT_SOURCES += stdlib.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@stdlib.h
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+@gl_REL_SOURCE_BASE@stdlib.h: @gl_rel_source_b...@stdlib.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) \
   $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
@@ -64,7 +64,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/co
              -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
              -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
              -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
-             < $(srcdir)/stdlib.in.h | \
+             < $(srcdir)/@gl_rel_source_b...@stdlib.in.h | \
          sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
              -e 
's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
@@ -116,7 +116,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/co
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += stdlib.h stdlib.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@stdlib.h @gl_REL_SOURCE_BASE@stdlib.h-t
 
 Include:
 <stdlib.h>
diff --git a/modules/strftime b/modules/strftime
--- a/modules/strftime
+++ b/modules/strftime
@@ -16,7 +16,7 @@ configure.ac:
 gl_FUNC_GNU_STRFTIME
 
 Makefile.am:
-lib_SOURCES += strftime.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@strftime.c
 
 Include:
 "strftime.h"
diff --git a/modules/string b/modules/string
--- a/modules/string
+++ b/modules/string
@@ -18,11 +18,11 @@ configure.ac:
 gl_HEADER_STRING_H
 
 Makefile.am:
-BUILT_SOURCES += string.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@string.h
 
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
-string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@string.h: @gl_rel_source_b...@string.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -67,7 +67,7 @@ string.h: string.in.h $(top_builddir)/co
              -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
              -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
              -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
-             < $(srcdir)/string.in.h | \
+             < $(srcdir)/@gl_rel_source_b...@string.in.h | \
          sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
              -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
              -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
@@ -107,10 +107,10 @@ string.h: string.in.h $(top_builddir)/co
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
-             < $(srcdir)/string.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@string.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += string.h string.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@string.h @gl_REL_SOURCE_BASE@string.h-t
 
 Include:
 <string.h>
diff --git a/modules/strings b/modules/strings
--- a/modules/strings
+++ b/modules/strings
@@ -16,11 +16,11 @@ configure.ac:
 gl_HEADER_STRINGS_H
 
 Makefile.am:
-BUILT_SOURCES += strings.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@strings.h
 
 # We need the following in order to create <strings.h> when the system
 # doesn't have one that works with the given compiler.
-strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(WARN_ON_USE_H) $(ARG_NONNULL_H)
+@gl_REL_SOURCE_BASE@strings.h: @gl_rel_source_b...@strings.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -36,10 +36,10 @@ strings.h: strings.in.h $(top_builddir)/
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/strings.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@strings.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += strings.h strings.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@strings.h 
@gl_REL_SOURCE_BASE@strings.h-t
 
 Include:
 <strings.h>
diff --git a/modules/strnlen1 b/modules/strnlen1
--- a/modules/strnlen1
+++ b/modules/strnlen1
@@ -11,7 +11,7 @@ memchr
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += strnlen1.h strnlen1.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@strnlen1.h @gl_REL_SOURCE_BASE@strnlen1.c
 
 Include:
 "strnlen1.h"
diff --git a/modules/sys_resource b/modules/sys_resource
--- a/modules/sys_resource
+++ b/modules/sys_resource
@@ -17,12 +17,12 @@ gl_HEADER_SYS_RESOURCE
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/resource.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/resource.h
 
 # We need the following in order to create <sys/resource.h> when the system
 # doesn't have one.
-sys/resource.h: sys_resource.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/resource.h: @gl_REL_SOURCE_BASE@sys_resource.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -36,11 +36,11 @@ sys/resource.h: sys_resource.in.h $(top_
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_resource.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_resource.in.h; \
        } > $@-t && \
        mv -f $@-t $@
-MOSTLYCLEANFILES += sys/resource.h sys/resource.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/resource.h 
@gl_REL_SOURCE_BASE@sys/resource.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/resource.h>
diff --git a/modules/sys_select b/modules/sys_select
--- a/modules/sys_select
+++ b/modules/sys_select
@@ -18,12 +18,12 @@ gl_HEADER_SYS_SELECT
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/select.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/select.h
 
 # We need the following in order to create <sys/select.h> when the system
 # doesn't have one that works with the given compiler.
-sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(WARN_ON_USE_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/select.h: @gl_REL_SOURCE_BASE@sys_select.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -40,11 +40,11 @@ sys/select.h: sys_select.in.h $(top_buil
              -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_select.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_select.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += sys/select.h sys/select.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/select.h 
@gl_REL_SOURCE_BASE@sys/select.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/select.h>
diff --git a/modules/sys_socket b/modules/sys_socket
--- a/modules/sys_socket
+++ b/modules/sys_socket
@@ -24,13 +24,13 @@ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/socket.h
-lib_SOURCES += sys_socket.c
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/socket.h
+lib_SOURCES += @gl_REL_SOURCE_BASE@sys_socket.c
 
 # We need the following in order to create <sys/socket.h> when the system
 # doesn't have one that works with the given compiler.
-sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(WARN_ON_USE_H) $(ARG_NONNULL_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/socket.h: @gl_REL_SOURCE_BASE@sys_socket.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -64,11 +64,11 @@ sys/socket.h: sys_socket.in.h $(top_buil
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_socket.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_socket.in.h; \
        } > $@-t && \
        mv -f $@-t $@
-MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/socket.h 
@gl_REL_SOURCE_BASE@sys/socket.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/socket.h>
diff --git a/modules/sys_stat b/modules/sys_stat
--- a/modules/sys_stat
+++ b/modules/sys_stat
@@ -19,12 +19,12 @@ gl_HEADER_SYS_STAT_H
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/stat.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/stat.h
 
 # We need the following in order to create <sys/stat.h> when the system
 # has one that is incomplete.
-sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/stat.h: @gl_REL_SOURCE_BASE@sys_stat.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -69,11 +69,11 @@ sys/stat.h: sys_stat.in.h $(top_builddir
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_stat.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_stat.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/stat.h 
@gl_REL_SOURCE_BASE@sys/stat.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/stat.h>
diff --git a/modules/sys_time b/modules/sys_time
--- a/modules/sys_time
+++ b/modules/sys_time
@@ -17,12 +17,12 @@ gl_HEADER_SYS_TIME_H
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/time.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/time.h
 
 # We need the following in order to create <sys/time.h> when the system
 # doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/time.h: @gl_REL_SOURCE_BASE@sys_time.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -40,10 +40,10 @@ sys/time.h: sys_time.in.h $(top_builddir
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_time.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_time.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += sys/time.h sys/time.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/time.h 
@gl_REL_SOURCE_BASE@sys/time.h-t
 
 Include:
 <sys/time.h>
diff --git a/modules/sys_times b/modules/sys_times
--- a/modules/sys_times
+++ b/modules/sys_times
@@ -15,12 +15,12 @@ gl_SYS_TIMES_H
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/times.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/times.h
 
 # We need the following in order to create <sys/times.h> when the system
 # doesn't have one that works with the given compiler.
-sys/times.h: sys_times.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) 
$(ARG_NONNULL_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/times.h: @gl_REL_SOURCE_BASE@sys_times.in.h 
$(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -34,11 +34,11 @@ sys/times.h: sys_times.in.h $(top_buildd
              -e 's|@''HAVE_TIMES''@|$(HAVE_TIMES)|g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_times.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_times.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += sys/times.h sys/times.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/times.h 
@gl_REL_SOURCE_BASE@sys/times.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/times.h>
diff --git a/modules/sys_types b/modules/sys_types
--- a/modules/sys_types
+++ b/modules/sys_types
@@ -15,12 +15,12 @@ gl_SYS_TYPES_H
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/types.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/types.h
 
 # We need the following in order to create <sys/types.h> when the system
 # doesn't have one that works with the given compiler.
-sys/types.h: sys_types.in.h $(top_builddir)/config.status
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/types.h: @gl_REL_SOURCE_BASE@sys_types.in.h 
$(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -29,10 +29,10 @@ sys/types.h: sys_types.in.h $(top_buildd
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
              -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
-             < $(srcdir)/sys_types.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_types.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/types.h 
@gl_REL_SOURCE_BASE@sys/types.h-t
 
 Include:
 <sys/types.h>
diff --git a/modules/sys_uio b/modules/sys_uio
--- a/modules/sys_uio
+++ b/modules/sys_uio
@@ -15,12 +15,12 @@ gl_HEADER_SYS_UIO
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/uio.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/uio.h
 
 # We need the following in order to create <sys/uio.h> when the system
 # doesn't have one that works with the given compiler.
-sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/uio.h: @gl_REL_SOURCE_BASE@sys_uio.in.h 
$(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -29,11 +29,11 @@ sys/uio.h: sys_uio.in.h $(top_builddir)/
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \
              -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \
-             < $(srcdir)/sys_uio.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_uio.in.h; \
        } > $@-t && \
        mv -f $@-t $@
-MOSTLYCLEANFILES += sys/uio.h sys/uio.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/uio.h 
@gl_REL_SOURCE_BASE@sys/uio.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/uio.h>
diff --git a/modules/sys_utsname b/modules/sys_utsname
--- a/modules/sys_utsname
+++ b/modules/sys_utsname
@@ -15,12 +15,12 @@ gl_SYS_UTSNAME_H
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/utsname.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/utsname.h
 
 # We need the following in order to create <sys/utsname.h> when the system
 # does not have one.
-sys/utsname.h: sys_utsname.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) 
$(ARG_NONNULL_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/utsname.h: @gl_REL_SOURCE_BASE@sys_utsname.in.h 
$(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -34,11 +34,11 @@ sys/utsname.h: sys_utsname.in.h $(top_bu
              -e 's|@''HAVE_UNAME''@|$(HAVE_UNAME)|g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_utsname.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_utsname.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += sys/utsname.h sys/utsname.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/utsname.h 
@gl_REL_SOURCE_BASE@sys/utsname.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/utsname.h>
diff --git a/modules/sys_wait b/modules/sys_wait
--- a/modules/sys_wait
+++ b/modules/sys_wait
@@ -15,12 +15,12 @@ gl_SYS_WAIT_H
 AC_PROG_MKDIR_P
 
 Makefile.am:
-BUILT_SOURCES += sys/wait.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@sys/wait.h
 
 # We need the following in order to create <sys/wait.h> when the system
 # has one that is incomplete.
-sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(WARN_ON_USE_H)
-       $(AM_V_at)$(MKDIR_P) sys
+@gl_REL_SOURCE_BASE@sys/wait.h: @gl_REL_SOURCE_BASE@sys_wait.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) @gl_REL_SOURCE_BASE@sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -31,11 +31,11 @@ sys/wait.h: sys_wait.in.h $(top_builddir
              -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_wait.in.h; \
+             < $(srcdir)/@gl_REL_SOURCE_BASE@sys_wait.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += sys/wait.h sys/wait.h-t
-MOSTLYCLEANDIRS += sys
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@sys/wait.h 
@gl_REL_SOURCE_BASE@sys/wait.h-t
+MOSTLYCLEANDIRS += @gl_REL_SOURCE_BASE@sys
 
 Include:
 <sys/wait.h>
diff --git a/modules/tempname b/modules/tempname
--- a/modules/tempname
+++ b/modules/tempname
@@ -20,7 +20,7 @@ configure.ac:
 gl_FUNC_GEN_TEMPNAME
 
 Makefile.am:
-lib_SOURCES += tempname.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@tempname.c
 
 Include:
 "tempname.h"
diff --git a/modules/threadlib b/modules/threadlib
--- a/modules/threadlib
+++ b/modules/threadlib
@@ -16,7 +16,7 @@ configure.ac:
 gl_THREADLIB
 
 Makefile.am:
-lib_SOURCES += glthread/threadlib.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@glthread/threadlib.c
 
 Include:
 
diff --git a/modules/time b/modules/time
--- a/modules/time
+++ b/modules/time
@@ -18,11 +18,11 @@ configure.ac:
 gl_HEADER_TIME_H
 
 Makefile.am:
-BUILT_SOURCES += time.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@time.h
 
 # We need the following in order to create <time.h> when the system
 # doesn't have one that works with the given compiler.
-time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@time.h: @gl_rel_source_b...@time.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -55,10 +55,10 @@ time.h: time.in.h $(top_builddir)/config
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/time.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@time.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += time.h time.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@time.h @gl_REL_SOURCE_BASE@time.h-t
 
 Include:
 <time.h>
diff --git a/modules/tls b/modules/tls
--- a/modules/tls
+++ b/modules/tls
@@ -13,7 +13,7 @@ configure.ac:
 gl_TLS
 
 Makefile.am:
-lib_SOURCES += glthread/tls.h glthread/tls.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@glthread/tls.h 
@gl_REL_SOURCE_BASE@glthread/tls.c
 
 Include:
 "glthread/tls.h"
diff --git a/modules/tmpdir b/modules/tmpdir
--- a/modules/tmpdir
+++ b/modules/tmpdir
@@ -16,7 +16,7 @@ configure.ac:
 gt_TMPDIR
 
 Makefile.am:
-lib_SOURCES += tmpdir.h tmpdir.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@tmpdir.h @gl_REL_SOURCE_BASE@tmpdir.c
 
 Include:
 "tmpdir.h"
diff --git a/modules/u64 b/modules/u64
--- a/modules/u64
+++ b/modules/u64
@@ -12,7 +12,7 @@ stdint
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += u64.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@u64.c
 
 Include:
 "u64.h"
diff --git a/modules/unistd b/modules/unistd
--- a/modules/unistd
+++ b/modules/unistd
@@ -21,12 +21,12 @@ configure.ac:
 gl_UNISTD_H
 
 Makefile.am:
-BUILT_SOURCES += unistd.h
-lib_SOURCES += unistd.c
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@unistd.h
+lib_SOURCES += @gl_REL_SOURCE_BASE@unistd.c
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@unistd.h: @gl_rel_source_b...@unistd.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -85,7 +85,7 @@ unistd.h: unistd.in.h $(top_builddir)/co
              -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
              -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
              -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
-             < $(srcdir)/unistd.in.h | \
+             < $(srcdir)/@gl_rel_source_b...@unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
              -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
@@ -167,7 +167,7 @@ unistd.h: unistd.in.h $(top_builddir)/co
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += unistd.h unistd.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@unistd.h @gl_REL_SOURCE_BASE@unistd.h-t
 
 Include:
 <unistd.h>
diff --git a/modules/unistd-safer b/modules/unistd-safer
--- a/modules/unistd-safer
+++ b/modules/unistd-safer
@@ -17,7 +17,7 @@ configure.ac:
 gl_UNISTD_SAFER
 
 Makefile.am:
-lib_SOURCES += dup-safer.c fd-safer.c pipe-safer.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@dup-safer.c @gl_REL_SOURCE_BASE@fd-safer.c 
@gl_REL_SOURCE_BASE@pipe-safer.c
 
 Include:
 "unistd-safer.h"
diff --git a/modules/wchar b/modules/wchar
--- a/modules/wchar
+++ b/modules/wchar
@@ -17,11 +17,11 @@ configure.ac:
 gl_WCHAR_H
 
 Makefile.am:
-BUILT_SOURCES += wchar.h
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@wchar.h
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@wchar.h: @gl_rel_source_b...@wchar.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -70,7 +70,7 @@ wchar.h: wchar.in.h $(top_builddir)/conf
              -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
              -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
              -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
-             < $(srcdir)/wchar.in.h | \
+             < $(srcdir)/@gl_rel_source_b...@wchar.in.h | \
          sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
              -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
@@ -130,7 +130,7 @@ wchar.h: wchar.in.h $(top_builddir)/conf
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += wchar.h wchar.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@wchar.h @gl_REL_SOURCE_BASE@wchar.h-t
 
 Include:
 <wchar.h>
diff --git a/modules/wctype-h b/modules/wctype-h
--- a/modules/wctype-h
+++ b/modules/wctype-h
@@ -17,12 +17,12 @@ configure.ac:
 gl_WCTYPE_H
 
 Makefile.am:
-BUILT_SOURCES += wctype.h
-lib_SOURCES += wctype-h.c
+BUILT_SOURCES += @gl_REL_SOURCE_BASE@wctype.h
+lib_SOURCES += @gl_REL_SOURCE_BASE@wctype-h.c
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) 
$(WARN_ON_USE_H)
+@gl_REL_SOURCE_BASE@wctype.h: @gl_rel_source_b...@wctype.in.h 
$(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -46,10 +46,10 @@ wctype.h: wctype.in.h $(top_builddir)/co
              -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/wctype.in.h; \
+             < $(srcdir)/@gl_rel_source_b...@wctype.in.h; \
        } > $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += wctype.h wctype.h-t
+MOSTLYCLEANFILES += @gl_REL_SOURCE_BASE@wctype.h @gl_REL_SOURCE_BASE@wctype.h-t
 
 Include:
 <wctype.h>
diff --git a/modules/xalloc b/modules/xalloc
--- a/modules/xalloc
+++ b/modules/xalloc
@@ -15,7 +15,7 @@ configure.ac:
 gl_XALLOC
 
 Makefile.am:
-lib_SOURCES += xmalloc.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@xmalloc.c
 
 Include:
 "xalloc.h"
diff --git a/modules/xalloc-die b/modules/xalloc-die
--- a/modules/xalloc-die
+++ b/modules/xalloc-die
@@ -13,7 +13,7 @@ exitfail
 configure.ac:
 
 Makefile.am:
-lib_SOURCES += xalloc-die.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@xalloc-die.c
 
 Include:
 "xalloc.h"
diff --git a/modules/xgetcwd b/modules/xgetcwd
--- a/modules/xgetcwd
+++ b/modules/xgetcwd
@@ -15,7 +15,7 @@ configure.ac:
 gl_XGETCWD
 
 Makefile.am:
-lib_SOURCES += xgetcwd.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@xgetcwd.c
 
 Include:
 "xgetcwd.h"
diff --git a/modules/xsize b/modules/xsize
--- a/modules/xsize
+++ b/modules/xsize
@@ -14,7 +14,7 @@ configure.ac:
 gl_XSIZE
 
 Makefile.am:
-lib_SOURCES += xsize.h xsize.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@xsize.h @gl_REL_SOURCE_BASE@xsize.c
 
 Include:
 "xsize.h"
diff --git a/modules/xstrndup b/modules/xstrndup
--- a/modules/xstrndup
+++ b/modules/xstrndup
@@ -14,7 +14,7 @@ configure.ac:
 gl_XSTRNDUP
 
 Makefile.am:
-lib_SOURCES += xstrndup.h xstrndup.c
+lib_SOURCES += @gl_REL_SOURCE_BASE@xstrndup.h @gl_REL_SOURCE_BASE@xstrndup.c
 
 Include:
 "xstrndup.h"

Reply via email to