[Libreoffice-commits] core.git: autogen.sh Makefile.in

2017-09-22 Thread Tor Lillqvist
 Makefile.in |1 +
 autogen.sh  |   47 +--
 2 files changed, 46 insertions(+), 2 deletions(-)

New commits:
commit c32d54f244b0a18e0dcfcfceae140499e2dc3bbe
Author: Tor Lillqvist 
Date:   Fri Sep 22 16:51:22 2017 +0300

Revert "Goodbye autogen.lastrun"

Welcome back autogen.lastrun. I just don't have the energy to convince
tinderbox maintainers to fix their scripts. Oh well.

This reverts commit 7496c83374f68148c62ac23a6e4c4c314d67273d.

diff --git a/Makefile.in b/Makefile.in
index 03184af18d44..62924dc2aae0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -46,6 +46,7 @@ $(BUILDDIR)/config_host.mk : $(wildcard \
$(SRCDIR)/configure.ac \
$(SRCDIR)/config_host/*.h.in \
$(BUILDDIR)/autogen.input \
+   $(BUILDDIR)/autogen.lastrun \
$(BUILDDIR)/autogen.sh \
) \
$(shell . $(SRCDIR)/bin/get_config_variables JAVA_HOME && \
diff --git a/autogen.sh b/autogen.sh
index 02d160bdca92..a4bab811a36b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,15 @@
 :
 #
+# This script checks various configure parameters and uses three files:
+#   * autogen.input (ro)
+#   * autogen.lastrun (rw)
+#   * autogen.lastrun.bak (rw)
+#
 # If _no_ parameters:
-#   Read args from autogen.input
+#   Read args from autogen.input or autogen.lastrun
+# Else
+#   Backup autogen.lastrun as autogen.lastrun.bak
+#   Write autogen.lastrun with new commandline args
 #
 # Run configure with checked args
 #
@@ -178,7 +186,7 @@ unlink ("configure");
 system ("autoconf -I ${src_path}") && die "Failed to run autoconf";
 die "Failed to generate the configure script" if (! -f "configure");
 
-# Handle help arguments first
+# Handle help arguments first, so we don't clobber autogen.lastrun
 for my $arg (@ARGV) {
 if ($arg =~ /^(--help|-h|-\?)$/) {
 print STDOUT "autogen.sh - libreoffice configuration helper\n";
@@ -193,10 +201,24 @@ for my $arg (@ARGV) {
 my @cmdline_args = ();
 
 my $input = "autogen.input";
+my $lastrun = "autogen.lastrun";
 
 if (!@ARGV) {
 if (-f $input) {
+if (-f $lastrun) {
+print STDERR < 0) {
+# if there's already an autogen.lastrun, make a backup first
+if (-e $lastrun) {
+open (my $fh, $lastrun) || warn "Can't open $lastrun.\n";
+open (BAK, ">$lastrun.bak") || warn "Can't create backup file 
$lastrun.bak.\n";
+while (<$fh>) {
+print BAK;
+}
+close (BAK) && close ($fh);
+}
+# print "Saving command-line args to $lastrun\n";
+my $fh;
+open ($fh, ">autogen.lastrun") || die "Can't open autogen.lastrun: 
$!";
+for my $arg (@cmdline_args) {
+print $fh "$arg\n";
+}
+close ($fh);
+}
+}
 push @args, "--srcdir=$src_path";
 push @args, "--enable-option-checking=$option_checking";
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: autogen.sh Makefile.in

2017-09-22 Thread Tor Lillqvist
 Makefile.in |1 -
 autogen.sh  |   47 ++-
 2 files changed, 2 insertions(+), 46 deletions(-)

New commits:
commit 7496c83374f68148c62ac23a6e4c4c314d67273d
Author: Tor Lillqvist 
Date:   Mon Sep 18 17:16:33 2017 +0300

Goodbye autogen.lastrun

Change-Id: I46b92baf88661d49da2905699b9639522c0940d8
Reviewed-on: https://gerrit.libreoffice.org/42418
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/Makefile.in b/Makefile.in
index 62924dc2aae0..03184af18d44 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -46,7 +46,6 @@ $(BUILDDIR)/config_host.mk : $(wildcard \
$(SRCDIR)/configure.ac \
$(SRCDIR)/config_host/*.h.in \
$(BUILDDIR)/autogen.input \
-   $(BUILDDIR)/autogen.lastrun \
$(BUILDDIR)/autogen.sh \
) \
$(shell . $(SRCDIR)/bin/get_config_variables JAVA_HOME && \
diff --git a/autogen.sh b/autogen.sh
index a4bab811a36b..02d160bdca92 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,15 +1,7 @@
 :
 #
-# This script checks various configure parameters and uses three files:
-#   * autogen.input (ro)
-#   * autogen.lastrun (rw)
-#   * autogen.lastrun.bak (rw)
-#
 # If _no_ parameters:
-#   Read args from autogen.input or autogen.lastrun
-# Else
-#   Backup autogen.lastrun as autogen.lastrun.bak
-#   Write autogen.lastrun with new commandline args
+#   Read args from autogen.input
 #
 # Run configure with checked args
 #
@@ -186,7 +178,7 @@ unlink ("configure");
 system ("autoconf -I ${src_path}") && die "Failed to run autoconf";
 die "Failed to generate the configure script" if (! -f "configure");
 
-# Handle help arguments first, so we don't clobber autogen.lastrun
+# Handle help arguments first
 for my $arg (@ARGV) {
 if ($arg =~ /^(--help|-h|-\?)$/) {
 print STDOUT "autogen.sh - libreoffice configuration helper\n";
@@ -201,24 +193,10 @@ for my $arg (@ARGV) {
 my @cmdline_args = ();
 
 my $input = "autogen.input";
-my $lastrun = "autogen.lastrun";
 
 if (!@ARGV) {
 if (-f $input) {
-if (-f $lastrun) {
-print STDERR < 0) {
-# if there's already an autogen.lastrun, make a backup first
-if (-e $lastrun) {
-open (my $fh, $lastrun) || warn "Can't open $lastrun.\n";
-open (BAK, ">$lastrun.bak") || warn "Can't create backup file 
$lastrun.bak.\n";
-while (<$fh>) {
-print BAK;
-}
-close (BAK) && close ($fh);
-}
-# print "Saving command-line args to $lastrun\n";
-my $fh;
-open ($fh, ">autogen.lastrun") || die "Can't open autogen.lastrun: 
$!";
-for my $arg (@cmdline_args) {
-print $fh "$arg\n";
-}
-close ($fh);
-}
-}
 push @args, "--srcdir=$src_path";
 push @args, "--enable-option-checking=$option_checking";
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: autogen.sh Makefile.in

2015-03-08 Thread Miklos Vajna
 Makefile.in |1 +
 autogen.sh  |3 +++
 2 files changed, 4 insertions(+)

New commits:
commit aefc43ba5c2688a1301dcda08b56a42127904cbb
Author: Miklos Vajna 
Date:   Sun Mar 8 16:58:35 2015 +0100

autogen.sh: better error message when src_path contains spaces

Change-Id: I921ffaf2ee4be73ecfffca8bc36cfae484b70a32

diff --git a/Makefile.in b/Makefile.in
index b4c1ecf..36bcaf3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -45,6 +45,7 @@ $(BUILDDIR)/config_host.mk : $(wildcard \

$(SRCDIR)/android/experimental/LOAndroid3/AndroidManifest.xml.in \
$(BUILDDIR)/autogen.input \
$(BUILDDIR)/autogen.lastrun \
+   $(BUILDDIR)/autogen.sh \
)
sh -c $(SRCDIR)/autogen.sh
 
diff --git a/autogen.sh b/autogen.sh
index cdf4e76..ab9c94d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -116,6 +116,9 @@ sub invalid_distro($$)
 closedir ($dirh);
 }
 
+# Avoid confusing "aclocal: error: non-option arguments are not accepted: 
'.../m4'." error message.
+die "\$src_path must not contain spaces, but it is '$src_path'." if ($src_path 
=~ / /);
+
 # Alloc $ACLOCAL to specify which aclocal to use
 $aclocal = $ENV{ACLOCAL} ? $ENV{ACLOCAL} : 'aclocal';
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: autogen.sh Makefile.in

2013-04-03 Thread Tor Lillqvist
 Makefile.in |9 +
 autogen.sh  |   40 ++--
 2 files changed, 27 insertions(+), 22 deletions(-)

New commits:
commit ca0c54d0fe3812cec64e5c7cc83309d4397f5e0a
Author: Tor Lillqvist 
Date:   Thu Mar 28 15:26:25 2013 +0200

Make autogen.sh prefer to read an autogen.input file

For backward compatibility, an autogen.lastrun file will still be used if it
exists and autogen.input does not exist. The recommended workflow is now to
keep the configuration parametets in autogen.input which is never written by
autogen.sh.

Most (?) developers used to treat autogen.lastrun as a valuable parameter 
file
to be edited manually anyway, and not as an ad-hoc backup copy of 
command-line
parameters last used. The name autogen.input better reflects this usage.

Change-Id: I7e3c747fa95e9f2f0bc44036419aaab8f4ad01e7
Reviewed-on: https://gerrit.libreoffice.org/3111
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/Makefile.in b/Makefile.in
index f19de69..ecfbc1c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -33,16 +33,17 @@ $(BUILDDIR)/config_host.mk : \
$(SRCDIR)/Makefile.in \
$(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
$(SRCDIR)/configure.ac \
-   $(BUILDDIR)/autogen.lastrun
+   $(if $(wildcard 
$(BUILDDIR)/autogen.input),$(BUILDDIR)/autogen.input,$(if $(wildcard 
$(BUILDDIR)/autogen.lastrun),$(BUILDDIR)/autogen.lastrun))
$(SRCDIR)/autogen.sh
 
-# dummy rule in case any of the above prerequisites are removed, so that a 
stale
-# Makefile still triggers autogen.sh, or in case autogen.lastrun does not yet
-# exist
+# dummy rule in case any of the above prerequisites are removed, so
+# that a stale Makefile still triggers autogen.sh, or in case
+# autogen.input does not exist, or autogen.lastrun does not yet exist
 $(SRCDIR)/config_host.mk.in \
 $(SRCDIR)/Makefile.in \
 $(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
 $(SRCDIR)/configure.ac \
+$(BUILDDIR)/autogen.input \
 $(BUILDDIR)/autogen.lastrun:
@true
 
diff --git a/autogen.sh b/autogen.sh
index fa77b73..f5960e3 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -21,7 +21,7 @@ sub clean()
 {
 system ("rm -Rf autom4te.cache");
 system ("rm -f missing install-sh mkinstalldirs libtool ltmain.sh");
-print "cleaned the build tree\n";
+print "Cleaned the build tree\n";
 }
 
 my $aclocal;
@@ -108,9 +108,18 @@ for my $arg (@ARGV) {
 }
 
 my @cmdline_args = ();
-if (!@ARGV) {
-my $lastrun = "autogen.lastrun";
-@cmdline_args = read_args ($lastrun) if (-f $lastrun);
+
+my $input = "autogen.input";
+my $lastrun = "autogen.lastrun";
+
+if (-f $input) {
+warn "Ignoring command-line arguments, using $input.\n" if (@ARGV);
+warn "Ignoring $lastrun, using $input.\n" if (-f $lastrun);
+@cmdline_args = read_args ($input);
+} elsif (-f $lastrun) {
+warn "Ignoring command-line arguments, using $lastrun.\n" if (@ARGV);
+print STDERR "Reading $lastrun. Please rename it to $input to avoid this 
message.\n";
+@cmdline_args = read_args ($lastrun);
 } else {
 @cmdline_args = @ARGV;
 }
@@ -118,7 +127,7 @@ if (!@ARGV) {
 my @args;
 my $default_config = "$src_path/distro-configs/default.conf";
 if (-f $default_config) {
-print STDERR "Reading default config file: $default_config\n";
+print STDERR "Reading default config file: $default_config.\n";
 push @args, read_args ($default_config);
 }
 for my $arg (@cmdline_args) {
@@ -164,40 +173,35 @@ if ($src_path ne $build_path)
 system ("$aclocal $aclocal_flags") && die "Failed to run aclocal";
 unlink ("configure");
 system ("autoconf -I ${src_path}") && die "Failed to run autoconf";
-die "failed to generate configure" if (! -f "configure");
+die "Failed to generate the configure script" if (! -f "configure");
 
 if (defined $ENV{NOCONFIGURE}) {
 print "Skipping configure process.";
 } else {
 # Save autogen.lastrun only if we did get some arguments on the 
command-line
-if (@ARGV) {
+if (! -f $input && @ARGV) {
 if (scalar(@cmdline_args) > 0) {
 # if there's already an autogen.lastrun, make a backup first
-if (-e "autogen.lastrun") {
-open (my $fh, "autogen.lastrun") || warn "can't open 
autogen.lastrun. \n";
-open (BAK, ">autogen.lastrun.bak") || warn "can't create 
backup file. \n";
+if (-e $lastrun) {
+open (my $fh, $lastrun) || warn "Can't open $lastrun.\n";
+open (BAK, ">$lastrun.bak") || warn "Can't create backup file 
$lastrun.bak.\n";
 while (<$fh>) {
 print BAK;
 }
 close (BAK) && close ($fh);
 }
-# print "writing args to autogen.lastrun\n";
+# print "Saving command-line args to $lastrun\n";
 my $fh;
-open ($fh, ">autogen.last