mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-12-22 12:23:31 +01:00
103 lines
1.9 KiB
Plaintext
103 lines
1.9 KiB
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
# --------------------------------
|
||
|
# Defaults
|
||
|
|
||
|
package_name="QCaml"
|
||
|
prefix='/usr/local'
|
||
|
bin='$(prefix)/bin'
|
||
|
lib='$(prefix)/lib'
|
||
|
doc='$(prefix)/doc'
|
||
|
share='$(prefix)/share'
|
||
|
man='$(prefix)/man'
|
||
|
etc='$(prefix)/etc'
|
||
|
ocamlcflags='"-g -warn-error A"'
|
||
|
ocamloptflags='"opt -O3 -nodynlink -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100"'
|
||
|
ocamldocflags='-docflags "-g ltxhtml.cma -sort -css-style $(PWD)/style.css -colorize-code"'
|
||
|
|
||
|
# --------------------------------
|
||
|
|
||
|
|
||
|
LC_ALL=C
|
||
|
export LC_ALL
|
||
|
|
||
|
if [ x.$OPAM_PACKAGE_NAME != x. ] ; then
|
||
|
package_name=$OPAM_PACKAGE_NAME
|
||
|
fi
|
||
|
|
||
|
|
||
|
help()
|
||
|
{
|
||
|
cat <<EOF
|
||
|
usage: configure [options]
|
||
|
|
||
|
where options include:
|
||
|
-prefix dir installation directory
|
||
|
-bin dir default: $bin
|
||
|
-lib dir default: $lib
|
||
|
-doc dir default: $doc
|
||
|
-share dir default: $share
|
||
|
-man dir default: $man
|
||
|
-etc dir default: $etc
|
||
|
-ocamlcflags default: $ocamlcflags
|
||
|
-ocamloptflags default: $ocamloptflags
|
||
|
|
||
|
EOF
|
||
|
exit
|
||
|
}
|
||
|
|
||
|
|
||
|
while : ; do
|
||
|
case "$1" in
|
||
|
"")
|
||
|
break;;
|
||
|
-prefix|--prefix)
|
||
|
prefix="$2"
|
||
|
shift;;
|
||
|
-bin|--bin)
|
||
|
bin="$2"
|
||
|
shift;;
|
||
|
-lib|--lib)
|
||
|
lib="$2"
|
||
|
shift;;
|
||
|
-doc|--doc)
|
||
|
doc="$2"
|
||
|
shift;;
|
||
|
-etc|--etc)
|
||
|
etc="$2"
|
||
|
shift;;
|
||
|
-man|--man)
|
||
|
man="$2"
|
||
|
shift;;
|
||
|
-share|--share)
|
||
|
share="$2"
|
||
|
shift;;
|
||
|
-help|--help)
|
||
|
help;;
|
||
|
*)
|
||
|
echo "Unknown option $1, try -help"
|
||
|
exit 2;;
|
||
|
esac
|
||
|
shift
|
||
|
done
|
||
|
|
||
|
|
||
|
cat << EOF > Makefile
|
||
|
package_name=$package_name
|
||
|
prefix=$prefix
|
||
|
bin=$bin
|
||
|
lib=$lib
|
||
|
doc=$doc
|
||
|
share=$share
|
||
|
man=$man
|
||
|
etc=$etc
|
||
|
|
||
|
ocamlcflags=$ocamlcflags
|
||
|
ocamloptflags=$ocamloptflags
|
||
|
ocamldocflags=$ocamldocflags
|
||
|
|
||
|
|
||
|
include Makefile.include
|
||
|
EOF
|
||
|
|