I made the test ebuild to output some stuff: python_configure() { for pc in python-config python3.4-config python2.7-config; do elog "which ${pc}: $(which ${pc})" elog "${pc} --prefix: $(${pc} --prefix)" elog "${pc} --includes: $(${pc} --includes)" elog "${pc} --libs: $(${pc} --libs)" done } python_foreach_impl python_configure * python3_4: running python_configure * which python-config: /var/tmp/portage/sys-process/audit-2.4.3/temp/python3.4/bin/python-config * python-config --prefix: /var/tmp/portage/sys-process/audit-2.4.3/temp/python3.4 * python-config --includes: -I/var/tmp/portage/sys-process/audit-2.4.3/temp/python3.4/include/python3.4 -I/var/tmp/portage/sys-process/audit-2.4.3/temp/python3.4/include/python3.4 * python-config --libs: -lpthread -ldl -lutil -lm -lpython3.4 * which python3.4-config: /usr/bin/python3.4-config * python3.4-config --prefix: /usr * python3.4-config --includes: -I/usr/include/python3.4 -I/usr/include/python3.4 * python3.4-config --libs: -lpthread -ldl -lutil -lm -lpython3.4 * python2_7: running python_configure * which python-config: /var/tmp/portage/sys-process/audit-2.4.3/temp/python2.7/bin/python-config * python-config --prefix: /usr * python-config --includes: -I/usr/include/python2.7 -I/usr/include/python2.7 * python-config --libs: -lpython2.7 -lpthread -ldl -lutil -lm * which python2.7-config: /usr/bin/python2.7-config * python2.7-config --prefix: /usr * python2.7-config --includes: -I/usr/include/python2.7 -I/usr/include/python2.7 * python2.7-config --libs: -lpython2.7 -lpthread -ldl -lutil -lm Note the wrong --prefix which also causes the --includes line to be wrong which breaks compiling C modules that include Python.h. pythonX.Y-config all return the right things since they are not handled by python_wrapper_setup. python-config returns the right thing when it points at python2.7-config but broken when points at python3.4-config (I have not tested 3.3). I suspect this may also affect the other python things handled by the wrapper (eg the 'python' and 'python3' symlinks) since python 3.4 added venv support.
27 Jul 2015; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass: python_wrapper_setup(): replace symlinks with shell wrappers to avoid triggering Python 3.4+ magical prefix support.