convert to static/shared pipe-driver and add software rendering support

Taken from DRI3 branch code.
All of this code was written by xexaxo or mannerov.

Tested-by: Nick Sarnie <commendsarnex@gmail.com>