3 ###########################
10 echo Usage
: $0 \
<directory\
>
16 if [ $2="dri" ] ; then
21 MODULAR_DIR
=`( cd $1 ; cd ../.. ; pwd )`
22 MODULE_DIR
=`( cd $1 ; pwd )`
23 MODULE_NAME
=`( basename $MODULE_DIR )`
24 modulename
=`echo $MODULE_NAME | tr "[:upper:]" "[:lower:]"`
25 drivername
=`echo $MODULE_NAME | sed s/xf86-video-//`
28 echo Modular dir
: $MODULAR_DIR
29 echo Module dir
: $MODULE_DIR
30 echo Name
: $MODULE_NAME
31 echo lower
: $modulename
32 echo Man dir
: $HAS_MAN_DIR
33 echo Include dir
: $HAS_INCLUDE_DIR
42 for x
in `ls man/*` ; do
47 ###############################
54 cat <<EOF >> autogen.sh
57 srcdir=\`dirname \$0\`
58 test -z "\$srcdir" && srcdir=.
63 autoreconf -v --install || exit 1
64 cd \$ORIGDIR || exit \$?
66 \$srcdir/configure --enable-maintainer-mode "\$@"
73 ###################################
75 # Generate toplevel Makefile.am
80 cat <<EOF >> Makefile.am
81 # Copyright 2005 Adam Jackson.
83 # Permission is hereby granted, free of charge, to any person obtaining a
84 # copy of this software and associated documentation files (the "Software"),
85 # to deal in the Software without restriction, including without limitation
86 # on the rights to use, copy, modify, merge, publish, distribute, sub
87 # license, and/or sell copies of the Software, and to permit persons to whom
88 # the Software is furnished to do so, subject to the following conditions:
90 # The above copyright notice and this permission notice (including the next
91 # paragraph) shall be included in all copies or substantial portions of the
94 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
95 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
96 # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
97 # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
98 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
99 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
101 AUTOMAKE_OPTIONS = foreign
104 if [ -z $man_pages ] ; then
105 echo SUBDIRS
= src
>> Makefile.am
107 echo SUBDIRS
= src man
>> Makefile.am
111 # Generate configure.ac
116 cat <<EOF >> configure.ac
117 # Copyright 2005 Adam Jackson.
119 # Permission is hereby granted, free of charge, to any person obtaining a
120 # copy of this software and associated documentation files (the "Software"),
121 # to deal in the Software without restriction, including without limitation
122 # on the rights to use, copy, modify, merge, publish, distribute, sub
123 # license, and/or sell copies of the Software, and to permit persons to whom
124 # the Software is furnished to do so, subject to the following conditions:
126 # The above copyright notice and this permission notice (including the next
127 # paragraph) shall be included in all copies or substantial portions of the
130 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
131 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
132 # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
133 # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
134 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
135 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
137 # Process this file with autoconf to produce a configure script
140 AC_INIT([xf86-video-$drivername],
142 [ajax@freedesktop.org],
143 xf86-video-$drivername)
145 AC_CONFIG_SRCDIR([Makefile.am])
146 AM_CONFIG_HEADER([config.h])
149 AM_INIT_AUTOMAKE([dist-bzip2])
153 # Checks for programs.
157 AH_TOP([#include "xorg-server.h"])
159 AC_ARG_WITH(xorg-module-dir,
160 AC_HELP_STRING([--with-xorg-module-dir=DIR],
161 [Default xorg module directory [[default=\$libdir/xorg/modules]]]),
162 [moduledir="\$withval"],
163 [moduledir="\$libdir/xorg/modules"])
166 if [ ! -z $has_dri ] ; then
167 cat <<EOF >> configure.ac
169 AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
170 [Disable DRI support [[default=auto]]]),
176 cat <<EOF >> configure.ac
177 # Checks for pkg-config packages
178 PKG_CHECK_MODULES(XORG, [xorg-server xproto])
179 sdkdir=\$(pkg-config --variable=sdkdir xorg-server)
181 # Checks for libraries.
183 # Checks for header files.
188 if [ ! -z $has_dri ] ; then
189 cat <<EOF >> configure.ac
190 if test "\$DRI" != no; then
191 AC_CHECK_FILE([\${sdkdir}/dri.h],
192 [have_dri_h="yes"], [have_dri_h="no"])
193 AC_CHECK_FILE([\${sdkdir}/sarea.h],
194 [have_sarea_h="yes"], [have_sarea_h="no"])
195 AC_CHECK_FILE([\${sdkdir}/dristruct.h],
196 [have_dristruct_h="yes"], [have_dristruct_h="no"])
199 AC_MSG_CHECKING([whether to include DRI support])
200 if test x\$DRI = xauto; then
201 if test "\$ac_cv_header_dri_h" = yes -a \\
202 "\$ac_cv_header_sarea_h" = yes -a \\
203 "\$ac_cv_header_dristruct_h" = yes; then
209 AC_MSG_RESULT([\$DRI])
211 AM_CONDITIONAL(DRI, test x\$DRI = xyes)
212 if test "\$DRI" = yes; then
213 PKG_CHECK_MODULES(DRI, [libdrm])
214 AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
215 AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
218 AC_SUBST([DRI_CFLAGS])
221 cat <<EOF >> configure.ac
222 AC_SUBST([XORG_CFLAGS])
223 AC_SUBST([moduledir])
230 if [ ! -z $man_pages ] ; then
231 cat <<EOF >> configure.ac
236 cat <<EOF >> configure.ac
240 ##############################
244 if [ ! -z $man_pages ] ; then
249 cat <<EOF >> Makefile.am
250 # Copyright 2005 Adam Jackson.
252 # Permission is hereby granted, free of charge, to any person obtaining a
253 # copy of this software and associated documentation files (the "Software"),
254 # to deal in the Software without restriction, including without limitation
255 # on the rights to use, copy, modify, merge, publish, distribute, sub
256 # license, and/or sell copies of the Software, and to permit persons to whom
257 # the Software is furnished to do so, subject to the following conditions:
259 # The above copyright notice and this permission notice (including the next
260 # paragraph) shall be included in all copies or substantial portions of the
263 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
264 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
265 # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
266 # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
267 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
268 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
273 for x
in `ls *.4` ; do
277 for x
in `ls *.4` ; do
278 if [ $x = $LAST ] ; then
279 echo \ \ \ \ \ \ \ \ \
$x >> Makefile.am
281 echo \ \ \ \ \ \ \ \ \
$x \\ >> Makefile.am
287 ############################
296 cat <<EOF >> Makefile.am
297 # Copyright 2005 Adam Jackson.
299 # Permission is hereby granted, free of charge, to any person obtaining a
300 # copy of this software and associated documentation files (the "Software"),
301 # to deal in the Software without restriction, including without limitation
302 # on the rights to use, copy, modify, merge, publish, distribute, sub
303 # license, and/or sell copies of the Software, and to permit persons to whom
304 # the Software is furnished to do so, subject to the following conditions:
306 # The above copyright notice and this permission notice (including the next
307 # paragraph) shall be included in all copies or substantial portions of the
310 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
311 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
312 # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
313 # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
314 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
315 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
318 # -module lets us name the module exactly how we want
319 # -avoid-version prevents gratuitous .0.0.0 version numbers on the end
320 # _ladir passes a dummy rpath to libtool so the thing will actually link
321 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
324 if [ ! -z $has_dri ]; then
325 cat <<EOF >> Makefile.am
326 AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@
329 cat <<EOF >> Makefile.am
330 AM_CFLAGS = @XORG_CFLAGS@
334 cat <<EOF >> Makefile.am
335 ${drivername}_drv_la_LTLIBRARIES = ${drivername}_drv.la
336 ${drivername}_drv_la_LDFLAGS = -module -avoid-version
337 ${drivername}_drv_ladir = @moduledir@/drivers
339 ${drivername}_drv_la_SOURCES = \\
342 for x
in `ls *.[ch]` ; do
346 for x
in `ls *.[ch]` ; do
347 if [ $x = $LAST ] ; then
348 echo \ \ \ \ \ \ \ \ \
$x >> Makefile.am
350 echo \ \ \ \ \ \ \ \ \
$x \\ >> Makefile.am