summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDane Springmeyer <dane@dbsgeo.com>2014-02-03 15:40:56 -0800
committerDane Springmeyer <dane@dbsgeo.com>2014-02-03 15:40:56 -0800
commitb895711b01f60437727b94eb75383304e9c09347 (patch)
treea38e2855a627088e55577aae903e520a4c89caec /configure
parent0052211278c7f7e4ec976ac87467bc5a5cd159f7 (diff)
downloadqtlocation-mapboxgl-b895711b01f60437727b94eb75383304e9c09347.tar.gz
png is a new dependency in sprite.cpp - add it to build system
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 20 insertions, 1 deletions
diff --git a/configure b/configure
index 0c6ddf70cb..bd64442e76 100755
--- a/configure
+++ b/configure
@@ -29,10 +29,15 @@ parser.add_option("--glfw3",
dest="glfw3",
help="Path to gflw3 (defaults to using pkg-config)")
+parser.add_option("--png",
+ action="store",
+ dest="png",
+ help="Path to png (defaults to using pkg-config)")
+
(options, args) = parser.parse_args()
def pkg_config(pkg):
- cmd = os.popen('pkg-config --libs %s' % pkg, 'r')
+ cmd = os.popen('pkg-config --static --libs %s' % pkg, 'r')
libs = cmd.readline().strip()
ret = cmd.close()
if (ret): return None
@@ -64,6 +69,19 @@ def configure_glfw3(o):
o['variables']['glfw3_libraries'] = ret[0].split()
o['variables']['glfw3_cflags'] = ret[1].split()
+def configure_png(o):
+ if options.glfw3:
+ o['variables']['png_libraries'] = '-L'+os.path.join(options.png,'lib')
+ o['variables']['png_libraries'] += '-lpng'
+ o['variables']['png_cflags'] += '-I'+os.path.join(options.png,'lib')
+ else:
+ ret = pkg_config('libpng')
+ if not ret:
+ sys.stderr.write('could not find libpng with pkg-config')
+ sys.exit(-1)
+ o['variables']['png_libraries'] = ret[0].split()
+ o['variables']['png_cflags'] = ret[1].split()
+
def write(filename, data):
filename = os.path.join(root_dir, filename)
print "creating ", filename
@@ -89,6 +107,7 @@ def run_gyp(args):
if __name__ == '__main__':
configure_llmr(output)
configure_glfw3(output)
+ configure_png(output)
pprint.pprint(output, indent=2)
write('config.gypi', "# Do not edit. Generated by the configure script.\n" +