(?!%s))' % arg_name[1], '', env_val) This causes '-L/path/to/foo -R/path/to/bar' to become '-L/path/to/fooR/path/to/bar', which obviously doesn't work. The fix is simple - eat non-whitespace after the unrecognized option: env_val = re.sub(r'(^
This was fixed in r57389 by georg.brandl by changing the replacement string '' to ' ' (turning the option into a non-option). Steps to reproduce this on Ubuntu Feisty, before that revision, were: $ mkdir banana $ sudo mv /usr/include/sqlite3.h banana/ $ make clean && ./configure && make [...] Failed to find the necessary bits to build these modules: _sqlite3 bsddb185 sunaudiodev [...] $ make clean && CPPFLAGS=-Ibanana ./configure && make Failed to find the necessary bits to build these modules: bsddb185 sunaudiodev $ make clean && CPPFLAGS=-Ibanana\ -Rmango ./configure && make Failed to find the necessary bits to build these modules: _sqlite3 bsddb185 sunaudiodev