3
### Copyright (C) 2002 by the KDE developers
5
### All the real work is done by the shellscript cvs.sh
5
@if grep '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \
6
echo "*** Creating acinclude.m4" ;\
7
rm -f acinclude.m4 configure.files ;\
8
$(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\
10
@echo "!!! If you get recursion errors from autoconf, it is advisable to set the"
11
@echo " environment variable M4 to something including \"--nesting-limit=500\""
12
@if test -r configure.in.in; then \
13
rm -f subdirs configure.in ;\
14
echo "*** Creating list of subdirectories" ;\
15
$(MAKE) -f Makefile.am top_srcdir=. subdirs ;\
16
echo "*** Creating configure.in" ;\
17
$(MAKE) -f Makefile.am top_srcdir=. configure.in ;\
19
@echo "*** Creating aclocal.m4"
21
@echo "*** Creating configure"
23
@if test -r configure.in.in ; then \
24
perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\
25
then\n perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\
26
|| mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\
27
\n rm -f \$$CONFIG_STATUS.bak;\nfi\
28
\n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\
30
@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
31
#David's hack for autoconf bug when $INSTALL is set
32
@perl -pi -e 'if (/\[\/\$$\]\*. INSTALL=/) { print $$_ ; $$_ = "\"\") ;;\n"; }' configure
33
@if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then \
34
echo "*** Creating config.h template" ;\
37
@echo "*** Creating Makefile templates"
39
@echo "*** Postprocessing Makefile templates"
41
@if egrep "^cvs-local:" Makefile.am >/dev/null; then \
42
$(MAKE) -f Makefile.am cvs-local ;\
44
@echo "*** Creating date/time stamp"
47
@echo " Don't forget to run ./configure"
48
@echo " If you haven't done so in a while, run ./configure --help"
51
@if grep -e '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \
52
$(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\
54
@if test -r configure.in.in; then \
55
$(MAKE) -f Makefile.am top_srcdir=. subdirs configure.in; \
59
automake --foreign --include-deps; \
62
if test -r configure.in.in ; then \
63
perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\
64
then\n perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\
65
|| mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\
66
\n rm -f \$$CONFIG_STATUS.bak;\nfi\
67
\n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\
70
if grep -e "^cvs-local:" Makefile.am >/dev/null; then \
71
$(MAKE) -f Makefile.am cvs-local ;\
73
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 ;\
75
LIST=`find ./po -name "*.po"`; \
77
file2=`echo $$i | sed -e "s#\.po#\.gmo#"`; \
78
msgfmt -o $$file2 $$i || touch $$file2; \
81
@if grep -e "^cvs-dist-local:" Makefile.am >/dev/null; then \
82
$(MAKE) -f Makefile.am cvs-dist-local ;\
86
@if test ! -d CVS; then \
87
echo "You don't have a toplevel CVS directory."; \
88
echo "You most certainly didn't use cvs to get these sources."; \
89
echo "But this function depends on cvs's information."; \
93
dirs=`find . -type d | grep -v CVS | sed -e "s#^./##"` ;\
95
if test ! -d "$$pwd/$$i/CVS"; then \
102
if test ! -d "$$f"; then \
103
if grep "^/$$f/" CVS/Entries > /dev/null; then \
107
rm -f "$$pwd/$$i/$$f"; \
9
cvs dist cvs-clean configure.in configure.files subdirs package-messages package-merge:
10
@admindir=$(admindir); \
11
if test "x$$admindir" = x; then \
12
admindir=.; until test -f $$admindir/admin/cvs.sh; do \
13
admindir=$$admindir/..; \
14
if test `cd $$admindir && pwd` = / ; then break; fi; \
114
# The Makefiles have to be sorted for slashes, since configure creates
115
# only one directory per Makefile not the whole hierarchy
16
admindir=$$admindir/admin; \
17
if test -f $$admindir/cvs.sh; then :; else \
18
echo "Can't find the admin/ directory in any parent of the"; \
19
echo "current directory. Please set it with admindir=..."; \
23
if test "$@" = "package-merge"; then \
24
MAKE=$(MAKE) POFILES="$(POFILES)" PACKAGE="$(PACKAGE)" \
25
$(SHELL) $$admindir/cvs.sh package-merge ;\
26
else MAKE=$(MAKE) $(SHELL) $$admindir/cvs.sh $@ ;\
116
29
configure.in: configure.files $(shell test -f configure.files && cat configure.files) subdirs
117
@rm -f configure.in configure.in.new ;\
118
cat `cat configure.files | egrep -v "^configure.in.bot"` >> configure.in.new ;\
119
echo "KDE_CREATE_SUBDIRSLIST" >> configure.in.new ;\
120
echo "AC_OUTPUT( \\" >> configure.in.new ;\
121
mfs=`find . -type d -print | fgrep -v "/." | sed -e "s#\./##" -e "/^debian/d" | sort`; \
123
topleveldir=`echo $$i| sed -e "s#/.*##"`; \
124
if test -f $$topleveldir/configure.in; then \
127
if test ! -f $$i/Makefile.am; then \
130
if test -s inst-apps; then \
131
if test -z "`grep \"^$$topleveldir\" inst-apps`"; then \
135
echo "$$i/Makefile \\" >> configure.in.new ;\
137
egrep '^dnl AC_OUTPUT\(.*\)' `cat configure.files` | sed -e "s#^.*dnl AC_OUTPUT(\(.*\))#\1 \\\\#" >> configure.in.new ;\
138
echo ")" >> configure.in.new
140
if test -f configure.in.in; then \
141
if head -2 configure.in.in | egrep "^#MIN_CONFIG$$" > /dev/null; then \
142
line=`egrep "^AM_INIT_AUTOMAKE\(" configure.in.in` ;\
143
if test -n "$$line"; then \
144
modulename=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE(\([^,]*\),.*#\1#"` ;\
145
VERSION=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE([^,]*, *\([^)]*\)).*#\1#"` ;\
147
sed -e "s#AM_INIT_AUTOMAKE([^@].*#dnl PACKAGE set before#" configure.in.new > configure.in \
148
&& mv configure.in configure.in.new ;\
151
if test -z "$$modulename" || test "$$modulename" = "@MODULENAME@"; then \
152
modulename=`pwd`; modulename=`basename $$modulename`; \
154
if test -z "$$VERSION" || test "$$VERSION" = "@VERSION@"; then \
155
VERSION="\"2.90\""; \
157
sed -e "s#@MODULENAME@#$$modulename#" configure.in.new | \
158
sed -e "s#@VERSION@#$$VERSION#" > configure.in
159
@if test -f configure.in.bot ; then cat configure.in.bot >> configure.in ; fi
160
@rm -f configure.in.new
162
30
configure.files: subdirs
164
for i in . .. ../.. ../../..; do \
165
if test -x $$i/admin; then admindir=$$i/admin; break; fi; \
167
rm -rf configure.files ;\
168
if test -f configure.in.in && head -2 configure.in.in | egrep "^#MIN_CONFIG$$" > /dev/null; then \
169
echo $$admindir/configure.in.min >> configure.files ;\
171
@test -f configure.in.in && echo configure.in.in >> configure.files
172
@list=`find . -name "configure.in.in" | sort`; \
173
for i in $$list; do if test -f $$i && test ! `dirname $$i` = "." ; then \
174
echo $$i >> configure.files ;\
176
@if test -f configure.in.mid ; then echo configure.in.mid >> configure.files ; fi
177
@if test -f configure.in.bot ; then echo configure.in.bot >> configure.files ; fi
180
@files=`ls -1 | sort`; \
185
compilefirst=`grep '^COMPILE_FIRST[ ]*=' Makefile.am | \
186
sed -e 's#^COMPILE_FIRST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\
187
compilelast=`grep '^COMPILE_LAST[ ]*=' Makefile.am | \
188
sed -e 's#^COMPILE_LAST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\
189
for i in $$files; do if test -d $$i; then \
190
if test -f $$i/Makefile.am; then \
191
if echo $$compilefirst | grep "|$$i|" >/dev/null; then \
192
first_dirs="$$first_dirs $$i" ;\
193
elif echo $$compilelast | grep "|$$i|" >/dev/null; then \
194
last_dirs="$$last_dirs $$i" ; \
195
else dirs="$$dirs $$i" ;\
201
for i in $$dirs; do \
202
echo $$i >> ./SUBDIRS; \
204
@if test -r subdirs && diff subdirs SUBDIRS > /dev/null; then \
207
@test -r SUBDIRS && mv SUBDIRS subdirs || true
210
@catalogs='$(POFILES)'; \
211
for cat in $$catalogs; do \
213
msgmerge -o $$cat.new $$cat $(PACKAGE).pot ; \
214
if test -s $$cat.new; then \
215
grep -v "\"POT-Creation" $$cat.new > $$cat.new.2 ; \
216
grep -v "\"POT-Creation" $$cat >> $$cat.new.1; \
217
if diff $$cat.new.1 $$cat.new.2; then \
220
mv $$cat.new $$cat ; \
222
rm -f $$cat.new.1 $$cat.new.2 ;\
230
for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \
231
egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > po.backup/$$i ; \
232
cp po/$$i po.backup/backup_$$i ; \
233
touch -r po/$$i po.backup/backup_$$i ;\
236
@podir=$${podir:-$$PWD/po} ;\
237
files=`find . -name Makefile.am | xargs egrep -l '^messages:' `; \
238
dirs=`for i in $$files; do echo \`dirname $$i\`; done`; \
239
tmpname="$$PWD/messages.log" ;\
240
if test -z "$$EXTRACTRC"; then EXTRACTRC=extractrc ; fi ;\
241
if test -z "$$PREPARETIPS"; then PREPARETIPS=preparetips ; fi ;\
242
export EXTRACTRC PREPARETIPS ;\
243
for subdir in $$dirs; do \
244
test -z "$$VERBOSE" || echo "Making messages in $$subdir"; \
246
if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then \
247
$$EXTRACTRC *.rc *.ui > rc.cpp ;\
249
candidates=`ls -1 *.rc *.ui 2>/dev/null` ;\
250
if test -n "$$candidates"; then \
251
echo "$$subdir has *.rc or *.ui files, but not correct messages line" ;\
254
if test -n "`grep -r KAboutData *.c* *.C* 2>/dev/null`"; then \
255
echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp ;\
256
else echo " " > _translatorinfo.cpp ;\
258
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 ;\
259
$(MAKE) -s -f _transMakefile podir=$$podir EXTRACTRC="$$EXTRACTRC" PREPARETIPS="$$PREPARETIPS" \
260
XGETTEXT="$${XGETTEXT:-xgettext} -C -ki18n \
261
-kI18N_NOOP -ktranslate -kaliasLocale \
262
-x $${includedir:-$$KDEDIR/include}/kde.pot" \
263
messages ) >$$tmpname 2>&1 ;\
264
test -s $$tmpname && (echo $$subdir ; cat $$tmpname) ;\
265
test ! -f $$subdir/rc.cpp || rm -f $$subdir/rc.cpp ;\
266
rm -f $$subdir/_translatorinfo.cpp ;\
267
rm -f $$subdir/_transMakefile ;\
270
@for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v '^backup_'`; do \
271
if test ! -f po/$$i; then echo "disappeared: $$i"; fi ;\
273
@for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \
274
egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > temp.pot ;\
275
if test -f po.backup/$$i && test -n "`diff temp.pot po.backup/$$i`"; then \
276
echo "will update $$i"; \
277
msgmerge -q po.backup/backup_$$i po/$$i > temp.pot ;\
278
mv temp.pot po/$$i; \
280
if test -f po.backup/backup_$$i; then \
281
test -z "$$VERBOSE" || echo "I'm restoring $$i" ;\
282
mv po.backup/backup_$$i po/$$i; \
285
echo "will add $$i" ;\
293
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
34
.PHONY: cvs dist cvs-clean package-merge package-messages