Applied patch from Mohamed Gaber that fixes the issue of the
configuration script not doing tilde expansion on paths in the
configure command line.  This patch uses python3 and is cross-
platform (existing code used "readlink -f" and so also had
problems on Mac OSX).  Also changed the configuration script
so that the value for --enable-sky130-pdk can have the
libraries/ directory on the end or not, and it will find the
path regardless.
diff --git a/scripts/configure b/scripts/configure
index 41644f1..9b9bd8d 100755
--- a/scripts/configure
+++ b/scripts/configure
@@ -587,15 +587,6 @@
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 EF_STYLE
-pkgpyexecdir
-pyexecdir
-pkgpythondir
-pythondir
-PYTHON_PLATFORM
-PYTHON_EXEC_PREFIX
-PYTHON_PREFIX
-PYTHON_VERSION
-PYTHON
 XSCHEM_PATH
 SKY130_ML_XX_HD_PATH
 OSU_PATH
@@ -610,6 +601,15 @@
 SKY130_LOCAL_PATH
 SKY130_SOURCE_PATH
 SKY130_LINK_TARGETS
+pkgpyexecdir
+pyexecdir
+pkgpythondir
+pythondir
+PYTHON_PLATFORM
+PYTHON_EXEC_PREFIX
+PYTHON_PREFIX
+PYTHON_VERSION
+PYTHON
 target_alias
 host_alias
 build_alias
@@ -1769,706 +1769,6 @@
 
 
 
