10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-14 18:13:40 +01:00
QCaml/configure

116 lines
2.2 KiB
Bash
Executable File

#!/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"'
ocamllflags='"-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"'
mpi=''
# --------------------------------
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
-mpi default: mpi off
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;;
-mpi|--mpi)
mpi='-tag "package(mpi)"';;
-help|--help)
help;;
*)
echo "Unknown option $1, try -help"
exit 2;;
esac
shift
done
rm -f Parallel
if [[ -n $mpi ]] ; then
ln -s Parallel_mpi Parallel
else
ln -s Parallel_serial Parallel
fi
cat << EOF > Makefile
package_name=$package_name
prefix=$prefix
bin=$bin
lib=$lib
doc=$doc
share=$share
man=$man
etc=$etc
mpi=$mpi
ocamlcflags=$ocamlcflags
ocamllflags=$ocamllflags
ocamloptflags=$ocamloptflags
ocamldocflags=$ocamldocflags
include Makefile.include
EOF