configure.py
changeset 21 4633027730f5
parent 7 923ff622b8b9
child 23 e6ad4ef83b23
--- a/configure.py	Tue Jul 06 14:36:53 2010 +0300
+++ b/configure.py	Wed Aug 18 10:05:37 2010 +0300
@@ -192,6 +192,8 @@
                              help="Install qmake feature files to <dir>. The default value is 'QTDIR/mkspecs/features'.")
             group.add_option("--resources-dir", dest="resourcesdir", metavar="dir",
                              help="Install resources to <dir>. The default value is 'PREFIX/resources'.")
+            group.add_option("--translations-dir", dest="translationsdir", metavar="dir",
+                             help="Install translation files to <dir>. The default value is 'PREFIX/translations'.")
             self.add_option_group(group)
         self.set_defaults(prefix=None)
         self.set_defaults(bindir=None)
@@ -201,6 +203,7 @@
         self.set_defaults(pluginsdir=None)
         self.set_defaults(featuresdir=None)
         self.set_defaults(resourcesdir=None)
+        self.set_defaults(translationsdir=None)
 
         group = optparse.OptionGroup(self, "Configure options")
         group.add_option("--platform", dest="platform", metavar="platform",
@@ -219,10 +222,10 @@
                          help="Build in debug mode.")
         group.add_option("--debug_and_release", action="store_const", dest="config", const="debug_and_release",
                          help="Build in both debug and release modes.")
-        group.add_option("--debug-output", action="store_false", dest="debug_output",
-                         help="Do not suppress debug and warning output (suppressed by default in release mode).")
+        group.add_option("--debug-output", action="store_true", dest="debug_output",
+                            help="Do not suppress debug and warning output (suppressed by default in release-armv5 builds on Symbian).")
         group.add_option("--no-debug-output", action="store_true", dest="no_debug_output",
-                         help="Suppress debug and warning output (not supporessed by default in debug mode).")
+                            help="Suppress debug and warning output (suppressed by default in release-armv5 builds on Symbian).")
         if QMAKE.platform() != "symbian":
             group.add_option("--silent", action="store_true", dest="silent",
                              help="Suppress verbose compiler output.")
@@ -296,10 +299,6 @@
                          help="Assumes that Qt Mobility is available without performing a compilation test.")
         group.add_option("--no-qt-mobility", action="store_false", dest="qtmobility",
                          help="Assumes that Qt Mobility is not available without performing a compilation test.")