-# detect PDKs based on directories that include Makefile.in files
-
-
-# define tools
-# define tools to install setup files for.  This does not imply that the tools are
-# available on the system;  just that open_pdks will install the setup files for them.
-## DO NOT INCLUDE XSCHEM IN THE TOOL LIST. XSCHEM CAN BE INSTALLED IN THE CONFIG SCRIPT
-
-
-mkdir -p ../pdks
-
-# check for the source and install paths for each PDK.
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: Found technology directories: sky130" >&5
-$as_echo "$as_me: Found technology directories: sky130" >&6;}
-
-
-
-    # --enable-pdk-[pdk]=/path/to/pdk
-
-
-
-        SKY130_SOURCE_PATH=""
-        SKY130_LOCAL_PATH=""
-        SKY130_DIST_PATH=""
-        SKY130_LINK_TARGETS="none"
-
-        pdk_get() {
-            { $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_info"; then
-  ac_cv_file____sky130_pdk_info=yes
-else
-  ac_cv_file____sky130_pdk_info=no
-fi
-fi
-{ $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; }
-if ${ac_cv_file____pdks_sky130+:} 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 "../pdks/sky130"; then
-  ac_cv_file____pdks_sky130=yes
-else
-  ac_cv_file____pdks_sky130=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____pdks_sky130" >&5
-$as_echo "$ac_cv_file____pdks_sky130" >&6; }
-if test "x$ac_cv_file____pdks_sky130" = xyes; then :
-
-                    echo "Using pre-existing sky130 download..."
-
-else
-
-                    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
-
-                export SKY130_SOURCE_PATH=../pdks/sky130
-
-else
-
-                as_fn_error $? "PDK sky130 cannot be automatically downloaded and requires a path." "$LINENO" 5
-
-fi
-
-        }
-
-        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_find
-                elif test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    echo "Disabling sky130..."
-                else
-                    SKY130_SOURCE_PATH=$enableval
-                fi
-
-else
-
-                pdk_find
-
-
-fi
-
-	    # # Require this argument
-
-        if [ "$SKY130_SOURCE_PATH" != "" ]; then
-            SKY130_SOURCE_PATH=`readlink -f $SKY130_SOURCE_PATH`
-            # basic check that the PDK exists there (the path must exist in any case)
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Checking specified path for 'sky130' at $SKY130_SOURCE_PATH" >&5
-$as_echo "$as_me: Checking specified path for 'sky130' at $SKY130_SOURCE_PATH" >&6;}
-            as_ac_File=`$as_echo "ac_cv_file_$SKY130_SOURCE_PATH" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SKY130_SOURCE_PATH" >&5
-$as_echo_n "checking for $SKY130_SOURCE_PATH... " >&6; }
-if eval \${$as_ac_File+:} 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_SOURCE_PATH"; then
-  eval "$as_ac_File=yes"
-else
-  eval "$as_ac_File=no"
-fi
-fi
-eval ac_res=\$$as_ac_File
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
-
-                { $as_echo "$as_me:${as_lineno-$LINENO}: 'sky130' source path found at $SKY130_SOURCE_PATH" >&5
-$as_echo "$as_me: 'sky130' source path found at $SKY130_SOURCE_PATH" >&6;}
-
-else
-
-                as_fn_error $? "Specified path for 'sky130' at $SKY130_SOURCE_PATH not found" "$LINENO" 5
-
-fi
-
-
-            # --with-pdk-local-path=PDK_LOCAL_PATH
-
-# Check whether --with-sky130-local-path was given.
-if test "${with_sky130_local_path+set}" = set; then :
-  withval=$with_sky130_local_path; SKY130_LOCAL_PATH=$withval
-
-fi
-
-
-            # Require this argument
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Checking whether local path is specified for 'sky130'" >&5
-$as_echo "$as_me: Checking whether local path is specified for 'sky130'" >&6;}
-            if test "x$SKY130_LOCAL_PATH" == "x" ; then
-                as_fn_error $? "Option --with-sky130-local-path=<path> not specified!" "$LINENO" 5
-                SKY130_LOCAL_PATH=""
-            else
-                SKY130_LOCAL_PATH=`readlink -f $SKY130_LOCAL_PATH`
-            fi
-
-            # --with-pdk-dist-path=PDK_DIST_PATH
-
-# Check whether --with-sky130-dist-path was given.
-if test "${with_sky130_dist_path+set}" = set; then :
-  withval=$with_sky130_dist_path; SKY130_DIST_PATH=$withval
-
-fi
-
-
-
-            # "Require" this argument
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Checking whether distribution path is specified for 'sky130'" >&5
-$as_echo "$as_me: Checking whether distribution path is specified for 'sky130'" >&6;}
-            if test "x$SKY130_DIST_PATH" == "x" ; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: Option --with-sky130-dist-path=<path> not specified.  Local install only." >&5
-$as_echo "$as_me: Option --with-sky130-dist-path=<path> not specified.  Local install only." >&6;}
-                SKY130_DIST_PATH=""
-            else
-                SKY130_DIST_PATH=`readlink -f $SKY130_DIST_PATH`
-            fi
-
-            # --with-pdk-link-targets=PDK_LINK_TARGETS
-
-# Check whether --with-sky130-link-targets was given.
-if test "${with_sky130_link_targets+set}" = set; then :
-  withval=$with_sky130_link_targets; SKY130_LINK_TARGETS=$with_sky130_link_targets
-
-fi
-
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Link targets set to $SKY130_LINK_TARGETS" >&5
-$as_echo "$as_me: Link targets set to $SKY130_LINK_TARGETS" >&6;}
-        fi
-
-
-
-
-
-
-
-
-# Set variables for tool setups
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: Found tools: klayout magic netgen openlane qflow" >&5
-$as_echo "$as_me: Found tools: klayout magic netgen openlane qflow" >&6;}
-
-
-
-
-
-        KLAYOUT_DISABLED=0
-        # Check whether --enable-klayout was given.
-if test "${enable_klayout+set}" = set; then :
-  enableval=$enable_klayout;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    KLAYOUT_DISABLED=1
-                fi
-
-
-fi
-
-
-
-
-
-        MAGIC_DISABLED=0
-        # Check whether --enable-magic was given.
-if test "${enable_magic+set}" = set; then :
-  enableval=$enable_magic;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    MAGIC_DISABLED=1
-                fi
-
-
-fi
-
-
-
-
-
-        NETGEN_DISABLED=0
-        # Check whether --enable-netgen was given.
-if test "${enable_netgen+set}" = set; then :
-  enableval=$enable_netgen;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    NETGEN_DISABLED=1
-                fi
-
-
-fi
-
-
-
-
-
-        OPENLANE_DISABLED=0
-        # Check whether --enable-openlane was given.
-if test "${enable_openlane+set}" = set; then :
-  enableval=$enable_openlane;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    OPENLANE_DISABLED=1
-                fi
-
-
-fi
-
-
-
-
-
-        QFLOW_DISABLED=0
-        # Check whether --enable-qflow was given.
-if test "${enable_qflow+set}" = set; then :
-  enableval=$enable_qflow;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    QFLOW_DISABLED=1
-                fi
-
-
-fi
-
-
-
-
-
-# Magic
-# Extract the first word of "magic", so it can be a program name with args.
-set dummy magic; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MAGIC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MAGIC="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-MAGIC=$ac_cv_path_MAGIC
-if test -n "$MAGIC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC" >&5
-$as_echo "$MAGIC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test -z "$MAGIC"; then
-   as_fn_error $? "You need 'magic' to generate the needed various cell views." "$LINENO" 5
-fi
-# Extract the first word of "patch", so it can be a program name with args.
-set dummy patch; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PATCH+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PATCH in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PATCH=$ac_cv_path_PATCH
-if test -n "$PATCH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5
-$as_echo "$PATCH" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test -z "$PATCH"; then
-   as_fn_error $? "You need 'patch' to apply patches." "$LINENO" 5
-fi
-
-# Other installations (libraries or tools if applicable)
-mkdir -p ../libs
-mkdir -p ../tools
-
-
-
-
-
-
-
-
-
-    # echo target targetvar flag url location
-
-    OSU_PATH=""
-    OSU_GET() {
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../libs/osu" >&5
-$as_echo_n "checking for ../libs/osu... " >&6; }
-if ${ac_cv_file____libs_osu+:} 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 "../libs/osu"; then
-  ac_cv_file____libs_osu=yes
-else
-  ac_cv_file____libs_osu=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____libs_osu" >&5
-$as_echo "$ac_cv_file____libs_osu" >&6; }
-if test "x$ac_cv_file____libs_osu" = xyes; then :
-
-                echo "Using pre-existing osu download..."
-
-else
-
-                mkdir -p ../libs/osu
-                sh ./download.sh 'https://vlsiarch.ecen.okstate.edu/flows/MOSIS_SCMOS/osu_stdcells_v2.4/osu_stdcells_lib.v2.4.tar.gz' ../libs/osu.tar.gz
-                (echo "Extracting osu..." && cd ../libs && tar -xf osu.tar.gz --strip-components 1 -C ../libs/osu)
-
-
-fi
-
-        export OSU_PATH=../libs/osu
-    }
-
-    # Check whether --enable-osu-lib was given.
-if test "${enable_osu_lib+set}" = set; then :
-  enableval=$enable_osu_lib;
-            if test "$enableval" == "yes" -o "$enableval" == "YES"; then
-                OSU_GET
-                XSCHEM_INST=1
-            elif test "$enableval" == "no" -o "$enableval" == "NO"; then
-                echo "Disabling osu..."
-                XSCHEM_DISABLED=1
-            else
-                OSU_PATH=$enableval
-            fi
-            OSU_PATH=`readlink -f $OSU_PATH`
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-    # echo target targetvar flag url location
-
-    SKY130_ML_XX_HD_PATH=""
-    SKY130_ML_XX_HD_GET() {
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../libs/sky130_ml_xx_hd" >&5
-$as_echo_n "checking for ../libs/sky130_ml_xx_hd... " >&6; }
-if ${ac_cv_file____libs_sky130_ml_xx_hd+:} 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 "../libs/sky130_ml_xx_hd"; then
-  ac_cv_file____libs_sky130_ml_xx_hd=yes
-else
-  ac_cv_file____libs_sky130_ml_xx_hd=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____libs_sky130_ml_xx_hd" >&5
-$as_echo "$ac_cv_file____libs_sky130_ml_xx_hd" >&6; }
-if test "x$ac_cv_file____libs_sky130_ml_xx_hd" = xyes; then :
-
-                echo "Using pre-existing sky130_ml_xx_hd download..."
-
-else
-
-                mkdir -p ../libs/sky130_ml_xx_hd
-                sh ./download.sh 'https://github.com/PaulSchulz/sky130_pschulz_xx_hd/archive/master.tar.gz' ../libs/sky130_ml_xx_hd.tar.gz
-                (echo "Extracting sky130_ml_xx_hd..." && cd ../libs && tar -xf sky130_ml_xx_hd.tar.gz --strip-components 1 -C ../libs/sky130_ml_xx_hd)
-
-
-fi
-
-        export SKY130_ML_XX_HD_PATH=../libs/sky130_ml_xx_hd
-    }
-
-    # Check whether --enable-alpha-lib was given.
-if test "${enable_alpha_lib+set}" = set; then :
-  enableval=$enable_alpha_lib;
-            if test "$enableval" == "yes" -o "$enableval" == "YES"; then
-                SKY130_ML_XX_HD_GET
-                XSCHEM_INST=1
-            elif test "$enableval" == "no" -o "$enableval" == "NO"; then
-                echo "Disabling sky130_ml_xx_hd..."
-                XSCHEM_DISABLED=1
-            else
-                SKY130_ML_XX_HD_PATH=$enableval
-            fi
-            SKY130_ML_XX_HD_PATH=`readlink -f $SKY130_ML_XX_HD_PATH`
-
-fi
-
-
-
-
-
-
-
-XSCHEM_DISABLED=0
-XSCHEM_INST=0
-
-
-
-
-
-
-
-    # echo target targetvar flag url location
-
-    XSCHEM_PATH=""
-    XSCHEM_GET() {
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../tools/xschem" >&5
-$as_echo_n "checking for ../tools/xschem... " >&6; }
-if ${ac_cv_file____tools_xschem+:} 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 "../tools/xschem"; then
-  ac_cv_file____tools_xschem=yes
-else
-  ac_cv_file____tools_xschem=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____tools_xschem" >&5
-$as_echo "$ac_cv_file____tools_xschem" >&6; }
-if test "x$ac_cv_file____tools_xschem" = xyes; then :
-
-                echo "Using pre-existing xschem download..."
-
-else
-
-                mkdir -p ../tools/xschem
-                sh ./download.sh 'https://github.com/StefanSchippers/xschem/archive/master.tar.gz' ../tools/xschem.tar.gz
-                (echo "Extracting xschem..." && cd ../tools && tar -xf xschem.tar.gz --strip-components 1 -C ../tools/xschem)
-
-
-fi
-
-        export XSCHEM_PATH=../tools/xschem
-    }
-
-    # Check whether --enable-xschem was given.
-if test "${enable_xschem+set}" = set; then :
-  enableval=$enable_xschem;
-            if test "$enableval" == "yes" -o "$enableval" == "YES"; then
-                XSCHEM_GET
-                XSCHEM_INST=1
-            elif test "$enableval" == "no" -o "$enableval" == "NO"; then
-                echo "Disabling xschem..."
-                XSCHEM_DISABLED=1
-            else
-                XSCHEM_PATH=$enableval
-            fi
-            XSCHEM_PATH=`readlink -f $XSCHEM_PATH`
-
-fi
-
-
-
-    if [ "$XSCHEM_INST" = 1 ]; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../tools/xschem-install" >&5
-$as_echo_n "checking for ../tools/xschem-install... " >&6; }
-if ${ac_cv_file____tools_xschem_install+:} 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 "../tools/xschem-install"; then
-  ac_cv_file____tools_xschem_install=yes
-else
-  ac_cv_file____tools_xschem_install=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____tools_xschem_install" >&5
-$as_echo "$ac_cv_file____tools_xschem_install" >&6; }
-if test "x$ac_cv_file____tools_xschem_install" = xyes; then :
-
-            echo "Using pre-existing xschem installation..."
-
-else
-
-            echo "---"
-            echo "Note: attempting to build xschem. Xschem requires all of Magic's dependencies and further, flex, bison and libxpm."
-            echo "Your build WILL fail if any of these are missing. You can choose to remove --enable-xschem or add a known installation path."
-            sleep 2
-            mkdir -p ../tools/xschem-install
-            XSCHEM_ABSOLUTE=`readlink -f ../tools/xschem-install`
-            (cd ../tools/xschem && ./configure --prefix=$XSCHEM_ABSOLUTE && make && make install)
-            XSCHEM_PATH=$XSCHEM_ABSOLUTE
-
-fi
-
-    fi
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: Tools enabled for PDK setup installation: klayout magic netgen openlane qflow" >&5
-$as_echo "$as_me: Tools enabled for PDK setup installation: klayout magic netgen openlane qflow" >&6;}
-
-
-
-
-
-        KLAYOUT_DISABLED=0
-        # Check whether --enable-klayout was given.
-if test "${enable_klayout+set}" = set; then :
-  enableval=$enable_klayout;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    KLAYOUT_DISABLED=1
-                fi
-
-fi
-
-
-
-
-
-        MAGIC_DISABLED=0
-        # Check whether --enable-magic was given.
-if test "${enable_magic+set}" = set; then :
-  enableval=$enable_magic;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    MAGIC_DISABLED=1
-                fi
-
-fi
-
-
-
-
-
-        NETGEN_DISABLED=0
-        # Check whether --enable-netgen was given.
-if test "${enable_netgen+set}" = set; then :
-  enableval=$enable_netgen;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    NETGEN_DISABLED=1
-                fi
-
-fi
-
-
-
-
-
-        OPENLANE_DISABLED=0
-        # Check whether --enable-openlane was given.
-if test "${enable_openlane+set}" = set; then :
-  enableval=$enable_openlane;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    OPENLANE_DISABLED=1
-                fi
-
-fi
-
-
-
-
-
-        QFLOW_DISABLED=0
-        # Check whether --enable-qflow was given.
-if test "${enable_qflow+set}" = set; then :
-  enableval=$enable_qflow;
-                if test "$enableval" == "no" -o "$enableval" == "NO"; then
-                    QFLOW_DISABLED=1
-                fi
-
-fi
-
-
-
-
-
-# Checking if (some) prerequisites are satisfied
 ## REQUIRES: https://www.gnu.org/software/autoconf-archive/ax_python_module.html#ax_python_module
 
 
@@ -2758,6 +2058,714 @@
 	fi
 
 
+realpath() {
+    # Cross-platform, handles ~
+    python3 -c 'import os,sys;print(os.path.realpath(os.path.expanduser(sys.argv[1])))' $1
+}
+
+# detect PDKs based on directories that include Makefile.in files
+
+
+# define tools
+# define tools to install setup files for.  This does not imply that the tools are
+# available on the system;  just that open_pdks will install the setup files for them.
+## DO NOT INCLUDE XSCHEM IN THE TOOL LIST. XSCHEM CAN BE INSTALLED IN THE CONFIG SCRIPT
+
+
+mkdir -p ../pdks
+
+# check for the source and install paths for each PDK.
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Found technology directories: sky130" >&5
+$as_echo "$as_me: Found technology directories: sky130" >&6;}
+
+
+
+    # --enable-pdk-[pdk]=/path/to/pdk
+
+
+
+        SKY130_SOURCE_PATH=""
+        SKY130_LOCAL_PATH=""
+        SKY130_DIST_PATH=""
+        SKY130_LINK_TARGETS="none"
+
+        pdk_get() {
+            { $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_info"; then
+  ac_cv_file____sky130_pdk_info=yes
+else
+  ac_cv_file____sky130_pdk_info=no
+fi
+fi
+{ $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; }
+if ${ac_cv_file____pdks_sky130+:} 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 "../pdks/sky130"; then
+  ac_cv_file____pdks_sky130=yes
+else
+  ac_cv_file____pdks_sky130=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____pdks_sky130" >&5
+$as_echo "$ac_cv_file____pdks_sky130" >&6; }
+if test "x$ac_cv_file____pdks_sky130" = xyes; then :
+
+                    echo "Using pre-existing sky130 download..."
+
+else
+
+                    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
+
+                export SKY130_SOURCE_PATH=../pdks/sky130
+
+else
+
+                as_fn_error $? "PDK sky130 cannot be automatically downloaded and requires a path." "$LINENO" 5
+
+fi
+
+        }
+
+        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_find
+                elif test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    echo "Disabling sky130..."
+                else
+                    SKY130_SOURCE_PATH=$enableval
+                fi
+
+else
+
+                pdk_find
+
+
+fi
+
+	    # # Require this argument
+
+        if [ "$SKY130_SOURCE_PATH" != "" ]; then
+            SKY130_SOURCE_PATH=`realpath $SKY130_SOURCE_PATH`
+            SKY130_BASENAME=`basename $SKY130_SOURCE_PATH`
+	    if [ "$SKY130_BASENAME" = "libraries" ]; then
+		SKY130_SOURCE_PATH=`dirname $SKY130_SOURCE_PATH`
+	    fi
+            # basic check that the PDK exists there (the path must exist in any case)
+            { $as_echo "$as_me:${as_lineno-$LINENO}: Checking specified path for 'sky130' at $SKY130_SOURCE_PATH" >&5
+$as_echo "$as_me: Checking specified path for 'sky130' at $SKY130_SOURCE_PATH" >&6;}
+            as_ac_File=`$as_echo "ac_cv_file_$SKY130_SOURCE_PATH" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SKY130_SOURCE_PATH" >&5
+$as_echo_n "checking for $SKY130_SOURCE_PATH... " >&6; }
+if eval \${$as_ac_File+:} 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_SOURCE_PATH"; then
+  eval "$as_ac_File=yes"
+else
+  eval "$as_ac_File=no"
+fi
+fi
+eval ac_res=\$$as_ac_File
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+
+                { $as_echo "$as_me:${as_lineno-$LINENO}: 'sky130' source path found at $SKY130_SOURCE_PATH" >&5
+$as_echo "$as_me: 'sky130' source path found at $SKY130_SOURCE_PATH" >&6;}
+
+else
+
+                as_fn_error $? "Specified path for 'sky130' at $SKY130_SOURCE_PATH not found" "$LINENO" 5
+
+fi
+
+
+            # --with-pdk-local-path=PDK_LOCAL_PATH
+
+# Check whether --with-sky130-local-path was given.
+if test "${with_sky130_local_path+set}" = set; then :
+  withval=$with_sky130_local_path; SKY130_LOCAL_PATH=$withval
+
+fi
+
+
+            # Require this argument
+            { $as_echo "$as_me:${as_lineno-$LINENO}: Checking whether local path is specified for 'sky130'" >&5
+$as_echo "$as_me: Checking whether local path is specified for 'sky130'" >&6;}
+            if test "x$SKY130_LOCAL_PATH" == "x" ; then
+                as_fn_error $? "Option --with-sky130-local-path=<path> not specified!" "$LINENO" 5
+                SKY130_LOCAL_PATH=""
+            else
+                SKY130_LOCAL_PATH=`realpath $SKY130_LOCAL_PATH`
+            fi
+
+            # --with-pdk-dist-path=PDK_DIST_PATH
+
+# Check whether --with-sky130-dist-path was given.
+if test "${with_sky130_dist_path+set}" = set; then :
+  withval=$with_sky130_dist_path; SKY130_DIST_PATH=$withval
+
+fi
+
+
+
+            # "Require" this argument
+            { $as_echo "$as_me:${as_lineno-$LINENO}: Checking whether distribution path is specified for 'sky130'" >&5
+$as_echo "$as_me: Checking whether distribution path is specified for 'sky130'" >&6;}
+            if test "x$SKY130_DIST_PATH" == "x" ; then
+                { $as_echo "$as_me:${as_lineno-$LINENO}: Option --with-sky130-dist-path=<path> not specified.  Local install only." >&5
+$as_echo "$as_me: Option --with-sky130-dist-path=<path> not specified.  Local install only." >&6;}
+                SKY130_DIST_PATH=""
+            else
+                SKY130_DIST_PATH=`realpath $SKY130_DIST_PATH`
+            fi
+
+            # --with-pdk-link-targets=PDK_LINK_TARGETS
+
+# Check whether --with-sky130-link-targets was given.
+if test "${with_sky130_link_targets+set}" = set; then :
+  withval=$with_sky130_link_targets; SKY130_LINK_TARGETS=$with_sky130_link_targets
+
+fi
+
+
+            { $as_echo "$as_me:${as_lineno-$LINENO}: Link targets set to $SKY130_LINK_TARGETS" >&5
+$as_echo "$as_me: Link targets set to $SKY130_LINK_TARGETS" >&6;}
+        fi
+
+
+
+
+
+
+
+
+# Set variables for tool setups
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Found tools: klayout magic netgen openlane qflow" >&5
+$as_echo "$as_me: Found tools: klayout magic netgen openlane qflow" >&6;}
+
+
+
+
+
+        KLAYOUT_DISABLED=0
+        # Check whether --enable-klayout was given.
+if test "${enable_klayout+set}" = set; then :
+  enableval=$enable_klayout;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    KLAYOUT_DISABLED=1
+                fi
+
+
+fi
+
+
+
+
+
+        MAGIC_DISABLED=0
+        # Check whether --enable-magic was given.
+if test "${enable_magic+set}" = set; then :
+  enableval=$enable_magic;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    MAGIC_DISABLED=1
+                fi
+
+
+fi
+
+
+
+
+
+        NETGEN_DISABLED=0
+        # Check whether --enable-netgen was given.
+if test "${enable_netgen+set}" = set; then :
+  enableval=$enable_netgen;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    NETGEN_DISABLED=1
+                fi
+
+
+fi
+
+
+
+
+
+        OPENLANE_DISABLED=0
+        # Check whether --enable-openlane was given.
+if test "${enable_openlane+set}" = set; then :
+  enableval=$enable_openlane;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    OPENLANE_DISABLED=1
+                fi
+
+
+fi
+
+
+
+
+
+        QFLOW_DISABLED=0
+        # Check whether --enable-qflow was given.
+if test "${enable_qflow+set}" = set; then :
+  enableval=$enable_qflow;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    QFLOW_DISABLED=1
+                fi
+
+
+fi
+
+
+
+
+
+# Magic
+# Extract the first word of "magic", so it can be a program name with args.
+set dummy magic; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MAGIC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_MAGIC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+MAGIC=$ac_cv_path_MAGIC
+if test -n "$MAGIC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC" >&5
+$as_echo "$MAGIC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test -z "$MAGIC"; then
+   as_fn_error $? "You need 'magic' to generate the needed various cell views." "$LINENO" 5
+fi
+# Extract the first word of "patch", so it can be a program name with args.
+set dummy patch; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATCH+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PATCH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PATCH=$ac_cv_path_PATCH
+if test -n "$PATCH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5
+$as_echo "$PATCH" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test -z "$PATCH"; then
+   as_fn_error $? "You need 'patch' to apply patches." "$LINENO" 5
+fi
+
+# Other installations (libraries or tools if applicable)
+mkdir -p ../libs
+mkdir -p ../tools
+
+
+
+
+
+
+
+
+
+    # echo target targetvar flag url location
+
+    OSU_PATH=""
+    OSU_GET() {
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../libs/osu" >&5
+$as_echo_n "checking for ../libs/osu... " >&6; }
+if ${ac_cv_file____libs_osu+:} 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 "../libs/osu"; then
+  ac_cv_file____libs_osu=yes
+else
+  ac_cv_file____libs_osu=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____libs_osu" >&5
+$as_echo "$ac_cv_file____libs_osu" >&6; }
+if test "x$ac_cv_file____libs_osu" = xyes; then :
+
+                echo "Using pre-existing osu download..."
+
+else
+
+                mkdir -p ../libs/osu
+                sh ./download.sh 'https://vlsiarch.ecen.okstate.edu/flows/MOSIS_SCMOS/osu_stdcells_v2.4/osu_stdcells_lib.v2.4.tar.gz' ../libs/osu.tar.gz
+                (echo "Extracting osu..." && cd ../libs && tar -xf osu.tar.gz --strip-components 1 -C ../libs/osu)
+
+
+fi
+
+        export OSU_PATH=../libs/osu
+    }
+
+    # Check whether --enable-osu-lib was given.
+if test "${enable_osu_lib+set}" = set; then :
+  enableval=$enable_osu_lib;
+            if test "$enableval" == "yes" -o "$enableval" == "YES"; then
+                OSU_GET
+                XSCHEM_INST=1
+            elif test "$enableval" == "no" -o "$enableval" == "NO"; then
+                echo "Disabling osu..."
+                XSCHEM_DISABLED=1
+            else
+                OSU_PATH=$enableval
+            fi
+            OSU_PATH=`realpath $OSU_PATH`
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+    # echo target targetvar flag url location
+
+    SKY130_ML_XX_HD_PATH=""
+    SKY130_ML_XX_HD_GET() {
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../libs/sky130_ml_xx_hd" >&5
+$as_echo_n "checking for ../libs/sky130_ml_xx_hd... " >&6; }
+if ${ac_cv_file____libs_sky130_ml_xx_hd+:} 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 "../libs/sky130_ml_xx_hd"; then
+  ac_cv_file____libs_sky130_ml_xx_hd=yes
+else
+  ac_cv_file____libs_sky130_ml_xx_hd=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____libs_sky130_ml_xx_hd" >&5
+$as_echo "$ac_cv_file____libs_sky130_ml_xx_hd" >&6; }
+if test "x$ac_cv_file____libs_sky130_ml_xx_hd" = xyes; then :
+
+                echo "Using pre-existing sky130_ml_xx_hd download..."
+
+else
+
+                mkdir -p ../libs/sky130_ml_xx_hd
+                sh ./download.sh 'https://github.com/PaulSchulz/sky130_pschulz_xx_hd/archive/master.tar.gz' ../libs/sky130_ml_xx_hd.tar.gz
+                (echo "Extracting sky130_ml_xx_hd..." && cd ../libs && tar -xf sky130_ml_xx_hd.tar.gz --strip-components 1 -C ../libs/sky130_ml_xx_hd)
+
+
+fi
+
+        export SKY130_ML_XX_HD_PATH=../libs/sky130_ml_xx_hd
+    }
+
+    # Check whether --enable-alpha-lib was given.
+if test "${enable_alpha_lib+set}" = set; then :
+  enableval=$enable_alpha_lib;
+            if test "$enableval" == "yes" -o "$enableval" == "YES"; then
+                SKY130_ML_XX_HD_GET
+                XSCHEM_INST=1
+            elif test "$enableval" == "no" -o "$enableval" == "NO"; then
+                echo "Disabling sky130_ml_xx_hd..."
+                XSCHEM_DISABLED=1
+            else
+                SKY130_ML_XX_HD_PATH=$enableval
+            fi
+            SKY130_ML_XX_HD_PATH=`realpath $SKY130_ML_XX_HD_PATH`
+
+fi
+
+
+
+
+
+
+
+XSCHEM_DISABLED=0
+XSCHEM_INST=0
+
+
+
+
+
+
+
+    # echo target targetvar flag url location
+
+    XSCHEM_PATH=""
+    XSCHEM_GET() {
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../tools/xschem" >&5
+$as_echo_n "checking for ../tools/xschem... " >&6; }
+if ${ac_cv_file____tools_xschem+:} 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 "../tools/xschem"; then
+  ac_cv_file____tools_xschem=yes
+else
+  ac_cv_file____tools_xschem=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____tools_xschem" >&5
+$as_echo "$ac_cv_file____tools_xschem" >&6; }
+if test "x$ac_cv_file____tools_xschem" = xyes; then :
+
+                echo "Using pre-existing xschem download..."
+
+else
+
+                mkdir -p ../tools/xschem
+                sh ./download.sh 'https://github.com/StefanSchippers/xschem/archive/master.tar.gz' ../tools/xschem.tar.gz
+                (echo "Extracting xschem..." && cd ../tools && tar -xf xschem.tar.gz --strip-components 1 -C ../tools/xschem)
+
+
+fi
+
+        export XSCHEM_PATH=../tools/xschem
+    }
+
+    # Check whether --enable-xschem was given.
+if test "${enable_xschem+set}" = set; then :
+  enableval=$enable_xschem;
+            if test "$enableval" == "yes" -o "$enableval" == "YES"; then
+                XSCHEM_GET
+                XSCHEM_INST=1
+            elif test "$enableval" == "no" -o "$enableval" == "NO"; then
+                echo "Disabling xschem..."
+                XSCHEM_DISABLED=1
+            else
+                XSCHEM_PATH=$enableval
+            fi
+            XSCHEM_PATH=`realpath $XSCHEM_PATH`
+
+fi
+
+
+
+    if [ "$XSCHEM_INST" = 1 ]; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../tools/xschem-install" >&5
+$as_echo_n "checking for ../tools/xschem-install... " >&6; }
+if ${ac_cv_file____tools_xschem_install+:} 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 "../tools/xschem-install"; then
+  ac_cv_file____tools_xschem_install=yes
+else
+  ac_cv_file____tools_xschem_install=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____tools_xschem_install" >&5
+$as_echo "$ac_cv_file____tools_xschem_install" >&6; }
+if test "x$ac_cv_file____tools_xschem_install" = xyes; then :
+
+            echo "Using pre-existing xschem installation..."
+
+else
+
+            echo "---"
+            echo "Note: attempting to build xschem. Xschem requires all of Magic's dependencies and further, flex, bison and libxpm."
+            echo "Your build WILL fail if any of these are missing. You can choose to remove --enable-xschem or add a known installation path."
+            sleep 2
+            mkdir -p ../tools/xschem-install
+            XSCHEM_ABSOLUTE=`realpath ../tools/xschem-install`
+            (cd ../tools/xschem && ./configure --prefix=$XSCHEM_ABSOLUTE && make && make install)
+            XSCHEM_PATH=$XSCHEM_ABSOLUTE
+
+fi
+
+    fi
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Tools enabled for PDK setup installation: klayout magic netgen openlane qflow" >&5
+$as_echo "$as_me: Tools enabled for PDK setup installation: klayout magic netgen openlane qflow" >&6;}
+
+
+
+
+
+        KLAYOUT_DISABLED=0
+        # Check whether --enable-klayout was given.
+if test "${enable_klayout+set}" = set; then :
+  enableval=$enable_klayout;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    KLAYOUT_DISABLED=1
+                fi
+
+fi
+
+
+
+
+
+        MAGIC_DISABLED=0
+        # Check whether --enable-magic was given.
+if test "${enable_magic+set}" = set; then :
+  enableval=$enable_magic;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    MAGIC_DISABLED=1
+                fi
+
+fi
+
+
+
+
+
+        NETGEN_DISABLED=0
+        # Check whether --enable-netgen was given.
+if test "${enable_netgen+set}" = set; then :
+  enableval=$enable_netgen;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    NETGEN_DISABLED=1
+                fi
+
+fi
+
+
+
+
+
+        OPENLANE_DISABLED=0
+        # Check whether --enable-openlane was given.
+if test "${enable_openlane+set}" = set; then :
+  enableval=$enable_openlane;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    OPENLANE_DISABLED=1
+                fi
+
+fi
+
+
+
+
+
+        QFLOW_DISABLED=0
+        # Check whether --enable-qflow was given.
+if test "${enable_qflow+set}" = set; then :
+  enableval=$enable_qflow;
+                if test "$enableval" == "no" -o "$enableval" == "NO"; then
+                    QFLOW_DISABLED=1
+                fi
+
+fi
+
+
+
+
+
 # Check for "--with-ef-style"
 EF_STYLE=0
 
