aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinstall.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/install.sh b/install.sh
index 7f3908b..6c51304 100755
--- a/install.sh
+++ b/install.sh
@@ -52,7 +52,18 @@ if [ -z ${FFLAGS+x} ]; then
fi
mkdir -p $BOOTSTRAP_DIR
-curl -LJ $SOURCE_URL > $BOOTSTRAP_DIR/fpm.f90
+
+if command -v curl > /dev/null 2>&1; then
+ FETCH="curl -L"
+elif command -v wget > /dev/null 2>&1; then
+ FETCH="wget -O -"
+else
+ echo "No download mechanism found. Install curl or wget first."
+ exit 1
+fi
+
+$FETCH $SOURCE_URL > $BOOTSTRAP_DIR/fpm.f90
+
$FC $FFLAGS -J $BOOTSTRAP_DIR $BOOTSTRAP_DIR/fpm.f90 -o $BOOTSTRAP_DIR/fpm
$BOOTSTRAP_DIR/fpm install --compiler "$FC" --flag "$FFLAGS" --prefix "$PREFIX"