loader: Use drirc device_id parameter in complement to DRI_PRIME

DRI_PRIME is not very handy, because you have to launch the executable
with it set, which is not always easy to do.
By using drirc, the user specifies the target executable
and the device to use. After that the program will be launched everytime
on the target device.

For example if .drirc contains:

<driconf>
    <device driver="loader">
        <application name="Glmark2" executable="glmark2">
            <option name="device_id" value="pci-0000_01_00_0" />
        </application>
    </device>
</driconf>

Then glmark2 will use if possible the render-node of
ID_PATH_TAG pci-0000_01_00_0.

v2: Fix compilation issue
v3: Add "-lm" and rebase.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index 9d1580f..d4a7090 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,12 +19,14 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
-SUBDIRS = gtest loader mapi
+SUBDIRS = gtest mapi
 
 if NEED_OPENGL_COMMON
 SUBDIRS += glsl mesa
 endif
 
+SUBDIRS += loader
+
 if HAVE_DRI_GLX
 SUBDIRS += glx
 endif