--- /dev/null
+# Copyright 2005 Adam Jackson.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# eventually someone might want to build the kernel modules or tests from
+# here too, but let's just do libdrm for now
+
+AUTOMAKE_OPTIONS = foreign
+SUBDIRS = libdrm
+
+pkgconfigdir = @pkgconfigdir@
+pkgconfig_DATA = libdrm.pc
+
+EXTRA_DIST = libdrm.pc.in
--- /dev/null
+By default, this will install into /usr/local. If you want to install this
+libdrm to replace your system copy, say:
+
+./autogen.sh --enable-system
--- /dev/null
+# Copyright 2005 Adam Jackson.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+AC_PREREQ(2.57)
+AC_INIT([libdrm], 1.0.0, [dri-devel@lists.sourceforge.net], libdrm)
+AC_CONFIG_SRCDIR([Makefile.am])
+AM_INIT_AUTOMAKE([dist-bzip2])
+
+AM_CONFIG_HEADER([libdrm/config.h])
+
+AC_PROG_LIBTOOL
+AC_PROG_CC
+
+AC_HEADER_STDC
+
+AC_ARG_ENABLE(system, AC_HELP_STRING([--enable-system],
+ [Configure to be the system libdrm]),
+ [SYSTEM=$enableval], [SYSTEM=no])
+AM_CONDITIONAL(SYSTEM, [test x$SYSTEM = xyes])
+if test x$SYSTEM = xyes; then
+ libdir=/lib
+ includedir=/usr/include
+ pkgconfigdir=/usr/lib/pkgconfig
+else
+ pkgconfigdir=${libdir}/pkgconfig
+fi
+AC_SUBST(pkgconfigdir)
+
+AC_OUTPUT([Makefile libdrm/Makefile libdrm.pc])
--- /dev/null
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdrm
+Description: Userspace interface to kernel DRM services
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir}
+Cflags: -I${includedir} -I${includedir}/drm
+++ /dev/null
-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
-
-# 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
-
-all: libdrm.so
-
-libdrm.so: $(OBJECTS)
- $(CC) -shared -Wl,-hlibdrm.so.1 -o $@ $^
-
-.c.o:
- $(CC) $(DEFINES) $(CFLAGS) -c -I../shared-core $<
-
-clean:
- rm -f *.a *.o *.so
-
-# 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
--- /dev/null
+# Copyright 2005 Adam Jackson.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+libdrm_la_LTLIBRARIES = libdrm.la
+libdrm_ladir = /lib
+libdrm_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+
+AM_CFLAGS = -I$(top_srcdir)/shared-core
+libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c
+
+libdrmincludedir = ${includedir}
+libdrminclude_HEADERS = xf86drm.h
+
+klibdrmincludedir = ${includedir}/drm
+klibdrminclude_HEADERS = \
+ ../shared-core/drm.h \
+ ../shared-core/drm_sarea.h \
+ ../shared-core/i915_drm.h \
+ ../shared-core/i915_drv.h \
+ ../shared-core/imagine_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