Dan Villiom Podlaski Christiansen avatar Dan Villiom Podlaski Christiansen committed 1be5e2b

allow build from within LLVM

Comments (0)

Files changed (2)

autoconf/configure.ac

   fi
 fi
 
+case "${srcdir}" in
+  .)   srcdir="`pwd`"           ;;
+  ./*) srcdir="`pwd`/${srcdir}" ;;
+esac
+
+if test -z "${LLVM_SRC_ROOT}" ; then
+  if test -f "${srcdir}/../../include/llvm/Config/config.h" ; then
+    LLVM_SRC_ROOT="${srcdir}/../.."
+    LLVM_OBJ_ROOT="`pwd`/../.."
+    LLVM_SRC="$LLVM_SRC_ROOT"
+    LLVM_OBJ="$LLVM_OBJ_ROOT"
+  else
+    AC_MSG_ERROR([Unable to find LLVM source and build directories; 
+                  please set LLVM_SRC_ROOT and LLVM_OBJ_ROOT])
+  fi
+fi
+
 dnl Place all of the extra autoconf files into the config subdirectory. Tell
 dnl various tools where the m4 autoconf macros are.
 AC_CONFIG_AUX_DIR([$LLVM_SRC_ROOT/autoconf])
   fi
 fi
 
+case "${srcdir}" in
+  .)   srcdir="`pwd`"           ;;
+  ./*) srcdir="`pwd`/${srcdir}" ;;
+esac
+
+
+if test -z "${LLVM_SRC_ROOT}" ; then
+  if test -f "${srcdir}/../../include/llvm/Config/config.h" ; then
+    LLVM_SRC_ROOT="${srcdir}/../.."
+    LLVM_OBJ_ROOT="`pwd`/../.."
+    LLVM_SRC="$LLVM_SRC_ROOT"
+    LLVM_OBJ="$LLVM_OBJ_ROOT"
+  else
+    { { echo "$as_me:$LINENO: error: Unable to find LLVM source and build directories;
+                  please set LLVM_SRC_ROOT and LLVM_OBJ_ROOT" >&5
+echo "$as_me: error: Unable to find LLVM source and build directories;
+                  please set LLVM_SRC_ROOT and LLVM_OBJ_ROOT" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
 ac_aux_dir=
 for ac_dir in $LLVM_SRC_ROOT/autoconf "$srcdir"/$LLVM_SRC_ROOT/autoconf; do
   if test -f "$ac_dir/install-sh"; then
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.