You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/08/17 18:58:22 UTC

svn commit: r1374357 - in /subversion/trunk: Makefile.in build.conf build/ac-macros/apache.m4 build/generator/gen_base.py build/generator/gen_make.py build/generator/templates/makefile.ezt

Author: brane
Date: Fri Aug 17 16:58:22 2012
New Revision: 1374357

URL: http://svn.apache.org/viewvc?rev=1374357&view=rev
Log:
Followup to r1374198: Introduce a new build.conf predicate "when", which names
the post-configure substituted variable that controls the building and linking
of a module. Since the makefiles are generated before configure, "when" cannot
control the dependencies, but it can control the build/link commands.

With this change, we can now put mod_dontdothat back into the tools group.

* build.conf (mod_dav_svn, mod_authz_svn): when = INSTALL_APACHE_MODS.
  (mod_dontdothat): when = INSTALL_APACHE_MODS, install = tools.
* Makefile.in (INSTALL_APACHE_MODS): Define, substituted.
* build/ac-macros/apache.m4: Define INSTALL_APACHE_MODS.
* build/generator/gen_base.py (DependencyNode): Add optional member "when".
  (ObjectFile): Accept optional "when" in constructor and propagate it
  to DependencyNode. Propagate Target.when everywhere when creating ObjectFile.
  (Target): Initialize "when" from buil.conf options.
  (FileInfo): New.
  (_sorted_files): Return a list of FileInfo instead of just filenames, so that
  "when" can propagate to install group dependencies.
* build/generator/gen_make.py: Propagate "when" to targets, install areas and
  and dependency lists for the template processor.
* build/generator/templates/makefile.ezt (Sections 5, 7 and 10): Make the
  build/link/install commands conditional on the "when" predicate.

Modified:
    subversion/trunk/Makefile.in
    subversion/trunk/build.conf
    subversion/trunk/build/ac-macros/apache.m4
    subversion/trunk/build/generator/gen_base.py
    subversion/trunk/build/generator/gen_make.py
    subversion/trunk/build/generator/templates/makefile.ezt

Modified: subversion/trunk/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1374357&r1=1374356&r2=1374357&view=diff
==============================================================================
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Fri Aug 17 16:58:22 2012
@@ -250,6 +250,7 @@ INSTALL_INCLUDE = $(INSTALL) -m 644
 INSTALL_MOD_SHARED = @APXS@ -i -S LIBEXECDIR="$(APACHE_LIBEXECDIR)" @MOD_ACTIVATION@
 INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_LOCALE = $(INSTALL_DATA)
+INSTALL_APACHE_MODS = @INSTALL_APACHE_MODS@
 
 ### this isn't correct yet
 INSTALL_SWIG_PY = $(INSTALL_LIB)

Modified: subversion/trunk/build.conf
URL: http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1374357&r1=1374356&r2=1374357&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Fri Aug 17 16:58:22 2012
@@ -327,6 +327,7 @@ msvc-export = svn_wc.h private\svn_wc_pr
 # Subversion plugin for Apache's mod_dav
 [mod_dav_svn]
 description = Subversion plug-in for the Apache DAV module
