diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 243: Build: Convert waf usage to gnu_dirs.

Message ID 20120807121015.11234.59442.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org Aug. 7, 2012, 12:10 p.m. UTC
------------------------------------------------------------
revno: 243
author: Mike Frysinger <vapier@gentoo.org>, Alexandros Frantzis <alexandros.frantzis@linaro.org>
committer: Alexandros Frantzis <alexandros.frantzis@linaro.org>
branch nick: trunk
timestamp: Tue 2012-08-07 15:04:04 +0300
message:
  Build: Convert waf usage to gnu_dirs.
  
  Use the standard gnu_dirs module that waf already includes. Keep the
  '--data-path' option in order to be able to specify arbitrary data
  paths, a feature useful for development.
modified:
  doc/wscript_build
  wscript


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'doc/wscript_build'
--- doc/wscript_build	2011-06-24 12:17:59 +0000
+++ doc/wscript_build	2012-08-07 12:04:04 +0000
@@ -6,7 +6,7 @@ 
         APPNAME = 'GLMARK2',
         appname = 'glmark2',
         appversion = bld.env.GLMARK2_VERSION,
-        install_path = '${PREFIX}/share/man/man1'
+        install_path = '${MANDIR}/man1'
     )
 
 if bld.env.USE_GLESv2:
@@ -17,5 +17,5 @@ 
         APPNAME = 'GLMARK2-ES2',
         appname = 'glmark2-es2',
         appversion = bld.env.GLMARK2_VERSION,
-        install_path = '${PREFIX}/share/man/man1'
+        install_path = '${MANDIR}/man1'
     )

=== modified file 'wscript'
--- wscript	2012-07-30 09:27:14 +0000
+++ wscript	2012-08-07 12:04:04 +0000
@@ -12,6 +12,7 @@ 
 APPNAME = 'glmark2'
 
 def options(opt):
+    opt.tool_options('gnu_dirs')
     opt.tool_options('compiler_cc')
     opt.tool_options('compiler_cxx')
 
@@ -24,7 +25,7 @@ 
     opt.add_option('--no-opt', action='store_false', dest = 'opt',
                    default = True, help='disable compiler optimizations')
     opt.add_option('--data-path', action='store', dest = 'data_path',
-                   help='the path to install the data to')
+                   help='path to main data (also see --data(root)dir)')
     opt.add_option('--extras-path', action='store', dest = 'extras_path',
                    help='path to additional data (models, shaders, textures)')
 
@@ -32,6 +33,7 @@ 
     if not Options.options.gl and not Options.options.glesv2:
         ctx.fatal("You must configure using at least one of --enable-gl, --enable-glesv2")
 
+    ctx.check_tool('gnu_dirs')
     ctx.check_tool('compiler_cc')
     ctx.check_tool('compiler_cxx')
 
@@ -74,17 +76,19 @@ 
     if Options.options.debug:
         ctx.env.prepend_value('CXXFLAGS', '-g')
 
-    if Options.options.data_path is None:
-        Options.options.data_path = os.path.join(ctx.env.PREFIX, 'share/glmark2')
-
     ctx.env.HAVE_EXTRAS = False
     if Options.options.extras_path is not None:
         ctx.env.HAVE_EXTRAS = True
         ctx.env.append_unique('GLMARK_EXTRAS_PATH', Options.options.extras_path)
         ctx.env.append_unique('DEFINES', 'GLMARK_EXTRAS_PATH="%s"' % Options.options.extras_path)
 
-    ctx.env.append_unique('GLMARK_DATA_PATH', Options.options.data_path)
-    ctx.env.append_unique('DEFINES', 'GLMARK_DATA_PATH="%s"' % Options.options.data_path)
+    if Options.options.data_path is not None:
+        data_path = Options.options.data_path 
+    else:
+        data_path = os.path.join(ctx.env.DATADIR, 'glmark2')
+
+    ctx.env.append_unique('GLMARK_DATA_PATH', data_path)
+    ctx.env.append_unique('DEFINES', 'GLMARK_DATA_PATH="%s"' % data_path)
     ctx.env.append_unique('DEFINES', 'GLMARK_VERSION="%s"' % VERSION)
     ctx.env.GLMARK2_VERSION = VERSION
 
@@ -92,7 +96,7 @@ 
     ctx.env.USE_GLESv2 = Options.options.glesv2
 
     ctx.msg("Prefix", ctx.env.PREFIX, color = 'PINK')
-    ctx.msg("Data path", Options.options.data_path, color = 'PINK')
+    ctx.msg("Data path", data_path, color = 'PINK')
     ctx.msg("Including extras", "Yes" if ctx.env.HAVE_EXTRAS else "No",
             color = 'PINK');
     if ctx.env.HAVE_EXTRAS: