[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[committed] Handle running configure in source dir



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