From 630eda9e509613fb58f795007b98d0176524d622 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 3 Feb 2014 17:12:12 -0800 Subject: [PATCH] improve handling of glfw3 and png flags --- configure | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/configure b/configure index bd64442e7..555177379 100755 --- a/configure +++ b/configure @@ -58,9 +58,13 @@ def configure_llmr(o): def configure_glfw3(o): if options.glfw3: - o['variables']['glfw3_libraries'] = '-L'+os.path.join(options.glfw3,'lib') - o['variables']['glfw3_libraries'] += '-lglfw3' - o['variables']['glfw3_cflags'] += '-I'+os.path.join(options.glfw3,'lib') + libpath = os.path.join(options.glfw3,'lib') + if os.path.exists(libpath): + o['variables']['glfw3_libraries'] = '-L'+libpath + o['variables']['glfw3_libraries'] += ' -lglfw3' + incpath = os.path.join(options.glfw3,'include') + if os.path.exists(incpath): + o['variables']['glfw3_cflags'] = '-I'+include else: ret = pkg_config('glfw3') if not ret: @@ -71,9 +75,13 @@ def configure_glfw3(o): 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') + libpath = os.path.join(options.glfw3,'lib') + if os.path.exists(libpath): + o['variables']['png_libraries'] = '-L'+libpath + o['variables']['png_libraries'] += ' -lpng -lz' + incpath = os.path.join(options.glfw3,'include') + if os.path.exists(incpath): + o['variables']['png_cflags'] = '-I'+include else: ret = pkg_config('libpng') if not ret: