bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] gnulib-tool: new option --makefile-name


From: Bruno Haible
Subject: Re: [bug-gnulib] gnulib-tool: new option --makefile-name
Date: Thu, 31 Aug 2006 15:37:02 +0200
User-agent: KMail/1.9.1

Eric Blake wrote:
> I was interested in trying out the new config-h module.  But it only works 
> when 
> using gnulib-tool --import/--update; the sed expression is not applied for 
> files copied manually using --extract* information.

This is normal. The --extract* accessors give low-level access to the
module description, so that anyone can experiment with new ways of using
or verifying the module descriptions. However, there is some magic that
currently is handled inside gnulib-tool, such as the dependencies, the
GPL->LGPL conversion, the EARLY stuff.

> My first attempt was to use gnulib-tool --makefile-name to stick both gnulib 
> libraries in the same --source-base dir, but with different --makefile-name, 
> different --m4-base (required, so that the two caches of which modules belong 
> in which libraries are separate) and different --macro-prefix (required, so 
> that configure.ac can invoke the *_EARLY and *_INIT macros of both 
> libraries), 
> and have a single glue Makefile.am pull in both makefile fragments.  This 
> failed because of all the automake targets that are defined with = instead of 
> +=, so the second fragment caused automake errors for all its redefinitions.

I'm committing the appended change, so that you won't fall into the same
error again. However, there is still a problem with LIBOBJ in this case.

People using --makefile-name now must define AUTOMAKE_OPTIONS themselves
and provide initial definitions for EXTRA_DIST, MOSTLYCLEANFILES etc.
themselves. This is a little more manual work, but allows the generated
gnulib.mk to be fully incremental. One might consider to write out
the set of empty variable assignments to a separate file, but for the
moment I'd consider such a feature as bloat.

Bruno


2006-08-31  Bruno Haible  <address@hidden>

        * gnulib-tool (func_emit_lib_Makefile_am): When --makefile-name was
        specified, augment Makefile.am variables instead of assigning them.

*** gnulib-tool 31 Aug 2006 13:11:23 -0000      1.152
--- gnulib-tool 31 Aug 2006 13:31:53 -0000
***************
*** 1036,1041 ****
--- 1036,1048 ----
  # - actioncmd       (optional) command that will reproduce this invocation
  func_emit_lib_Makefile_am ()
  {
+   # When creating an includable Makefile.am snippet, augment variables with
+   # += instead of assigning them.
+   if test -n "$makefile_name"; then
+     assign='+='
+   else
+     assign='='
+   fi
    if test "$libtool" = true; then
      libext=la
      perhapsLT=LT
***************
*** 1049,1056 ****
      echo "# Reproduce by: $actioncmd"
    fi
    echo
!   # No need to generate dependencies since the sources are in gnulib, not 
here.
!   echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
    echo
    (
      for module in $modules; do
--- 1056,1065 ----
      echo "# Reproduce by: $actioncmd"
    fi
    echo
!   if test -n "$makefile_name"; then
!     # No need to generate dependencies since the sources are in gnulib, not 
here.
!     echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
!   fi
    echo
    (
      for module in $modules; do
***************
*** 1085,1109 ****
      :
    else
      # By default, the generated library should not be installed.
!     echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext"
    fi
    echo
    echo "${libname}_${libext}_SOURCES ="
    echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@"
!   echo "noinst_HEADERS ="
!   if grep '^pkgdata_DATA *+=' allsnippets.tmp > /dev/null; then
!     echo "pkgdata_DATA ="
    fi
-   echo "EXTRA_DIST ="
-   echo "BUILT_SOURCES ="
-   echo "SUFFIXES ="
-   echo "MOSTLYCLEANFILES = core *.stackdump"
-   echo "MOSTLYCLEANDIRS ="
-   echo "CLEANFILES ="
-   echo "DISTCLEANFILES ="
-   echo "MAINTAINERCLEANFILES ="
-   echo
-   echo "AM_CPPFLAGS ="
    echo
    cat allsnippets.tmp
    echo
--- 1094,1122 ----
      :
    else
      # By default, the generated library should not be installed.
!     echo "noinst_${perhapsLT}LIBRARIES $assign $libname.$libext"
    fi
    echo
    echo "${libname}_${libext}_SOURCES ="
    echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@"
!   if test -n "$makefile_name"; then
!     echo "noinst_HEADERS ="
!     if grep '^pkgdata_DATA *+=' allsnippets.tmp > /dev/null; then
!       echo "pkgdata_DATA ="
!     fi
!     echo "EXTRA_DIST ="
!     echo "BUILT_SOURCES ="
!     echo "SUFFIXES ="
!   fi
!   echo "MOSTLYCLEANFILES $assign core *.stackdump"
!   if test -n "$makefile_name"; then
!     echo "MOSTLYCLEANDIRS ="
!     echo "CLEANFILES ="
!     echo "DISTCLEANFILES ="
!     echo "MAINTAINERCLEANFILES ="
!     echo
!     echo "AM_CPPFLAGS ="
    fi
    echo
    cat allsnippets.tmp
    echo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]