Additional support for automatically searching standard places for
repositories before attempting a download.
diff --git a/scripts/configure b/scripts/configure
index ba4f0c8..5e03076 100755
--- a/scripts/configure
+++ b/scripts/configure
@@ -628,6 +628,7 @@
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -706,6 +707,7 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -958,6 +960,15 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1095,7 +1106,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1248,6 +1259,7 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1279,7 +1291,7 @@
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-sky130-pdk=[/path/to/sky130/] --disable-sky130-pdk
                           "location of the source files for the sky130 (pdks
-                          with a pdk_url file can automatically download them
+                          with a pdk_info file can automatically download them
                           if the path is omitted)"
   --enable-klayout
                 Enable or disable klayout [default=enabled]
@@ -1797,22 +1809,22 @@
         SKY130_LINK_TARGETS="none"
 
         pdk_get() {
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../sky130/pdk_url" >&5
-$as_echo_n "checking for ../sky130/pdk_url... " >&6; }
-if ${ac_cv_file____sky130_pdk_url+:} false; then :
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../sky130/pdk_info" >&5
+$as_echo_n "checking for ../sky130/pdk_info... " >&6; }
+if ${ac_cv_file____sky130_pdk_info+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   test "$cross_compiling" = yes &&
   as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "../sky130/pdk_url"; then
-  ac_cv_file____sky130_pdk_url=yes
+if test -r "../sky130/pdk_info"; then
+  ac_cv_file____sky130_pdk_info=yes
 else
-  ac_cv_file____sky130_pdk_url=no
+  ac_cv_file____sky130_pdk_info=no
 fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____sky130_pdk_url" >&5
-$as_echo "$ac_cv_file____sky130_pdk_url" >&6; }
-if test "x$ac_cv_file____sky130_pdk_url" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____sky130_pdk_info" >&5
+$as_echo "$ac_cv_file____sky130_pdk_info" >&6; }
+if test "x$ac_cv_file____sky130_pdk_info" = xyes; then :
 
                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../pdks/sky130" >&5
 $as_echo_n "checking for ../pdks/sky130... " >&6; }
@@ -1835,9 +1847,11 @@
 
 else
 
-                    mkdir -p ../pdks/sky130
-                    sh dl $(cat "../sky130/pdk_get") ../pdks/sky130.tar.gz;
-                    (echo "Extracting sky130" && cd ../pdks && tar -xf sky130.tar.gz --strip-components 1 -C ../pdks/sky130)
+                    REPO=$(cat "../sky130/pdk_info" | sed -n "1p")
+                    POST_CLONE_COMMANDS=$(cat "../sky130/pdk_info" | sed "1d")
+                    mkdir -p ../pdks
+                    git clone "$REPO" ../pdks/sky130;
+                    (cd ../pdks/sky130 && sh -c "$POST_CLONE_COMMANDS")
 
 fi
 
@@ -1851,11 +1865,26 @@
 
         }
 
+        pdk_find() {
+            FOUND=0
+            for path in /opt/pdks/sky130 /usr/share/pdks/sky130 /usr/local/share/pdks/sky130; do
+                if [ -d $path ] ; then
+                    echo "Found sky130 in $path, using this installation..."
+                    export SKY130_SOURCE_PATH=$path
+                    FOUND=1
+                fi
+            done
+            if [ "$FOUND" = "sky130" ]; then
+                echo "Could not found sky130 in standard search paths, manually downloading to ../pdks/sky130 ..."
+                pdk_find
+            fi
+        }
+
         # Check whether --enable-sky130-sky130 was given.
 if test "${enable_sky130_pdk+set}" = set; then :
   enableval=$enable_sky130_pdk;
                 if test "$enableval" == "yes" -o "$enableval" == "YES"; then
-                    pdk_get
+                   pdk_find
                 elif test "$enableval" == "no" -o "$enableval" == "NO"; then
                     echo "Disabling sky130..."
                 else
@@ -1864,7 +1893,7 @@
 
 else
 
-                pdk_get
+                pdk_find
 
 
 fi
@@ -2455,7 +2484,7 @@
   $as_echo_n "(cached) " >&6
 else
 
-	for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+	for am_cv_pathless_PYTHON in python python2 python3 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
 	  test "$am_cv_pathless_PYTHON" = none && break
 	  prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
@@ -2678,28 +2707,33 @@
 
     if test -z $PYTHON;
     then
-        PYTHON="python"
+        if test -z "";
+        then
+            PYTHON="python3"
+        else
+            PYTHON=""
+        fi
     fi
     PYTHON_NAME=`basename $PYTHON`
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking $PYTHON_NAME module: distutils" >&5
 $as_echo_n "checking $PYTHON_NAME module: distutils... " >&6; }
-	$PYTHON -c "import distutils" 2>/dev/null
-	if test $? -eq 0;
-	then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+    $PYTHON -c "import distutils" 2>/dev/null
+    if test $? -eq 0;
+    then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-		eval HAVE_PYMOD_DISTUTILS=yes
-	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+        eval HAVE_PYMOD_DISTUTILS=yes
+    else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-		eval HAVE_PYMOD_DISTUTILS=no
-		#
-		if test -n ""
-		then
-			as_fn_error $? "failed to find required module distutils" "$LINENO" 5
-			exit 1
-		fi
-	fi
+        eval HAVE_PYMOD_DISTUTILS=no
+        #
+        if test -n ""
+        then
+            as_fn_error $? "failed to find required module distutils" "$LINENO" 5
+            exit 1
+        fi
+    fi
 
 
 # Check for "--with-ef-style"