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