public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Handle running configure in source dir
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub; +Cc: Matthias Klose

Hi,

The configure script was added to facilitate building in a separate build dir
rather than in the source dir.  It does this by generating a Makefile in the
build dir that calls make using the Makefile in the source dir.

However, running the configure in the source dir overwrites the Makefile in
the source dir.

Fix this by detecting running configure in the source dir, and not generating
the unnecessary Makefile.

Committed to trunk.

Thanks,
- Tom

Handle running configure in source dir

2019-07-02  Tom de Vries  <tdevries@suse.de>

	* configure: Handle running in source dir.

---
 configure | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configure b/configure
index 24f3fd2..894f6be 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,12 @@
 #!/bin/sh
 srcdir=$(cd $(dirname $0); pwd -P)
 
+if [ "$srcdir" = "$(pwd -P)" ]; then
+    # We're not in a separate build dir, but in the source dir, we already
+    # have a Makefile.
+    exit 0
+fi
+
 cat > Makefile <<EOF
 srcdir:=$srcdir
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-02  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Handle running configure in source dir Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).