rpm: added fc14 support
[barry/progweb.git] / buildgen.sh
blob2836a24f48527a8cbb5cf31a60bf4c747ad32628
1 #!/bin/sh
3 libtoolit() {
4 # Different name on the Mac
5 libtoolize --force --copy || glibtoolize --force --copy
8 doconf() {
9 aclocal -I $1 && \
10 autoheader && \
11 automake --add-missing --copy --foreign && \
12 autoconf
15 cleangettext() {
16 rm -f ABOUT-NLS \
17 m4/codeset.m4 \
18 m4/gettext.m4 \
19 m4/glibc2.m4 \
20 m4/glibc21.m4 \
21 m4/iconv.m4 \
22 m4/intdiv0.m4 \
23 m4/intl.m4 \
24 m4/intldir.m4 \
25 m4/intlmacosx.m4 \
26 m4/intmax.m4 \
27 m4/inttypes-pri.m4 \
28 m4/inttypes_h.m4 \
29 m4/lcmessage.m4 \
30 m4/lib-ld.m4 \
31 m4/lib-link.m4 \
32 m4/lib-prefix.m4 \
33 m4/lock.m4 \
34 m4/longlong.m4 \
35 m4/nls.m4 \
36 m4/po.m4 \
37 m4/printf-posix.m4 \
38 m4/progtest.m4 \
39 m4/size_max.m4 \
40 m4/stdint_h.m4 \
41 m4/uintmax_t.m4 \
42 m4/visibility.m4 \
43 m4/wchar_t.m4 \
44 m4/wint_t.m4 \
45 m4/xsize.m4 \
46 m4/libtool.m4 \
47 m4/ltoptions.m4 \
48 m4/ltsugar.m4 \
49 m4/ltversion.m4 \
50 m4/lt~obsolete.m4 \
51 po/Makefile.in.in \
52 po/Makevars.template \
53 po/fr.gmo \
54 po/stamp-po
58 # Generates the build system.
61 if [ "$1" = "cleanall" ] ; then
62 make distclean
63 (cd gui && make distclean)
64 (cd desktop && make distclean)
65 (cd opensync-plugin && make distclean)
66 (cd opensync-plugin-0.4x && make distclean)
67 ./buildgen.sh clean
68 (cd gui && ./buildgen.sh clean)
69 (cd desktop && ./buildgen.sh clean)
70 (cd opensync-plugin && ./buildgen.sh clean)
71 (cd opensync-plugin-0.4x && ./buildgen.sh clean)
72 cleangettext
73 (cd gui && cleangettext)
74 elif [ "$1" = "clean" ] ; then
75 rm -rf autom4te.cache
76 rm -f Makefile.in aclocal.m4 config.guess config.h.in config.sub \
77 configure depcomp install-sh ltmain.sh missing \
78 src/Makefile.in tools/Makefile.in examples/Makefile.in \
79 man/Makefile.in test/Makefile.in INSTALL config.h.in~ compile
80 # clean up Debian build trails
81 rm -rf debian/barry
82 rm -f build-arch-stamp build-indep-stamp configure-stamp \
83 debian/barry.substvars debian/files \
84 tools/bcharge
85 # clean up ctags trails
86 rm -f src/tags tools/tags examples/tags \
87 gui/src/tags \
88 desktop/src/tags \
89 opensync-plugin/src/tags \
90 opensync-plugin-0.4x/src/tags
91 elif [ "$1" = "ctags" ] ; then
92 echo "Building ctags..."
93 (cd src && ctags -R)
94 (cd tools && ctags -R)
95 (cd examples && ctags -R)
96 (cd gui/src && ctags -R)
97 (cd desktop/src && ctags -R)
98 if [ "$2" = "0.22" ] ; then
99 (cd opensync-plugin/src && ctags -R)
101 if [ "$2" = "0.4x" ] ; then
102 (cd opensync-plugin-0.4x/src && ctags -R)
104 # and one with everything
105 ctags -R -f ~/tags-barry --tag-relative=yes
107 if [ "$2" = "0.22" ] ; then
108 # add opensync library as well (yes, I know this only works for my
109 # setup... sorry) :-)
110 #OS_DIR=~/software/opensync/svn
111 OS_DIR=~/software/opensync/0.22
112 if [ -d $OS_DIR ] ; then
113 echo "Detected 0.22 opensync source tree, building ctags on it..."
114 (cd $OS_DIR && ctags -R -a -f ~/tags-barry --tag-relative=yes)
118 if [ "$2" = "0.4x" ] ; then
119 OS_DIR=~/software/opensync/git
120 if [ -d $OS_DIR ] ; then
121 echo "Detected 0.4x opensync source tree, building ctags on it..."
122 (cd $OS_DIR && ctags -R -a -f ~/tags-barry --tag-relative=yes)
125 else
126 #autoreconf -if --include=config
127 #autoreconf -ifv --include=config
129 # Autogenerate the gettext PO support files
130 # Do this for ./ and gui/
131 autopoint
132 (cd gui && autopoint)
134 # If we let autoreconf do this, it will run libtoolize after
135 # creating some or all of the configure files. For example,
136 # it might copy files into ../m4 again while processing the
137 # opensync-plugin/ directory, making those files newer than
138 # the gui/configure file. This will cause configure to
139 # be regenerated (incorrectly) during the make step on some
140 # systems (Fedora 11).
142 # So... we do the libtool stuff all at once at the beginning,
143 # then the rest.
144 libtoolit m4
145 (cd gui && libtoolit m4)
146 # note that gui gets its own m4 via autopoint, while
147 # desktop does not use it
148 (cd desktop && libtoolit ../m4)
149 # the plugins always have their own m4's
150 (cd opensync-plugin && libtoolit m4)
151 (cd opensync-plugin-0.4x && libtoolit m4)
153 # Now for aclocal, autoheader, automake, and autoconf
154 doconf m4
155 (cd gui && doconf m4)
156 (cd desktop && doconf ../m4)
157 (cd opensync-plugin && doconf m4)
158 (cd opensync-plugin-0.4x && doconf m4)