autoreconf 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. #! /usr/bin/env perl
  2. # -*- perl -*-
  3. # Generated from autoreconf.in; do not edit by hand.
  4. eval 'case $# in 0) exec /usr/bin/env perl -S "$0";; *) exec /usr/bin/env perl -S "$0" "$@";; esac'
  5. if 0;
  6. # autoreconf - install the GNU Build System in a directory tree
  7. # Copyright (C) 1994, 1999-2012 Free Software Foundation, Inc.
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License, or
  11. # (at your option) any later version.
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. # Written by David J. MacKenzie.
  19. # Extended and rewritten in Perl by Akim Demaille.
  20. BEGIN
  21. {
  22. my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/share/autoconf';
  23. unshift @INC, $pkgdatadir;
  24. # Override SHELL. On DJGPP SHELL may not be set to a shell
  25. # that can handle redirection and quote arguments correctly,
  26. # e.g.: COMMAND.COM. For DJGPP always use the shell that configure
  27. # has detected.
  28. $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos');
  29. }
  30. use Autom4te::ChannelDefs;
  31. use Autom4te::Channels;
  32. use Autom4te::Configure_ac;
  33. use Autom4te::FileUtils;
  34. use Autom4te::General;
  35. use Autom4te::XFile;
  36. # Do not use Cwd::chdir, since it might hang.
  37. use Cwd 'cwd';
  38. use strict;
  39. ## ----------- ##
  40. ## Variables. ##
  41. ## ----------- ##
  42. # $HELP
  43. # -----
  44. $help = "Usage: $0 [OPTION]... [DIRECTORY]...
  45. Run `autoconf' (and `autoheader', `aclocal', `automake', `autopoint'
  46. (formerly `gettextize'), `libtoolize', and `gnu-configize' where appropriate)
  47. repeatedly to remake the GNU Build System files in specified
  48. DIRECTORIES and their subdirectories (defaulting to `.').
  49. By default, it only remakes those files that are older than their
  50. sources. If you install new versions of the GNU Build System,
  51. you can make `autoreconf' remake all of the files by giving it the
  52. `--force' option.
  53. Operation modes:
  54. -h, --help print this help, then exit
  55. -V, --version print version number, then exit
  56. -v, --verbose verbosely report processing
  57. -d, --debug don't remove temporary files
  58. -f, --force consider all files obsolete
  59. -i, --install copy missing auxiliary files
  60. --no-recursive don't rebuild sub-packages
  61. -s, --symlink with -i, install symbolic links instead of copies
  62. -x, --exclude=STEPS steps we should not run
  63. -m, --make when applicable, re-run ./configure && make
  64. -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
  65. " . Autom4te::ChannelDefs::usage . "
  66. The environment variable \`WARNINGS\' is honored. Some subtools might
  67. support other warning types, using \`all' is encouraged.
  68. Library directories:
  69. -B, --prepend-include=DIR prepend directory DIR to search path
  70. -I, --include=DIR append directory DIR to search path
  71. The environment variables AUTOM4TE, AUTOCONF, AUTOHEADER, AUTOMAKE,
  72. ACLOCAL, AUTOPOINT, LIBTOOLIZE, M4, and MAKE are honored.
  73. Report bugs to <bug-autoconf\@gnu.org>.
  74. GNU Autoconf home page: <http://www.gnu.org/software/autoconf/>.
  75. General help using GNU software: <http://www.gnu.org/gethelp/>.
  76. ";
  77. # $VERSION
  78. # --------
  79. $version = "autoreconf (GNU Autoconf) 2.69
  80. Copyright (C) 2012 Free Software Foundation, Inc.
  81. License GPLv3+/Autoconf: GNU GPL version 3 or later
  82. <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
  83. This is free software: you are free to change and redistribute it.
  84. There is NO WARRANTY, to the extent permitted by law.
  85. Written by David J. MacKenzie and Akim Demaille.
  86. ";
  87. # Lib files.
  88. my $autoconf = $ENV{'AUTOCONF'} || '/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/autoconf';
  89. my $autoheader = $ENV{'AUTOHEADER'} || '/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/autoheader';
  90. my $autom4te = $ENV{'AUTOM4TE'} || '/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/autom4te';
  91. my $automake = $ENV{'AUTOMAKE'} || 'automake';
  92. my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
  93. my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
  94. my $autopoint = $ENV{'AUTOPOINT'} || 'autopoint';
  95. my $make = $ENV{'MAKE'} || 'make';
  96. my $gnuconfigize = $ENV{'GNUCONFIGIZE'} || 'gnu-configize';
  97. # --install -- as --add-missing in other tools.
  98. my $install = 0;
  99. # symlink -- when --install, use symlinks instead.
  100. my $symlink = 0;
  101. # Does aclocal support --force?
  102. my $aclocal_supports_force = 0;
  103. # Does aclocal support -Wfoo?
  104. my $aclocal_supports_warnings = 0;
  105. # Does automake support --force-missing?
  106. my $automake_supports_force_missing = 0;
  107. # Does automake support -Wfoo?
  108. my $automake_supports_warnings = 0;
  109. # Does automake support --warning=cross
  110. my $automake_supports_cross_warning = 0;
  111. my @prepend_include;
  112. my @include;
  113. # List of command line warning requests.
  114. my @warning;
  115. # Rerun `./configure && make'?
  116. my $run_make = 0;
  117. # Recurse into subpackages
  118. my $recursive = 1;
  119. # Steps to exclude
  120. my @exclude;
  121. my @ex;
  122. my $uses_gettext;
  123. my $configure_ac;
  124. ## ---------- ##
  125. ## Routines. ##
  126. ## ---------- ##
  127. # parse_args ()
  128. # -------------
  129. # Process any command line arguments.
  130. sub parse_args ()
  131. {
  132. my $srcdir;
  133. getopt ("W|warnings=s" => \@warning,
  134. 'I|include=s' => \@include,
  135. 'B|prepend-include=s' => \@prepend_include,
  136. 'i|install' => \$install,
  137. 's|symlink' => \$symlink,
  138. 'x|exclude=s' => \@exclude,
  139. 'm|make' => \$run_make,
  140. 'recursive!' => \$recursive);
  141. # Split the warnings as a list of elements instead of a list of
  142. # lists.
  143. @warning = map { split /,/ } @warning;
  144. parse_WARNINGS;
  145. parse_warnings '--warnings', @warning;
  146. @exclude = map { split /,/ } @exclude;
  147. # Even if the user specified a configure.ac, trim to get the
  148. # directory, and look for configure.ac again. Because (i) the code
  149. # is simpler, and (ii) we are still able to diagnose simultaneous
  150. # presence of configure.ac and configure.in.
  151. @ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV;
  152. push @ARGV, '.' unless @ARGV;
  153. if ($verbose && $debug)
  154. {
  155. for my $prog ($autoconf, $autoheader,
  156. $automake, $aclocal,
  157. $autopoint,
  158. $libtoolize)
  159. {
  160. xsystem ("$prog --version | sed 1q >&2");
  161. print STDERR "\n";
  162. }
  163. }
  164. my $aclocal_help = `$aclocal --help 2>/dev/null`;
  165. my $automake_help = `$automake --help 2>/dev/null`;
  166. $aclocal_supports_force = $aclocal_help =~ /--force/;
  167. $aclocal_supports_warnings = $aclocal_help =~ /--warnings/;
  168. $automake_supports_force_missing = $automake_help =~ /--force-missing/;
  169. $automake_supports_warnings = $automake_help =~ /--warnings/;
  170. $automake_supports_cross_warning = $automake_help =~ /cross/;
  171. # Dispatch autoreconf's option to the tools.
  172. # --include;
  173. $aclocal .= join (' -I ', '', map { shell_quote ($_) } @include);
  174. $autoconf .= join (' --include=', '', map { shell_quote ($_) } @include);
  175. $autoconf .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
  176. $autoheader .= join (' --include=', '', map { shell_quote ($_) } @include);
  177. $autoheader .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
  178. # --install and --symlink;
  179. if ($install)
  180. {
  181. $automake .= ' --add-missing';
  182. $automake .= ' --copy' unless $symlink;
  183. $libtoolize .= ' --copy' unless $symlink;
  184. }
  185. # --force;
  186. if ($force)
  187. {
  188. $aclocal .= ' --force'
  189. if $aclocal_supports_force;
  190. $autoconf .= ' --force';
  191. $autoheader .= ' --force';
  192. $automake .= ' --force-missing'
  193. if $automake_supports_force_missing;
  194. $autopoint .= ' --force';
  195. $libtoolize .= ' --force';
  196. }
  197. else
  198. {
  199. # The implementation of --no-force is bogus in all implementations
  200. # of Automake up to 1.8, so we avoid it in these cases. (Automake
  201. # 1.8 is the first version where aclocal supports force, hence
  202. # the condition.)
  203. $automake .= ' --no-force'
  204. if $aclocal_supports_force;
  205. }
  206. # --verbose --verbose or --debug;
  207. if ($verbose > 1 || $debug)
  208. {
  209. $autoconf .= ' --verbose';
  210. $autoheader .= ' --verbose';
  211. $automake .= ' --verbose';
  212. $aclocal .= ' --verbose';
  213. }
  214. if ($debug)
  215. {
  216. $autoconf .= ' --debug';
  217. $autoheader .= ' --debug';
  218. $libtoolize .= ' --debug';
  219. }
  220. # --warnings;
  221. @warning = grep { $_ ne "cross" } @warning
  222. if ! $automake_supports_cross_warning;
  223. if (@warning)
  224. {
  225. my $warn = ' --warnings=' . join (',', @warning);
  226. $autoconf .= $warn;
  227. $autoheader .= $warn;
  228. $automake .= $warn
  229. if $automake_supports_warnings;
  230. $aclocal .= $warn
  231. if $aclocal_supports_warnings;
  232. }
  233. }
  234. # &run_aclocal ($ACLOCAL, $FLAGS)
  235. # -------------------------------
  236. # Update aclocal.m4 as lazily as possible, as aclocal pre-1.8 always
  237. # overwrites aclocal.m4, hence triggers autoconf, autoheader, automake
  238. # etc. uselessly. aclocal 1.8+ does not need this.
  239. sub run_aclocal ($$)
  240. {
  241. my ($aclocal, $flags) = @_;
  242. @ex = grep (/^aclocal$/, @exclude);
  243. if ($#ex != -1) {
  244. return;
  245. }
  246. # aclocal 1.8+ does all this for free. It can be recognized by its
  247. # --force support.
  248. if ($aclocal_supports_force)
  249. {
  250. xsystem ("$aclocal $flags");
  251. }
  252. else
  253. {
  254. xsystem ("$aclocal $flags --output=aclocal.m4t");
  255. # aclocal may produce no output.
  256. if (-f 'aclocal.m4t')
  257. {
  258. update_file ('aclocal.m4t', 'aclocal.m4');
  259. # Make sure that the local m4 files are older than
  260. # aclocal.m4.
  261. #
  262. # Why is not always the case? Because we already run
  263. # aclocal at first (before tracing), which, for instance,
  264. # can find Gettext's macros in .../share/aclocal, so we may
  265. # have had the right aclocal.m4 already. Then autopoint is
  266. # run, and installs locally these M4 files. Then
  267. # autoreconf, via update_file, sees it is the _same_
  268. # aclocal.m4, and doesn't change its timestamp. But later,
  269. # Automake's Makefile expresses that aclocal.m4 depends on
  270. # these local files, which are newer, so it triggers aclocal
  271. # again.
  272. #
  273. # To make sure aclocal.m4 is no older, we change the
  274. # modification times of the local M4 files to be not newer
  275. # than it.
  276. #
  277. # First, where are the local files?
  278. my $aclocal_local_dir = '.';
  279. if ($flags =~ /-I\s+(\S+)/)
  280. {
  281. $aclocal_local_dir = $1;
  282. }
  283. # All the local files newer than aclocal.m4 are to be
  284. # made not newer than it.
  285. my $aclocal_m4_mtime = mtime ('aclocal.m4');
  286. for my $file (glob ("$aclocal_local_dir/*.m4"), 'acinclude.m4')
  287. {
  288. if ($aclocal_m4_mtime < mtime ($file))
  289. {
  290. debug "aging $file to be not newer than aclocal.m4";
  291. utime $aclocal_m4_mtime, $aclocal_m4_mtime, $file;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. # &autoreconf_current_directory
  298. # -----------------------------
  299. sub autoreconf_current_directory ()
  300. {
  301. my $configure_ac = find_configure_ac;
  302. # ---------------------- #
  303. # Is it using Autoconf? #
  304. # ---------------------- #
  305. my $uses_autoconf;
  306. my $uses_gettext;
  307. if (-f $configure_ac)
  308. {
  309. my $configure_ac_file = new Autom4te::XFile "< $configure_ac";
  310. while ($_ = $configure_ac_file->getline)
  311. {
  312. s/#.*//;
  313. s/dnl.*//;
  314. $uses_autoconf = 1 if /AC_INIT/;
  315. # See below for why we look for gettext here.
  316. $uses_gettext = 1 if /^AM_GNU_GETTEXT_VERSION/;
  317. }
  318. }
  319. if (!$uses_autoconf)
  320. {
  321. verb "$configure_ac: not using Autoconf";
  322. return;
  323. }
  324. # ------------------- #
  325. # Running autopoint. #
  326. # ------------------- #
  327. # Gettext is a bit of a problem: its macros are not necessarily
  328. # visible to aclocal, so if we start with a completely striped down
  329. # package (think of a fresh CVS checkout), running `aclocal' first
  330. # will fail: the Gettext macros are missing.
  331. #
  332. # Therefore, we can't use the traces to decide if we use Gettext or
  333. # not. I guess that once Gettext move to 2.5x we will be able to,
  334. # but in the meanwhile forget it.
  335. #
  336. # We can only grep for AM_GNU_GETTEXT_VERSION in configure.ac. You
  337. # might think this approach is naive, and indeed it is, as it
  338. # prevents one to embed AM_GNU_GETTEXT_VERSION in another *.m4, but
  339. # anyway we don't limit the generality, since... that's what
  340. # autopoint does. Actually, it is even more restrictive, as it
  341. # greps for `^AM_GNU_GETTEXT_VERSION('. We did this above, while
  342. # scanning configure.ac.
  343. if (!$uses_gettext)
  344. {
  345. verb "$configure_ac: not using Gettext";
  346. }
  347. elsif (!$install)
  348. {
  349. verb "$configure_ac: not running autopoint: --install not given";
  350. }
  351. else
  352. {
  353. @ex = grep (/^autopoint$/, @exclude);
  354. if ($#ex == -1) {
  355. xsystem_hint ("autopoint is needed because this package uses Gettext", "$autopoint");
  356. }
  357. }
  358. # ----------------- #
  359. # Running aclocal. #
  360. # ----------------- #
  361. # Run it first: it might discover new macros to add, e.g.,
  362. # AC_PROG_LIBTOOL, which we will trace later to see if Libtool is
  363. # used.
  364. #
  365. # Always run it. Tracking its sources for up-to-dateness is too
  366. # complex and too error prone. The best we can do is avoiding
  367. # nuking the time stamp.
  368. my $uses_aclocal = 1;
  369. # Nevertheless, if aclocal.m4 exists and is not made by aclocal,
  370. # don't run aclocal.
  371. if (-f 'aclocal.m4')
  372. {
  373. my $aclocal_m4 = new Autom4te::XFile 'aclocal.m4';
  374. $_ = $aclocal_m4->getline;
  375. $uses_aclocal = 0
  376. unless defined ($_) && /generated.*by aclocal/;
  377. }
  378. # If there are flags for aclocal in Makefile.am, use them.
  379. my $aclocal_flags = '';
  380. if ($uses_aclocal && -f 'Makefile.am')
  381. {
  382. my $makefile = new Autom4te::XFile 'Makefile.am';
  383. while ($_ = $makefile->getline)
  384. {
  385. if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
  386. {
  387. $aclocal_flags = $1;
  388. last;
  389. }
  390. }
  391. }
  392. if (!$uses_aclocal)
  393. {
  394. verb "$configure_ac: not using aclocal";
  395. }
  396. else
  397. {
  398. # Some file systems have sub-second time stamps, and if so we may
  399. # run into trouble later, after we rerun autoconf and set the
  400. # time stamps of input files to be no greater than aclocal.m4,
  401. # because the time-stamp-setting operation (utime) has a
  402. # resolution of only 1 second. Work around the problem by
  403. # ensuring that there is at least a one-second window before the
  404. # time stamp of aclocal.m4t in which no file time stamps can
  405. # fall.
  406. sleep 1;
  407. run_aclocal ($aclocal, $aclocal_flags);
  408. }
  409. # We might have to rerun aclocal if Libtool (or others) imports new
  410. # macros.
  411. my $rerun_aclocal = 0;
  412. # ------------------------------- #
  413. # See what tools will be needed. #
  414. # ------------------------------- #
  415. # Perform a single trace reading to avoid --force forcing a rerun
  416. # between two --trace, that's useless. If there is no AC_INIT, then
  417. # we are not interested: it looks like a Cygnus thingy.
  418. my $aux_dir;
  419. my $uses_gettext_via_traces;
  420. my $uses_libtool;
  421. my $uses_libltdl;
  422. my $uses_autoheader;
  423. my $uses_automake;
  424. my @subdir;
  425. verb "$configure_ac: tracing";
  426. my $traces = new Autom4te::XFile
  427. ("$autoconf"
  428. . join (' ',
  429. map { ' --trace=' . $_ . ':\$n::\${::}%' }
  430. # If you change this list, update the
  431. # `Autoreconf-preselections' section of autom4te.in.
  432. 'AC_CONFIG_AUX_DIR',
  433. 'AC_CONFIG_HEADERS',
  434. 'AC_CONFIG_SUBDIRS',
  435. 'AC_INIT',
  436. 'AC_PROG_LIBTOOL',
  437. 'LT_INIT',
  438. 'LT_CONFIG_LTDL_DIR',
  439. 'AM_GNU_GETTEXT',
  440. 'AM_INIT_AUTOMAKE',
  441. )
  442. . ' |');
  443. while ($_ = $traces->getline)
  444. {
  445. chomp;
  446. my ($macro, @args) = split (/::/);
  447. $aux_dir = $args[0] if $macro eq "AC_CONFIG_AUX_DIR";
  448. $uses_autoconf = 1 if $macro eq "AC_INIT";
  449. $uses_gettext_via_traces = 1 if $macro eq "AM_GNU_GETTEXT";
  450. $uses_libtool = 1 if $macro eq "AC_PROG_LIBTOOL"
  451. || $macro eq "LT_INIT";
  452. $uses_libltdl = 1 if $macro eq "LT_CONFIG_LTDL_DIR";
  453. $uses_autoheader = 1 if $macro eq "AC_CONFIG_HEADERS";
  454. $uses_automake = 1 if $macro eq "AM_INIT_AUTOMAKE";
  455. push @subdir, split (' ', $args[0])
  456. if $macro eq "AC_CONFIG_SUBDIRS" && $recursive;
  457. }
  458. # The subdirs are *optional*, they may not exist.
  459. foreach (@subdir)
  460. {
  461. if (-d)
  462. {
  463. verb "$configure_ac: adding subdirectory $_ to autoreconf";
  464. autoreconf ($_);
  465. }
  466. else
  467. {
  468. verb "$configure_ac: subdirectory $_ not present";
  469. }
  470. }
  471. # Gettext consistency checks...
  472. error "$configure_ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION"
  473. if $uses_gettext_via_traces && ! $uses_gettext;
  474. error "$configure_ac: AM_GNU_GETTEXT_VERSION is used, but not AM_GNU_GETTEXT"
  475. if $uses_gettext && ! $uses_gettext_via_traces;
  476. # ---------------------------- #
  477. # Setting up the source tree. #
  478. # ---------------------------- #
  479. # libtoolize, automake --add-missing etc. will drop files in the
  480. # $AUX_DIR. But these tools fail to install these files if the
  481. # directory itself does not exist, which valid: just imagine a CVS
  482. # repository with hand written code only (there is not even a need
  483. # for a Makefile.am!).
  484. if (defined $aux_dir && ! -d $aux_dir)
  485. {
  486. verb "$configure_ac: creating directory $aux_dir";
  487. mkdir $aux_dir, 0755
  488. or error "cannot create $aux_dir: $!";
  489. }
  490. # -------------------- #
  491. # Running libtoolize. #
  492. # -------------------- #
  493. if (!$uses_libtool)
  494. {
  495. verb "$configure_ac: not using Libtool";
  496. }
  497. elsif ($install)
  498. {
  499. if ($uses_libltdl)
  500. {
  501. $libtoolize .= " --ltdl";
  502. }
  503. @ex = grep (/^libtoolize$/, @exclude);
  504. if ($#ex == -1) {
  505. xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
  506. $rerun_aclocal = 1;
  507. }
  508. }
  509. else
  510. {
  511. verb "$configure_ac: not running libtoolize: --install not given";
  512. }
  513. # ------------------- #
  514. # Rerunning aclocal. #
  515. # ------------------- #
  516. # If we re-installed Libtool or Gettext, the macros might have changed.
  517. # Automake also needs an up-to-date aclocal.m4.
  518. if ($rerun_aclocal)
  519. {
  520. if (!$uses_aclocal)
  521. {
  522. verb "$configure_ac: not using aclocal";
  523. }
  524. else
  525. {
  526. run_aclocal ($aclocal, $aclocal_flags);
  527. }
  528. }
  529. # ------------------ #
  530. # Running autoconf. #
  531. # ------------------ #
  532. # Don't try to be smarter than `autoconf', which does its own up to
  533. # date checks.
  534. #
  535. # We prefer running autoconf before autoheader, because (i) the
  536. # latter runs the former, and (ii) autoconf is stricter than
  537. # autoheader. So all in all, autoconf should give better error
  538. # messages.
  539. @ex = grep (/^autoconf$/, @exclude);
  540. if ($#ex == -1) {
  541. xsystem ("$autoconf");
  542. }
  543. # -------------------- #
  544. # Running autoheader. #
  545. # -------------------- #
  546. # We now consider that if AC_CONFIG_HEADERS is used, then autoheader
  547. # is used too.
  548. #
  549. # Just as for autoconf, up to date ness is performed by the tool
  550. # itself.
  551. #
  552. # Run it before automake, since the latter checks the presence of
  553. # config.h.in when it sees an AC_CONFIG_HEADERS.
  554. if (!$uses_autoheader)
  555. {
  556. verb "$configure_ac: not using Autoheader";
  557. }
  558. else
  559. {
  560. @ex = grep (/^autoheader$/, @exclude);
  561. if ($#ex == -1) {
  562. xsystem ("$autoheader");
  563. }
  564. }
  565. # ------------------ #
  566. # Running automake. #
  567. # ------------------ #
  568. if (!$uses_automake)
  569. {
  570. verb "$configure_ac: not using Automake";
  571. }
  572. else
  573. {
  574. # We should always run automake, and let it decide whether it shall
  575. # update the file or not. In fact, the effect of `$force' is already
  576. # included in `$automake' via `--no-force'.
  577. @ex = grep (/^automake$/, @exclude);
  578. if ($#ex == -1) {
  579. xsystem ("$automake");
  580. }
  581. }
  582. @ex = grep (/^gnu-configize$/, @exclude);
  583. if ($#ex == -1) {
  584. xsystem ("$gnuconfigize");
  585. }
  586. # -------------- #
  587. # Running make. #
  588. # -------------- #
  589. if ($run_make)
  590. {
  591. if (!-f "config.status")
  592. {
  593. verb "no config.status: cannot re-make";
  594. }
  595. else
  596. {
  597. xsystem ("./config.status --recheck");
  598. xsystem ("./config.status");
  599. if (!-f "Makefile")
  600. {
  601. verb "no Makefile: cannot re-make";
  602. }
  603. else
  604. {
  605. @ex = grep (/^make$/, @exclude);
  606. if ($#ex == -1) {
  607. xsystem ("$make");
  608. }
  609. }
  610. }
  611. }
  612. }
  613. # &autoreconf ($DIRECTORY)
  614. # ------------------------
  615. # Reconf the $DIRECTORY.
  616. sub autoreconf ($)
  617. {
  618. my ($directory) = @_;
  619. my $cwd = cwd;
  620. # The format for this message is not free: taken from Emacs, itself
  621. # using GNU Make's format.
  622. verb "Entering directory `$directory'";
  623. chdir $directory
  624. or error "cannot chdir to $directory: $!";
  625. autoreconf_current_directory;
  626. # The format is not free: taken from Emacs, itself using GNU Make's
  627. # format.
  628. verb "Leaving directory `$directory'";
  629. chdir $cwd
  630. or error "cannot chdir to $cwd: $!";
  631. }
  632. ## ------ ##
  633. ## Main. ##
  634. ## ------ ##
  635. # When debugging, it is convenient that all the related temporary
  636. # files be at the same place.
  637. mktmpdir ('ar');
  638. $ENV{'TMPDIR'} = $tmp;
  639. parse_args;
  640. # Autoreconf all the given configure.ac. Unless `--no-recursive' is passed,
  641. # AC_CONFIG_SUBDIRS will be traversed in &autoreconf_current_directory.
  642. $ENV{'AUTOM4TE'} = $autom4te;
  643. for my $directory (@ARGV)
  644. {
  645. require_configure_ac ($directory);
  646. autoreconf ($directory);
  647. }
  648. ### Setup "GNU" style for perl-mode and cperl-mode.
  649. ## Local Variables:
  650. ## perl-indent-level: 2
  651. ## perl-continued-statement-offset: 2
  652. ## perl-continued-brace-offset: 0
  653. ## perl-brace-offset: 0
  654. ## perl-brace-imaginary-offset: 0
  655. ## perl-label-offset: -2
  656. ## cperl-indent-level: 2
  657. ## cperl-brace-offset: 0
  658. ## cperl-continued-brace-offset: 0
  659. ## cperl-label-offset: -2
  660. ## cperl-extra-newline-before-brace: t
  661. ## cperl-merge-trailing-else: nil
  662. ## cperl-continued-statement-offset: 2
  663. ## End: