91 |
my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize'; |
my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize'; |
92 |
my $gettextize = $ENV{'GETTEXTIZE'} || 'gettextize'; |
my $gettextize = $ENV{'GETTEXTIZE'} || 'gettextize'; |
93 |
|
|
94 |
|
# Does gettextize support --no-changelog and --intl? |
95 |
|
my $gettextize_intl_p; |
96 |
|
my $gettextize_no_changelog_p; |
97 |
|
|
98 |
# --install -- as --add-missing in other tools. |
# --install -- as --add-missing in other tools. |
99 |
my $install = 0; |
my $install = 0; |
105 |
# The directory where autoreconf was run. |
# The directory where autoreconf was run. |
106 |
my $cwd = cwd; |
my $cwd = cwd; |
107 |
|
|
108 |
|
|
109 |
|
|
110 |
## ---------- ## |
## ---------- ## |
111 |
## Routines. ## |
## Routines. ## |
112 |
## ---------- ## |
## ---------- ## |
184 |
} |
} |
185 |
|
|
186 |
|
|
187 |
|
# &study_gettextize |
188 |
|
# ----------------- |
189 |
|
# See what options gettextize supports. |
190 |
|
sub study_gettextize () |
191 |
|
{ |
192 |
|
return |
193 |
|
if defined $gettextize_no_changelog_p && defined $gettextize_intl_p; |
194 |
|
|
195 |
|
$gettextize_no_changelog_p = 0; |
196 |
|
$gettextize_intl_p = 0; |
197 |
|
|
198 |
|
my $usage = new Autom4te::XFile ("$gettextize --help |"); |
199 |
|
while ($_ = $usage->getline) |
200 |
|
{ |
201 |
|
$gettextize_no_changelog_p = 1 if /--no-changelog/; |
202 |
|
$gettextize_intl_p = 1 if /--intl/; |
203 |
|
} |
204 |
|
|
205 |
|
$gettextize .= " --no-changelog" if $gettextize_no_changelog_p; |
206 |
|
} |
207 |
|
|
208 |
|
|
209 |
|
|
210 |
# &autoreconf ($DIRECTORY) |
# &autoreconf ($DIRECTORY) |
211 |
# ------------------------ |
# ------------------------ |
212 |
# Reconf the $DIRECTORY. |
# Reconf the $DIRECTORY. |
294 |
if -f 'aclocal.m4t'; |
if -f 'aclocal.m4t'; |
295 |
} |
} |
296 |
|
|
297 |
|
# We might have to rerun aclocal if Libtool or Gettext import new |
298 |
|
# macros. |
299 |
|
my $rerun_alocal = 0; |
300 |
|
|
301 |
|
|
302 |
# ------------------------------- # |
# ------------------------------- # |
307 |
# between two --trace, that's useless. If there is no AC_INIT, then |
# between two --trace, that's useless. If there is no AC_INIT, then |
308 |
# we are not interested: it looks like a Cygnus thingy. |
# we are not interested: it looks like a Cygnus thingy. |
309 |
my $uses_gettext; |
my $uses_gettext; |
310 |
|
# Starting at GNU Gettext 0.11, libintl is optional. |
311 |
|
my $uses_libintl; |
312 |
my $uses_libtool; |
my $uses_libtool; |
313 |
my $uses_autoheader; |
my $uses_autoheader; |
314 |
my @subdir; |
my @subdir; |
322 |
while ($_ = $traces->getline) |
while ($_ = $traces->getline) |
323 |
{ |
{ |
324 |
$uses_autoconf = 1 if /AC_INIT/; |
$uses_autoconf = 1 if /AC_INIT/; |
325 |
$uses_gettext = 1 if /AM_GNU_GETTEXT/; |
if (/AM_GNU_GETTEXT/) |
326 |
|
{ |
327 |
|
$uses_gettext = 1; |
328 |
|
$uses_libintl = !/external/; |
329 |
|
} |
330 |
$uses_libtool = 1 if /AC_PROG_LIBTOOL/; |
$uses_libtool = 1 if /AC_PROG_LIBTOOL/; |
331 |
$uses_autoheader = 1 if /AC_CONFIG_HEADERS/; |
$uses_autoheader = 1 if /AC_CONFIG_HEADERS/; |
332 |
push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/; |
push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/; |
356 |
{ |
{ |
357 |
verbose "$configure_ac: not using Gettext"; |
verbose "$configure_ac: not using Gettext"; |
358 |
} |
} |
359 |
elsif (-d 'intl' && !$force) |
elsif (!$install) |
|
{ |
|
|
verbose "$configure_ac: not running gettextize: `intl' is already present"; |
|
|
} |
|
|
elsif ($install) |
|
360 |
{ |
{ |
361 |
xsystem ($gettextize); |
verbose "$configure_ac: not running gettextize: --install not given"; |
362 |
} |
} |
363 |
else |
else |
364 |
{ |
{ |
365 |
verbose "$configure_ac: not running gettextize: --install not given"; |
# See if gettextize supports --intl and --no-changelog. |
366 |
|
study_gettextize; |
367 |
|
|
368 |
|
# Old and new gettext are really different :( |
369 |
|
if ($gettextize_intl_p) |
370 |
|
{ |
371 |
|
# Gettext >= 0.11. |
372 |
|
if ($uses_libintl) |
373 |
|
{ |
374 |
|
if (-d 'intl' && !$force) |
375 |
|
{ |
376 |
|
verbose ("$configure_ac: not running gettextize: ", |
377 |
|
"`intl' is already present"); |
378 |
|
} |
379 |
|
else |
380 |
|
{ |
381 |
|
xsystem "$gettextize --intl"; |
382 |
|
$rerun_alocal = 1; |
383 |
|
} |
384 |
|
} |
385 |
|
else |
386 |
|
{ |
387 |
|
# Always run modern gettextizes, as they update/import |
388 |
|
# several files. |
389 |
|
xsystem "$gettextize"; |
390 |
|
$rerun_alocal = 1; |
391 |
|
} |
392 |
|
} |
393 |
|
else |
394 |
|
{ |
395 |
|
# Gettext < 0.11. |
396 |
|
if (-d 'intl' && !$force) |
397 |
|
{ |
398 |
|
verbose ("$configure_ac: not running gettextize: ", |
399 |
|
"`intl' is already present"); |
400 |
|
} |
401 |
|
else |
402 |
|
{ |
403 |
|
xsystem "$gettextize --intl"; |
404 |
|
$rerun_alocal = 1; |
405 |
|
} |
406 |
|
} |
407 |
} |
} |
408 |
|
|
409 |
|
|
418 |
elsif ($install) |
elsif ($install) |
419 |
{ |
{ |
420 |
xsystem ($libtoolize); |
xsystem ($libtoolize); |
421 |
|
$rerun_alocal = 1; |
422 |
} |
} |
423 |
else |
else |
424 |
{ |
{ |
444 |
} |
} |
445 |
|
|
446 |
|
|
447 |
|
# ------------------- # |
448 |
|
# Rerunning aclocal. # |
449 |
|
# ------------------- # |
450 |
|
|
451 |
|
# If we re-installed Libtool or Gettext, the macros might have changed. |
452 |
|
if ($rerun_alocal) |
453 |
|
{ |
454 |
|
if (!$uses_aclocal) |
455 |
|
{ |
456 |
|
verbose "$configure_ac: not using aclocal"; |
457 |
|
} |
458 |
|
else |
459 |
|
{ |
460 |
|
xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t"); |
461 |
|
# aclocal may produce no output. |
462 |
|
update_file ('aclocal.m4t', 'aclocal.m4') |
463 |
|
if -f 'aclocal.m4t'; |
464 |
|
} |
465 |
|
} |
466 |
|
|
467 |
|
|
468 |
# ------------------ # |
# ------------------ # |
469 |
# Running autoconf. # |
# Running autoconf. # |
470 |
# ------------------ # |
# ------------------ # |