Skip to content

Commit

Permalink
Validate that Python was compiled with sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
stealthycoin committed Feb 14, 2023
1 parent 6a20f79 commit 12d1742
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
18 changes: 18 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,24 @@ printf "%s\n" "$am_cv_python_pyexecdir" >&6; }
fi


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sqlite3" >&5
printf %s "checking for sqlite3... " >&6; }
read -r -d '' SQLITE_TEST_PROG <<-EOF
import sys
try:
import sqlite3
except ImportError:
sys.exit(1)
EOF
$PYTHON -c "${SQLITE_TEST_PROG}"
if [ $? -eq 0 ]
then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
as_fn_error 1 "AWS CLI requires a Python interpreter compiled with sqlite3. $PYTHON does not have sqlite3." "$LINENO" 5
fi

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-install-type" >&5
printf %s "checking for --with-install-type... " >&6; }

Expand Down
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ AC_INIT([awscli], [2.7.31])
AC_CONFIG_SRCDIR([bin/aws])
AM_PATH_PYTHON([3.8])

AC_MSG_CHECKING(for sqlite3)
read -r -d '' SQLITE_TEST_PROG <<-EOF
import sys
try:
import sqlite3
except ImportError:
sys.exit(1)
EOF
$PYTHON -c "${SQLITE_TEST_PROG}"
if [[ $? -eq 0 ]]
then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR(AWS CLI requires a Python interpreter compiled with sqlite3. $PYTHON does not have sqlite3., 1)
fi

AC_MSG_CHECKING(for --with-install-type)
AC_ARG_WITH(install_type,
AS_HELP_STRING([--with-install-type=@<:@system-sandbox|portable-exe@:>@],
Expand Down

0 comments on commit 12d1742

Please sign in to comment.