diff --git a/scripts/configure.ac b/scripts/configure.ac
index c6a0c53..d153c38 100755
--- a/scripts/configure.ac
+++ b/scripts/configure.ac
@@ -1,5 +1,14 @@
 AC_INIT([open_pdks], [1.0], [github.com/RTimothyEdwards/open_pdks])
 
+## REQUIRES: https://www.gnu.org/software/autoconf-archive/ax_python_module.html#ax_python_module
+AM_PATH_PYTHON([3.4])
+AX_PYTHON_MODULE([distutils],[])
+
+realpath() {
+    # Cross-platform, handles ~
+    python3 -c 'import os,sys;print(os.path.realpath(os.path.expanduser(sys.argv@<:@1@:>@)))' $1
+}
+
 # detect PDKs based on directories that include Makefile.in files
 m4_define([M4_GET_TECHS], [m4_normalize(m4_esyscmd(cd .. && find * -mindepth 1 -maxdepth 1 -name "Makefile.in" -exec dirname {} \; | tr "\n" " "))])
 
@@ -72,7 +81,11 @@
 	    # # Require this argument
 
         if @<:@ "$[]pdkvar[]_SOURCE_PATH" != "" @:>@; then
-            pdkvar[]_SOURCE_PATH=`readlink -f $[]pdkvar[]_SOURCE_PATH`
+            pdkvar[]_SOURCE_PATH=`realpath $[]pdkvar[]_SOURCE_PATH`
+            pdkvar[]_BASENAME=`basename $[]pdkvar[]_SOURCE_PATH`
+	    if @<:@ "$[]pdkvar[]_BASENAME" = "libraries" @:>@; then
+		pdkvar[]_SOURCE_PATH=`dirname $[]pdkvar[]_SOURCE_PATH`
+	    fi
             # basic check that the PDK exists there (the path must exist in any case)
             AC_MSG_NOTICE([Checking specified path for 'pdk' at $[]pdkvar[]_SOURCE_PATH])
             AC_CHECK_FILE($pdkvar[]_SOURCE_PATH,[
@@ -93,7 +106,7 @@
                 AC_MSG_ERROR([Option --with-pdk-local-path=<path> not specified!])
                 pdkvar[]_LOCAL_PATH=""
             else
-                pdkvar[]_LOCAL_PATH=`readlink -f $[]pdkvar[]_LOCAL_PATH`
+                pdkvar[]_LOCAL_PATH=`realpath $[]pdkvar[]_LOCAL_PATH`
             fi
 
             # --with-pdk-dist-path=PDK_DIST_PATH
@@ -109,7 +122,7 @@
                 AC_MSG_NOTICE([Option --with-pdk-dist-path=<path> not specified.  Local install only.])
                 pdkvar[]_DIST_PATH=""
             else
-                pdkvar[]_DIST_PATH=`readlink -f $[]pdkvar[]_DIST_PATH`
+                pdkvar[]_DIST_PATH=`realpath $[]pdkvar[]_DIST_PATH`
             fi
 
             # --with-pdk-link-targets=PDK_LINK_TARGETS
@@ -208,7 +221,7 @@
             else
                 targetvar[]_PATH=$enableval
             fi
-            targetvar[]_PATH=`readlink -f $[]targetvar[]_PATH`
+            targetvar[]_PATH=`realpath $[]targetvar[]_PATH`
         ],
         []
     )
