7 echo Usage
: $0 \
<directory\
>
12 # fixme: modular dir should
14 MODULAR_DIR
=`( cd $1 ; cd ../.. ; pwd )`
15 MODULE_DIR
=`( cd $1 ; pwd )`
16 MODULE_NAME
=`( basename $MODULE_DIR )`
17 modulename
=`echo $MODULE_NAME | tr "[:upper:]" "[:lower:]"`
19 if [ -x $MODULE_DIR/man
] ; then
25 if [ -x $MODULE_DIR/include
] ; then
32 echo Modular dir
: $MODULAR_DIR
33 echo Module dir
: $MODULE_DIR
34 echo Name
: $MODULE_NAME
35 echo lower
: $modulename
36 echo Man dir
: $HAS_MAN_DIR
37 echo Include dir
: $HAS_INCLUDE_DIR
41 # Generate build files
44 cp $MODULAR_DIR/lib
/Xfixes
/autogen.sh
$MODULAR_DIR/lib
/$MODULE_NAME
58 # Generate Makefile.am
62 cat <<EOF >> Makefile.am
64 # Copyright 2005 Red Hat, Inc.
66 # Permission to use, copy, modify, distribute, and sell this software and its
67 # documentation for any purpose is hereby granted without fee, provided that
68 # the above copyright notice appear in all copies and that both that
69 # copyright notice and this permission notice appear in supporting
70 # documentation, and that the name of Red Hat not be used in
71 # advertising or publicity pertaining to distribution of the software without
72 # specific, written prior permission. Red Hat makes no
73 # representations about the suitability of this software for any purpose. It
74 # is provided "as is" without express or implied warranty.
76 # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
77 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
78 # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
79 # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
80 # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
81 # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
82 # PERFORMANCE OF THIS SOFTWARE.
86 if [ $HAS_MAN_DIR = "yes" ] ; then
87 cat << EOF >> Makefile.am
91 cat <<EOF >> Makefile.am
96 cat <<EOF >> Makefile.am
98 pkgconfigdir = \$(libdir)/pkgconfig
99 pkgconfig_DATA = $modulename.pc
101 EXTRA_DIST = $modulename.pc.in autogen.sh
105 # Generate configure.ac
109 cat <<EOF >> $MODULE_DIR/configure.ac
111 dnl Copyright 2005 Red Hat, Inc.
113 dnl Permission to use, copy, modify, distribute, and sell this software and its
114 dnl documentation for any purpose is hereby granted without fee, provided that
115 dnl the above copyright notice appear in all copies and that both that
116 dnl copyright notice and this permission notice appear in supporting
117 dnl documentation, and that the name of Red Hat not be used in
118 dnl advertising or publicity pertaining to distribution of the software without
119 dnl specific, written prior permission. Red Hat makes no
120 dnl representations about the suitability of this software for any purpose. It
121 dnl is provided "as is" without express or implied warranty.
123 dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
124 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
125 dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
126 dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
127 dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
128 dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
129 dnl PERFORMANCE OF THIS SOFTWARE.
131 dnl Process this file with autoconf to create configure.
135 AC_INIT(lib$MODULE_NAME, 7.0.0, [sandmann@redhat.com], lib$MODULE_NAME)
136 AM_INIT_AUTOMAKE([dist-bzip2])
139 AM_CONFIG_HEADER(config.h)
145 # Check for dependencies
146 PKG_CHECK_MODULES(DEP, x11)
155 if [ $HAS_MAN_DIR = yes ] ; then
156 cat <<EOF >> configure.ac
161 cat <<EOF >> configure.ac
167 cat <<EOF > $modulename.pc.in
169 exec_prefix=@exec_prefix@
171 includedir=@includedir@
174 Description: The $MODULE_NAME Library
175 Version: @PACKAGE_VERSION@
176 Cflags: -I\${includedir} @DEP_CFLAGS@
177 Libs: -L\${libdir} -l$MODULE_NAME @DEP_LIBS@
189 cat <<EOF > Makefile.am
190 lib_LTLIBRARIES = lib$MODULE_NAME.la
192 lib${MODULE_NAME}_la_SOURCES = \
195 for x
in `ls *.[ch]` ; do
199 for x
in `ls *.[ch]`; do
200 if [ $x = $LAST ] ; then
201 echo \ \ \ \ \ \ \ \ \
$x >> Makefile.am
203 echo \ \ \ \ \ \ \ \ \
$x \\ >> Makefile.am
207 if [ $HAS_INCLUDE_DIR = yes ] ; then
209 HEADERFILE
=`find ../include -name "*.h" | head -1`
211 INCLUDE_SRC_DIR
=`dirname $HEADERFILE | sed "s/../\\$(top_srcdir)/"`
213 INCLUDE_INSTALL_DIR
=`dirname $HEADERFILE | sed "s/..\/include/\\$(includedir)/"`
215 cat <<EOF >> Makefile.am
217 INCLUDES = -I$INCLUDE_SRC_DIR
223 cat <<EOF >> Makefile.am
225 lib${MODULE_NAME}_la_LIBADD = @DEP_LIBS@
227 lib${MODULE_NAME}_la_LDFLAGS = -version-info 7:0:0 -no-undefined
232 if [ $HAS_INCLUDE_DIR = yes ] ; then
234 cat <<EOF >> Makefile.am
236 lib${MODULE_NAME}includedir = $INCLUDE_INSTALL_DIR
237 lib${MODULE_NAME}include_HEADERS = \\
240 for f
in `find ../include -name "*.h"` ; do
244 for f
in `find ../include -name "*.h"` ; do
246 NAME
=`echo $f | sed "s/../\\$(top_srcdir)/"`
248 echo -n \ \ \ \
$NAME >> Makefile.am
250 if [ $LAST = $f ] ; then
253 echo \\ >> Makefile.am
264 if [ $HAS_MAN_DIR = yes ] ; then
268 cat <<EOF > Makefile.am
269 # Copyright 2005 Red Hat, Inc.
271 # Permission to use, copy, modify, distribute, and sell this software and its
272 # documentation for any purpose is hereby granted without fee, provided that
273 # the above copyright notice appear in all copies and that both that
274 # copyright notice and this permission notice appear in supporting
275 # documentation, and that the name of Red Hat not be used in
276 # advertising or publicity pertaining to distribution of the software without
277 # specific, written prior permission. Red Hat makes no representations about
278 # the suitability of this software for any purpose. It is provided "as is" without
279 # express or implied warranty.
281 # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
282 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
283 # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
284 # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
285 # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
286 # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
287 # PERFORMANCE OF THIS SOFTWARE.
293 for x
in `ls *.3` ; do
297 for x
in `ls *.3`; do
298 if [ $x = $LAST ] ; then
299 echo \ \ \ \ \ \ \ \ \
$x >> Makefile.am
301 echo \ \ \ \ \ \ \ \ \
$x \\ >> Makefile.am
305 echo "EXTRA_DIST = \$(man3_MANS)" >> Makefile.am