ciao-lang / ciao

Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
https://ciao-lang.org
GNU Lesser General Public License v3.0
272 stars 21 forks source link

configuration gives error #40

Closed wettoast4 closed 2 years ago

wettoast4 commented 2 years ago

I attempted to install ciao according to "Quick installation from source". When I ran "./ciao-boot.sh configure", its output had following error.

$./ciao-boot.sh configure => builder: building [boot] compiling ciaoengine (engine for ciaoc.sta) /home/junya/Downloads/ciao-1.21.0-alpha.4/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: ': unexpected operator /home/junya/Downloads/ciao-1.21.0-alpha.4/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: ': unexpected operator /home/junya/Downloads/ciao-1.21.0-alpha.4/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: unexpected operator /home/junya/Downloads/ciao-1.21.0-alpha.4/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: unexpected operator (truncated followings)

500--510 lines of config-sysdep.sh:

qflag() { # q str
    if [ "$1" == "" ]; then # (Make)
        # escape $ as $$
        printf "%s" "$2" | sed -e "s/\\\$/\$\$/g"
    else # (sh)
        # escape ' as '"'"', $ as \$
        printf "$1"
        printf "%s" "$2" | sed -e "s/'/'\"'\"'/g;s/\\\$/\\\\\$/g"
        printf "$1"
    fi
}

I guess the error is due to my environment used 'dash shell' to run scripts and its test command lacks == operator.

~$ readlink /bin/sh dash

jfmc commented 2 years ago

Thank you! This is indeed a bashism (bash syntax that is not POSIX compliant). It should be fixed in 9b75f28e8b1a66c19caaeb7880f1849abd0c8c51 . Please tell us if it still fails.

wettoast4 commented 2 years ago

Thanks. It is solved.