Shared admin folder
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. #! /bin/sh
  2. #
  3. # cvs.sh
  4. #
  5. # This file contains support code from Makefile.common
  6. # It defines a shell function for each known target
  7. # and then does a case to call the correct function.
  8. unset MAKEFLAGS
  9. call_and_fix_autoconf()
  10. {
  11. $AUTOCONF || exit 1
  12. }
  13. strip_makefile()
  14. {
  15. if test ! -f $makefile_wo; then
  16. perl -e '$in=0; while ( <> ) { $in = 1 if ($_ =~ m/^if / ); print $_ unless ($in || $_ =~ m/^include /); $in = 0 if ($_ =~ m/^endif/); }' < $makefile_am > $makefile_wo
  17. fi
  18. }
  19. check_autotool_versions()
  20. {
  21. required_autoconf_version="2.53 or newer"
  22. AUTOCONF_VERSION=`$AUTOCONF --version | head -n 1`
  23. case $AUTOCONF_VERSION in
  24. Autoconf*2.5* | autoconf*2.5* | autoconf*2.6* ) : ;;
  25. "" )
  26. echo "*** AUTOCONF NOT FOUND!."
  27. echo "*** TDE requires autoconf $required_autoconf_version"
  28. exit 1
  29. ;;
  30. * )
  31. echo "*** YOU'RE USING $AUTOCONF_VERSION."
  32. echo "*** TDE requires autoconf $required_autoconf_version"
  33. exit 1
  34. ;;
  35. esac
  36. AUTOHEADER_VERSION=`$AUTOHEADER --version | head -n 1`
  37. case $AUTOHEADER_VERSION in
  38. Autoconf*2.5* | autoheader*2.5* | autoheader*2.6* ) : ;;
  39. "" )
  40. echo "*** AUTOHEADER NOT FOUND!."
  41. echo "*** TDE requires autoheader $required_autoconf_version"
  42. exit 1
  43. ;;
  44. * )
  45. echo "*** YOU'RE USING $AUTOHEADER_VERSION."
  46. echo "*** TDE requires autoheader $required_autoconf_version"
  47. exit 1
  48. ;;
  49. esac
  50. AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1`
  51. required_automake_version="1.6.1 or newer"
  52. case $AUTOMAKE_STRING in
  53. automake*1.6.* | automake*1.[7-9]* | automake*1.[1-9][0-9]* )
  54. echo "*** $AUTOMAKE_STRING found."
  55. UNSERMAKE=no
  56. ;;
  57. "" )
  58. echo "*** AUTOMAKE NOT FOUND!."
  59. echo "*** TDE requires automake $required_automake_version"
  60. exit 1
  61. ;;
  62. *unsermake* ) :
  63. echo "*** YOU'RE USING UNSERMAKE."
  64. echo "*** GOOD LUCK!! :)"
  65. UNSERMAKE=unsermake
  66. ;;
  67. * )
  68. echo "*** YOU'RE USING $AUTOMAKE_STRING."
  69. echo "*** TDE requires automake $required_automake_version"
  70. exit 1
  71. ;;
  72. esac
  73. unset required_automake_version
  74. }
  75. cvs()
  76. {
  77. check_autotool_versions
  78. acinclude_m4
  79. ### Make new subdirs and configure.in.
  80. ### The make calls could be optimized away here,
  81. ### with a little thought.
  82. if test -r configure.in.in; then
  83. rm -f configure.in
  84. echo "*** Creating list of subdirectories"
  85. create_subdirs
  86. if test -r Makefile.am.in; then
  87. echo "*** Creating Makefile.am"
  88. if grep '\$(top_srcdir)/Makefile.am:' $makefile_am >/dev/null; then
  89. strip_makefile
  90. $MAKE -f $makefile_wo top_srcdir=. ./Makefile.am || exit 1
  91. else
  92. Makefile_am
  93. fi
  94. fi
  95. configure_files
  96. echo "*** Creating configure.in"
  97. if grep '\$(top_srcdir)/configure.in:' $makefile_am >/dev/null; then
  98. strip_makefile
  99. $MAKE -f $makefile_wo top_srcdir=. ./configure.in || exit 1
  100. else
  101. configure_in
  102. fi
  103. fi
  104. echo "*** Creating aclocal.m4"
  105. $ACLOCAL $ACLOCALFLAGS || exit 1
  106. echo "*** Creating configure"
  107. call_and_fix_autoconf
  108. if egrep "^A[MC]_CONFIG_HEADER" configure.in >/dev/null 2>&1; then
  109. echo "*** Creating config.h template"
  110. $AUTOHEADER || exit 1
  111. touch config.h.in
  112. fi
  113. echo "*** Creating Makefile templates"
  114. $AUTOMAKE --add-missing || exit 1
  115. if test "$UNSERMAKE" = no; then
  116. echo "*** Postprocessing Makefile templates"
  117. perl -w admin/am_edit || exit 1
  118. fi
  119. if egrep "^cvs-local:" $makefile_am >/dev/null; then \
  120. strip_makefile
  121. $MAKE -f $makefile_wo cvs-local top_srcdir=. || exit 1
  122. fi
  123. echo "*** Creating date/time stamp"
  124. touch stamp-h.in
  125. echo "*** Finished"
  126. echo " Don't forget to run ./configure"
  127. echo " If you haven't done so in a while, run ./configure --help"
  128. }
  129. dist()
  130. {
  131. check_autotool_versions
  132. ###
  133. ### First build all of the files necessary to do just "make"
  134. ###
  135. acinclude_m4
  136. if test -r configure.in.in; then
  137. rm -f configure.in
  138. create_subdirs
  139. if test -r Makefile.am.in; then
  140. if grep '\$(top_srcdir)/Makefile.am:' $makefile_am >/dev/null; then
  141. strip_makefile
  142. $MAKE -f $makefile_wo top_srcdir=. ./Makefile.am || exit 1
  143. else
  144. Makefile_am
  145. fi
  146. fi
  147. configure_files
  148. if grep '\$(top_srcdir)/configure.in:' $makefile_am >/dev/null; then
  149. strip_makefile
  150. $MAKE -f $makefile_wo top_srcdir=. ./configure.in || exit 1
  151. else
  152. configure_in
  153. fi
  154. fi
  155. $ACLOCAL $ACLOCALFLAGS
  156. if egrep "^A[MC]_CONFIG_HEADER" configure.in >/dev/null 2>&1; then
  157. echo "*** Creating config.h template"
  158. $AUTOHEADER || exit 1
  159. touch config.h.in
  160. fi
  161. $AUTOMAKE --add-missing --foreign || exit 1
  162. if test "$UNSERMAKE" = no; then
  163. echo "*** Postprocessing Makefile templates"
  164. perl -w admin/am_edit || exit 1
  165. fi
  166. call_and_fix_autoconf
  167. touch stamp-h.in
  168. if grep "^cvs-local:" $makefile_am >/dev/null; then
  169. strip_makefile
  170. $MAKE -f $makefile_wo cvs-local top_srcdir=.
  171. fi
  172. ###
  173. ### Then make messages
  174. ###
  175. if test -d po; then
  176. LIST=`find ./po -name "*.po"`
  177. for i in $LIST; do
  178. file2=`echo $i | sed -e "s#\.po#\.gmo#"`
  179. msgfmt -o $file2 $i || touch $file2
  180. done
  181. fi
  182. if grep "^cvs-dist-local:" $makefile_am >/dev/null; then
  183. strip_makefile
  184. $MAKE -f $makefile_wo cvs-dist-local top_srcdir=.
  185. fi
  186. }
  187. subdir_dist()
  188. {
  189. $ACLOCAL $ACLOCALFLAGS
  190. $AUTOHEADER
  191. touch config.h.in
  192. $AUTOMAKE
  193. AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1`
  194. case $AUTOMAKE_STRING in
  195. *unsermake* ) :
  196. ;;
  197. *)
  198. perl -w ../admin/am_edit --path=../admin
  199. esac
  200. call_and_fix_autoconf
  201. touch stamp-h.in
  202. }
  203. configure_in()
  204. {
  205. rm -f configure.in configure.in.new
  206. kde_use_tqt_param=
  207. test -f configure.files || { echo "need configure.files for configure.in"; exit 1; }
  208. list=`fgrep -v "configure.in.bot" < configure.files | fgrep -v "configure.in.mid"`
  209. : > configure.in.new
  210. for file in $list; do
  211. echo "dnl =======================================================" >> configure.in.new
  212. echo "dnl FILE: $file" >> configure.in.new
  213. echo "dnl =======================================================" >> configure.in.new
  214. echo "" >> configure.in.new
  215. cat $file >> configure.in.new
  216. done
  217. echo "KDE_CREATE_SUBDIRSLIST" >> configure.in.new
  218. if test -f Makefile.am.in; then
  219. subdirs=`cat subdirs`
  220. for dir in $subdirs; do
  221. vdir=`echo $dir | sed -e 's,[-+.@],_,g'`
  222. echo "AM_CONDITIONAL($vdir""_SUBDIR_included, test \"x\$$vdir""_SUBDIR_included\" = xyes)" >> configure.in.new
  223. if test -f "$dir/configure.in"; then
  224. echo "if test \"x\$$vdir""_SUBDIR_included\" = xyes; then " >> configure.in.new
  225. echo " AC_CONFIG_SUBDIRS($dir)" >> configure.in.new
  226. echo "fi" >> configure.in.new
  227. fi
  228. done
  229. fi
  230. echo "AC_CONFIG_FILES([ Makefile ])" >> configure.in.new
  231. if test -f inst-apps; then
  232. topleveldirs=`cat inst-apps`
  233. else
  234. topleveldirs=
  235. for dir in `ls -1d * | sort`; do
  236. if test "$dir" != "debian" && test -d $dir; then
  237. topleveldirs="$topleveldirs $dir"
  238. fi
  239. done
  240. fi
  241. for topleveldir in $topleveldirs; do
  242. if test -f $topleveldir/configure.in; then
  243. continue
  244. fi
  245. if test -f $topleveldir/Makefile.am; then :; else
  246. continue
  247. fi
  248. mfs=`find $topleveldir -follow -name Makefile.am -print | fgrep -v "/." | \
  249. sed -e 's#\./##; s#/Makefile.am$##' | sort | sed -e 's#$#/Makefile#'`
  250. for i in $mfs; do
  251. echo "AC_CONFIG_FILES([ $i ])" >> configure.in.new
  252. done
  253. done
  254. files=`cat configure.files`
  255. list=`egrep '^dnl AC_OUTPUT\(.*\)' $files | sed -e "s#^.*dnl AC_OUTPUT(\(.*\))#\1#"`
  256. for file in $list; do
  257. echo "AC_CONFIG_FILES([ $file ])" >> configure.in.new
  258. done
  259. midfiles=`cat configure.files | fgrep "configure.in.mid"`
  260. test -n "$midfiles" && cat $midfiles >> configure.in.new
  261. echo "AC_OUTPUT" >> configure.in.new
  262. modulename=
  263. if test -f configure.in.in; then
  264. if head -n 2 configure.in.in | egrep "^#MIN_CONFIG\(.*\)$" > /dev/null; then
  265. kde_use_tqt_param=`cat configure.in.in | sed -n -e "s/#MIN_CONFIG(\(.*\))/\1/p"`
  266. fi
  267. if head -n 2 configure.in.in | egrep "^#MIN_CONFIG" > /dev/null; then
  268. line=`grep "^AM_INIT_AUTOMAKE(" configure.in.in`
  269. if test -n "$line"; then
  270. modulename=`echo $line | sed -e "s#AM_INIT_AUTOMAKE(\([^,]*\),.*#\1#"`
  271. VERSION=`echo $line | sed -e "s#AM_INIT_AUTOMAKE([^,]*, *\([^)]*\)).*#\1#"`
  272. fi
  273. sed -e "s#AM_INIT_AUTOMAKE([^@].*#dnl PACKAGE set before#" \
  274. configure.in.new > configure.in && mv configure.in configure.in.new
  275. fi
  276. fi
  277. if test -z "$VERSION" || test "$VERSION" = "@VERSION@"; then
  278. VERSION="\"3.5.10\""
  279. fi
  280. if test -z "$modulename" || test "$modulename" = "@MODULENAME@"; then
  281. modulename=`pwd`;
  282. modulename=`basename $modulename`
  283. esc_VERSION=`echo $VERSION | sed -e "s#[^.0-9a-zA-Z]##g"`
  284. modulename=`echo $modulename | sed -e "s#-$esc_VERSION##"`
  285. fi
  286. if test -n "$kde_use_tqt_param"; then
  287. sed -e "s#^dnl KDE_USE_TQT#KDE_USE_TQT($kde_use_tqt_param)#" \
  288. configure.in.new > configure.in && mv configure.in configure.in.new
  289. fi
  290. sed -e "s#@MODULENAME@#$modulename#" configure.in.new |
  291. sed -e "s#@VERSION@#$VERSION#" > configure.in
  292. botfiles=`cat configure.files | egrep "configure.in.bot"`
  293. test -n "$botfiles" && cat $botfiles >> configure.in
  294. cat $admindir/configure.in.bot.end >> configure.in
  295. rm -f configure.in.new
  296. }
  297. configure_files()
  298. {
  299. echo "*** Creating configure.files"
  300. admindir=NO
  301. for i in . .. ../.. ../../..; do
  302. if test -x $i/admin; then admindir=$i/admin; break; fi
  303. done
  304. rm -f configure.files
  305. touch configure.files
  306. if test -f configure.in.in && head -n 2 configure.in.in | grep "^#MIN_CONFIG" > /dev/null; then
  307. echo $admindir/configure.in.min >> configure.files
  308. fi
  309. test -f configure.in.in && echo configure.in.in >> configure.files
  310. # we collect files in the subdirs and do some sorting tricks, so subsubdirs come after subdirs
  311. if test -f inst-apps; then
  312. inst=`cat inst-apps`
  313. list=""
  314. for i in $inst; do
  315. list="$list `find $i/ -follow -name "configure.in.in" -o -name "configure.in.bot" -o -name "configure.in.mid" | \
  316. sed -e "s,/configure,/aaaconfigure," | sort | sed -e "s,/aaaconfigure,/configure,"`"
  317. done
  318. else
  319. list=`find . -path "./.pc" -prune -o -follow -name "configure.in.in" -o -name "configure.in.bot" -o -name "configure.in.mid" | \
  320. sed -e "s,/configure,/aaaconfigure," | sort | sed -e "s,/aaaconfigure,/configure,"`
  321. fi
  322. for i in $list; do if test -f $i && test `dirname $i` != "." ; then
  323. echo $i >> configure.files
  324. fi; done
  325. test -f configure.in.mid && echo configure.in.mid >> configure.files
  326. test -f configure.in.bot && echo configure.in.bot >> configure.files
  327. if test ! -s configure.files; then
  328. echo "There are no files to build a configure. Please check your checkout."
  329. exit 1
  330. fi
  331. }
  332. create_subdirs()
  333. {
  334. if grep '\$(top_srcdir)/subdirs:' $makefile_am >/dev/null; then
  335. # as many modules contain rules to create subdirs without any
  336. # dependencies make won't create it unless there is no file.
  337. # so we check if that's a dummy rule or one that works
  338. rm -f subdirs.cvs.sh.$$
  339. if test -f subdirs; then
  340. mv subdirs subdirs.cvs.sh.$$
  341. fi
  342. strip_makefile
  343. $MAKE -f $makefile_wo top_srcdir=. ./subdirs || exit 1
  344. if test -f subdirs.cvs.sh.$$; then
  345. if test -s subdirs; then
  346. rm subdirs.cvs.sh.$$
  347. else
  348. mv subdirs.cvs.sh.$$ subdirs
  349. fi
  350. fi
  351. else
  352. subdirs
  353. fi
  354. }
  355. subdirs()
  356. {
  357. dirs=
  358. idirs=
  359. if test -f inst-apps; then
  360. idirs=`cat inst-apps`
  361. else
  362. idirs=`ls -1 | sort`
  363. fi
  364. compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -n 1`
  365. compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -n 1`
  366. for i in $idirs; do
  367. if test -f $i/Makefile.am; then
  368. case " $compilefirst $compilelast " in
  369. *" $i "*) ;;
  370. *) dirs="$dirs $i"
  371. esac
  372. fi
  373. done
  374. : > ./_SUBDIRS
  375. for d in $compilefirst; do
  376. echo $d >> ./_SUBDIRS
  377. done
  378. (for d in $dirs; do
  379. list=`sed -ne "s#^COMPILE_BEFORE_$d""[ ]*=[ ]*##p" $makefile_am | head -n 1`
  380. for s in $list; do
  381. echo $s $d
  382. done
  383. list=`sed -ne "s#^COMPILE_AFTER_$d""[ ]*=[ ]*##p" $makefile_am | head -n 1`
  384. for s in $list; do
  385. echo $d $s
  386. done
  387. echo $d $d
  388. done ) | tsort >> ./_SUBDIRS
  389. for d in $compilelast; do
  390. echo $d >> ./_SUBDIRS
  391. done
  392. if test -r subdirs && cmp -s subdirs _SUBDIRS; then
  393. rm -f _SUBDIRS
  394. fi
  395. test -r _SUBDIRS && mv _SUBDIRS subdirs || true
  396. }
  397. Makefile_am()
  398. {
  399. if test -f Makefile.am.in; then
  400. compilefirst=`sed -ne 's#^COMPILE_FIRST[ ]*=[ ]*##p' $makefile_am | head -n 1`
  401. compilelast=`sed -ne 's#^COMPILE_LAST[ ]*=[ ]*##p' $makefile_am | head -n 1`
  402. idirs=
  403. dirs=
  404. if test -f inst-apps; then
  405. idirs=`cat inst-apps`
  406. else
  407. idirs=`cat subdirs`
  408. fi
  409. for i in $idirs; do
  410. case " $compilefirst $compilelast " in
  411. *" $i "*) ;;
  412. *) dirs="$dirs $i"
  413. esac
  414. done
  415. adds=`fgrep '$(top_srcdir)/acinclude.m4:' Makefile.am.in | sed -e 's,^[^:]*: *,,; s,\$(top_srcdir)/,,g'`
  416. if echo "$adds" | fgrep "*" >/dev/null ; then
  417. adds=`ls -d -1 $adds 2>/dev/null`
  418. fgrep -v '$(top_srcdir)/acinclude.m4:' Makefile.am.in > Makefile.am.in.adds
  419. str='$(top_srcdir)/acinclude.m4:'
  420. for add in $adds; do
  421. str="$str \$(top_srcdir)/$add"
  422. done
  423. echo $str >> Makefile.am.in.adds
  424. else
  425. cat Makefile.am.in > Makefile.am.in.adds
  426. fi
  427. cat Makefile.am.in.adds | \
  428. sed -e 's,^\s*\(COMPILE_BEFORE.*\),# \1,' | \
  429. sed -e 's,^\s*\(COMPILE_AFTER.*\),# \1,' > Makefile.am
  430. echo "SUBDIRS="'$(TOPSUBDIRS)' >> Makefile.am
  431. rm Makefile.am.in.adds
  432. fi
  433. }
  434. acinclude_m4()
  435. {
  436. echo "*** Creating acinclude.m4"
  437. adds=
  438. if grep '\$(top_srcdir)/acinclude.m4:' $makefile_am >/dev/null; then
  439. strip_makefile
  440. rm -f acinclude.m4
  441. adds=`grep '\$(top_srcdir)/acinclude.m4:' $makefile_wo | sed -e 's,^[^:]*: *,,; s,\$(top_srcdir),.,g'`
  442. if echo $adds | fgrep "*" >/dev/null ; then
  443. adds=`ls -d -1 $adds 2>/dev/null`
  444. else
  445. $MAKE -f $makefile_wo top_srcdir=. ./acinclude.m4 || exit 1
  446. fi
  447. else
  448. rm -f acinclude.m4
  449. fi
  450. # if it wasn't created up to now, then we do it better
  451. if test ! -f acinclude.m4; then
  452. cat admin/acinclude.m4.in admin/libtool.m4.in admin/pkg.m4.in $adds > acinclude.m4
  453. fi
  454. }
  455. package_merge()
  456. {
  457. catalogs=$POFILES
  458. for cat in $catalogs; do
  459. msgmerge -o $cat.new $cat $PACKAGE.pot
  460. if test -s $cat.new; then
  461. grep -v "\"POT-Creation" $cat.new > $cat.new.2
  462. grep -v "\"POT-Creation" $cat >> $cat.new.1
  463. if diff $cat.new.1 $cat.new.2; then
  464. rm $cat.new
  465. else
  466. mv $cat.new $cat
  467. fi
  468. rm -f $cat.new.1 $cat.new.2
  469. fi
  470. done
  471. }
  472. extract_messages()
  473. {
  474. podir=${podir:-$PWD/po}
  475. files=`find . -name Makefile.am | xargs egrep -l '^messages:' `
  476. dirs=`for i in $files; do echo \`dirname $i\`; done`
  477. tmpname="$PWD/messages.log"
  478. export PATH=$PATH:/opt/trinity/bin:/opt/trinity/bin
  479. if test -z "$EXTRACTRC"; then EXTRACTRC=extractrc ; fi
  480. if test -z "$PREPARETIPS"; then PREPARETIPS=preparetips ; fi
  481. export EXTRACTRC PREPARETIPS
  482. for subdir in $dirs; do
  483. test -z "$VERBOSE" || echo "Making messages in $subdir"
  484. (cd $subdir
  485. if test -n "`grep -e '^messages:.*rc.cpp' Makefile.am`"; then
  486. $EXTRACTRC *.rc *.ui *.kcfg > rc.cpp
  487. else
  488. candidates=`ls -1 *.rc *.ui *.kcfg 2>/dev/null`
  489. if test -n "$candidates"; then
  490. echo "$subdir has *.rc, *.ui or *.kcfg files, but not correct messages line"
  491. fi
  492. fi
  493. if find . -name \*.c\* -o -name \*.h\* | fgrep -v ".svn" | xargs fgrep -s -q TDEAboutData ; then
  494. echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp
  495. else echo " " > _translatorinfo.cpp
  496. fi
  497. perl -e '$mes=0; while (<STDIN>) { next if (/^(if\s|else\s|endif)/); if (/^messages:/) { $mes=1; print $_; next; } if ($mes) { if (/$\\(XGETTEXT\)/ && / -o/) { s/ -o \$\(podir\)/ _translatorinfo.cpp -o \$\(podir\)/ } print $_; } else { print $_; } }' < Makefile.am | egrep -v '^include ' > _transMakefile
  498. kdepotpath=${includedir:-`tde-config --expandvars --install include`}/tde.pot
  499. if ! test -f $kdepotpath; then
  500. kdepotpath=`tde-config --expandvars --prefix`/include/tde.pot
  501. fi
  502. $MAKE -s -f _transMakefile podir=$podir EXTRACTRC="$EXTRACTRC" PREPARETIPS="$PREPARETIPS" srcdir=. \
  503. XGETTEXT="${XGETTEXT:-xgettext} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -x $kdepotpath" messages
  504. exit_code=$?
  505. if test "$exit_code" != 0; then
  506. echo "make exit code: $exit_code"
  507. fi
  508. ) 2>&1 | grep -v '^make\[1\]' > $tmpname
  509. test -s $tmpname && { echo $subdir ; cat "$tmpname"; }
  510. test -f $subdir/rc.cpp && rm -f $subdir/rc.cpp
  511. rm -f $subdir/_translatorinfo.cpp
  512. rm -f $subdir/_transMakefile
  513. done
  514. rm -f $tmpname
  515. }
  516. package_messages()
  517. {
  518. rm -rf po.backup
  519. mkdir po.backup
  520. for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do
  521. egrep -v '^#[^,]' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > po.backup/$i
  522. cat po/$i > po.backup/backup_$i
  523. touch -r po/$i po.backup/backup_$i
  524. rm po/$i
  525. done
  526. extract_messages
  527. for i in `ls -1 po.backup/*.pot 2>/dev/null | sed -e "s#po.backup/##" | egrep -v '^backup_'`; do
  528. test -f po/$i || echo "disappeared: $i"
  529. done
  530. for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do
  531. sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n",' po/$i > po/$i.new && mv po/$i.new po/$i
  532. #msgmerge -q -o po/$i po/$i po/$i
  533. egrep -v '^#[^,]' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > temp.pot
  534. if test -f po.backup/$i && ! cmp -s temp.pot po.backup/$i; then
  535. echo "will update $i"
  536. else
  537. if test -f po.backup/backup_$i; then
  538. test -z "$VERBOSE" || echo "I'm restoring $i"
  539. mv po.backup/backup_$i po/$i
  540. rm po.backup/$i
  541. else
  542. echo "will add $i"
  543. fi
  544. fi
  545. done
  546. rm -f temp.pot
  547. rm -rf po.backup
  548. }
  549. # Make sure that sorting is always done the same way
  550. LC_ALL=C
  551. export LC_ALL
  552. unset LANG || :
  553. unset LC_CTYPE || :
  554. unset LANGUAGE || :
  555. unset CDPATH || :
  556. admindir=`echo "$0" | sed 's%[\\/][^\\/][^\\/]*$%%'`
  557. test "x$admindir" = "x$0" && admindir=.
  558. test "x$MAKE" = x && MAKE=make
  559. makefile_am=Makefile.am
  560. makefile_wo=Makefile.am.wo
  561. if test -f Makefile.am.in; then
  562. makefile_am=Makefile.am.in
  563. makefile_wo=Makefile.am.in.wo
  564. rm -f $makefile_wo
  565. fi
  566. # Call script to find autoconf and friends. Uses eval since the script outputs
  567. # sh-compatible code.
  568. eval `$admindir/detect-autoconf.pl`
  569. ###
  570. ### Main
  571. ###
  572. arg=`echo $1 | tr .- __`
  573. case $arg in
  574. cvs | dist | subdir_dist | configure_in | configure_files | subdirs | \
  575. cvs_clean | package_merge | package_messages | Makefile_am | acinclude_m4 | extract_messages ) $arg ;;
  576. configure ) call_and_fix_autoconf ;;
  577. * ) echo "Usage: cvs.sh <target>"
  578. echo "Target can be one of:"
  579. echo " cvs svn dist"
  580. echo " configure.in configure.files"
  581. echo " package-merge package-messages"
  582. echo ""
  583. echo "Usage: anything but $1"
  584. exit 1 ;;
  585. esac
  586. if test -f $makefile_wo; then
  587. rm $makefile_wo
  588. fi
  589. exit 0