OSDN Git Service

disable asserts in libdvdnav except when configured with --debug=max
[handbrake-jp/handbrake-jp-git.git] / make / configure.py
index ba08941..27c3801 100644 (file)
@@ -199,6 +199,15 @@ class Configure( object ):
         self.src_dir    = os.path.normpath( options.src )
         self.build_dir  = os.path.normpath( options.build )
         self.prefix_dir = os.path.normpath( options.prefix )
+        if options.sysroot != None:
+                self.sysroot_dir = os.path.normpath( options.sysroot )
+        else:
+                self.sysroot_dir = ""
+
+        if options.minver != None:
+                self.minver = options.minver
+        else:
+                self.minver = ""
 
         ## special case if src == build: add build subdir
         if os.path.abspath( self.src_dir ) == os.path.abspath( self.build_dir ):
@@ -621,7 +630,7 @@ class RepoProbe( ShellProbe ):
         if self.uuid == 'b64f7644-9d1e-0410-96f1-a4d463321fa5':
             self.official = 1
             m = re.match( '([^:]+)://([^/]+)/(.+)', self.url )
-            if m and re.match( 'tags/', m.group( 3 )):
+            if m and re.match( '.*tags/.*', m.group( 3 )):
                 self.type = 'release'
             else:
                 self.type = 'developer'
@@ -642,7 +651,7 @@ class Project( Action ):
         self.name          = 'HandBrake'
         self.acro_lower    = 'hb'
         self.acro_upper    = 'HB'
-        self.url_website   = 'http://code.google.com/p/hbfork'
+        self.url_website   = 'http://handbrake.fr'
         self.url_community = 'http://forum.handbrake.fr'
         self.url_irc       = 'irc://irc.freenode.net/handbrake'
 
@@ -651,26 +660,36 @@ class Project( Action ):
 
         self.vmajor = 0
         self.vminor = 9
-        self.vpoint = 4
+        self.vpoint = 5
 
     def _action( self ):
-        appcastfmt = 'http://handbrake.fr/appcast%s.xml'
+        ## add architecture to URL only for Mac
+        if fnmatch.fnmatch( build.spec, '*-*-darwin*' ):
+            url_arch = '.%s' % (arch.mode.mode)
+        else:
+            url_arch = ''
 
         if repo.type == 'release':
             self.version = '%d.%d.%d' % (self.vmajor,self.vminor,self.vpoint)
-            self.url_appcast = appcastfmt % ('')
+            url_ctype = ''
+            url_ntype = 'stable'
             self.build = time.strftime('%Y%m%d') + '00'
             self.title = '%s %s (%s)' % (self.name,self.version,self.build)
         elif repo.type == 'developer':
             self.version = 'svn%d' % (repo.rev)
-            self.url_appcast = appcastfmt % ('_unstable')
+            url_ctype = '_unstable'
+            url_ntype = 'unstable'
             self.build = time.strftime('%Y%m%d') + '01'
             self.title = '%s svn%d (%s)' % (self.name,repo.rev,self.build)
         else:
-            self.version = 'svn%d' % (repo.rev)
-            self.url_appcast = appcastfmt % ('_unofficial')
+            self.version = 'rev%d' % (repo.rev)
+            url_ctype = '_unofficial'
+            url_ntype = 'unofficial'
             self.build = time.strftime('%Y%m%d') + '99'
-            self.title = 'Unofficial svn%d (%s)' % (repo.rev,self.build)
+            self.title = '%s rev%d (%s)' % (self.name,repo.rev,self.build)
+
+        self.url_appcast = 'http://handbrake.fr/appcast%s%s.xml' % (url_ctype,url_arch)
+        self.url_appnote = 'http://handbrake.fr/appcast/%s.html' % (url_ntype)
 
         self.msg_end = '%s (%s)' % (self.name,repo.type)
         self.fail = False
@@ -933,6 +952,9 @@ def createCLI():
 
     ## add install options
     grp = OptionGroup( cli, 'Directory Locations' )
