From 8b4b91f6cc272c001c2a2cd956a28d2b8b619b26 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 3 Feb 2014 17:31:33 -0800 Subject: first pass at universal libpng for iOS --- configure | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 7e7df519f2..434a39e80c 100755 --- a/configure +++ b/configure @@ -34,6 +34,16 @@ parser.add_option("--png", dest="png", help="Path to png (defaults to using pkg-config)") +parser.add_option("--png-includes", + action="store", + dest="png_includes", + help="Path to png includes") + +parser.add_option("--png-libpath", + action="store", + dest="png_libpath", + help="Path to png libs") + (options, args) = parser.parse_args() def pkg_config(pkg): @@ -60,11 +70,11 @@ def configure_glfw3(o): if options.glfw3: libpath = os.path.join(options.glfw3,'lib') if os.path.exists(libpath): - o['variables']['glfw3_libraries'] = '-L'+libpath - o['variables']['glfw3_libraries'] += ' -lglfw3' + 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 + o['variables']['glfw3_cflags'] = ['-I'+incpath] else: ret = pkg_config('glfw3') if not ret: @@ -74,14 +84,22 @@ def configure_glfw3(o): o['variables']['glfw3_cflags'] = ret[1].split() def configure_png(o): - if options.png: - libpath = os.path.join(options.png,'lib') - if os.path.exists(libpath): - o['variables']['png_libraries'] = '-L'+libpath - o['variables']['png_libraries'] += ' -lpng -lz' - incpath = os.path.join(options.png,'include') - if os.path.exists(incpath): - o['variables']['png_cflags'] = '-I'+include + if options.png or options.png_libpath or options.png_includes: + libpath = None + if options.png_libpath: + libpath = options.png_libpath + elif options.png: + libpath = os.path.join(options.png,'lib') + if libpath and os.path.exists(libpath): + o['variables']['png_libraries'] = ['-L'+libpath] + o['variables']['png_libraries'] += ['-lpng','-lz'] + incpath = None + if options.png_includes: + incpath = options.png_includes + elif options.png: + incpath = os.path.join(options.png,'include') + if incpath and os.path.exists(incpath): + o['variables']['png_cflags'] = '-I'+incpath else: ret = pkg_config('libpng') if not ret: -- cgit v1.2.1