gettextize 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  1. #! /bin/sh
  2. #
  3. # Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software Foundation,
  17. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. #
  19. # This file is meant for authors or maintainers which want to
  20. # internationalize their package with the help of GNU gettext. For
  21. # further information how to use it consult the GNU gettext manual.
  22. progname=$0
  23. package=gettext-tools
  24. version=0.16.1
  25. # Set variables
  26. # - gettext_dir directory where the sources are stored.
  27. prefix="/usr"
  28. datarootdir="${prefix}/share"
  29. gettext_dir="/usr/share/gettext"
  30. # func_tmpdir
  31. # creates a temporary directory.
  32. # Sets variable
  33. # - tmp pathname of freshly created temporary directory
  34. func_tmpdir ()
  35. {
  36. # Use the environment variable TMPDIR, falling back to /tmp. This allows
  37. # users to specify a different temporary directory, for example, if their
  38. # /tmp is filled up or too small.
  39. : ${TMPDIR=/tmp}
  40. {
  41. # Use the mktemp program if available. If not available, hide the error
  42. # message.
  43. tmp=`(umask 077 && mktemp -d "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
  44. test -n "$tmp" && test -d "$tmp"
  45. } ||
  46. {
  47. # Use a simple mkdir command. It is guaranteed to fail if the directory
  48. # already exists. $RANDOM is bash specific and expands to empty in shells
  49. # other than bash, ksh and zsh. Its use does not increase security;
  50. # rather, it minimizes the probability of failure in a very cluttered /tmp
  51. # directory.
  52. tmp=$TMPDIR/gt$$-$RANDOM
  53. (umask 077 && mkdir "$tmp")
  54. } ||
  55. {
  56. echo "$0: cannot create a temporary directory in $TMPDIR" >&2
  57. { (exit 1); exit 1; }
  58. }
  59. }
  60. # Support for relocatability.
  61. func_find_curr_installdir ()
  62. {
  63. # Determine curr_installdir, even taking into account symlinks.
  64. curr_executable="$0"
  65. case "$curr_executable" in
  66. */* | *\\*) ;;
  67. *) # Need to look in the PATH.
  68. if test "${PATH_SEPARATOR+set}" != set; then
  69. func_tmpdir
  70. { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
  71. chmod +x "$tmp"/conf.sh
  72. if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
  73. PATH_SEPARATOR=';'
  74. else
  75. PATH_SEPARATOR=:
  76. fi
  77. rm -rf "$tmp"
  78. fi
  79. save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
  80. for dir in $PATH; do
  81. IFS="$save_IFS"
  82. test -z "$dir" && dir=.
  83. for exec_ext in ''; do
  84. if test -f "$dir/$curr_executable$exec_ext"; then
  85. curr_executable="$dir/$curr_executable$exec_ext"
  86. break 2
  87. fi
  88. done
  89. done
  90. IFS="$save_IFS"
  91. ;;
  92. esac
  93. # Make absolute.
  94. case "$curr_executable" in
  95. /* | ?:/* | ?:\\*) ;;
  96. *) curr_executable=`pwd`/"$curr_executable" ;;
  97. esac
  98. # Resolve symlinks.
  99. sed_dirname='s,/[^/]*$,,'
  100. sed_linkdest='s,^.* -> \(.*\),\1,p'
  101. while : ; do
  102. lsline=`LC_ALL=C ls -l "$curr_executable"`
  103. case "$lsline" in
  104. *" -> "*)
  105. linkdest=`echo "$lsline" | sed -n -e "$sed_linkdest"`
  106. case "$linkdest" in
  107. /* | ?:/* | ?:\\*) curr_executable="$linkdest" ;;
  108. *) curr_executable=`echo "$curr_executable" | sed -e "$sed_dirname"`/"$linkdest" ;;
  109. esac ;;
  110. *) break ;;
  111. esac
  112. done
  113. curr_installdir=`echo "$curr_executable" | sed -e 's,/[^/]*$,,'`
  114. # Canonicalize.
  115. curr_installdir=`cd "$curr_installdir" && pwd`
  116. }
  117. func_find_prefixes ()
  118. {
  119. # Compute the original/current installation prefixes by stripping the
  120. # trailing directories off the original/current installation directories.
  121. orig_installprefix="$orig_installdir"
  122. curr_installprefix="$curr_installdir"
  123. while true; do
  124. orig_last=`echo "$orig_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
  125. curr_last=`echo "$curr_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
  126. if test -z "$orig_last" || test -z "$curr_last"; then
  127. break
  128. fi
  129. if test "$orig_last" != "$curr_last"; then
  130. break
  131. fi
  132. orig_installprefix=`echo "$orig_installprefix" | sed -e 's,/[^/]*$,,'`
  133. curr_installprefix=`echo "$curr_installprefix" | sed -e 's,/[^/]*$,,'`
  134. done
  135. }
  136. if test "no" = yes; then
  137. exec_prefix="/usr"
  138. bindir="/usr/bin"
  139. orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables
  140. func_find_curr_installdir # determine curr_installdir
  141. func_find_prefixes
  142. # Relocate the directory variables that we use.
  143. gettext_dir=`echo "$gettext_dir/" | sed -e "s%^${orig_installprefix}/%${curr_installprefix}/%" | sed -e 's,/$,,'`
  144. fi
  145. # func_usage
  146. # outputs to stdout the --help usage message.
  147. func_usage ()
  148. {
  149. echo "\
  150. Usage: gettextize [OPTION]... [package-dir]
  151. Prepares a source package to use gettext.
  152. Options:
  153. --help print this help and exit
  154. --version print version information and exit
  155. -f, --force force writing of new files even if old exist
  156. --intl install libintl in a subdirectory
  157. --no-changelog don't update or create ChangeLog files
  158. --symlink make symbolic links instead of copying files
  159. -n, --dry-run print modifications but don't perform them
  160. Report bugs to <bug-gnu-gettext@gnu.org>."
  161. }
  162. # func_version
  163. # outputs to stdout the --version message.
  164. func_version ()
  165. {
  166. echo "$progname (GNU $package) $version"
  167. echo "Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
  168. This is free software; see the source for copying conditions. There is NO
  169. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  170. echo "Written by" "Ulrich Drepper"
  171. }
  172. # func_fatal_error message
  173. # outputs to stderr a fatal error message, and terminates the program.
  174. func_fatal_error ()
  175. {
  176. echo "gettextize: *** $1" 1>&2
  177. echo "gettextize: *** Stop." 1>&2
  178. exit 1
  179. }
  180. # Nuisances.
  181. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  182. # Command-line option processing.
  183. # Removes the OPTIONS from the arguments. Sets the variables:
  184. # - force 1 if --force was given, 0 otherwise
  185. # - intldir yes if --intl was given, empty otherwise
  186. # - try_ln_s : if --symlink was given, false otherwise
  187. # - do_changelog false if --no-changelog was given, : otherwise
  188. # - doit false if --dry-run was given, : otherwise
  189. {
  190. force=0
  191. intldir=
  192. try_ln_s=false
  193. do_changelog=:
  194. doit=:
  195. while test $# -gt 0; do
  196. case "$1" in
  197. -c | --copy | --cop | --co | --c ) # accepted for backward compatibility
  198. shift ;;
  199. -n | --dry-run | --dry-ru | --dry-r | --dry- | --dry | --dr | --d )
  200. shift
  201. doit=false ;;
  202. -f | --force | --forc | --for | --fo | --f )
  203. shift
  204. force=1 ;;
  205. --help | --hel | --he | --h )
  206. func_usage; exit 0 ;;
  207. --intl | --int | --in | --i )
  208. shift
  209. intldir=yes ;;
  210. --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c )
  211. shift
  212. do_changelog=false ;;
  213. --symlink | --symlin | --symli | --syml | --sym | --sy | --s )
  214. shift
  215. try_ln_s=: ;;
  216. --version | --versio | --versi | --vers | --ver | --ve | --v )
  217. func_version
  218. exit 0 ;;
  219. -- ) # Stop option prcessing
  220. shift; break ;;
  221. -* )
  222. echo "gettextize: unknown option $1" 1>&2
  223. echo "Try 'gettextize --help' for more information." 1>&2
  224. exit 1 ;;
  225. * )
  226. break ;;
  227. esac
  228. done
  229. }
  230. # Command-line argument processing.
  231. # Analyzes the remaining arguments.
  232. # Sets the variables
  233. # - origdir to the original directory,
  234. # - srcdir to the package directory, and cd-s into it.
  235. {
  236. if test $# -gt 1; then
  237. func_usage 1>&2
  238. exit 1
  239. fi
  240. origdir=`pwd`
  241. if test $# -eq 1; then
  242. srcdir=$1
  243. if cd "$srcdir"; then
  244. srcdir=`pwd`
  245. else
  246. func_fatal_error "Cannot change directory to '$srcdir'."
  247. fi
  248. else
  249. srcdir=$origdir
  250. fi
  251. }
  252. # The current directory is now $srcdir.
  253. # Check integrity of package: A configure.in/ac must be present. Sets variable
  254. # - configure_in name of configure.in/ac file.
  255. test -f configure.in || test -f configure.ac ||
  256. func_fatal_error "Missing configure.in or configure.ac, please cd to your package first."
  257. configure_in=NONE
  258. if test -f configure.in; then
  259. configure_in=configure.in
  260. else
  261. if test -f configure.ac; then
  262. configure_in=configure.ac
  263. fi
  264. fi
  265. # Check whether the --force option is needed but has not been specified.
  266. if test $force -eq 0; then
  267. if test -d intl; then
  268. func_fatal_error "intl/ subdirectory exists: use option -f if you really want to delete it."
  269. fi
  270. if test -f po/Makefile.in.in; then
  271. func_fatal_error "po/Makefile.in.in exists: use option -f if you really want to delete it."
  272. fi
  273. if test -f ABOUT-NLS; then
  274. func_fatal_error "ABOUT-NLS exists: use option -f if you really want to delete it."
  275. fi
  276. fi
  277. # Check in which directory config.rpath etc. belong.
  278. auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
  279. if test -n "$auxdir"; then
  280. auxdir="$auxdir/"
  281. fi
  282. # For simplicity we change to the gettext source directory.
  283. cd $gettext_dir ||
  284. func_fatal_error "gettext source directory '${gettext_dir}' doesn't exist"
  285. # Variables which keep track what has been modified.
  286. added_directories=
  287. removed_directory=
  288. added_extradist=
  289. added_acoutput=
  290. removed_acoutput=" intl/intlh.inst"
  291. # Variable:
  292. # - please accumulates instructions for the user.
  293. please=
  294. # Variable:
  295. # - date current date, for use in ChangeLog entries.
  296. date=`date +%Y-%m-%d`
  297. # func_copy from to
  298. # copies a file.
  299. # 'from' is a relative pathname, relative to the current directory.
  300. # 'to' is a relative pathname, relative to $srcdir.
  301. func_copy ()
  302. {
  303. if $doit; then
  304. rm -f "$srcdir/$2"
  305. echo "Copying file $2"
  306. cp "$1" "$srcdir/$2"
  307. else
  308. echo "Copy file $2"
  309. fi
  310. }
  311. # func_linkorcopy from absfrom to
  312. # links or copies a file.
  313. # 'from' is a relative pathname, relative to the current directory.
  314. # 'absfrom' is the corresponding absolute pathname.
  315. # 'to' is a relative pathname, relative to $srcdir.
  316. func_linkorcopy ()
  317. {
  318. if $doit; then
  319. rm -f "$srcdir/$3"
  320. ($try_ln_s && ln -s "$2" "$srcdir/$3" && echo "Symlinking file $3") 2>/dev/null ||
  321. { echo "Copying file $3"; cp "$1" "$srcdir/$3"; }
  322. else
  323. if $try_ln_s; then
  324. echo "Symlink file $3"
  325. else
  326. echo "Copy file $3"
  327. fi
  328. fi
  329. }
  330. # func_backup to
  331. # makes a backup of a file that is about to be overwritten or replaced.
  332. # 'to' is a relative pathname, relative to $srcdir.
  333. func_backup ()
  334. {
  335. if $doit; then
  336. if test -f "$srcdir/$1"; then
  337. rm -f "$srcdir/$1~"
  338. cp -p "$srcdir/$1" "$srcdir/$1~"
  339. fi
  340. fi
  341. }
  342. # func_remove to
  343. # removes a file.
  344. # 'to' is a relative pathname, relative to $srcdir.
  345. func_remove ()
  346. {
  347. if $doit; then
  348. echo "Removing $1"
  349. rm -f "$srcdir/$1"
  350. else
  351. echo "Remove $1"
  352. fi
  353. }
  354. # func_ChangeLog_init
  355. # func_ChangeLog_add_entry line
  356. # func_ChangeLog_finish
  357. # manage the ChangeLog file, relative to $srcdir.
  358. func_ChangeLog_init ()
  359. {
  360. modified_ChangeLog=
  361. }
  362. func_ChangeLog_add_entry ()
  363. {
  364. if $doit; then
  365. if test -z "$modified_ChangeLog"; then
  366. echo "$date gettextize <bug-gnu-gettext@gnu.org>" > "$srcdir/ChangeLog.tmp"
  367. echo >> "$srcdir/ChangeLog.tmp"
  368. modified_ChangeLog=yes
  369. fi
  370. echo "$1" >> "$srcdir/ChangeLog.tmp"
  371. else
  372. modified_ChangeLog=yes
  373. fi
  374. }
  375. func_ChangeLog_finish ()
  376. {
  377. if test -n "$modified_ChangeLog"; then
  378. if $doit; then
  379. echo >> "$srcdir/ChangeLog.tmp"
  380. if test -f "$srcdir/ChangeLog"; then
  381. echo "Adding an entry to ChangeLog (backup is in ChangeLog~)"
  382. cat "$srcdir/ChangeLog" >> "$srcdir/ChangeLog.tmp"
  383. rm -f "$srcdir/ChangeLog~"
  384. cp -p "$srcdir/ChangeLog" "$srcdir/ChangeLog~"
  385. else
  386. echo "Creating ChangeLog"
  387. fi
  388. cp "$srcdir/ChangeLog.tmp" "$srcdir/ChangeLog"
  389. rm -f "$srcdir/ChangeLog.tmp"
  390. else
  391. if test -f "$srcdir/ChangeLog"; then
  392. echo "Add an entry to ChangeLog"
  393. else
  394. echo "Create ChangeLog"
  395. fi
  396. fi
  397. fi
  398. }
  399. # func_poChangeLog_init
  400. # func_poChangeLog_add_entry line
  401. # func_poChangeLog_finish
  402. # manage the po/ChangeLog file, relative to $srcdir.
  403. func_poChangeLog_init ()
  404. {
  405. modified_poChangeLog=
  406. }
  407. func_poChangeLog_add_entry ()
  408. {
  409. if $doit; then
  410. if test -z "$modified_poChangeLog"; then
  411. echo "$date gettextize <bug-gnu-gettext@gnu.org>" > "$srcdir/po/ChangeLog.tmp"
  412. echo >> "$srcdir/po/ChangeLog.tmp"
  413. modified_poChangeLog=yes
  414. fi
  415. echo "$1" >> "$srcdir/po/ChangeLog.tmp"
  416. else
  417. modified_poChangeLog=yes
  418. fi
  419. }
  420. func_poChangeLog_finish ()
  421. {
  422. if test -n "$modified_poChangeLog"; then
  423. if $doit; then
  424. echo >> "$srcdir/po/ChangeLog.tmp"
  425. if test -f "$srcdir/po/ChangeLog"; then
  426. echo "Adding an entry to po/ChangeLog (backup is in po/ChangeLog~)"
  427. cat "$srcdir/po/ChangeLog" >> "$srcdir/po/ChangeLog.tmp"
  428. rm -f "$srcdir/po/ChangeLog~"
  429. cp -p "$srcdir/po/ChangeLog" "$srcdir/po/ChangeLog~"
  430. else
  431. echo "Creating po/ChangeLog"
  432. fi
  433. cp "$srcdir/po/ChangeLog.tmp" "$srcdir/po/ChangeLog"
  434. rm -f "$srcdir/po/ChangeLog.tmp"
  435. else
  436. if test -f "$srcdir/po/ChangeLog"; then
  437. echo "Add an entry to po/ChangeLog"
  438. else
  439. echo "Create po/ChangeLog"
  440. fi
  441. fi
  442. fi
  443. }
  444. # func_m4ChangeLog_init
  445. # func_m4ChangeLog_add_entry line
  446. # func_m4ChangeLog_finish
  447. # manage the $m4dir/ChangeLog file, relative to $srcdir.
  448. func_m4ChangeLog_init ()
  449. {
  450. if test -n "$using_m4ChangeLog"; then
  451. modified_m4ChangeLog=
  452. created_m4ChangeLog=
  453. fi
  454. }
  455. func_m4ChangeLog_add_entry ()
  456. {
  457. if test -n "$using_m4ChangeLog"; then
  458. if $doit; then
  459. if test -z "$modified_m4ChangeLog"; then
  460. echo "$date gettextize <bug-gnu-gettext@gnu.org>" > "$srcdir/$m4dir/ChangeLog.tmp"
  461. echo >> "$srcdir/$m4dir/ChangeLog.tmp"
  462. modified_m4ChangeLog=yes
  463. fi
  464. echo "$1" >> "$srcdir/$m4dir/ChangeLog.tmp"
  465. else
  466. modified_m4ChangeLog=yes
  467. fi
  468. else
  469. line="$1"
  470. line=`echo "$line" | sed -e "s%^ \\* % * $m4dir/%"`
  471. func_ChangeLog_add_entry "$line"
  472. fi
  473. }
  474. func_m4ChangeLog_finish ()
  475. {
  476. if test -n "$using_m4ChangeLog"; then
  477. if test -n "$modified_m4ChangeLog"; then
  478. if $doit; then
  479. echo >> "$srcdir/$m4dir/ChangeLog.tmp"
  480. if test -f "$srcdir/$m4dir/ChangeLog"; then
  481. echo "Adding an entry to $m4dir/ChangeLog (backup is in $m4dir/ChangeLog~)"
  482. cat "$srcdir/$m4dir/ChangeLog" >> "$srcdir/$m4dir/ChangeLog.tmp"
  483. rm -f "$srcdir/$m4dir/ChangeLog~"
  484. cp -p "$srcdir/$m4dir/ChangeLog" "$srcdir/$m4dir/ChangeLog~"
  485. else
  486. echo "Creating $m4dir/ChangeLog"
  487. created_m4ChangeLog=yes
  488. fi
  489. cp "$srcdir/$m4dir/ChangeLog.tmp" "$srcdir/$m4dir/ChangeLog"
  490. rm -f "$srcdir/$m4dir/ChangeLog.tmp"
  491. else
  492. if test -f "$srcdir/$m4dir/ChangeLog"; then
  493. echo "Add an entry to $m4dir/ChangeLog"
  494. else
  495. echo "Create $m4dir/ChangeLog"
  496. created_m4ChangeLog=yes
  497. fi
  498. fi
  499. fi
  500. fi
  501. }
  502. using_m4ChangeLog=yes
  503. if test ! -f "$srcdir/intl/Makefile.in" && test -n "$intldir"; then
  504. added_acoutput="$added_acoutput intl/Makefile"
  505. fi
  506. if test -f "$srcdir/intl/Makefile.in" && test -z "$intldir"; then
  507. removed_acoutput="$removed_acoutput intl/Makefile"
  508. fi
  509. if test -d "$srcdir/intl"; then
  510. # Remove everything inside intl except for RCS and CVS subdirs and invisible
  511. # files.
  512. if $doit; then
  513. echo "Wiping out intl/ subdirectory"
  514. (cd "$srcdir/intl" &&
  515. for f in *; do
  516. if test CVS != "$f" && test RCS != "$f"; then
  517. rm -rf "$f"
  518. fi
  519. done)
  520. else
  521. echo "Wipe out intl/ subdirectory"
  522. fi
  523. if test -z "$intldir"; then
  524. removed_directory=intl
  525. fi
  526. else
  527. if test -n "$intldir"; then
  528. if $doit; then
  529. echo "Creating intl/ subdirectory"
  530. mkdir "$srcdir/intl" || func_fatal_error "failed to create intl/ subdirectory"
  531. else
  532. echo "Create intl/ subdirectory"
  533. fi
  534. added_directories="$added_directories intl"
  535. fi
  536. fi
  537. $do_changelog && func_ChangeLog_init
  538. test -d "$srcdir/po" || {
  539. if $doit; then
  540. echo "Creating po/ subdirectory"
  541. mkdir "$srcdir/po" || func_fatal_error "failed to create po/ subdirectory"
  542. else
  543. echo "Create po/ subdirectory"
  544. fi
  545. added_directories="$added_directories po"
  546. }
  547. # Create the directory for config.rpath, if needed.
  548. # This is for consistency with autoreconf and automake.
  549. # Note that $auxdir is either empty or ends in a slash.
  550. test -d "$srcdir/$auxdir" || {
  551. if $doit; then
  552. echo "Creating $auxdir subdirectory"
  553. mkdir "$srcdir/$auxdir" || func_fatal_error "failed to create $auxdir subdirectory"
  554. else
  555. echo "Create $auxdir subdirectory"
  556. fi
  557. }
  558. # Now copy all files. Take care for the destination directories.
  559. for file in *; do
  560. case $file in
  561. ABOUT-NLS)
  562. func_linkorcopy $file "$gettext_dir/$file" $file
  563. ;;
  564. config.rpath)
  565. if test -f "$srcdir/$auxdir$file"; then
  566. :
  567. else
  568. added_extradist="$added_extradist $auxdir$file"
  569. fi
  570. func_linkorcopy $file "$gettext_dir/$file" "$auxdir$file"
  571. ;;
  572. esac
  573. done
  574. # Copy files to intl/ subdirectory.
  575. if test -n "$intldir"; then
  576. cd intl
  577. for file in *; do
  578. if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
  579. if test $file != plural.c; then
  580. func_linkorcopy $file "$gettext_dir/intl/$file" intl/$file
  581. else
  582. # plural.c is a generated file; it must be copied and touched.
  583. func_copy $file intl/$file
  584. if $doit; then
  585. (sleep 2; touch "$srcdir/intl/$file") &
  586. fi
  587. fi
  588. fi
  589. done
  590. cd ..
  591. else
  592. echo "Not copying intl/ directory."
  593. # Tell the user what to put into configure.ac, if it is not already there.
  594. if grep '^AM_GNU_GETTEXT([[]\?external[]]\?[ ]*[,)]' "$srcdir/$configure_in" > /dev/null; then
  595. :
  596. else
  597. please="$please
  598. Please use AM_GNU_GETTEXT([external]) in order to cause autoconfiguration
  599. to look for an external libintl.
  600. "
  601. fi
  602. fi
  603. # Copy files to po/ subdirectory.
  604. $do_changelog && func_poChangeLog_init
  605. cd po
  606. for file in Makefile.in.in; do
  607. same=no
  608. if test -f "$srcdir/po/$file"; then
  609. if cmp -s $file "$srcdir/po/$file"; then
  610. same=yes
  611. fi
  612. else
  613. added_acoutput="$added_acoutput po/Makefile.in"
  614. fi
  615. if $do_changelog && test $same = no; then
  616. if test -f "$srcdir/po/$file"; then
  617. func_poChangeLog_add_entry " * $file: Upgrade to gettext-${version}."
  618. else
  619. func_poChangeLog_add_entry " * $file: New file, from gettext-${version}."
  620. fi
  621. fi
  622. func_backup po/$file
  623. func_linkorcopy $file "$gettext_dir/po/$file" po/$file
  624. done
  625. for file in *; do
  626. case $file in
  627. Makefile.in.in)
  628. # Already handled above.
  629. ;;
  630. Makevars.template)
  631. func_linkorcopy Makevars.template "$gettext_dir/po/Makevars.template" po/Makevars.template
  632. if test -f "$srcdir/po/Makevars"; then
  633. LC_ALL=C sed -n -e 's/[ ]*\([A-Za-z0-9_]*\)[ ]*=.*/\1/p' < "$srcdir/po/Makevars" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp1"
  634. LC_ALL=C sed -n -e 's/[ ]*\([A-Za-z0-9_]*\)[ ]*=.*/\1/p' < "$srcdir/po/Makevars.template" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp2"
  635. missingvars=`LC_ALL=C comm -13 "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2"`
  636. rm -f "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2"
  637. if test -n "$missingvars"; then
  638. please="$please
  639. Please update po/Makevars so that it defines all the variables mentioned
  640. in po/Makevars.template.
  641. You can then remove po/Makevars.template.
  642. "
  643. fi
  644. else
  645. please="$please
  646. Please create po/Makevars from the template in po/Makevars.template.
  647. You can then remove po/Makevars.template.
  648. "
  649. fi
  650. ;;
  651. *)
  652. same=no
  653. if test -f "$srcdir/po/$file"; then
  654. if cmp -s $file "$srcdir/po/$file"; then
  655. same=yes
  656. fi
  657. fi
  658. if $do_changelog && test $same = no; then
  659. if test -f "$srcdir/po/$file"; then
  660. func_poChangeLog_add_entry " * $file: Upgrade to gettext-${version}."
  661. else
  662. func_poChangeLog_add_entry " * $file: New file, from gettext-${version}."
  663. fi
  664. fi
  665. func_backup po/$file
  666. func_linkorcopy $file $gettext_dir/po/$file po/$file
  667. ;;
  668. esac
  669. done
  670. if test -f "$srcdir/po/cat-id-tbl.c"; then
  671. func_remove po/cat-id-tbl.c
  672. $do_changelog && func_poChangeLog_add_entry " * cat-id-tbl.c: Remove file."
  673. fi
  674. if test -f "$srcdir/po/stamp-cat-id"; then
  675. func_remove po/stamp-cat-id
  676. $do_changelog && func_poChangeLog_add_entry " * stamp-cat-id: Remove file."
  677. fi
  678. if test ! -f "$srcdir/po/POTFILES.in"; then
  679. if $doit; then
  680. echo "Creating initial po/POTFILES.in"
  681. echo '# List of source files which contain translatable strings.' > "$srcdir/po/POTFILES.in"
  682. else
  683. echo "Create initial po/POTFILES.in"
  684. fi
  685. $do_changelog && func_poChangeLog_add_entry " * POTFILES.in: New file."
  686. please="$please
  687. Please fill po/POTFILES.in as described in the documentation.
  688. "
  689. fi
  690. $do_changelog && func_poChangeLog_finish
  691. # Determine whether we can assume automake 1.9 or newer.
  692. have_automake19=
  693. if (aclocal --version) >/dev/null 2>/dev/null; then
  694. aclocal_version=`aclocal --version | sed -n -e 1p | sed -e 's/^[^0-9]*//'`
  695. case $aclocal_version in
  696. 1.9* | 1.[1-9][0-9]* | [2-9]*) have_automake19=yes ;;
  697. esac
  698. fi
  699. m4filelist='gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4
  700. po.m4 progtest.m4'
  701. # With aclocal versions < 1.9 we need all m4 files, otherwise "aclocal -I m4"
  702. # might give an error. (aclocal < 1.9 didn't know which macros are really
  703. # needed, it looked which macros are potentially needed.)
  704. min_automake_version=1.9
  705. if test -n "$intldir" || test -z "$have_automake19"; then
  706. # Add intldir.m4, intl.m4 and its dependencies.
  707. m4filelist=$m4filelist' codeset.m4 glibc2.m4 glibc21.m4 intdiv0.m4 intl.m4
  708. intldir.m4 intmax.m4 inttypes_h.m4 inttypes-pri.m4 lcmessage.m4 lock.m4
  709. longdouble.m4 longlong.m4 printf-posix.m4 size_max.m4 stdint_h.m4
  710. uintmax_t.m4 ulonglong.m4 visibility.m4 wchar_t.m4 wint_t.m4 xsize.m4'
  711. min_automake_version=1.8
  712. fi
  713. # All sorts of bugs could occur if the configure file was remade with the wrong
  714. # version of gettext.m4 et al. (because then the configure and the po/Makefile.in.in
  715. # don't fit together). It is therefore important that the package carries the
  716. # right versions of gettext.m4 et al. with it.
  717. if test -f "$srcdir/Makefile.am"; then
  718. # A package using automake.
  719. # Determine whether it's using automake 1.8 or newer.
  720. have_automake18=
  721. if (aclocal --version) >/dev/null 2>/dev/null; then
  722. aclocal_version=`aclocal --version | sed -n -e 1p | sed -e 's/^[^0-9]*//'`
  723. case $aclocal_version in
  724. 1.[8-9]* | 1.[1-9][0-9]* | [2-9]*) have_automake18=yes ;;
  725. esac
  726. fi
  727. # Extract the macro directory name from Makefile.am.
  728. aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$srcdir/Makefile.am" | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
  729. m4dir=m4
  730. m4dir_defaulted=yes
  731. m4dir_is_next=
  732. for arg in $aclocal_amflags; do
  733. if test -n "$m4dir_is_next"; then
  734. # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
  735. case "$arg" in
  736. /*) ;;
  737. *)
  738. m4dir="$arg"
  739. m4dir_defaulted=
  740. break
  741. ;;
  742. esac
  743. m4dir_is_next=
  744. else
  745. if test "X$arg" = "X-I"; then
  746. m4dir_is_next=yes
  747. else
  748. m4dir_is_next=
  749. fi
  750. fi
  751. done
  752. # Decide whether to use $m4dir/ChangeLog, or to use ChangeLog instead.
  753. if test -d "$srcdir/$m4dir" && test -f "$srcdir/ChangeLog" && test ! -f "$srcdir/$m4dir/ChangeLog"; then
  754. # The programmer has no $m4dir/ChangeLog so far. Don't introduce one.
  755. using_m4ChangeLog=
  756. fi
  757. # Update the *.m4 files and the corresponding Makefile.am.
  758. $do_changelog && func_m4ChangeLog_init
  759. added_m4dir=
  760. added_m4files=
  761. if test -d "$srcdir/$m4dir"; then
  762. :
  763. else
  764. if $doit; then
  765. echo "Creating directory $m4dir"
  766. mkdir "$srcdir/$m4dir"
  767. else
  768. echo "Create directory $m4dir"
  769. fi
  770. added_m4dir=yes
  771. fi
  772. for file in $m4filelist; do
  773. same=no
  774. if test -f "$srcdir/$m4dir/$file"; then
  775. if cmp -s "/usr/share/aclocal/$file" "$srcdir/$m4dir/$file"; then
  776. same=yes
  777. fi
  778. else
  779. added_m4files="$added_m4files $file"
  780. fi
  781. if $do_changelog && test $same = no; then
  782. if test -f "$srcdir/$m4dir/$file"; then
  783. func_m4ChangeLog_add_entry " * $file: Upgrade to gettext-${version}."
  784. else
  785. func_m4ChangeLog_add_entry " * $file: New file, from gettext-${version}."
  786. fi
  787. fi
  788. func_backup "$m4dir/$file"
  789. func_linkorcopy "/usr/share/aclocal/$file" "/usr/share/aclocal/$file" "$m4dir/$file"
  790. done
  791. missing_m4Makefileam=
  792. if test -n "$added_m4files"; then
  793. if test -f "$srcdir/$m4dir/Makefile.am"; then
  794. if $doit; then
  795. echo "Updating EXTRA_DIST in $m4dir/Makefile.am (backup is in $m4dir/Makefile.am~)"
  796. func_backup "$m4dir/Makefile.am"
  797. rm -f "$srcdir/$m4dir/Makefile.am"
  798. if grep '^EXTRA_DIST[ ]*=' "$srcdir/$m4dir/Makefile.am~" > /dev/null; then
  799. sed -e "s%^\(EXTRA_DIST[ ]*=\) \\?%\\1$added_m4files %" < "$srcdir/$m4dir/Makefile.am~" > "$srcdir/$m4dir/Makefile.am"
  800. $do_changelog && func_m4ChangeLog_add_entry " * Makefile.am (EXTRA_DIST): Add the new files."
  801. else
  802. (cat "$srcdir/$m4dir/Makefile.am~"; echo; echo "EXTRA_DIST =$added_m4files") > "$srcdir/$m4dir/Makefile.am"
  803. $do_changelog && func_m4ChangeLog_add_entry " * Makefile.am (EXTRA_DIST): New variable."
  804. fi
  805. else
  806. echo "Update EXTRA_DIST in $m4dir/Makefile.am"
  807. $do_changelog && func_m4ChangeLog_add_entry " * Makefile.am (EXTRA_DIST)."
  808. fi
  809. else
  810. # $m4dir/Makefile.am is not needed any more when aclocal 1.8 or newer
  811. # is used.
  812. if test -z "$have_automake18"; then
  813. if $doit; then
  814. echo "Creating $m4dir/Makefile.am"
  815. echo "EXTRA_DIST =$added_m4files" > "$srcdir/$m4dir/Makefile.am"
  816. else
  817. echo "Create $m4dir/Makefile.am"
  818. fi
  819. $do_changelog && func_m4ChangeLog_add_entry " * Makefile.am: New file."
  820. added_acoutput="$added_acoutput $m4dir/Makefile"
  821. else
  822. missing_m4Makefileam=yes
  823. fi
  824. fi
  825. fi
  826. if test -n "$added_m4dir" && test -z "$missing_m4Makefileam"; then
  827. added_directories="$added_directories $m4dir"
  828. fi
  829. $do_changelog && func_m4ChangeLog_finish
  830. # automake will arrange for $m4dir/ChangeLog to be distributed if a
  831. # $m4dir/Makefile.am exists. If not, we need to add it to Makefile.am's
  832. # EXTRA_DIST explicitly.
  833. if test -n "$created_m4ChangeLog" && test -n "$missing_m4Makefileam"; then
  834. added_extradist="$added_extradist $m4dir/ChangeLog"
  835. fi
  836. # Update the top-level Makefile.am.
  837. modified_Makefile_am=
  838. # func_modify_Makefile_am changelog_comment
  839. # assumes a modified copy of $srcdir/Makefile.am in $srcdir/Makefile.am.tmp
  840. # and replaces the original Makefile.am file with the modified one if
  841. # the two files differ. Then it removes the modified copy.
  842. func_modify_Makefile_am ()
  843. {
  844. if cmp -s "$srcdir/Makefile.am" "$srcdir/Makefile.am.tmp"; then
  845. :
  846. else
  847. if test -z "$modified_Makefile_am"; then
  848. if $doit; then
  849. echo "Updating Makefile.am (backup is in Makefile.am~)"
  850. func_backup Makefile.am
  851. else
  852. echo "Update Makefile.am"
  853. fi
  854. fi
  855. if $doit; then
  856. rm -f "$srcdir/Makefile.am"
  857. cp "$srcdir/Makefile.am.tmp" "$srcdir/Makefile.am"
  858. fi
  859. if $do_changelog; then
  860. if test -z "$modified_Makefile_am"; then
  861. func_ChangeLog_add_entry " * Makefile.am $1"
  862. else
  863. func_ChangeLog_add_entry " $1"
  864. fi
  865. fi
  866. modified_Makefile_am=yes
  867. fi
  868. rm -f "$srcdir/Makefile.am.tmp"
  869. }
  870. if test -n "$added_directories"; then
  871. if grep '^SUBDIRS[ ]*=' "$srcdir/Makefile.am" > /dev/null; then
  872. sed -e "s%^\(SUBDIRS[ ]*=\) \\?%\\1$added_directories %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
  873. added_directories_pretty=`echo $added_directories | sed -e 's/ /, /g'`
  874. func_modify_Makefile_am "(SUBDIRS): Add $added_directories_pretty."
  875. else
  876. (cat "$srcdir/Makefile.am"; echo; echo "SUBDIRS =$added_directories") > "$srcdir/Makefile.am.tmp"
  877. func_modify_Makefile_am "(SUBDIRS): New variable."
  878. fi
  879. fi
  880. if test -n "$removed_directory"; then
  881. sed -e '/^SUBDIRS[ ]*=/ {
  882. :a
  883. s%\([ ]\)'"$removed_directory"'[ ]%\1%
  884. s%[ ]'"$removed_directory"'$%%
  885. tb
  886. :b
  887. s%\\$%\\%
  888. tc
  889. bd
  890. :c
  891. n
  892. ba
  893. :d
  894. }' < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
  895. func_modify_Makefile_am "(SUBDIRS): Remove $removed_directory."
  896. fi
  897. if test -n "$added_directories"; then
  898. if grep '^DIST_SUBDIRS[ ]*=' "$srcdir/Makefile.am" > /dev/null; then
  899. sed -e "s%^\(DIST_SUBDIRS[ ]*=\) \\?%\\1$added_directories %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
  900. added_directories_pretty=`echo $added_directories | sed -e 's/ /, /g'`
  901. func_modify_Makefile_am "(DIST_SUBDIRS): Add $added_directories_pretty."
  902. fi
  903. fi
  904. if test -n "$removed_directory"; then
  905. sed -e '/^DIST_SUBDIRS[ ]*=/ {
  906. :a
  907. s%\([ ]\)'"$removed_directory"'[ ]%\1%
  908. s%[ ]'"$removed_directory"'$%%
  909. tb
  910. :b
  911. s%\\$%\\%
  912. tc
  913. bd
  914. :c
  915. n
  916. ba
  917. :d
  918. }' < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
  919. func_modify_Makefile_am "(DIST_SUBDIRS): Remove $removed_directory."
  920. fi
  921. if test -n "$m4dir_defaulted"; then
  922. if grep '^ACLOCAL_AMFLAGS[ ]*=' "$srcdir/Makefile.am" > /dev/null; then
  923. sed -e "s%^\(ACLOCAL_AMFLAGS[ ]*=\) \\?%\\1 -I $m4dir %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
  924. func_modify_Makefile_am "(ACLOCAL_AMFLAGS): Add -I $m4dir."
  925. else
  926. (cat "$srcdir/Makefile.am"; echo; echo "ACLOCAL_AMFLAGS = -I $m4dir") > "$srcdir/Makefile.am.tmp"
  927. func_modify_Makefile_am "(ACLOCAL_AMFLAGS): New variable."
  928. fi
  929. # Also update Makefile.in and, if existent, Makefile. Otherwise they
  930. # would take into account the new flags only after a few rounds of
  931. # "./configure", "make", "touch configure.in", "make distclean".
  932. if $doit; then
  933. for file in Makefile.in Makefile; do
  934. if test -f "$srcdir/$file"; then
  935. func_backup $file
  936. rm -f "$srcdir/$file"
  937. sed -e "s%(ACLOCAL)%(ACLOCAL) -I $m4dir%" < "$srcdir/$file~" > "$srcdir/$file"
  938. fi
  939. done
  940. fi
  941. fi
  942. if test -n "$added_extradist"; then
  943. if grep '^EXTRA_DIST[ ]*=' "$srcdir/Makefile.am" > /dev/null; then
  944. sed -e "s%^\(EXTRA_DIST[ ]*=\)%\\1$added_extradist %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
  945. added_extradist_pretty=`echo $added_extradist | sed -e 's/ /, /g'`
  946. func_modify_Makefile_am "(EXTRA_DIST): Add $added_extradist_pretty."
  947. else
  948. (cat "$srcdir/Makefile.am"; echo; echo "EXTRA_DIST =$added_extradist") > "$srcdir/Makefile.am.tmp"
  949. func_modify_Makefile_am "(EXTRA_DIST): New variable."
  950. fi
  951. fi
  952. # Extract the aclocal options name from Makefile.am.
  953. aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$srcdir/Makefile.am" | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
  954. aclocal_options=
  955. m4dir_is_next=
  956. for arg in $aclocal_amflags; do
  957. if test -n "$m4dir_is_next"; then
  958. aclocal_options="$aclocal_options -I $arg"
  959. m4dir_is_next=
  960. else
  961. if test "X$arg" = "X-I"; then
  962. m4dir_is_next=yes
  963. else
  964. m4dir_is_next=
  965. fi
  966. fi
  967. done
  968. please="$please
  969. Please run 'aclocal$aclocal_options' to regenerate the aclocal.m4 file.
  970. You need aclocal from GNU automake $min_automake_version (or newer) to do this.
  971. Then run 'autoconf' to regenerate the configure file.
  972. "
  973. # Also create $m4dir/Makefile.in from $m4dir/Makefile.am, because automake
  974. # doesn't do it by itself.
  975. if $doit; then
  976. case "$added_acoutput" in
  977. *" $m4dir/Makefile")
  978. (cd "$srcdir" && automake "$m4dir/Makefile") 2>/dev/null ||
  979. please="$please
  980. Please run 'automake $m4dir/Makefile' to create $m4dir/Makefile.in
  981. "
  982. ;;
  983. esac
  984. fi
  985. else
  986. please="$please
  987. Please add the files
  988. $m4filelist
  989. from the /usr/share/aclocal directory to your aclocal.m4 file.
  990. "
  991. fi
  992. modified_configure_in=
  993. # func_modify_configure_in changelog_comment
  994. # assumes a modified copy of $srcdir/$configure_in in $srcdir/$configure_in.tmp
  995. # and replaces the original configure.in/ac file with the modified one if
  996. # the two files differ. Then it removes the modified copy.
  997. func_modify_configure_in ()
  998. {
  999. if cmp -s "$srcdir/$configure_in" "$srcdir/$configure_in.tmp"; then
  1000. :
  1001. else
  1002. if test -z "$modified_configure_in"; then
  1003. if $doit; then
  1004. echo "Updating $configure_in (backup is in $configure_in~)"
  1005. func_backup $configure_in
  1006. else
  1007. echo "Update $configure_in"
  1008. fi
  1009. fi
  1010. if $doit; then
  1011. rm -f "$srcdir/$configure_in"
  1012. cp "$srcdir/$configure_in.tmp" "$srcdir/$configure_in"
  1013. fi
  1014. if $do_changelog; then
  1015. if test -z "$modified_configure_in"; then
  1016. func_ChangeLog_add_entry " * $configure_in $1"
  1017. else
  1018. func_ChangeLog_add_entry " $1"
  1019. fi
  1020. fi
  1021. modified_configure_in=yes
  1022. fi
  1023. rm -f "$srcdir/$configure_in.tmp"
  1024. }
  1025. if test -n "$added_acoutput"; then
  1026. if grep '^AC_CONFIG_FILES(' "$srcdir/$configure_in" > /dev/null; then
  1027. sedprog='
  1028. ta
  1029. b
  1030. :a
  1031. n
  1032. ba'
  1033. sed -e "s%^\\(AC_CONFIG_FILES([^])\\,]*\\)%\\1$added_acoutput%$sedprog" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
  1034. added_acoutput_pretty=`echo $added_acoutput | sed -e 's/ /, /g'`
  1035. func_modify_configure_in "(AC_CONFIG_FILES): Add $added_acoutput_pretty."
  1036. else
  1037. if grep '^AC_OUTPUT(' "$srcdir/$configure_in" > /dev/null; then
  1038. sed -e "s%^\\(AC_OUTPUT([^])\\,]*\\)%\\1$added_acoutput%" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
  1039. added_acoutput_pretty=`echo $added_acoutput | sed -e 's/ /, /g'`
  1040. func_modify_configure_in "(AC_OUTPUT): Add $added_acoutput_pretty."
  1041. else
  1042. please="$please
  1043. Please add$added_acoutput to the AC_OUTPUT or AC_CONFIG_FILES invocation in the $configure_in file.
  1044. "
  1045. fi
  1046. fi
  1047. fi
  1048. if test -n "$removed_acoutput"; then
  1049. for file in $removed_acoutput; do
  1050. tag=
  1051. sedprog='{
  1052. s%\([[ ]\)'"$file"'[ ]%\1%
  1053. s%\([[ ]\)'"$file"'\([]),]\)%\1\2%
  1054. s%[[ ]'"$file"'$%%
  1055. :a
  1056. tb
  1057. :b
  1058. s%\\$%\\%
  1059. tc
  1060. bd
  1061. :c
  1062. n
  1063. s%\([ ]\)'"$file"'[ ]%\1%
  1064. s%\([ ]\)'"$file"'\([]),]\)%\1\2%
  1065. s%[ ]'"$file"'$%%
  1066. ba
  1067. :d
  1068. }'
  1069. sed -e '/^AC_CONFIG_FILES(/'"$sedprog" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
  1070. if cmp -s "$srcdir/$configure_in" "$srcdir/$configure_in.tmp"; then
  1071. sed -e '/^AC_OUTPUT(/'"$sedprog" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
  1072. if cmp -s "$srcdir/$configure_in" "$srcdir/$configure_in.tmp"; then
  1073. :
  1074. else
  1075. tag=AC_OUTPUT
  1076. fi
  1077. else
  1078. tag=AC_CONFIG_FILES
  1079. fi
  1080. if test -n "$tag"; then
  1081. func_modify_configure_in "($tag): Remove $file."
  1082. else
  1083. rm -f "$srcdir/$configure_in.tmp"
  1084. if test "$file" != intl/intlh.inst; then
  1085. please="$please
  1086. Please remove $file from the AC_OUTPUT or AC_CONFIG_FILES invocation
  1087. in the $configure_in file.
  1088. "
  1089. fi
  1090. fi
  1091. done
  1092. fi
  1093. sed -e 's%sed -e "/POTFILES =/r po/POTFILES" po/Makefile\.in > po/Makefile *;* *%%' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
  1094. func_modify_configure_in "(AC_OUTPUT): Remove command that created po/Makefile."
  1095. sed -e '/^\(dnl \|\)AC_LINK_FILES(\$nls_cv_header_libgt, \$nls_cv_header_intl)$/d' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
  1096. func_modify_configure_in "(AC_LINK_FILES): Remove invocation."
  1097. sed -e 's/^AM_GNU_GETTEXT_VERSION([^()]*)/AM_GNU_GETTEXT_VERSION(['"$version"'])/' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
  1098. func_modify_configure_in "(AM_GNU_GETTEXT_VERSION): Bump to $version."
  1099. $do_changelog && func_ChangeLog_finish
  1100. # Recommend replacement for deprecated Makefile variables.
  1101. use_libtool=`cat "$srcdir/$configure_in" | grep '^A[CM]_PROG_LIBTOOL'`
  1102. for file in `(cd "$srcdir"; find . -name Makefile.am -print; find . -name Makefile.in -print) | sed -e 's,^\./,,'`; do
  1103. if test -f "$srcdir/$file"; then
  1104. if test `echo "$file" | sed -e 's,^.*/,,'` = Makefile.in && grep automake "$srcdir/$file" >/dev/null 2>&1; then
  1105. continue;
  1106. fi
  1107. # INTLLIBS is deprecated because it doesn't distinguish the two
  1108. # cases: with libtool, without libtool.
  1109. if grep '@''INTLLIBS''@' "$srcdir/$file" >/dev/null 2>&1; then
  1110. if test -n "$use_libtool"; then
  1111. please="$please
  1112. Please change $file to use @""LTLIBINTL""@ or @""LIBINTL""@ instead of
  1113. @""INTLLIBS""@. Which one, depends whether it is used with libtool or not.
  1114. @""INTLLIBS""@ will go away.
  1115. "
  1116. else
  1117. please="$please
  1118. Please change $file to use @""LIBINTL""@ instead of @""INTLLIBS""@.
  1119. @""INTLLIBS""@ will go away.
  1120. "
  1121. fi
  1122. fi
  1123. # DATADIRNAME is deprecated because we install only .gmo files nowadays,
  1124. # which can be stored in the platform independent $prefix/share hierarchy.
  1125. if grep '@''DATADIRNAME''@' "$srcdir/$file" >/dev/null 2>&1; then
  1126. please="$please
  1127. Please change $file to use the constant string \"share\" instead of
  1128. @""DATADIRNAME""@. @""DATADIRNAME""@ will go away.
  1129. "
  1130. fi
  1131. # INSTOBJEXT is deprecated because we install only .gmo files nowadays,
  1132. # no catgets .cat catalogs.
  1133. if grep '@''INSTOBJEXT''@' "$srcdir/$file" >/dev/null 2>&1; then
  1134. please="$please
  1135. Please change $file to use the constant string \".mo\" instead of
  1136. @""INSTOBJEXT""@. @""INSTOBJEXT""@ will go away.
  1137. "
  1138. fi
  1139. # GENCAT is deprecated because we install no catgets catalogs anymore.
  1140. if grep '@''GENCAT''@' "$srcdir/$file" >/dev/null 2>&1; then
  1141. please="$please
  1142. Please change $file to use the constant string \"gencat\" instead of
  1143. @""GENCAT""@. @""GENCAT""@ will go away. Maybe you don't even need it any more?
  1144. "
  1145. fi
  1146. # POSUB is deprecated because it causes "./configure --disable-nls", "make",
  1147. # "make dist" to create a buggy tarfile.
  1148. if grep '@''POSUB''@' "$srcdir/$file" >/dev/null 2>&1; then
  1149. please="$please
  1150. Please change $file to use the constant string \"po\" instead of
  1151. @""POSUB""@. @""POSUB""@ will go away.
  1152. "
  1153. fi
  1154. fi
  1155. done
  1156. # Recommend replacement for deprecated configure variables.
  1157. if grep '\$nls_cv_header_' "$srcdir/$configure_in" >/dev/null 2>&1; then
  1158. please="$please
  1159. Please stop using \$nls_cv_header_intl or \$nls_cv_header_libgt in the
  1160. $configure_in file. Both will go away. Use <libintl.h> or \"gettext.h\" instead.
  1161. "
  1162. fi
  1163. # Recommend fetching config.guess and config.sub.
  1164. if test -f "$srcdir/$auxdir"config.guess && test -f "$srcdir/$auxdir"config.sub; then
  1165. :
  1166. else
  1167. please="$please
  1168. You will also need config.guess and config.sub, which you can get from the CVS
  1169. of the 'config' project at http://savannah.gnu.org/. The commands to fetch them
  1170. are
  1171. \$ wget 'http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess'
  1172. \$ wget 'http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub'
  1173. "
  1174. fi
  1175. if $doit; then
  1176. echo "$please"
  1177. echo "You might also want to copy the convenience header file gettext.h"
  1178. echo "from the $gettext_dir directory into your package."
  1179. echo "It is a wrapper around <libintl.h> that implements the configure --disable-nls"
  1180. echo "option."
  1181. echo
  1182. count=`echo "$please" | grep '^$' | wc -l`
  1183. count=`echo "$count" | sed -e 's/[ ]//g'`
  1184. case "$count" in
  1185. 1) count="paragraph";;
  1186. 2) count="two paragraphs";;
  1187. 3) count="three paragraphs";;
  1188. 4) count="four paragraphs";;
  1189. 5) count="five paragraphs";;
  1190. *) count="$count paragraphs";;
  1191. esac
  1192. echo "Press Return to acknowledge the previous $count."
  1193. # Read from /dev/tty, not stdin, so that gettextize cannot be abused by
  1194. # non-interactive tools.
  1195. read dummy < /dev/tty
  1196. fi
  1197. exit 0