-        group.add_option("--meegotouch", action="store_true", dest="meegotouch",
-                         help="Assumes that MeeGoTouch UI is available without performing a compilation test.")
-        group.add_option("--no-meegotouch", action="store_false", dest="meegotouch",
-                         help="Assumes that MeeGoTouch UI is not available without performing a compilation test.")
         group.add_option("--qt-openvg", action="store_true", dest="qtopenvg",
                          help="Assumes that OpenVG is available without performing a compilation test.")
         group.add_option("--no-qt-openvg", action="store_false", dest="qtopenvg",
@@ -484,6 +483,7 @@
         self._pluginsdir = None
         self._featuresdir = None
         self._resourcesdir = None
+        self._translationsdir = None
 
     def init(self, options):
         # prefix
@@ -506,6 +506,7 @@
         self._pluginsdir = self._dir_option(options.pluginsdir, self._prefix + "/plugins")
         self._featuresdir = self._dir_option(options.featuresdir, QMAKE.features())
         self._resourcesdir = self._dir_option(options.resourcesdir, self._prefix + "/resources")
+        self._translationsdir = self._dir_option(options.translationsdir, self._prefix + "/translations")
 
         # symbian specific adjustments
         if QMAKE.platform() == "symbian":
@@ -548,6 +549,9 @@
     def resourcesdir(self):
         return self._resourcesdir
 
+    def translationsdir(self):
+        return self._translationsdir
+
     def exportdir(self, category=None):
         if os.path.isdir("/s60"):
             if category:
@@ -738,12 +742,10 @@
         if touchfeedback_result:
             config.add_value("DEFINES", "HB_TOUCHFEEDBACK_TYPE_IS_LONGPRESS")
         print("INFO: ETouchFeedbackLongPress:\t\t%s" % touchfeedback_result)
-    if options.meegotouch == None:
-        options.meegotouch = test.compile("config.tests/meego/meegotouch")
-    if options.meegotouch:
-        config.add_value("CONFIG", "hb_meegotouch")
-        config.add_value("DEFINES", "HB_MEEGOTOUCH")
-    print("INFO: MeeGo Touch:\t\t\t%s" % options.meegotouch)
+        wsrenderorientation_result = test.compile("config.tests/symbian/wsrenderorientation")
+        if wsrenderorientation_result:
+            config.add_value("DEFINES", "HB_WSERV_HAS_RENDER_ORIENTATION")
+        print("INFO: WServ render orientation support:\t%s" % wsrenderorientation_result)
 
     config.set_value("HB_INSTALL_DIR", ConfigFile.format_dir(BUILDENV.prefix()))
     config.set_value("HB_BIN_DIR", ConfigFile.format_dir(BUILDENV.bindir()))
@@ -753,6 +755,7 @@
     config.set_value("HB_PLUGINS_DIR", ConfigFile.format_dir(BUILDENV.pluginsdir()))
     config.set_value("HB_FEATURES_DIR", ConfigFile.format_dir(BUILDENV.featuresdir()))
     config.set_value("HB_RESOURCES_DIR", ConfigFile.format_dir(BUILDENV.resourcesdir()))
+    config.set_value("HB_TRANSLATIONS_DIR", ConfigFile.format_dir(BUILDENV.translationsdir()))
 
     # TODO: get rid of this!
     if QMAKE.platform() == "symbian":
@@ -816,37 +819,18 @@
         config.add_value("CONFIG", "coverage")
     if options.config:
         config.add_value("CONFIG", options.config)
-    if options.debug_output != None:
-        config.add_value("CONFIG", "debug_output")
-    if options.no_debug_output != None:
-        config.add_value("CONFIG", "no_debug_output")
-
-    # debug & warning outputs:
-    #   - release
-    #       - disabled by default
-    #       - can be enabled by passing --debug_output option
-    #   - debug
-    #       - enabled by default
-    #       - can be disabled by passing --no_debug_output option
-    config._lines.append("CONFIG(release, debug|release) {\n")
-    config._lines.append("    debug_output|developer {\n")
-    config._lines.append("        # debug/warning output enabled\n")
-    config._lines.append("    } else {\n")
-    config._lines.append("        DEFINES += QT_NO_DEBUG_OUTPUT\n")
-    config._lines.append("        DEFINES += QT_NO_WARNING_OUTPUT\n")
-    config._lines.append("    }\n")
-    config._lines.append("} else {\n")
-    config._lines.append("    no_debug_output {\n")
-    config._lines.append("        DEFINES += QT_NO_DEBUG_OUTPUT\n")
-    config._lines.append("        DEFINES += QT_NO_WARNING_OUTPUT\n")
-    config._lines.append("    }\n")
-    config._lines.append("}\n")
+    if options.debug_output:
+        config.add_value("DEFINES", "HB_DEBUG_OUTPUT")
+        config.add_value("DEFINES", "HB_WARNING_OUTPUT")
+    if options.no_debug_output:
+        config.add_value("DEFINES", "HB_NO_DEBUG_OUTPUT")
+        config.add_value("DEFINES", "HB_NO_WARNING_OUTPUT")
 
     # ensure that no QString(0) -like constructs slip in
     config.add_value("DEFINES", "QT_QCHAR_CONSTRUCTOR")
 
     # TODO: is there any better way to expose functions to the whole source tree?
-    config._lines.append("include(%s)\n" % (os.path.splitdrive(BUILDENV.sourcedir())[1] + "/mkspecs/hb_functions.prf"))
+    config._lines.append("include(%s)\n" % ConfigFile.format_dir((os.path.splitdrive(BUILDENV.sourcedir())[1]) + "/mkspecs/hb_functions.prf"))
 
     if options.verbose:
         print("INFO: Writing .qmake.cache")
@@ -854,22 +838,6 @@
         print("ERROR: Unable to write .qmake.cache.")
         return
 
-    if os.name == "posix" or os.name == "mac":
-        sharedmem = test.compile("config.tests/unix/sharedmemory")
-        if sharedmem:
-            (code, output) = run_process(["./hbconftest_sharedmemory"], "config.tests/unix/sharedmemory")
-            sharedmem = (code == 0)
-            if not sharedmem:
-                print("DEBUG:%s" % output)
-        print("INFO: Shared Memory:\t\t\t%s" % sharedmem)
-        if not sharedmem:
-            print("WARNING:The amount of available shared memory is too low!")
-            print "\tTry adjusting the shared memory configuration",
-            if os.path.exists("/proc/sys/kernel/shmmax"):
-                print "(/proc/sys/kernel/shmmax)"
-            elif os.path.exists("/etc/sysctl.conf"):
-                print "(/etc/sysctl.conf)"
-
     # generate local build wrapper headers
     print("\nGenerating files...")
     print("INFO: Wrapper headers")