Allow pkgconfigdir to be set when running configure

This also makes autogen.sh compatible with older versions of autotools +
pkg-config.
15 jobs for master
Status Name Job ID Coverage
  Test
passed job_clang_amd64 #965
amd64

02:50:02

passed job_clang_amd64_nosh #969
amd64

03:05:22

passed job_clang_py2_amd64 #967
amd64

02:56:25

failed job_gcc_386 #975
i386

02:38:07

passed job_gcc_amd64 #964
amd64

02:17:00

passed job_gcc_amd64_nosh #968
amd64

02:17:53

failed job_gcc_py2_386 #976
i386

02:35:19

passed job_gcc_py2_amd64 #966
amd64

02:04:47

failed job_gcc_386 #973
i386

04:54:01

failed job_gcc_386 #972
i386

02:39:00

failed job_gcc_386 #971
i386

02:20:19

failed job_gcc_386 #962
i386

00:19:46

failed job_gcc_py2_386 #974
i386

04:53:58

failed job_gcc_py2_386 #970
i386

04:41:55

failed job_gcc_py2_386 #963
i386

02:36:40

 
Name Stage Failure
failed
job_gcc_386 Test There is an unknown failure, please try again
  warnings.warn("tight_layout : falling back to Agg renderer")
/usr/lib/python3/dist-packages/matplotlib/tight_layout.py:222: UserWarning: tight_layout : falling back to Agg renderer
warnings.warn("tight_layout : falling back to Agg renderer")
/usr/lib/python3/dist-packages/numpy/ma/core.py:3192: MaskedArrayFutureWarning: Currently, slicing will try to return a view of the data, but will return a copy of the mask. In the future, it will try to return both as views. This means that using `__setitem__` will propagate values back through all masks that are present.
MaskedArrayFutureWarning
/usr/lib/python3/dist-packages/matplotlib/tight_layout.py:222: UserWarning: tight_layout : falling back to Agg renderer
warnings.warn("tight_layout : falling back to Agg renderer")

ERROR: Build failed with: exit status 1
failed
job_gcc_py2_386 Test There is an unknown failure, please try again
Doctest summary
===============
860 tests
1 failure in tests
0 failures in setup code
0 failures in cleanup code
build finished with problems, 137 warnings.

ERROR: Build failed with: exit status 1