Someone reported an issue with the windows build tools on IRC this weekend. It's
not related to this commit obviously, but I don't have the mail of your previous
commit here and otherwise I forget.
Anyway, the issue is that the script generation fails if you don't specify
--with-httpd on the command line. As far as I see it breaks while generating
the apache modules targets, which aren't supposed to be generated when
--with-httpd isn't specified.
Lieven
Quoting vgeorgescu@tigris.org:
> Author: vgeorgescu
> Date: Mon Apr  2 03:21:47 2007
> New Revision: 24333
>
> Log:
> Auto-detect the path to the JDK on Windows.
>
> * build/generator/gen_win.py
>   (WinGeneratorBase._find_jdk): Determine the path to the JDK by looking at
>    its registry entries.
>   (WinGeneratorBase.__init__): Call self._find_jdk().
>   (get_proj_sources): Prepend the path to the JDK's bin/ directory to the
> Java
>    tools (javah, javac and jar).
>   (get_win_includes): For the "libsvnjavahl" target, add the JDK's include/
>    and include/win32/ subdirectories to the list of include directories.
>
>
> Modified:
>    trunk/build/generator/gen_win.py
>
> Modified: trunk/build/generator/gen_win.py
> URL:
>
http://svn.collab.net/viewvc/svn/trunk/build/generator/gen_win.py?pathrev=24333&r1=24332&r2=24333
> ==============================================================================
> --- trunk/build/generator/gen_win.py	(original)
> +++ trunk/build/generator/gen_win.py	Mon Apr  2 03:21:47 2007
> @@ -199,6 +199,9 @@
>      # Find the installed SWIG version to adjust swig options
>      self._find_swig()
>
> +    # Find the installed Java Development Kit
> +    self._find_jdk()
> +
>      # Look for ML
>      if self.zlib_path:
>        self._find_ml()
> @@ -405,6 +408,15 @@
>    def get_proj_sources(self, quote_path, target):
>      "Get the list of source files for each project"
>      sources = [ ]
> +
> +    javac_exe = "javac"
> +    javah_exe = "javah"
> +    jar_exe = "jar"
> +    if self.jdk_path:
> +      javac_exe = os.path.join(self.jdk_path, "bin", javac_exe)
> +      javah_exe = os.path.join(self.jdk_path, "bin", javah_exe)
> +      jar_exe = os.path.join(self.jdk_path, "bin", jar_exe)
> +
>      if not isinstance(target, gen_base.TargetProject):
>        cbuild = None
>        ctarget = None
> @@ -417,8 +429,9 @@
>            headers = self.path(target.headers)
>            classname = target.package + "." + source.class_name
>
> -          cbuild = "javah -verbose -force -classpath %s -d %s %s" \
> -                   % (self.quote(classes), self.quote(headers), classname)
> +          cbuild = "%s -verbose -force -classpath %s -d %s %s" \
> +                   % (self.quote(javah_exe), self.quote(classes),
> +                      self.quote(headers), classname)
>
>            ctarget = self.path(object.filename_win)
>
> @@ -429,9 +442,10 @@
>
>            sourcepath = self.path(source.sourcepath)
>
> -          cbuild = "javac -g -target 1.2 -source 1.3 -classpath %s -d %s " \
> +          cbuild = "%s -g -target 1.2 -source 1.3 -classpath %s -d %s " \
>                     "-sourcepath %s $(InputPath)" \
> -                   % tuple(map(self.quote, (classes, targetdir,
> sourcepath)))
> +                   % tuple(map(self.quote, (javac_exe, classes,
> +                                            targetdir, sourcepath)))
>
>            ctarget = self.path(object.filename)
>
> @@ -445,8 +459,9 @@
>      if isinstance(target, gen_base.TargetJavaClasses) and target.jar:
>        classdir = self.path(target.classes)
>        jarfile = msvc_path_join(classdir, target.jar)
> -      cbuild = "jar cf %s -C %s %s" \
> -               % (jarfile, classdir, string.join(target.packages))
> +      cbuild = "%s cf %s -C %s %s" \
> +               % (self.quote(jar_exe), jarfile, classdir,
> +                  string.join(target.packages))
>        deps = map(lambda x: x.custom_target, sources)
>        sources.append(ProjectItem(path='makejar', reldir='', user_deps=deps,
>                                   custom_build=cbuild,
> custom_target=jarfile))
> @@ -827,6 +842,10 @@
>
>      if self.sasl_path:
>        fakeincludes.append(self.apath(self.sasl_path, 'include'))
> +
> +    if target.name == "libsvnjavahl" and self.jdk_path:
> +      fakeincludes.append(os.path.join(self.jdk_path, 'include'))
> +      fakeincludes.append(os.path.join(self.jdk_path, 'include', 'win32'))
>
>      return fakeincludes
>
> @@ -1105,6 +1124,37 @@
>      except ImportError:
>        pass
>
> +  def _find_jdk(self):
> +    self.jdk_path = None
> +    jdk_ver = None
> +    try:
> +      import _winreg
> +      key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
> +                            r"SOFTWARE\JavaSoft\Java Development Kit")
> +      # Find the newest JDK version.
> +      num_values = _winreg.QueryInfoKey(key)[1]
> +      for i in range(num_values):
> +        (name, value, key_type) = _winreg.EnumValue(key, i)
> +        if name == "CurrentVersion":
> +          jdk_ver = value
> +          break
> +
> +      # Find the JDK path.
> +      if jdk_ver is not None:
> +        key = _winreg.OpenKey(key, jdk_ver)
> +        num_values = _winreg.QueryInfoKey(key)[1]
> +        for i in range(num_values):
> +          (name, value, key_type) = _winreg.EnumValue(key, i)
> +          if name == "JavaHome":
> +            self.jdk_path = value
> +            break
> +      _winreg.CloseKey(key)
> +    except (ImportError, EnvironmentError):
> +      pass
> +    if self.jdk_path:
> +      sys.stderr.write("Found JDK version %s in %s\n"
> +                       % (jdk_ver, self.jdk_path))
> +
>    def _find_swig(self):
>      # Require 1.3.24. If not found, assume 1.3.25.
>      default_version = '1.3.25'
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr  2 12:29:27 2007