$OpenBSD: patch-gdb_python_python-config_py,v 1.3 2013/05/04 21:27:11 pascal Exp $
--- gdb/python/python-config.py.orig	Wed Dec 12 17:47:30 2012
+++ gdb/python/python-config.py	Mon Apr 29 20:28:12 2013
@@ -72,6 +72,8 @@ for opt in opt_flags:
                     libs.insert(0, '-L' + getvar('LIBPL'))
                 elif os.name == 'nt':
                     libs.insert(0, '-L' + sysconfig.PREFIX + '/libs')
+            if getvar('LDFLAGS') is not None:
+                libs.insert(0, getvar('LDFLAGS'))
             if getvar('LINKFORSHARED') is not None:
                 libs.extend(getvar('LINKFORSHARED').split())
         print (to_unix_path(' '.join(libs)))
