Fix configure in non-X environment.
When building xgsch2pcb in non-X environment configure script fails
on gtk python module check.
Example :
$ DISPLAY="" ./configure
...snip...
checking for python module gtk... no
configure: error: python module gtk is required
$ DISPLAY="" python -c "import gtk"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
_init()
File "/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
_gtk.init_check()
RuntimeError: could not open display
Module is found, but it tries to open display and fails.
To distinguish runtime errors from import errors, I've tried such
construction:
$ python -c "import gtk" 2>&1 | grep -q 'ImportError'
But logic exit code is inverted.
Also same reason prevents configure script from getting gtk+
version. So I introduced new --disable-x option to turn that check
off.
Closes-bug: lp-
1054241