+when = INSTALL_APACHE_MODS
 type = apache-mod
 path = subversion/mod_dav_svn
 sources = *.c reports/*.c posts/*.c
@@ -337,6 +338,7 @@ msvc-libs = mod_dav.lib libhttpd.lib
 
 [mod_authz_svn]
 description = Subversion path-based authorization module for Apache
+when = INSTALL_APACHE_MODS
 type = apache-mod
 path = subversion/mod_authz_svn
 nonlibs = mod_dav_svn apr aprutil
@@ -346,15 +348,12 @@ msvc-libs = libhttpd.lib
 
 [mod_dontdothat]
 description = Apache Httpd module to block certain kinds of Apache Subversion requests
+when = INSTALL_APACHE_MODS
 type = apache-mod
 path = tools/server-side/mod_dontdothat
 nonlibs = mod_dav_svn apr aprutil
 libs = libsvn_subr xml
-# This will cause mod_dontdothat to be installed with the other apache
-# modules instead of with the tools. While this is not quite right,
-# the build generator currently cannot exclude this module from the
-# build based on its install type
-install = apache-mod
+install = tools
 msvc-libs = libhttpd.lib
 
 # ----------------------------------------------------------------------------

Modified: subversion/trunk/build/ac-macros/apache.m4
URL: http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/apache.m4?rev=1374357&r1=1374356&r2=1374357&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/apache.m4 (original)
+++ subversion/trunk/build/ac-macros/apache.m4 Fri Aug 17 16:58:22 2012
@@ -128,6 +128,7 @@ AC_ARG_WITH(apache-libexecdir,
     APACHE_LIBEXECDIR="$withval"
 ])
 
+INSTALL_APACHE_MODS=false
 if test -n "$APXS" && test "$APXS" != "no"; then
     APXS_CC="`$APXS -q CC`"
     APACHE_INCLUDES="$APACHE_INCLUDES -I$APXS_INCLUDE"
@@ -140,6 +141,7 @@ if test -n "$APXS" && test "$APXS" != "n
 
     BUILD_APACHE_RULE=apache-mod
     INSTALL_APACHE_RULE=install-mods-shared
+    INSTALL_APACHE_MODS=true
 
     case $host in
       *-*-cygwin*)
@@ -157,6 +159,7 @@ AC_SUBST(APXS)
 AC_SUBST(APACHE_LDFLAGS)
 AC_SUBST(APACHE_INCLUDES)
 AC_SUBST(APACHE_LIBEXECDIR)
+AC_SUBST(INSTALL_APACHE_MODS)
 
 # there aren't any flags that interest us ...
 #if test -n "$APXS" && test "$APXS" != "no"; then

Modified: subversion/trunk/build/generator/gen_base.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_base.py?rev=1374357&r1=1374356&r2=1374357&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_base.py (original)
+++ subversion/trunk/build/generator/gen_base.py Fri Aug 17 16:58:22 2012
@@ -300,15 +300,16 @@ for _dt in dep_types:
   globals()[_dt] = _dt
 
 class DependencyNode:
-  def __init__(self, filename):
+  def __init__(self, filename, when = None):
     self.filename = filename
+    self.when = when
 
   def __str__(self):
     return self.filename
 
 class ObjectFile(DependencyNode):
-  def __init__(self, filename, compile_cmd = None):
-    DependencyNode.__init__(self, filename)
+  def __init__(self, filename, compile_cmd = None, when = None):
+    DependencyNode.__init__(self, filename, when)
     self.compile_cmd = compile_cmd
     self.source_generated = 0
 
@@ -362,6 +363,7 @@ class Target(DependencyNode):
     self.name = name
     self.gen_obj = gen_obj
     self.desc = options.get('description')
+    self.when = options.get('when')
     self.path = options.get('path', '')
     self.add_deps = options.get('add-deps', '')
     self.add_install_deps = options.get('add-install-deps', '')
@@ -434,7 +436,7 @@ class TargetLinked(Target):
           else:
             raise GenError('ERROR: unknown file extension on ' + src)
 
-          ofile = ObjectFile(objname, self.compile_cmd)
+          ofile = ObjectFile(objname, self.compile_cmd, self.when)
 
           # object depends upon source
           self.gen_obj.graph.add(DT_OBJECT, ofile, SourceFile(src, reldir))
@@ -554,7 +556,7 @@ class TargetI18N(Target):
       else:
         raise GenError('ERROR: unknown file extension on ' + src)
 
-      ofile = ObjectFile(objname, self.compile_cmd)
+      ofile = ObjectFile(objname, self.compile_cmd, self.when)
 
       # object depends upon source
       self.gen_obj.graph.add(DT_OBJECT, ofile, SourceFile(src, reldir))
@@ -699,7 +701,8 @@ class TargetJavaHeaders(TargetJava):
       class_pkg_list = self.package.split('.')
       class_pkg = build_path_join(*class_pkg_list)
       class_file = ObjectFile(build_path_join(self.classes, class_pkg,
-                                              class_name + self.objext))
+                                              class_name + self.objext),
+                              self.when)
       class_file.source_generated = 1
       class_file.class_name = class_name
       hfile = HeaderFile(class_header, self.package + '.' + class_name,
@@ -759,7 +762,7 @@ class TargetJavaClasses(TargetJava):
       else:
         raise GenError('ERROR: unknown file extension on "' + src + '"')
 
-      ofile = ObjectFile(objname, self.compile_cmd)
+      ofile = ObjectFile(objname, self.compile_cmd, self.when)
       sfile = SourceFile(src, reldir)
       sfile.sourcepath = sourcepath
 
@@ -1126,6 +1129,10 @@ class IncludeDependencyInfo:
       #   of <>/"" convention.
     return hdrs
 
+class FileInfo:
+    def __init__(self, filename, when):
+        self.filename = filename
+        self.when = when
 
 def _sorted_files(graph, area):
   "Given a list of targets, sort them based on their dependencies."
@@ -1163,9 +1170,9 @@ def _sorted_files(graph, area):
           s = graph.get_sources(DT_LINK, t.name)
           for d in s:
             if d not in targets:
-              files.append(d.filename)
+              files.append(FileInfo(d.filename, d.when))
         else:
-          files.append(t.filename)
+          files.append(FileInfo(t.filename, t.when))
 
         # don't consider this target any more
         targets.remove(t)

Modified: subversion/trunk/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_make.py?rev=1374357&r1=1374356&r2=1374357&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_make.py (original)
+++ subversion/trunk/build/generator/gen_make.py Fri Aug 17 16:58:22 2012
@@ -289,6 +289,7 @@ class Generator(gen_base.GeneratorBase):
                             add_deps=target_ob.add_deps,
                             objects=objects,
                             deps=deps,
+                            when=target_ob.when,
                             )
       data.target.append(ezt_target)
 
@@ -375,11 +376,11 @@ class Generator(gen_base.GeneratorBase):
 
       def apache_file_to_eztdata(file):
           # cd to dirname before install to work around libtool 1.4.2 bug.
-          dirname, fname = build_path_splitfile(file)
+          dirname, fname = build_path_splitfile(file.filename)
           base, ext = os.path.splitext(fname)
           name = base.replace('mod_', '')
-          return _eztdata(fullname=file, dirname=dirname,
-                          name=name, filename=fname)
+          return _eztdata(fullname=file.filename, dirname=dirname,
+                          name=name, filename=fname, when=file.when)
       if area == 'apache-mod':
         data.areas.append(ezt_area)
 
@@ -396,7 +397,8 @@ class Generator(gen_base.GeneratorBase):
 
         # ### TODO: This is a hack.  See discussion here:
         # ### http://mid.gmane.org/20120316191639.GA28451@daniel3.local
-        apache_files = [t.filename for t in inst_targets
+        apache_files = [gen_base.FileInfo(t.filename, t.when)
+                        for t in inst_targets
                         if isinstance(t, gen_base.TargetApacheMod)]
 
         files = [f for f in files if f not in apache_files]
@@ -404,9 +406,9 @@ class Generator(gen_base.GeneratorBase):
           ezt_area.apache_files.append(apache_file_to_eztdata(file))
         for file in files:
           # cd to dirname before install to work around libtool 1.4.2 bug.
-          dirname, fname = build_path_splitfile(file)
-          ezt_file = _eztdata(dirname=dirname, fullname=file,
-                              filename=fname)
+          dirname, fname = build_path_splitfile(file.filename)
+          ezt_file = _eztdata(dirname=dirname, fullname=file.filename,
+                              filename=fname, when=file.when)
           if area == 'locale':
             lang, objext = os.path.splitext(fname)
             installdir = '$(DESTDIR)$(%sdir)/%s/LC_MESSAGES' % (area_var, lang)
@@ -456,6 +458,7 @@ class Generator(gen_base.GeneratorBase):
 
     for objname, sources in obj_deps:
       dep = _eztdata(name=str(objname),
+                     when=objname.when,
                      deps=list(map(str, sources)),
                      cmd=objname.compile_cmd,
                      source=str(sources[0]))

Modified: subversion/trunk/build/generator/templates/makefile.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/makefile.ezt?rev=1374357&r1=1374356&r2=1374357&view=diff
==============================================================================
--- subversion/trunk/build/generator/templates/makefile.ezt (original)
+++ subversion/trunk/build/generator/templates/makefile.ezt Fri Aug 17 16:58:22 2012
@@ -112,7 +112,7 @@ $([target.varname]_OBJECTS): $([target.v
 [else][target.varname]_DEPS = [target.add_deps][for target.objects] [target.objects][end][for target.deps] [target.deps][end]
 [target.varname]_OBJECTS =[for target.objnames] [target.objnames][end]
 [target.filename]: $([target.varname]_DEPS)
-	cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)
+	[if-any target.when]if $([target.when]) ; then [else][end]cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)[if-any target.when] ; else echo "fake" > [target.filename] ; fi[else][end]
 [end][end][end]
 
 ########################################
@@ -127,13 +127,13 @@ $([target.varname]_OBJECTS): $([target.v
 ########################################
 [for areas]
 [is areas.type "apache-mod"]install-mods-shared:[for areas.files] [areas.files.fullname][end][for areas.files]
-	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename][end]
+	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename][if-any areas.files.when] ; fi[else][end][end]
 [else]install-[areas.type]: [for areas.files][if-index areas.files first][else] [end][areas.files.fullname][end] [for areas.apache_files] [areas.apache_files.fullname][end]
 	$(MKDIR) $(DESTDIR)$([areas.varname]dir)[for areas.files][is areas.type "locale"]
 	$(MKDIR) [areas.files.installdir]
-	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][else]
-	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][end][end][for areas.apache_files]
-	cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][end]
+	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][if-any areas.files.when] ; fi[else][end][else]
+	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][if-any areas.files.when] ; fi[else][end][end][end][for areas.apache_files]
+	[if-any areas.apache_files.when]if $([areas.apache_files.when]) ; then [else][end]cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][if-any areas.apache_files.when] ; fi[else][end][end]
 [if-any areas.extra_install]	$(INSTALL_EXTRA_[areas.uppervar])
 [end][end][end]
 
@@ -156,5 +156,5 @@ install-include:[for includes] [includes
 ########################################
 [for deps]
 [deps.name]:[for deps.deps] [deps.deps][end][if-any deps.cmd]
-	[deps.cmd] [if-any deps.generated][else]$(canonicalized_srcdir)[end][deps.source][end]
+	[if-any deps.when]if $([deps.when]) ; then [else][end][deps.cmd] [if-any deps.generated][else]$(canonicalized_srcdir)[end][deps.source][end][if-any deps.when] ; else echo "fake" > [deps.name] ; fi[else][end]
 [end]



Re: svn commit: r1374357 - in /subversion/trunk: Makefile.in build.conf build/ac-macros/apache.m4 build/generator/gen_base.py build/generator/gen_make.py build/generator/templates/makefile.ezt

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
brane@apache.org wrote on Fri, Aug 17, 2012 at 16:58:22 -0000:
> Author: brane
> Date: Fri Aug 17 16:58:22 2012
> New Revision: 1374357
> 
> URL: http://svn.apache.org/viewvc?rev=1374357&view=rev
> Log:
> Followup to r1374198: Introduce a new build.conf predicate "when", which names
> the post-configure substituted variable that controls the building and linking
> of a module. Since the makefiles are generated before configure, "when" cannot
> control the dependencies, but it can control the build/link commands.
> 
> With this change, we can now put mod_dontdothat back into the tools group.
> 
> Modified: subversion/trunk/build/generator/templates/makefile.ezt
> URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/makefile.ezt?rev=1374357&r1=1374356&r2=1374357&view=diff
> ==============================================================================
> --- subversion/trunk/build/generator/templates/makefile.ezt (original)
> +++ subversion/trunk/build/generator/templates/makefile.ezt Fri Aug 17 16:58:22 2012
> @@ -127,13 +127,13 @@ $([target.varname]_OBJECTS): $([target.v
>  ########################################
>  [for areas]
>  [is areas.type "apache-mod"]install-mods-shared:[for areas.files] [areas.files.fullname][end][for areas.files]
> -	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename][end]
> +	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]
> +	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename]
> +	[if-any areas.files.when] ; fi[else][end][end]

Should the line above be:

  +	[end][if-any areas.files.when] ; fi[else][end]

?

>  [else]install-[areas.type]: [for areas.files][if-index areas.files first][else] [end][areas.files.fullname][end] [for areas.apache_files] [areas.apache_files.fullname][end]
>  	$(MKDIR) $(DESTDIR)$([areas.varname]dir)[for areas.files][is areas.type "locale"]
>  	$(MKDIR) [areas.files.installdir]
> -	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][else]
> -	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][end][end][for areas.apache_files]
> -	cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][end]
> +	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][if-any areas.files.when] ; fi[else][end][else]
> +	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][if-any areas.files.when] ; fi[else][end][end][end][for areas.apache_files]
> +	[if-any areas.apache_files.when]if $([areas.apache_files.when]) ; then [else][end]cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][if-any areas.apache_files.when] ; fi[else][end][end]

I didn't check whether the same issue applies here.

>  [if-any areas.extra_install]	$(INSTALL_EXTRA_[areas.uppervar])
>  [end][end][end]
>  

Re: svn commit: r1374357 - in /subversion/trunk: Makefile.in build.conf build/ac-macros/apache.m4 build/generator/gen_base.py build/generator/gen_make.py build/generator/templates/makefile.ezt

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
brane@apache.org wrote on Fri, Aug 17, 2012 at 16:58:22 -0000:
> Author: brane
> Date: Fri Aug 17 16:58:22 2012
> New Revision: 1374357
> 
> URL: http://svn.apache.org/viewvc?rev=1374357&view=rev
> Log:
> Followup to r1374198: Introduce a new build.conf predicate "when", which names
> the post-configure substituted variable that controls the building and linking
> of a module. Since the makefiles are generated before configure, "when" cannot
> control the dependencies, but it can control the build/link commands.
> 
> With this change, we can now put mod_dontdothat back into the tools group.
> 
> Modified: subversion/trunk/build/generator/templates/makefile.ezt
> URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/makefile.ezt?rev=1374357&r1=1374356&r2=1374357&view=diff
> ==============================================================================
> --- subversion/trunk/build/generator/templates/makefile.ezt (original)
> +++ subversion/trunk/build/generator/templates/makefile.ezt Fri Aug 17 16:58:22 2012
> @@ -127,13 +127,13 @@ $([target.varname]_OBJECTS): $([target.v
>  ########################################
>  [for areas]
>  [is areas.type "apache-mod"]install-mods-shared:[for areas.files] [areas.files.fullname][end][for areas.files]
> -	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename][end]
> +	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]
> +	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename]
> +	[if-any areas.files.when] ; fi[else][end][end]

Should the line above be:

  +	[end][if-any areas.files.when] ; fi[else][end]

?

>  [else]install-[areas.type]: [for areas.files][if-index areas.files first][else] [end][areas.files.fullname][end] [for areas.apache_files] [areas.apache_files.fullname][end]
>  	$(MKDIR) $(DESTDIR)$([areas.varname]dir)[for areas.files][is areas.type "locale"]
>  	$(MKDIR) [areas.files.installdir]
> -	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][else]
> -	cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][end][end][for areas.apache_files]
> -	cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][end]
> +	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] [areas.files.installdir]/$(PACKAGE_NAME)[areas.files.objext][if-any areas.files.when] ; fi[else][end][else]
> +	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]cd [areas.files.dirname] ; $(INSTALL_[areas.uppervar]) [areas.files.filename] $(DESTDIR)[areas.files.install_fname][if-any areas.files.when] ; fi[else][end][end][end][for areas.apache_files]
> +	[if-any areas.apache_files.when]if $([areas.apache_files.when]) ; then [else][end]cd [areas.apache_files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.apache_files.name] [areas.apache_files.filename][if-any areas.apache_files.when] ; fi[else][end][end]

I didn't check whether the same issue applies here.

>  [if-any areas.extra_install]	$(INSTALL_EXTRA_[areas.uppervar])
>  [end][end][end]
>  

Re: svn commit: r1374357 - in /subversion/trunk: Makefile.in build.conf build/ac-macros/apache.m4 build/generator/gen_base.py build/generator/gen_make.py build/generator/templates/makefile.ezt

Posted by Branko Čibej <br...@wandisco.com>.
On 21.08.2012 21:25, Branko Čibej wrote:
> On 21.08.2012 18:57, Daniel Shahaf wrote:
>> Suggest:
>>
>>   if [if-any target.when]$([target.when])[else]true[endif] ; then ...
>>
>> This avoids the need for another if-any at the end of the line.
> Good idea.

On second thoughts, this would make the build-outputs.mk less
readable/more confusing. So I'll leave it this way.

-- Brane

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download


Re: svn commit: r1374357 - in /subversion/trunk: Makefile.in build.conf build/ac-macros/apache.m4 build/generator/gen_base.py build/generator/gen_make.py build/generator/templates/makefile.ezt

Posted by Branko Čibej <br...@wandisco.com>.
On 21.08.2012 18:57, Daniel Shahaf wrote:
> A few comments on read-through (but without checking out-of-mail
> context):
[...]
> Could you document 'when' somewhere in the tree itself, please?  In
> build.conf comments, or build/generator/, I don't care, but not just in
> the log message please. :-)

Eh. Good point. Not that the rest of the generator is all that well
documented.

[...]

>> @@ -396,7 +397,8 @@ class Generator(gen_base.GeneratorBase):
>>  
>>          # ### TODO: This is a hack.  See discussion here:
>>          # ### http://mid.gmane.org/20120316191639.GA28451@daniel3.local
> Is this comment still applicable?

I have no idea.
[...]

> Suggest:
>
>   if [if-any target.when]$([target.when])[else]true[endif] ; then ...
>
> This avoids the need for another if-any at the end of the line.

Good idea.

> +	[if-any areas.files.when]if $([areas.files.when]) ; then [else][end]
> +	cd [areas.files.dirname] ; $(MKDIR) "$(APACHE_LIBEXECDIR)" ; $(INSTALL_MOD_SHARED) -n [areas.files.name] [areas.files.filename]
> +	[if-any areas.files.when] ; fi[else][end][end]
> Should the line above be:
>
>   +	[end][if-any areas.files.when] ; fi[else][end]
>
> ?

Nope, the last [end] closes the [for areas.files].

-- Brane

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download


Re: svn commit: r1374357 - in /subversion/trunk: Makefile.in build.conf build/ac-macros/apache.m4 build/generator/gen_base.py build/generator/gen_make.py build/generator/templates/makefile.ezt

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
A few comments on read-through (but without checking out-of-mail
context):

brane@apache.org wrote on Fri, Aug 17, 2012 at 16:58:22 -0000:
> Author: brane
> Date: Fri Aug 17 16:58:22 2012
> New Revision: 1374357
> 
> URL: http://svn.apache.org/viewvc?rev=1374357&view=rev
> Log:
> Followup to r1374198: Introduce a new build.conf predicate "when", which names
> the post-configure substituted variable that controls the building and linking
> of a module. Since the makefiles are generated before configure, "when" cannot
> control the dependencies, but it can control the build/link commands.
> 

Could you document 'when' somewhere in the tree itself, please?  In
build.conf comments, or build/generator/, I don't care, but not just in
the log message please. :-)

> @@ -396,7 +397,8 @@ class Generator(gen_base.GeneratorBase):
>  
>          # ### TODO: This is a hack.  See discussion here:
>          # ### http://mid.gmane.org/20120316191639.GA28451@daniel3.local

Is this comment still applicable?

> -        apache_files = [t.filename for t in inst_targets
> +        apache_files = [gen_base.FileInfo(t.filename, t.when)
> +                        for t in inst_targets
>                          if isinstance(t, gen_base.TargetApacheMod)]
>  
>          files = [f for f in files if f not in apache_files]
> +++ subversion/trunk/build/generator/templates/makefile.ezt Fri Aug 17 16:58:22 2012
> @@ -112,7 +112,7 @@ $([target.varname]_OBJECTS): $([target.v
>  [else][target.varname]_DEPS = [target.add_deps][for target.objects] [target.objects][end][for target.deps] [target.deps][end]
>  [target.varname]_OBJECTS =[for target.objnames] [target.objnames][end]
>  [target.filename]: $([target.varname]_DEPS)
> -	cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)
> +	[if-any target.when]if $([target.when]) ; then [else][end]cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)[if-any target.when] ; else echo "fake" > [target.filename] ; fi[else][end]

Suggest:

  if [if-any target.when]$([target.when])[else]true[endif] ; then ...

This avoids the need for another if-any at the end of the line.

Re: svn commit: r1374357 - in /subversion/trunk: Makefile.in build.conf build/ac-macros/apache.m4 build/generator/gen_base.py build/generator/gen_make.py build/generator/templates/makefile.ezt

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
A few comments on read-through (but without checking out-of-mail
context):

brane@apache.org wrote on Fri, Aug 17, 2012 at 16:58:22 -0000:
> Author: brane
> Date: Fri Aug 17 16:58:22 2012
> New Revision: 1374357
> 
> URL: http://svn.apache.org/viewvc?rev=1374357&view=rev
> Log:
> Followup to r1374198: Introduce a new build.conf predicate "when", which names
> the post-configure substituted variable that controls the building and linking
> of a module. Since the makefiles are generated before configure, "when" cannot
> control the dependencies, but it can control the build/link commands.
> 

Could you document 'when' somewhere in the tree itself, please?  In
build.conf comments, or build/generator/, I don't care, but not just in
the log message please. :-)

> @@ -396,7 +397,8 @@ class Generator(gen_base.GeneratorBase):
>  
>          # ### TODO: This is a hack.  See discussion here:
>          # ### http://mid.gmane.org/20120316191639.GA28451@daniel3.local

Is this comment still applicable?

> -        apache_files = [t.filename for t in inst_targets
> +        apache_files = [gen_base.FileInfo(t.filename, t.when)
> +                        for t in inst_targets
>                          if isinstance(t, gen_base.TargetApacheMod)]
>  
>          files = [f for f in files if f not in apache_files]
> +++ subversion/trunk/build/generator/templates/makefile.ezt Fri Aug 17 16:58:22 2012
> @@ -112,7 +112,7 @@ $([target.varname]_OBJECTS): $([target.v
>  [else][target.varname]_DEPS = [target.add_deps][for target.objects] [target.objects][end][for target.deps] [target.deps][end]
>  [target.varname]_OBJECTS =[for target.objnames] [target.objnames][end]
>  [target.filename]: $([target.varname]_DEPS)
> -	cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)
> +	[if-any target.when]if $([target.when]) ; then [else][end]cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)[if-any target.when] ; else echo "fake" > [target.filename] ; fi[else][end]

Suggest:

  if [if-any target.when]$([target.when])[else]true[endif] ; then ...

This avoids the need for another if-any at the end of the line.