[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: autogen.sh --release doesn't work

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-04-28 03:03:37 CEST

Branko Čibej wrote:

>This second version of the patch gets the test programs to *almost*
>build. Dunno why some of them insiste that the entry point wasn't
>defined, even though they link with libsvn_test. Hm.
>
>Anyway, here's what changed since the previous patch:
>
> * __config__ got renamed to __CONFIG__
> * New pseudo-target __ALL_TESTS__ builds everything + test programs
> (this one should be autogenerated, in fact)
> * The .dsp template uses target.dsp_name to generate the name of the
> .dsp file, the project, and dependencies. These names are filtered
> to replace dashes with underscores.
>
>
>Greg, one thing still needs to be done (in general): The various .exes
>must be created in the correct subdirectory of the output directory.
>That's because the Python tests scripts expect them to be in the same
>path relative to $abs_builddir as the sources were in $abs_srcdir.
>
>

Oh, yes -- the patch uses the existing neon.dsp file in build/win32
instead of generating our own. This might or might not be O.K., but the
generated one didn't pull in the sources.

And it would be even better if I'd attached the patch...

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
Index: build.conf
===================================================================
--- build.conf	(revision 5729)
+++ build.conf	(working copy)
@@ -562,12 +562,10 @@
 libs = apriconv apr
 
 [neon]
-type = external
-path = neon
-sources = neon/src/*.c
-cmd = ..\build\win32\build_neon.bat
-release = libneon.lib
-debug = libneonD.lib
+type = project
+path = build/win32
+release = ../../neon/libneon.lib
+debug = ../../neon/libneonD.lib
 
 [gen_uri_delims]
 type = project
@@ -580,11 +578,21 @@
 [__ALL__]
 type = utility
 path = build/win32
-libs = __config__
-       svn svnserve svnadmin svnlook svnversion svndumpfilter
+libs = svn svnserve svnadmin svnlook svnversion svndumpfilter
        mod_dav_svn
 
-[__config__]
+[__ALL_TESTS__]
+type = utility
+path = build/win32
+libs = __ALL__
+       fs-test skel-test key-test strings-reps-test changes-test
+       md5args repos-test
+       config-test hashdump-test stringtest path-test stream-test time-test
+       translate-test
+       random-test diff-diff3-test
+       target-test svndiff-test vdelta-test diff-test diff3-test diff4-test
+
+[__CONFIG__]
 type = project
 path = build/win32
 project_name = svn_config
Index: build/win32/svn_config.dsp
===================================================================
--- build/win32/svn_config.dsp	(revision 5729)
+++ build/win32/svn_config.dsp	(working copy)
@@ -1,10 +1,10 @@
-# Microsoft Developer Studio Project File - Name="__config__" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="__CONFIG__" - Package Owner=<4>
 # Microsoft Developer Studio Generated Build File, Format Version 6.00
 # ** DO NOT EDIT **
 
 # TARGTYPE "Win32 (x86) Generic Project" 0x010a
 
-CFG=__config__ - Win32 Debug
+CFG=__CONFIG__ - Win32 Debug
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
 !MESSAGE use the Export Makefile command and run
 !MESSAGE 
@@ -13,12 +13,12 @@
 !MESSAGE You can specify a configuration when running NMAKE
 !MESSAGE by defining the macro CFG on the command line. For example:
 !MESSAGE 
-!MESSAGE NMAKE /f "svn_config.mak" CFG="__config__ - Win32 Debug"
+!MESSAGE NMAKE /f "svn_config.mak" CFG="__CONFIG__ - Win32 Debug"
 !MESSAGE 
 !MESSAGE Possible choices for configuration are:
 !MESSAGE 
-!MESSAGE "__config__ - Win32 Release" (based on "Win32 (x86) Generic Project")
-!MESSAGE "__config__ - Win32 Debug" (based on "Win32 (x86) Generic Project")
+!MESSAGE "__CONFIG__ - Win32 Release" (based on "Win32 (x86) Generic Project")
+!MESSAGE "__CONFIG__ - Win32 Debug" (based on "Win32 (x86) Generic Project")
 !MESSAGE 
 
 # Begin Project
@@ -27,7 +27,7 @@
 # PROP Scc_LocalPath ""
 MTL=midl.exe
 
-!IF  "$(CFG)" == "__config__ - Win32 Release"
+!IF  "$(CFG)" == "__CONFIG__ - Win32 Release"
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 0
@@ -40,7 +40,7 @@
 # PROP Intermediate_Dir ""
 # PROP Target_Dir ""
 
-!ELSEIF  "$(CFG)" == "__config__ - Win32 Debug"
+!ELSEIF  "$(CFG)" == "__CONFIG__ - Win32 Debug"
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
@@ -57,13 +57,13 @@
 
 # Begin Target
 
-# Name "__config__ - Win32 Release"
-# Name "__config__ - Win32 Debug"
+# Name "__CONFIG__ - Win32 Release"
+# Name "__CONFIG__ - Win32 Debug"
 # Begin Source File
 
 SOURCE=..\..\subversion\libsvn_subr\getdate.cw
 
-!IF  "$(CFG)" == "__config__ - Win32 Release"
+!IF  "$(CFG)" == "__CONFIG__ - Win32 Release"
 
 # PROP Ignore_Default_Tool 1
 # Begin Custom Build - Creating subversion\libsvn_subr\getdate.c from subversion\libsvn_subr\getdate.cw.
@@ -74,7 +74,7 @@
 
 # End Custom Build
 
-!ELSEIF  "$(CFG)" == "__config__ - Win32 Debug"
+!ELSEIF  "$(CFG)" == "__CONFIG__ - Win32 Debug"
 
 # Begin Custom Build - Creating getdate.c from getdate.cw.
 InputPath=..\..\subversion\libsvn_subr\getdate.cw
@@ -96,7 +96,7 @@
 
 SOURCE=..\..\svn_private_config.hw
 
-!IF  "$(CFG)" == "__config__ - Win32 Release"
+!IF  "$(CFG)" == "__CONFIG__ - Win32 Release"
 
 # PROP Ignore_Default_Tool 1
 # Begin Custom Build - Creating svn_private_config.h from svn_private_config.hw.
@@ -107,7 +107,7 @@
 
 # End Custom Build
 
-!ELSEIF  "$(CFG)" == "__config__ - Win32 Debug"
+!ELSEIF  "$(CFG)" == "__CONFIG__ - Win32 Debug"
 
 # PROP Ignore_Default_Tool 1
 # Begin Custom Build - Creating svn_private_config.h from svn_private_config.hw.
Index: build/generator/msvc_dsp.ezt
===================================================================
--- build/generator/msvc_dsp.ezt	(revision 5729)
+++ build/generator/msvc_dsp.ezt	(working copy)
@@ -1,23 +1,23 @@
-# Microsoft Developer Studio Project File - Name="[target.name]" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="[target.dsp_name]" - Package Owner=<4>
 # Microsoft Developer Studio Generated Build File, Format Version 6.00
 # ** DO NOT EDIT **
 
 # TARGTYPE "[target_type]" [target_number]
 
-CFG=[target.name] - [default_platform] [default_config]
+CFG=[target.dsp_name] - [default_platform] [default_config]
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
 !MESSAGE use the Export Makefile command and run
 !MESSAGE 
-!MESSAGE NMAKE /f "[target.name]_msvc.mak".
+!MESSAGE NMAKE /f "[target.dsp_name]_msvc.mak".
 !MESSAGE 
 !MESSAGE You can specify a configuration when running NMAKE
 !MESSAGE by defining the macro CFG on the command line. For example:
 !MESSAGE 
-!MESSAGE NMAKE /f "[target.name]_msvc.mak" CFG="[target.name] - [default_platform] [default_config]"
+!MESSAGE NMAKE /f "[target.dsp_name]_msvc.mak" CFG="[target.dsp_name] - [default_platform] [default_config]"
 !MESSAGE 
 !MESSAGE Possible choices for configuration are:
 !MESSAGE 
-[for platforms][for configs]!MESSAGE "[target.name] - [platforms] [configs.name]" (based on "[target_type]")
+[for platforms][for configs]!MESSAGE "[target.dsp_name] - [platforms] [configs.name]" (based on "[target_type]")
 [end][end]!MESSAGE 
 
 # Begin Project
@@ -27,7 +27,7 @@
 CPP=cl.exe
 RSC=rc.exe
 [for platforms][for configs]
-![if-index platforms first][if-index configs first][else]ELSE[end][else]ELSE[end]IF  "$(CFG)" == "[target.name] - [platforms] [configs.name]"
+![if-index platforms first][if-index configs first][else]ELSE[end][else]ELSE[end]IF  "$(CFG)" == "[target.dsp_name] - [platforms] [configs.name]"
 
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries [is configs.name "Debug"]1[else]0[end]
@@ -41,7 +41,7 @@
 # PROP Intermediate_Dir "[configs.name]\[target.name]"
 # PROP Target_Dir ""
 [if-any is_utility][else]LIB32=link.exe -lib
-# ADD LIB32 /out:"[rootpath]\[configs.name]\[target.name].lib"
+# ADD LIB32 /out:"[rootpath]\[configs.name]\[target.dsp_name].lib"
 # ADD CPP /nologo /W3 /FD /c [is configs.name "Debug"]/MDd /Gm /Gi /GX /ZI /Od /GZ[else]/MD /GX /O2 /Ob2[end][for configs.defines] /D "[configs.defines]"[end][for includes] /I "[includes]"[end]
 # ADD RSC /l [if-any is_exe]0x409[else]0x424[end]
 BSC32=bscmake.exe
@@ -52,12 +52,12 @@
 
 # Begin Target
 
-[for platforms][for configs]# Name "[target.name] - [platforms] [configs.name]"
+[for platforms][for configs]# Name "[target.dsp_name] - [platforms] [configs.name]"
 [end][end][for sources]# Begin Source File
 
 SOURCE=[sources.path][if-any sources.reldir]
 [for platforms][for configs]
-![if-index platforms first][if-index configs first][else]ELSE[end][else]ELSE[end]IF  "$(CFG)" == "[target.name] - [platforms] [configs.name]"
+![if-index platforms first][if-index configs first][else]ELSE[end][else]ELSE[end]IF  "$(CFG)" == "[target.dsp_name] - [platforms] [configs.name]"
 
 # PROP Intermediate_Dir "[configs.name]\[target.name]\[sources.reldir]"
 [end][end]
Index: build/generator/gen_vcnet_vcproj.py
===================================================================
--- build/generator/gen_vcnet_vcproj.py	(revision 5729)
+++ build/generator/gen_vcnet_vcproj.py	(working copy)
@@ -14,7 +14,8 @@
 class Generator(gen_win.WinGeneratorBase):
   "Generate a Visual C++.NET project"
 
-  def __init__(self, fname, verfname):
+  def __init__(self, fname, verfname, options):
+    self.parse_options(options)
     gen_win.WinGeneratorBase.__init__(self, fname, verfname, 'vcnet-vcproj')
 
   def default_output(self, oname):
Index: build/generator/gen_base.py
===================================================================
--- build/generator/gen_base.py	(revision 5729)
+++ build/generator/gen_base.py	(working copy)
@@ -24,7 +24,7 @@
   #        file-type is 'target', 'object', ...
   #
 
-  def __init__(self, fname, verfname):
+  def __init__(self, fname, verfname, options=None):
     parser = ConfigParser.ConfigParser(_cfg_defaults)
     parser.read(fname)
 
@@ -50,8 +50,14 @@
     self.infopages = [ ]
     self.graph = DependencyGraph()
 
+    if not hasattr(self, 'skip_targets'):
+      self.skip_targets = { }
+
     # PASS 1: collect the targets and some basic info
     for target in _filter_targets(parser.sections()):
+      if self.skip_targets.has_key(target):
+        continue
+
       install = parser.get(target, 'install')
       type = parser.get(target, 'type')
 
Index: build/generator/gen_win.py
===================================================================
--- build/generator/gen_win.py	(revision 5729)
+++ build/generator/gen_win.py	(working copy)
@@ -29,7 +29,7 @@
 
   envvars={
     "$(SVN_APR_LIBS)": ["apr"],
-    "$(SVN_APRUTIL_LIBS)": ["aprutil"],
+    "$(SVN_APRUTIL_LIBS)": ["aprutil", "apriconv"],
     "$(NEON_LIBS)":  ["neon"],
     "$(SVN_DB_LIBS)": [],
     "$(SVN_XMLRPC_LIBS)": [],
@@ -48,6 +48,15 @@
       open(dest,'wb').write(open(src, 'rb').read())
       os.unlink(src)
 
+  def parse_options(self, options):
+    for opt, val in options:
+      if opt == '--with-httpd':
+        self.httpd_path = val
+        break
+    else:
+      self.httpd_path = None
+      self.skip_targets = { 'mod_dav_svn': None }
+
   def __init__(self, fname, verfname, subdir):
     """
     Do some Windows specific setup
@@ -68,7 +77,6 @@
 
     """
 ### GJS: don't do this right now
-#    self.copyfile(os.path.join("subversion","libsvn_subr","getdate.c"), os.path.join("subversion","libsvn_subr","getdate.cw"))
 #    self.movefile(os.path.join("subversion","mod_dav_svn","davlog.c"), os.path.join("subversion","mod_dav_svn","log.c"))
 #    self.movefile(os.path.join("subversion","mod_dav_svn","davrepos.c"), os.path.join("subversion","mod_dav_svn","repos.c"))
 
@@ -110,6 +118,8 @@
         print 'Wrote %s' % svnissdeb
 
     #Initialize parent
+    self.copyfile(os.path.join("subversion","libsvn_subr","getdate.c"),
+                  os.path.join("subversion","libsvn_subr","getdate.cw"))
     gen_base.GeneratorBase.__init__(self, fname, verfname)
 
     #Make the project files directory if it doesn't exist
@@ -238,10 +248,10 @@
                                         ""],
                                        rootpath)
       fakeincludes.extend([
-        "$(HTTPD)/srclib/apr/include",
-        "$(HTTPD)/srclib/apr-util/include",
-        "$(HTTPD)/srclib/apr-util/xml/expat/lib",
-        "$(HTTPD)/include"
+        self.httpd_path + "/srclib/apr/include",
+        self.httpd_path + "/srclib/apr-util/include",
+        self.httpd_path + "/srclib/apr-util/xml/expat/lib",
+        self.httpd_path + "/include"
         ])
     else:
       fakeincludes = self.map_rootpath(["subversion/include",
@@ -264,11 +274,11 @@
     if target.name == 'mod_dav_svn':
       fakelibdirs = self.map_rootpath([self.dblibpath], rootpath)
       fakelibdirs.extend([
-        "$(HTTPD)/%s" % cfg,
-        "$(HTTPD)/modules/dav/main/%s" % cfg,
-        "$(HTTPD)/srclib/apr/%s" % cfg,
-        "$(HTTPD)/srclib/apr-util/%s" % cfg,
-        "$(HTTPD)/srclib/apr-util/xml/expat/lib/%s" % libcfg
+        self.httpd_path + "/%s" % cfg,
+        self.httpd_path + "/modules/dav/main/%s" % cfg,
+        self.httpd_path + "/srclib/apr/%s" % cfg,
+        self.httpd_path + "/srclib/apr-util/%s" % cfg,
+        self.httpd_path + "/srclib/apr-util/xml/expat/lib/%s" % libcfg
         ])
     else:
       fakelibdirs = self.map_rootpath([self.dblibpath], rootpath)
Index: build/generator/gen_msvc_dsp.py
===================================================================
--- build/generator/gen_msvc_dsp.py	(revision 5729)
+++ build/generator/gen_msvc_dsp.py	(working copy)
@@ -14,7 +14,8 @@
 class Generator(gen_win.WinGeneratorBase):
   "Generate a Microsoft Visual C++ 6 project"
 
-  def __init__(self, fname, verfname):
+  def __init__(self, fname, verfname, options):
+    self.parse_options(options)
     gen_win.WinGeneratorBase.__init__(self, fname, verfname, 'msvc-dsp')
 
   def default_output(self, conf_path):
@@ -97,13 +98,21 @@
 
     targets = [ ]
 
+    # Generate .dsp file names for the targets: replace dashes with
+    # underscores and replace *-test with test_* (so that the test
+    # programs are visually separare from the rest of the projects)
+    for name in self.targets.keys():
+      pos = string.find(name, '-test')
+      if pos >= 0:
+        dsp_name = 'test_' + string.replace(name[0:pos], '-', '_')
+      else:
+        dsp_name = string.replace(name, '-', '_')
+      self.targets[name].dsp_name = dsp_name
+
+    # Traverse the targets and generate the project files
     items = self.targets.items()
     items.sort()
     for name, target in items:
-      # This isn't working yet
-      if string.find(name, '-test') >= 0:
-        continue
-
       # These aren't working yet
       if isinstance(target, gen_base.TargetScript) \
          or isinstance(target, gen_base.TargetSWIG):
@@ -117,7 +126,7 @@
         fname = self.find_win_project(project_path, ['.dsp'])
       else:
         fname = os.path.join(self.projfilesdir,
-                             "%s_msvc.dsp" % (string.replace(name, '-', '_')))
+                             "%s_msvc.dsp" % target.dsp_name)
         depth = string.count(self.projfilesdir, os.sep) + 1
         self.write_project(target, fname, string.join(['..']*depth, '\\'))
 
@@ -127,32 +136,48 @@
       # For MSVC we need to hack around mod_dav_svn &
       # libsvn_ra because dependencies implies linking
       # and there is no way around that
-      depends = []
+      if name == '__CONFIG__':
+        depends = []
+      else:
+        depends = [self.targets['__CONFIG__']]
+
       if name == 'mod_dav_svn':
-        depends = []
+        pass
       elif name == 'depdelta':
-        depends = [self.targets['libsvn_delta']]
+        depends += [self.targets['libsvn_delta']]
       elif name == 'libsvn_wc':
-        depends = [self.targets['depdelta']]
+        depends += [self.targets['depdelta']]
       elif name == 'depsubr':
-        depends = [self.targets['libsvn_subr']]
+        depends += [self.targets['libsvn_subr']]
       elif name == 'libsvn_ra_svn':
-        depends = [self.targets['depsubr']]
+        depends += [self.targets['depsubr']]
       elif name == 'libsvn_ra_dav':
-        depends = [self.targets['depsubr'], self.targets['neon']]
+        depends += [self.targets['depsubr'], self.targets['neon']]
       elif isinstance(target, gen_base.Target):
-        depends = self.get_unique_win_depends(target)
+        if isinstance(target, gen_base.TargetExe):
+          deps = { }
+          for obj in self.get_win_depends(target, 0):
+            deps[obj] = None
+          for obj in self.get_win_depends(target, 2):
+            if isinstance(obj, gen_base.TargetLib):
+              deps[obj] = None
+          deps = deps.keys()
+          deps.sort()
+          depends += deps
+        else:
+          depends += self.get_unique_win_depends(target)
       else:
         assert 0
 
       dep_names = [ ]
       for dep in depends:
-        dep_names.append(string.replace(dep.name, '-', ''))
+        dep_names.append(dep.dsp_name)
 
-      targets.append(_item(name=string.replace(name, '-', ''),
+      targets.append(_item(name=target.dsp_name,
                            dsp=string.replace(fname, os.sep, '\\'),
                            depends=dep_names))
 
+    targets.sort()
     data = {
       'targets' : targets,
       }
Index: gen-make.py
===================================================================
--- gen-make.py	(revision 5729)
+++ gen-make.py	(working copy)
@@ -29,7 +29,8 @@
   'make-bcpp' : ('gen_bcpp_make', '### need description'),
   }
 
-def main(fname, gentype, verfname=None, oname=None, skip_depends=0):
+def main(fname, gentype, verfname=None, oname=None,
+         skip_depends=0, other_options=None):
   if verfname is None:
     verfname = os.path.join('subversion', 'include', 'svn_version.h')
 
@@ -39,7 +40,7 @@
     print 'ERROR: the "%s" generator is not yet implemented.' % gentype
     sys.exit(1)
 
-  generator = gen_module.Generator(fname, verfname)
+  generator = gen_module.Generator(fname, verfname, other_options)
   if not skip_depends:
     generator.compute_hdr_deps()
 
@@ -64,7 +65,8 @@
 
 if __name__ == '__main__':
   try:
-    opts, args = getopt.getopt(sys.argv[1:], 'st:')
+    opts, args = getopt.getopt(sys.argv[1:], 'st:',
+                               ['with-httpd='])
     if len(args) > 1:
       _usage_exit()
   except getopt.GetoptError:
@@ -73,6 +75,7 @@
   conf = 'build.conf'
   skip = 0
   gentype = 'make'
+  rest = []
 
   if args:
     conf = args[0]
@@ -82,11 +85,13 @@
       skip = 1
     elif opt == '-t':
       gentype = val
+    else:
+      rest.append((opt, val))
 
   if gentype not in gen_modules.keys():
     _usage_exit()
 
-  main(conf, gentype, skip_depends=skip)
+  main(conf, gentype, skip_depends=skip, other_options=rest)
 
 
 ### End of file.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 28 03:04:20 2003

This is an archived mail posted to the Subversion Dev mailing list.