@@ -233,7 +246,7 @@
             echo "Your build WILL fail if any of these are missing. You can choose to remove --enable-xschem or add a known installation path."
             sleep 2
             mkdir -p ../tools/xschem-install
-            XSCHEM_ABSOLUTE=`readlink -f ../tools/xschem-install`
+            XSCHEM_ABSOLUTE=`realpath ../tools/xschem-install`
             (cd ../tools/xschem && ./configure --prefix=$XSCHEM_ABSOLUTE && make && make install)
             XSCHEM_PATH=$XSCHEM_ABSOLUTE
         ])
@@ -264,11 +277,6 @@
 
 M4_GEN_WITH_TOOLS(M4_GET_TOOLS())
 
-# Checking if (some) prerequisites are satisfied
-## REQUIRES: https://www.gnu.org/software/autoconf-archive/ax_python_module.html#ax_python_module
-AM_PATH_PYTHON([3.4])
-AX_PYTHON_MODULE([distutils],[])
-
 # Check for "--with-ef-style"
 EF_STYLE=0
 AC_ARG_WITH(
diff --git a/sky130/.gitignore b/sky130/.gitignore
index 2dd427d..4425c6f 100644
--- a/sky130/.gitignore
+++ b/sky130/.gitignore
@@ -1,4 +1,3 @@
 # staged PDKs
-sky130/sky130A
-sky130/sky130A/*
+sky130A/
 
diff --git a/sky130/Makefile.in b/sky130/Makefile.in
index d8fe84b..d54887a 100644
--- a/sky130/Makefile.in
+++ b/sky130/Makefile.in
@@ -156,6 +156,9 @@
 
 # Path to skywater_pdk 
 SKYWATER_PATH = @SKY130_SOURCE_PATH@
+ifneq ($(SKYWATER_PATH),)
+SKYWATER_PATH = $(SKYWATER_PATH)/libraries
+endif
 
 # Path to OSU standard cell library sources (to be added to configuration options).
 OSU_PATH = ~/gits/osu_130_pdk