+    h = IfHost( 'specify sysroot (e.g. for Leopard builds from Snow Leapard)', '*-*-darwin*', none=optparse.SUPPRESS_HELP ).value
+    grp.add_option( '--sysroot', default=None, action='store', metavar='DIR',
+        help=h )
     grp.add_option( '--src', default=cfg.src_dir, action='store', metavar='DIR',
         help='specify top-level source dir [%s]' % (cfg.src_dir) )
     grp.add_option( '--build', default=cfg.build_dir, action='store', metavar='DIR',
@@ -976,6 +998,9 @@ def createCLI():
     arch.mode.cli_add_option( grp, '--arch' )
     grp.add_option( '--cross', default=None, action='store', metavar='SPEC',
         help='specify GCC cross-compilation spec' )
+    h = IfHost( 'Min OS X Version', '*-*-darwin*', none=optparse.SUPPRESS_HELP ).value
+    grp.add_option( '--minver', default=None, action='store', metavar='VER',
+        help=h )
     cli.add_option_group( grp )
 
     ## add tool locations
@@ -1190,17 +1215,18 @@ try:
     doc.add( 'CONF.args', ' '.join( args ))
 
     doc.addBlank()
-    doc.add( 'HB.title',         project.title )
-    doc.add( 'HB.name',          project.name )
-    doc.add( 'HB.name.lower',    project.name_lower )
-    doc.add( 'HB.name.upper',    project.name_upper )
-    doc.add( 'HB.acro.lower',    project.acro_lower )
-    doc.add( 'HB.acro.upper',    project.acro_upper )
-
-    doc.add( 'HB.url.website',   project.url_website )
-    doc.add( 'HB.url.community', project.url_community )
-    doc.add( 'HB.url.irc',       project.url_irc )
-    doc.add( 'HB.url.appcast',   project.url_appcast )
+    doc.add( 'HB.title',       project.title )
+    doc.add( 'HB.name',        project.name )
+    doc.add( 'HB.name.lower',  project.name_lower )
+    doc.add( 'HB.name.upper',  project.name_upper )
+    doc.add( 'HB.acro.lower',  project.acro_lower )
+    doc.add( 'HB.acro.upper',  project.acro_upper )
+
+    doc.add( 'HB.url.website',    project.url_website )
+    doc.add( 'HB.url.community',  project.url_community )
+    doc.add( 'HB.url.irc',        project.url_irc )
+    doc.add( 'HB.url.appcast',    project.url_appcast )
+    doc.add( 'HB.url.appnote',    project.url_appnote )
 
     doc.add( 'HB.version.major',  project.vmajor )
     doc.add( 'HB.version.minor',  project.vminor )
@@ -1248,9 +1274,9 @@ try:
     else:
         doc.add( 'BUILD.cross.prefix', '' )
 
-    doc.add( 'BUILD.method',       'terminal' )
-    doc.add( 'BUILD.date',         time.strftime('%c') )
-    doc.add( 'BUILD.arch',         arch.mode.mode )
+    doc.add( 'BUILD.method', 'terminal' )
+    doc.add( 'BUILD.date',   time.strftime('%c') )
+    doc.add( 'BUILD.arch',   arch.mode.mode )
 
     doc.addBlank()
     doc.add( 'CONF.method', options.conf_method )
@@ -1276,6 +1302,10 @@ try:
         doc.add( 'XCODE.external.prefix', cfg.xcode_x_prefix )
 
     doc.addMake( '' )
+    doc.addMake( '## define debug mode before other includes' )
+    doc.addMake( '## since it is tested in some module.defs' )
+    doc.add( 'GCC.g', debugMode.mode )
+    doc.addBlank()
     doc.addMake( '## include definitions' )
     doc.addMake( 'include $(SRC/)make/include/main.defs' )
 
@@ -1288,11 +1318,16 @@ try:
         select.doc_add( doc )
 
     doc.addBlank()
-    if arch.mode.mode != arch.mode.default:
+    if build.match( '*-*-darwin*' ):
         doc.add( 'GCC.archs', arch.mode.mode )
+        doc.add( 'GCC.sysroot', cfg.sysroot_dir )
+        doc.add( 'GCC.minver', cfg.minver )
     else:
         doc.add( 'GCC.archs', '' )
-    doc.add( 'GCC.g', debugMode.mode )
+        doc.add( 'GCC.sysroot', '' )
+        doc.add( 'GCC.minver', '' )
+    doc.add( 'GCC.ldsysroot', '$(GCC.sysroot)' )
+    doc.add( 'GCC.ldminver', '$(GCC.minver)' )
     doc.add( 'GCC.O', optimizeMode.mode )
 
     if options.enable_asm and not Tools.yasm.fail: