summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdrm/Makefile49
-rw-r--r--libdrm/xf86drm.h4
-rw-r--r--libdrm/xf86drmCompat.c2
-rw-r--r--libdrm/xf86drmHash.c1
-rw-r--r--libdrm/xf86drmRandom.c1
-rw-r--r--libdrm/xf86drmSL.c1
6 files changed, 47 insertions, 11 deletions
diff --git a/libdrm/Makefile b/libdrm/Makefile
index 58759af2..098f31a1 100644
--- a/libdrm/Makefile
+++ b/libdrm/Makefile
@@ -2,23 +2,54 @@ SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c
OBJECTS = xf86drm.o xf86drmHash.o xf86drmRandom.o xf86drmSL.o
CFLAGS ?= -O2 -fPIC -g
+DEFINES = -D_IN_LIBDRM
-all: libdrm.so
+# set this if you're installing into a fake root
+DESTDIR ?=
+
+DRIVER_HEADERS = ../shared-core/drm.h \
+ ../shared-core/drm_sarea.h \
+ ../shared-core/i915_drm.h \
+ ../shared-core/i915_drv.h \
+ ../shared-core/mach64_drm.h \
+ ../shared-core/mach64_drv.h \
+ ../shared-core/mga_drm.h \
+ ../shared-core/mga_drv.h \
+ ../shared-core/mga_ucode.h \
+ ../shared-core/r128_drm.h \
+ ../shared-core/r128_drv.h \
+ ../shared-core/radeon_drm.h \
+ ../shared-core/radeon_drv.h \
+ ../shared-core/savage_drm.h \
+ ../shared-core/savage_drv.h \
+ ../shared-core/sis_drm.h \
+ ../shared-core/sis_drv.h \
+ ../shared-core/sis_ds.h \
+ ../shared-core/tdfx_drv.h \
+ ../shared-core/via_3d_reg.h \
+ ../shared-core/via_drm.h \
+ ../shared-core/via_drv.h \
+ ../shared-core/via_ds.h \
+ ../shared-core/via_mm.h \
+ ../shared-core/via_verifier.h
-libxf86drm.a: $(OBJECTS)
- ar rc $@ $+
- ranlib $@
+all: libdrm.so
libdrm.so: $(OBJECTS)
$(CC) -shared -Wl,-hlibdrm.so.1 -o $@ $^
.c.o:
- $(CC) $(CFLAGS) -c -I../shared -I../linux $<
+ $(CC) $(DEFINES) $(CFLAGS) -c -I../shared-core $<
clean:
rm -f *.a *.o *.so
-install: libdrm.so xf86drm.h ../shared-core/drm.h
- install -m 755 libdrm.so /lib
- install -m 644 xf86drm.h /usr/include
- install -m 644 ../shared-core/drm.h /usr/include
+# XXX remove the xf86drm.h compat once this is widely installed
+install: libdrm.so xf86drm.h $(DRIVER_HEADERS)
+ install -m 755 libdrm.so $(DESTDIR)/lib
+ install -m 644 xf86drm.h $(DESTDIR)/usr/include/libdrm.h
+ install -m 644 xf86drm.h $(DESTDIR)/usr/include/xf86drm.h
+ echo '#warning Including xf86drm.h is deprecated, use libdrm.h' >> \
+ $(DESTDIR)/usr/include/xf86drm.h
+ mkdir -p -m 755 $(DESTDIR)/usr/include/drm
+ install -m 644 $(DRIVER_HEADERS) $(DESTDIR)/usr/include/drm
diff --git a/libdrm/xf86drm.h b/libdrm/xf86drm.h
index 7521e341..bd00a46c 100644
--- a/libdrm/xf86drm.h
+++ b/libdrm/xf86drm.h
@@ -36,7 +36,9 @@
#ifndef _XF86DRM_H_
#define _XF86DRM_H_
-#include <drm.h>
+#ifndef _IN_LIBDRM
+#include <drm/drm.h>
+#endif
/* Defaults, if nothing set in xf86config */
#define DRM_DEV_UID 0
diff --git a/libdrm/xf86drmCompat.c b/libdrm/xf86drmCompat.c
index 66f657bb..d284941b 100644
--- a/libdrm/xf86drmCompat.c
+++ b/libdrm/xf86drmCompat.c
@@ -70,9 +70,9 @@ extern int xf86RemoveSIGIOHandler(int fd);
#ifdef __linux__
#include <sys/sysmacros.h> /* for makedev() */
#endif
+#include "drm.h"
#include "xf86drm.h"
#include "xf86drmCompat.h"
-#include "drm.h"
#include "mga_drm.h"
#include "r128_drm.h"
#include <inttypes.h> /* for int64_t & friends */
diff --git a/libdrm/xf86drmHash.c b/libdrm/xf86drmHash.c
index 1f1a05b3..368dfe21 100644
--- a/libdrm/xf86drmHash.c
+++ b/libdrm/xf86drmHash.c
@@ -76,6 +76,7 @@
# include <stdio.h>
# include <stdlib.h>
#else
+# include "drm.h"
# include "xf86drm.h"
# ifdef XFree86LOADER
# include "xf86.h"
diff --git a/libdrm/xf86drmRandom.c b/libdrm/xf86drmRandom.c
index 9e1e9ee2..8db57a50 100644
--- a/libdrm/xf86drmRandom.c
+++ b/libdrm/xf86drmRandom.c
@@ -79,6 +79,7 @@
# include <stdio.h>
# include <stdlib.h>
#else
+# include "drm.h"
# include "xf86drm.h"
# ifdef XFree86LOADER
# include "xf86.h"
diff --git a/libdrm/xf86drmSL.c b/libdrm/xf86drmSL.c
index dd634c30..41e36a73 100644
--- a/libdrm/xf86drmSL.c
+++ b/libdrm/xf86drmSL.c
@@ -47,6 +47,7 @@
# include <stdlib.h>
# include <sys/time.h>
#else
+# include "drm.h"
# include "xf86drm.h"
# ifdef XFree86LOADER
# include "xf86.h"