5
if test -x /usr/bin/autoconf2.50 ; then \
6
AUTOCONF="/usr/bin/autoconf2.50" ;\
10
AUTOCONF_VERSION=`$$AUTOCONF --version` ;\
11
if test "x$$AUTOCONF_VERSION" = "xAutoconf version 2.13"; then \
12
echo "*** YOU'RE USING AUTOCONF 2.13. We suggest updating." ;\
13
echo "*** autoconf 2.5x works best for now, we will drop" ;\
14
echo "*** support for autoconf 2.13 soon."; \
15
test ! -f admin/libtool.m4.in || mv admin/libtool.m4.in admin/new-libtool.m4.in ;\
16
test ! -f admin/ltmain.sh || mv admin/ltmain.sh admin/new-ltmain.sh ;\
17
for file in libtool.m4.in ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh ltconfig ltmain.sh; do \
19
ln -s old-$$file admin/$$file ;\
22
@if grep '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \
23
echo "*** Creating acinclude.m4" ;\
24
rm -f acinclude.m4 configure.files ;\
25
$(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\
27
@echo "!!! If you get recursion errors from autoconf, it is advisable to set the"
28
@echo " environment variable M4 to something including \"--nesting-limit=500\""
29
@if test -r configure.in.in; then \
30
rm -f subdirs configure.in ;\
31
echo "*** Creating list of subdirectories" ;\
32
$(MAKE) -f Makefile.am top_srcdir=. subdirs ;\
33
echo "*** Creating configure.in" ;\
34
$(MAKE) -f Makefile.am top_srcdir=. configure.in ;\
36
@echo "*** Creating aclocal.m4"
38
@echo "*** Creating configure"
40
@if test -r configure.in.in ; then \
41
perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\
42
then\n perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\
43
|| mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\
44
\n rm -f \$$CONFIG_STATUS.bak;\nfi\
45
\n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\
47
@if grep '} \$$ac_kw foo' configure >/dev/null 2>&1; then perl -p -i -e "s/ac_kw foo/ac_kw int foo/" configure; fi
48
#David's hack for autoconf bug when $INSTALL is set
49
@perl -pi -e 'if (/\[\/\$$\]\*. INSTALL=/) { print $$_ ; $$_ = "\"\") ;;\n"; }' configure
50
@if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then \
51
echo "*** Creating config.h template" ;\
54
@echo "*** Creating Makefile templates"
56
@echo "*** Postprocessing Makefile templates"
58
@if egrep "^cvs-local:" Makefile.am >/dev/null; then \
59
$(MAKE) -f Makefile.am cvs-local ;\
61
@echo "*** Creating date/time stamp"
64
@echo " Don't forget to run ./configure"
65
@echo " If you haven't done so in a while, run ./configure --help"
68
@if grep -e '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \
69
$(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\
71
@if test -r configure.in.in; then \
72
$(MAKE) -f Makefile.am top_srcdir=. subdirs configure.in; \
76
automake --foreign --include-deps; \
79
if test -r configure.in.in ; then \
80
perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\
81
then\n perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\
82
|| mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\
83
\n rm -f \$$CONFIG_STATUS.bak;\nfi\
84
\n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\
87
if grep -e "^cvs-local:" Makefile.am >/dev/null; then \
88
$(MAKE) -f Makefile.am cvs-local ;\
90
if grep "ac_kw foo" configure >/dev/null 2>&1; then perl -p -i -e "s/ac_kw foo/ac_kw int foo/" configure; fi ;\
92
LIST=`find ./po -name "*.po"`; \
94
file2=`echo $$i | sed -e "s#\.po#\.gmo#"`; \
95
msgfmt -o $$file2 $$i || touch $$file2; \
98
@if grep -e "^cvs-dist-local:" Makefile.am >/dev/null; then \
99
$(MAKE) -f Makefile.am cvs-dist-local ;\
103
@if test ! -d CVS; then \
104
echo "You don't have a toplevel CVS directory."; \
105
echo "You most certainly didn't use cvs to get these sources."; \
106
echo "But this function depends on cvs's information."; \
115
if (opendir (DIR, $$fn)) { \
116
for my $$efn (grep (!/^\.\.?$$/, readdir (DIR))) { \
117
&rmrf ($$fn."/".$$efn); \
129
my ($$indir, $$incvs) = @_; \
130
for my $$n (keys (%$$incvs)) { delete $$$$indir{$$n} } \
131
return sort (keys (%$$indir)); \
137
my (%dirsdir, %filesdir, %dirscvs, %filescvs); \
138
my $$dnam = $$dir ? $$dir : "."; \
139
if (!opendir (DIR, $$dnam)) { \
140
print STDERR "Cannot enter \"".$$dnam."\".\n"; \
143
for my $$fn (grep (!/^\.\.?$$/, readdir (DIR))) { \
144
if (-d $$dir.$$fn) { \
145
$$fn eq "CVS" or $$dirsdir{$$fn} = 1; \
147
$$filesdir{$$fn} = 1; \
151
if (!open (FILE, "<".$$dir."CVS/Entries")) { \
152
print STDERR "No CVS information in \"".$$dnam."\".\n"; \
156
m%^D/([^/]+)/.*$$% and $$dirscvs{$$1} = 1; \
157
m%^/([^/]+)/.*$$% and $$filescvs{$$1} = 1; \
160
if (open (FILE, "<".$$dir."CVS/Entries.Log")) { \
162
m%^A D/([^/]+)/.*$$% and $$dirscvs{$$1} = 1; \
163
m%^A /([^/]+)/.*$$% and $$filescvs{$$1} = 1; \
164
m%^R D/([^/]+)/.*$$% and delete $$dirscvs{$$1}; \
165
m%^R /([^/]+)/.*$$% and delete $$filescvs{$$1}; \
169
for my $$fn (&newfiles (\%filesdir, \%filescvs)) { \
170
print ("F ".$$dir.$$fn."\n"); \
171
&rmrf ($$dir.$$fn); \
173
for my $$fn (&newfiles (\%dirsdir, \%dirscvs)) { \
174
print ("D ".$$dir.$$fn."\n"); \
175
&rmrf ($$dir.$$fn); \
177
for my $$fn (sort (keys (%dirscvs))) { \
178
&cvsclean ($$dir.$$fn."/"); \
185
# The Makefiles have to be sorted for slashes, since configure creates
186
# only one directory per Makefile not the whole hierarchy
187
configure.in: configure.files $(shell test -f configure.files && cat configure.files) subdirs
188
@rm -f configure.in configure.in.new ;\
189
kde_use_qt_param= ; \
190
cat `cat configure.files | egrep -v "^configure.in.bot"` >> configure.in.new ;\
191
echo "KDE_CREATE_SUBDIRSLIST" >> configure.in.new ;\
192
echo "AC_OUTPUT( \\" >> configure.in.new ;\
193
mfs=`find . -type d -print | fgrep -v "/." | sed -e "s#\./##" -e "/^debian/d" | sort`; \
195
topleveldir=`echo $$i| sed -e "s#/.*##"`; \
196
if test -f $$topleveldir/configure.in; then \
199
if test ! -f $$i/Makefile.am; then \
202
if test -s inst-apps; then \
203
if test -z "`grep \"^$$topleveldir\" inst-apps`"; then \
207
echo "$$i/Makefile \\" >> configure.in.new ;\
209
egrep '^dnl AC_OUTPUT\(.*\)' `cat configure.files` | sed -e "s#^.*dnl AC_OUTPUT(\(.*\))#\1 \\\\#" >> configure.in.new ;\
210
echo ")" >> configure.in.new
212
if test -f configure.in.in; then \
213
if head -2 configure.in.in | egrep "^#MIN_CONFIG\(.*\)$$" > /dev/null; then \
214
line=`egrep "^#MIN_CONFIG\(" configure.in.in` ;\
215
if test -n "$$line"; then \
216
kde_use_qt_param=`echo $$line | sed -e "s/#MIN_CONFIG(\(.*\))/\1/"` ;\
219
if head -2 configure.in.in | egrep "^#MIN_CONFI(G|G\(.*\))$$" > /dev/null; then \
220
line=`egrep "^AM_INIT_AUTOMAKE\(" configure.in.in` ;\
221
if test -n "$$line"; then \
222
modulename=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE(\([^,]*\),.*#\1#"` ;\
223
VERSION=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE([^,]*, *\([^)]*\)).*#\1#"` ;\
225
sed -e "s#AM_INIT_AUTOMAKE([^@].*#dnl PACKAGE set before#" configure.in.new > configure.in \
226
&& mv configure.in configure.in.new ;\
229
if test -z "$$modulename" || test "$$modulename" = "@MODULENAME@"; then \
230
modulename=`pwd`; modulename=`basename $$modulename`; \
232
if test -z "$$VERSION" || test "$$VERSION" = "@VERSION@"; then \
233
VERSION="\"3.0.3\""; \
235
if test -n "$$kde_use_qt_param"; then \
236
sed -e "s#^dnl KDE_USE_QT#KDE_USE_QT($$kde_use_qt_param)#" configure.in.new > configure.in \
237
&& mv configure.in configure.in.new ;\
239
sed -e "s#@MODULENAME@#$$modulename#" configure.in.new | \
240
sed -e "s#@VERSION@#$$VERSION#" > configure.in
241
@if test -f configure.in.bot ; then cat configure.in.bot >> configure.in ; fi
242
@rm -f configure.in.new
244
configure.files: subdirs
246
for i in . .. ../.. ../../..; do \
247
if test -x $$i/admin; then admindir=$$i/admin; break; fi; \
249
rm -rf configure.files ;\
250
if test -f configure.in.in && head -2 configure.in.in | egrep "^#MIN_CONFI(G|G\(.*\))$$" > /dev/null; then \
251
echo $$admindir/configure.in.min >> configure.files ;\
253
@test -f configure.in.in && echo configure.in.in >> configure.files
254
@list=`find . -name "configure.in.in" | sort`; \
255
for i in $$list; do if test -f $$i && test ! `dirname $$i` = "." ; then \
256
echo $$i >> configure.files ;\
258
@if test -f configure.in.mid ; then echo configure.in.mid >> configure.files ; fi
259
@if test -f configure.in.bot ; then echo configure.in.bot >> configure.files ; fi
262
@files=`ls -1 | sort`; \
267
compilefirst=`grep '^COMPILE_FIRST[ ]*=' Makefile.am | \
268
sed -e 's#^COMPILE_FIRST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\
269
compilelast=`grep '^COMPILE_LAST[ ]*=' Makefile.am | \
270
sed -e 's#^COMPILE_LAST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\
271
for i in $$files; do if test -d $$i; then \
272
if test -f $$i/Makefile.am; then \
273
if echo $$compilefirst | grep "|$$i|" >/dev/null; then \
274
first_dirs="$$first_dirs $$i" ;\
275
elif echo $$compilelast | grep "|$$i|" >/dev/null; then \
276
last_dirs="$$last_dirs $$i" ; \
277
else dirs="$$dirs $$i" ;\
283
for i in $$dirs; do \
284
echo $$i >> ./_SUBDIRS; \
286
@if test -r subdirs && diff subdirs _SUBDIRS > /dev/null; then \
289
@test -r _SUBDIRS && mv _SUBDIRS subdirs || true
292
@catalogs='$(POFILES)'; \
293
for cat in $$catalogs; do \
295
msgmerge -o $$cat.new $$cat $(PACKAGE).pot ; \
296
if test -s $$cat.new; then \
297
grep -v "\"POT-Creation" $$cat.new > $$cat.new.2 ; \
298
grep -v "\"POT-Creation" $$cat >> $$cat.new.1; \
299
if diff $$cat.new.1 $$cat.new.2; then \
302
mv $$cat.new $$cat ; \
304
rm -f $$cat.new.1 $$cat.new.2 ;\
312
for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \
313
egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > po.backup/$$i ; \
314
cp po/$$i po.backup/backup_$$i ; \
315
touch -r po/$$i po.backup/backup_$$i ;\
318
@podir=$${podir:-$$PWD/po} ;\
319
files=`find . -name Makefile.am | xargs egrep -l '^messages:' `; \
320
dirs=`for i in $$files; do echo \`dirname $$i\`; done`; \
321
tmpname="$$PWD/messages.log" ;\
322
if test -z "$$EXTRACTRC"; then EXTRACTRC=extractrc ; fi ;\
323
if test -z "$$PREPARETIPS"; then PREPARETIPS=preparetips ; fi ;\
324
export EXTRACTRC PREPARETIPS ;\
325
for subdir in $$dirs; do \
326
test -z "$$VERBOSE" || echo "Making messages in $$subdir"; \
328
if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then \
329
$$EXTRACTRC *.rc *.ui > rc.cpp ;\
331
candidates=`ls -1 *.rc *.ui 2>/dev/null` ;\
332
if test -n "$$candidates"; then \
333
echo "$$subdir has *.rc or *.ui files, but not correct messages line" ;\
336
if test -n "`grep -r KAboutData *.c* *.C* 2>/dev/null`"; then \
337
echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp ;\
338
else echo " " > _translatorinfo.cpp ;\
340
perl -e '$$mes=0; while (<STDIN>) { if (/^messages:/) { $$mes=1; print $$_; next; } if ($$mes) { if (/$$\\(XGETTEXT\)/ && / -o/) { s/ -o \$$\(podir\)/ _translatorinfo.cpp -o \$$\(podir\)/ } print $$_; } else { print $$_; } }' < Makefile.am > _transMakefile ;\
341
$(MAKE) -s -f _transMakefile podir=$$podir EXTRACTRC="$$EXTRACTRC" PREPARETIPS="$$PREPARETIPS" \
342
XGETTEXT="$${XGETTEXT:-xgettext} -C -ki18n -ktr2i18n \
343
-kI18N_NOOP -ktranslate -kaliasLocale \
344
-x $${includedir:-$$KDEDIR/include}/kde.pot" \
345
messages ) 2>&1 | grep -v '^make\[1\]' > $$tmpname; \
346
test -s $$tmpname && (echo $$subdir ; cat $$tmpname) ;\
347
test ! -f $$subdir/rc.cpp || rm -f $$subdir/rc.cpp ;\
348
rm -f $$subdir/_translatorinfo.cpp ;\
349
rm -f $$subdir/_transMakefile ;\
352
@for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v '^backup_'`; do \
353
if test ! -f po/$$i; then echo "disappeared: $$i"; fi ;\
355
@for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \
356
msgmerge -q -o po/$$i po/$$i po/$$i ;\
357
egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > temp.pot ;\
358
if test -f po.backup/$$i && test -n "`diff temp.pot po.backup/$$i`"; then \
359
echo "will update $$i"; \
360
msgmerge -q po.backup/backup_$$i po/$$i > temp.pot ;\
361
mv temp.pot po/$$i; \
363
if test -f po.backup/backup_$$i; then \
364
test -z "$$VERBOSE" || echo "I'm restoring $$i" ;\
365
mv po.backup/backup_$$i po/$$i; \
368
echo "will add $$i" ;\
376
perl -e '$$mes=0; while (<STDIN>) { if (/^messages:/) { $$mes=1; print $$_; next; } if ($$mes) { if (! /^\t/) { exit(0); } if (/$$\\(XGETTEXT\)/ && / -o/) { s/ -o/ _translatorinfo.cpp -o/ } print $$_; } }' < Makefile.am
380
.PHONY: cvs test dist cvs-clean package-merge package-messages