joachim99@2: joachim99@2: SHELL=/bin/sh joachim99@2: joachim99@2: cvs: joachim99@2: @if grep '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \ joachim99@2: echo "*** Creating acinclude.m4" ;\ joachim99@2: rm -f acinclude.m4 configure.files ;\ joachim99@2: $(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\ joachim99@2: fi joachim99@2: @echo "!!! If you get recursion errors from autoconf, it is advisable to set the" joachim99@2: @echo " environment variable M4 to something including \"--nesting-limit=500\"" joachim99@2: @if test -r configure.in.in; then \ joachim99@2: rm -f subdirs configure.in ;\ joachim99@2: echo "*** Creating list of subdirectories" ;\ joachim99@2: $(MAKE) -f Makefile.am top_srcdir=. subdirs ;\ joachim99@2: echo "*** Creating configure.in" ;\ joachim99@2: $(MAKE) -f Makefile.am top_srcdir=. configure.in ;\ joachim99@2: fi joachim99@2: @echo "*** Creating aclocal.m4" joachim99@2: @aclocal joachim99@2: @echo "*** Creating configure" joachim99@2: @autoconf joachim99@2: @if test -r configure.in.in ; then \ joachim99@2: perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\ joachim99@2: then\n perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\ joachim99@2: || mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\ joachim99@2: \n rm -f \$$CONFIG_STATUS.bak;\nfi\ joachim99@2: \n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\ joachim99@2: fi joachim99@2: @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 joachim99@2: #David's hack for autoconf bug when $INSTALL is set joachim99@2: @perl -pi -e 'if (/\[\/\$$\]\*. INSTALL=/) { print $$_ ; $$_ = "\"\") ;;\n"; }' configure joachim99@2: @if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then \ joachim99@2: echo "*** Creating config.h template" ;\ joachim99@2: autoheader ;\ joachim99@2: fi joachim99@2: @echo "*** Creating Makefile templates" joachim99@2: @automake joachim99@2: @echo "*** Postprocessing Makefile templates" joachim99@2: @perl admin/am_edit joachim99@2: @if egrep "^cvs-local:" Makefile.am >/dev/null; then \ joachim99@2: $(MAKE) -f Makefile.am cvs-local ;\ joachim99@2: fi joachim99@2: @echo "*** Creating date/time stamp" joachim99@2: @touch stamp-h.in joachim99@2: @echo "*** Finished" joachim99@2: @echo " Don't forget to run ./configure" joachim99@2: @echo " If you haven't done so in a while, run ./configure --help" joachim99@2: joachim99@2: dist: joachim99@2: @if grep -e '$$(top_srcdir)/acinclude.m4:' Makefile.am >/dev/null; then \ joachim99@2: $(MAKE) -f Makefile.am top_srcdir=. acinclude.m4 ;\ joachim99@2: fi joachim99@2: @if test -r configure.in.in; then \ joachim99@2: $(MAKE) -f Makefile.am top_srcdir=. subdirs configure.in; \ joachim99@2: fi ;\ joachim99@2: aclocal; \ joachim99@2: autoheader; \ joachim99@2: automake --foreign --include-deps; \ joachim99@2: perl admin/am_edit; \ joachim99@2: autoconf; \ joachim99@2: if test -r configure.in.in ; then \ joachim99@2: perl -pi -e 'print "if test \"x\$$with_fast_perl\" = \"xyes\" ;\ joachim99@2: then\n perl -i.bak \$$ac_aux_dir/conf.change.pl \$$CONFIG_STATUS\ joachim99@2: || mv \$$CONFIG_STATUS.bak \$$CONFIG_STATUS;\ joachim99@2: \n rm -f \$$CONFIG_STATUS.bak;\nfi\ joachim99@2: \n" if /^\s*chmod\s+.*\+x\s+.*CONFIG_STATUS/;' configure ;\ joachim99@2: fi ;\ joachim99@2: touch stamp-h.in; \ joachim99@2: if grep -e "^cvs-local:" Makefile.am >/dev/null; then \ joachim99@2: $(MAKE) -f Makefile.am cvs-local ;\ joachim99@2: fi ;\ joachim99@2: 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 ;\ joachim99@2: if test -d po; then \ joachim99@2: LIST=`find ./po -name "*.po"`; \ joachim99@2: for i in $$LIST; do \ joachim99@2: file2=`echo $$i | sed -e "s#\.po#\.gmo#"`; \ joachim99@2: msgfmt -o $$file2 $$i || touch $$file2; \ joachim99@2: done ;\ joachim99@2: fi joachim99@2: @if grep -e "^cvs-dist-local:" Makefile.am >/dev/null; then \ joachim99@2: $(MAKE) -f Makefile.am cvs-dist-local ;\ joachim99@2: fi joachim99@2: joachim99@2: cvs-clean: joachim99@2: @if test ! -d CVS; then \ joachim99@2: echo "You don't have a toplevel CVS directory."; \ joachim99@2: echo "You most certainly didn't use cvs to get these sources."; \ joachim99@2: echo "But this function depends on cvs's information."; \ joachim99@2: exit 1; \ joachim99@2: fi; \ joachim99@2: perl -e '\ joachim99@2: sub rmrf() \ joachim99@2: { \ joachim99@2: my $$fn = shift; \ joachim99@2: lstat ($$fn); \ joachim99@2: if (-d _) { \ joachim99@2: if (opendir (DIR, $$fn)) { \ joachim99@2: for my $$efn (grep (!/^\.\.?$$/, readdir (DIR))) { \ joachim99@2: &rmrf ($$fn."/".$$efn); \ joachim99@2: } \ joachim99@2: closedir (DIR); \ joachim99@2: rmdir ($$fn); \ joachim99@2: } \ joachim99@2: } else { \ joachim99@2: unlink ($$fn); \ joachim99@2: } \ joachim99@2: } \ joachim99@2: \ joachim99@2: sub newfiles() \ joachim99@2: { \ joachim99@2: my ($$indir, $$incvs) = @_; \ joachim99@2: for my $$n (keys (%$$incvs)) { delete $$$$indir{$$n} } \ joachim99@2: return sort (keys (%$$indir)); \ joachim99@2: } \ joachim99@2: \ joachim99@2: sub cvsclean() \ joachim99@2: { \ joachim99@2: my $$dir = shift; \ joachim99@2: my (%dirsdir, %filesdir, %dirscvs, %filescvs); \ joachim99@2: my $$dnam = $$dir ? $$dir : "."; \ joachim99@2: if (!opendir (DIR, $$dnam)) { \ joachim99@2: print STDERR "Cannot enter \"".$$dnam."\".\n"; \ joachim99@2: return; \ joachim99@2: } \ joachim99@2: for my $$fn (grep (!/^\.\.?$$/, readdir (DIR))) { \ joachim99@2: if (-d $$dir.$$fn) { \ joachim99@2: $$fn eq "CVS" or $$dirsdir{$$fn} = 1; \ joachim99@2: } else { \ joachim99@2: $$filesdir{$$fn} = 1; \ joachim99@2: } \ joachim99@2: } \ joachim99@2: closedir (DIR); \ joachim99@2: if (!open (FILE, "<".$$dir."CVS/Entries")) { \ joachim99@2: print STDERR "No CVS information in \"".$$dnam."\".\n"; \ joachim99@2: return; \ joachim99@2: } \ joachim99@2: while () { \ joachim99@2: m%^D/([^/]+)/.*$$% and $$dirscvs{$$1} = 1; \ joachim99@2: m%^/([^/]+)/.*$$% and $$filescvs{$$1} = 1; \ joachim99@2: } \ joachim99@2: close (FILE); \ joachim99@2: if (open (FILE, "<".$$dir."CVS/Entries.Log")) { \ joachim99@2: while () { \ joachim99@2: m%^A D/([^/]+)/.*$$% and $$dirscvs{$$1} = 1; \ joachim99@2: m%^A /([^/]+)/.*$$% and $$filescvs{$$1} = 1; \ joachim99@2: m%^R D/([^/]+)/.*$$% and delete $$dirscvs{$$1}; \ joachim99@2: m%^R /([^/]+)/.*$$% and delete $$filescvs{$$1}; \ joachim99@2: } \ joachim99@2: close (FILE); \ joachim99@2: } \ joachim99@2: for my $$fn (&newfiles (\%filesdir, \%filescvs)) { \ joachim99@2: print ("F ".$$dir.$$fn."\n"); \ joachim99@2: &rmrf ($$dir.$$fn); \ joachim99@2: } \ joachim99@2: for my $$fn (&newfiles (\%dirsdir, \%dirscvs)) { \ joachim99@2: print ("D ".$$dir.$$fn."\n"); \ joachim99@2: &rmrf ($$dir.$$fn); \ joachim99@2: } \ joachim99@2: for my $$fn (sort (keys (%dirscvs))) { \ joachim99@2: &cvsclean ($$dir.$$fn."/"); \ joachim99@2: } \ joachim99@2: } \ joachim99@2: \ joachim99@2: &cvsclean ("");' joachim99@2: joachim99@2: joachim99@2: # The Makefiles have to be sorted for slashes, since configure creates joachim99@2: # only one directory per Makefile not the whole hierarchy joachim99@2: configure.in: configure.files $(shell test -f configure.files && cat configure.files) subdirs joachim99@2: @rm -f configure.in configure.in.new ;\ joachim99@2: kde_use_qt_param= ; \ joachim99@2: cat `cat configure.files | egrep -v "^configure.in.bot"` >> configure.in.new ;\ joachim99@2: echo "KDE_CREATE_SUBDIRSLIST" >> configure.in.new ;\ joachim99@2: echo "AC_OUTPUT( \\" >> configure.in.new ;\ joachim99@2: mfs=`find . -type d -print | fgrep -v "/." | sed -e "s#\./##" -e "/^debian/d" | sort`; \ joachim99@2: for i in $$mfs; do \ joachim99@2: topleveldir=`echo $$i| sed -e "s#/.*##"`; \ joachim99@2: if test -f $$topleveldir/configure.in; then \ joachim99@2: continue; \ joachim99@2: fi ;\ joachim99@2: if test ! -f $$i/Makefile.am; then \ joachim99@2: continue; \ joachim99@2: fi ;\ joachim99@2: if test -s inst-apps; then \ joachim99@2: if test -z "`grep \"^$$topleveldir\" inst-apps`"; then \ joachim99@2: continue; \ joachim99@2: fi ;\ joachim99@2: fi ;\ joachim99@2: echo "$$i/Makefile \\" >> configure.in.new ;\ joachim99@2: done ;\ joachim99@2: egrep '^dnl AC_OUTPUT\(.*\)' `cat configure.files` | sed -e "s#^.*dnl AC_OUTPUT(\(.*\))#\1 \\\\#" >> configure.in.new ;\ joachim99@2: echo ")" >> configure.in.new joachim99@2: @modulename= ;\ joachim99@2: if test -f configure.in.in; then \ joachim99@2: if head -2 configure.in.in | egrep "^#MIN_CONFIG\(.*\)$$" > /dev/null; then \ joachim99@2: line=`egrep "^#MIN_CONFIG\(" configure.in.in` ;\ joachim99@2: if test -n "$$line"; then \ joachim99@2: kde_use_qt_param=`echo $$line | sed -e "s/#MIN_CONFIG(\(.*\))/\1/"` ;\ joachim99@2: fi ;\ joachim99@2: fi ;\ joachim99@2: if head -2 configure.in.in | egrep "^#MIN_CONFI(G|G\(.*\))$$" > /dev/null; then \ joachim99@2: line=`egrep "^AM_INIT_AUTOMAKE\(" configure.in.in` ;\ joachim99@2: if test -n "$$line"; then \ joachim99@2: modulename=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE(\([^,]*\),.*#\1#"` ;\ joachim99@2: VERSION=`echo $$line | sed -e "s#AM_INIT_AUTOMAKE([^,]*, *\([^)]*\)).*#\1#"` ;\ joachim99@2: fi ;\ joachim99@2: sed -e "s#AM_INIT_AUTOMAKE([^@].*#dnl PACKAGE set before#" configure.in.new > configure.in \ joachim99@2: && mv configure.in configure.in.new ;\ joachim99@2: fi ;\ joachim99@2: fi ;\ joachim99@2: if test -z "$$modulename" || test "$$modulename" = "@MODULENAME@"; then \ joachim99@2: modulename=`pwd`; modulename=`basename $$modulename`; \ joachim99@2: fi ;\ joachim99@2: if test -z "$$VERSION" || test "$$VERSION" = "@VERSION@"; then \ joachim99@2: VERSION="\"2.91\""; \ joachim99@2: fi ;\ joachim99@2: if test -n "$$kde_use_qt_param"; then \ joachim99@2: sed -e "s#^dnl KDE_USE_QT#KDE_USE_QT($$kde_use_qt_param)#" configure.in.new > configure.in \ joachim99@2: && mv configure.in configure.in.new ;\ joachim99@2: fi ; \ joachim99@2: sed -e "s#@MODULENAME@#$$modulename#" configure.in.new | \ joachim99@2: sed -e "s#@VERSION@#$$VERSION#" > configure.in joachim99@2: @if test -f configure.in.bot ; then cat configure.in.bot >> configure.in ; fi joachim99@2: @rm -f configure.in.new joachim99@2: joachim99@2: configure.files: subdirs joachim99@2: @admindir=NO ;\ joachim99@2: for i in . .. ../.. ../../..; do \ joachim99@2: if test -x $$i/admin; then admindir=$$i/admin; break; fi; \ joachim99@2: done ;\ joachim99@2: rm -rf configure.files ;\ joachim99@2: if test -f configure.in.in && head -2 configure.in.in | egrep "^#MIN_CONFI(G|G\(.*\))$$" > /dev/null; then \ joachim99@2: echo $$admindir/configure.in.min >> configure.files ;\ joachim99@2: fi joachim99@2: @test -f configure.in.in && echo configure.in.in >> configure.files joachim99@2: @list=`find . -name "configure.in.in" | sort`; \ joachim99@2: for i in $$list; do if test -f $$i && test ! `dirname $$i` = "." ; then \ joachim99@2: echo $$i >> configure.files ;\ joachim99@2: fi; done joachim99@2: @if test -f configure.in.mid ; then echo configure.in.mid >> configure.files ; fi joachim99@2: @if test -f configure.in.bot ; then echo configure.in.bot >> configure.files ; fi joachim99@2: joachim99@2: subdirs: joachim99@2: @files=`ls -1 | sort`; \ joachim99@2: dirs= ;\ joachim99@2: lib_dirs= ;\ joachim99@2: first_dirs= ;\ joachim99@2: last_dirs= ;\ joachim99@2: compilefirst=`grep '^COMPILE_FIRST[ ]*=' Makefile.am | \ joachim99@2: sed -e 's#^COMPILE_FIRST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\ joachim99@2: compilelast=`grep '^COMPILE_LAST[ ]*=' Makefile.am | \ joachim99@2: sed -e 's#^COMPILE_LAST[ ]*=[ ]*#|#' | sed -e 's#$$#|#' | sed -e 's# #|#g'`;\ joachim99@2: for i in $$files; do if test -d $$i; then \ joachim99@2: if test -f $$i/Makefile.am; then \ joachim99@2: if echo $$compilefirst | grep "|$$i|" >/dev/null; then \ joachim99@2: first_dirs="$$first_dirs $$i" ;\ joachim99@2: elif echo $$compilelast | grep "|$$i|" >/dev/null; then \ joachim99@2: last_dirs="$$last_dirs $$i" ; \ joachim99@2: else dirs="$$dirs $$i" ;\ joachim99@2: fi ;\ joachim99@2: fi ;\ joachim99@2: fi; \ joachim99@2: done ;\ joachim99@2: rm -f _SUBDIRS ;\ joachim99@2: for i in $$dirs; do \ joachim99@2: echo $$i >> ./_SUBDIRS; \ joachim99@2: done joachim99@2: @if test -r subdirs && diff subdirs _SUBDIRS > /dev/null; then \ joachim99@2: rm -f _SUBDIRS; \ joachim99@2: fi joachim99@2: @test -r _SUBDIRS && mv _SUBDIRS subdirs || true joachim99@2: joachim99@2: package-merge: joachim99@2: @catalogs='$(POFILES)'; \ joachim99@2: for cat in $$catalogs; do \ joachim99@2: echo $$cat $$name; \ joachim99@2: msgmerge -o $$cat.new $$cat $(PACKAGE).pot ; \ joachim99@2: if test -s $$cat.new; then \ joachim99@2: grep -v "\"POT-Creation" $$cat.new > $$cat.new.2 ; \ joachim99@2: grep -v "\"POT-Creation" $$cat >> $$cat.new.1; \ joachim99@2: if diff $$cat.new.1 $$cat.new.2; then \ joachim99@2: rm $$cat.new; \ joachim99@2: else \ joachim99@2: mv $$cat.new $$cat ; \ joachim99@2: fi; \ joachim99@2: rm -f $$cat.new.1 $$cat.new.2 ;\ joachim99@2: fi ;\ joachim99@2: done joachim99@2: joachim99@2: joachim99@2: package-messages: joachim99@2: @rm -rf po.backup ;\ joachim99@2: mkdir po.backup ;\ joachim99@2: for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \ joachim99@2: egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > po.backup/$$i ; \ joachim99@2: cp po/$$i po.backup/backup_$$i ; \ joachim99@2: touch -r po/$$i po.backup/backup_$$i ;\ joachim99@2: rm po/$$i ;\ joachim99@2: done joachim99@2: @podir=$${podir:-$$PWD/po} ;\ joachim99@2: files=`find . -name Makefile.am | xargs egrep -l '^messages:' `; \ joachim99@2: dirs=`for i in $$files; do echo \`dirname $$i\`; done`; \ joachim99@2: tmpname="$$PWD/messages.log" ;\ joachim99@2: if test -z "$$EXTRACTRC"; then EXTRACTRC=extractrc ; fi ;\ joachim99@2: if test -z "$$PREPARETIPS"; then PREPARETIPS=preparetips ; fi ;\ joachim99@2: export EXTRACTRC PREPARETIPS ;\ joachim99@2: for subdir in $$dirs; do \ joachim99@2: test -z "$$VERBOSE" || echo "Making messages in $$subdir"; \ joachim99@2: (cd $$subdir ;\ joachim99@2: if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then \ joachim99@2: $$EXTRACTRC *.rc *.ui > rc.cpp ;\ joachim99@2: else \ joachim99@2: candidates=`ls -1 *.rc *.ui 2>/dev/null` ;\ joachim99@2: if test -n "$$candidates"; then \ joachim99@2: echo "$$subdir has *.rc or *.ui files, but not correct messages line" ;\ joachim99@2: fi ;\ joachim99@2: fi ;\ joachim99@2: if test -n "`grep -r KAboutData *.c* *.C* 2>/dev/null`"; then \ joachim99@2: echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp ;\ joachim99@2: else echo " " > _translatorinfo.cpp ;\ joachim99@2: fi; \ joachim99@2: perl -e '$$mes=0; while () { if (/^messages:/) { $$mes=1; print $$_; next; } if ($$mes) { if (/$$\\(XGETTEXT\)/ && / -o/) { s/ -o \$$\(podir\)/ _translatorinfo.cpp -o \$$\(podir\)/ } print $$_; } else { print $$_; } }' < Makefile.am > _transMakefile ;\ joachim99@2: $(MAKE) -s -f _transMakefile podir=$$podir EXTRACTRC="$$EXTRACTRC" PREPARETIPS="$$PREPARETIPS" \ joachim99@2: XGETTEXT="$${XGETTEXT:-xgettext} -C -ki18n -ktr2i18n \ joachim99@2: -kI18N_NOOP -ktranslate -kaliasLocale \ joachim99@2: -x $${includedir:-$$KDEDIR/include}/kde.pot" \ joachim99@2: messages ) 2>&1 | grep -v '^make\[1\]' > $$tmpname; \ joachim99@2: test -s $$tmpname && (echo $$subdir ; cat $$tmpname) ;\ joachim99@2: test ! -f $$subdir/rc.cpp || rm -f $$subdir/rc.cpp ;\ joachim99@2: rm -f $$subdir/_translatorinfo.cpp ;\ joachim99@2: rm -f $$subdir/_transMakefile ;\ joachim99@2: done joachim99@2: rm -f $$tmpname joachim99@2: @for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v '^backup_'`; do \ joachim99@2: if test ! -f po/$$i; then echo "disappeared: $$i"; fi ;\ joachim99@2: done joachim99@2: @for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do \ joachim99@2: egrep -v '^#([^:]|$)' po/$$i | egrep '^.*[^ ]+.*$$' | grep -v "\"POT-Creation" > temp.pot ;\ joachim99@2: if test -f po.backup/$$i && test -n "`diff temp.pot po.backup/$$i`"; then \ joachim99@2: echo "will update $$i"; \ joachim99@2: msgmerge -q po.backup/backup_$$i po/$$i > temp.pot ;\ joachim99@2: mv temp.pot po/$$i; \ joachim99@2: else \ joachim99@2: if test -f po.backup/backup_$$i; then \ joachim99@2: test -z "$$VERBOSE" || echo "I'm restoring $$i" ;\ joachim99@2: mv po.backup/backup_$$i po/$$i; \ joachim99@2: rm po.backup/$$i; \ joachim99@2: else \ joachim99@2: echo "will add $$i" ;\ joachim99@2: fi ;\ joachim99@2: fi ;\ joachim99@2: done joachim99@2: @rm -f temp.pot joachim99@2: @rm -rf po.backup joachim99@2: joachim99@2: test: joachim99@2: perl -e '$$mes=0; while () { if (/^messages:/) { $$mes=1; print $$_; next; } if ($$mes) { if (! /^\t/) { exit(0); } if (/$$\\(XGETTEXT\)/ && / -o/) { s/ -o/ _translatorinfo.cpp -o/ } print $$_; } }' < Makefile.am joachim99@2: joachim99@2: .SILENT: joachim99@2: joachim99@2: .PHONY: cvs test dist cvs-clean package-merge package-messages joachim99@2: