Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/configure.cygwin')
-rwxr-xr-xwinsup/configure.cygwin49
1 files changed, 49 insertions, 0 deletions
diff --git a/winsup/configure.cygwin b/winsup/configure.cygwin
new file mode 100755
index 000000000..6c4d08e30
--- /dev/null
+++ b/winsup/configure.cygwin
@@ -0,0 +1,49 @@
+addto_CPPFLAGS() {
+ local f
+ for f; do
+ case " $CPPFLAGS " in
+ *\ $f\ *) ;;
+ *) CPPFLAGS="$CPPFLAGS $f" ;;
+ esac
+ done
+}
+
+realdirpath() {
+ [ -z "$1" ] && return 1
+ (cd "$1" 2>/dev/null && pwd)
+ if test $? -ne 0; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+for d in . .. ../.. ../../..; do
+ if test -e "$srcdir/$d/configure.cygwin"; then
+ winsup_srcdir=$(realdirpath "$srcdir/$d")
+ break
+ fi
+done
+
+if test -z "$winsup_srcdir"; then
+ echo "cannot find directory containing configure.cygwin" 1>&2
+ exit 1
+fi
+
+case "$srcdir" in
+ */newlib*) lookfor=newlib ;;
+ */winsup*) lookfor=winsup ;;
+ *) lookfor=. ;;
+esac
+
+for d in . .. ../.. ../../..; do
+ if test -d "$d/$lookfor"; then
+ target_builddir=$(realdirpath "$d")
+ break
+ fi
+done
+
+if test -z "$target_builddir"; then
+ echo "cannot determine top build dir, looking for $lookfor" 1>&2
+ exit 1
+fi