diff --git a/autogen.sh b/autogen.sh
index 06acafc..a6c02eb 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -80,8 +80,8 @@ parse_commandline()
 
   while [ -n "$1" ]; do
     # substring operations available in all sh?
-    if [ ${1:0:2} = "--" ]; then
-      keyvalue=${1:2}
+    if [ $(expr "$1" : '\(..\)') = "--" ]; then
+      keyvalue=$(expr substr $1 3 ${#1})
       key=${keyvalue%%=*}
       value=${keyvalue##*=}
       if [ "$key" = "simple-install" ]; then
