QCaml/configure

120 lines
2.5 KiB
Plaintext
Raw Normal View History

2018-03-28 01:50:19 +02:00
#!/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'
2019-11-30 10:41:07 +01:00
ocamlcflags='"-g -warn-error A -cc gcc -ccopt -Ofast -ccopt -march=native -ccopt=-fPIC "'
2018-10-17 10:15:02 +02:00
ocamllflags='"-g -warn-error A"'
2019-11-30 10:41:07 +01:00
ocamloptflags='"opt -O3 -nodynlink -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100 -cc gcc -ccopt -Ofast -ccopt -march=native -ccopt=-fPIC "'
2018-03-28 01:50:19 +02:00
ocamldocflags='-docflags "-g ltxhtml.cma -sort -css-style $(PWD)/style.css -colorize-code"'
2019-01-15 15:17:34 +01:00
mpi=''
2019-04-04 00:38:05 +02:00
ocamloptflags_profile='"opt -p -cc gcc -ccopt -Ofast -ccopt -march=native -ccopt -no-pie "'
2018-03-28 01:50:19 +02:00
# --------------------------------
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
2019-01-15 15:17:34 +01:00
-mpi default: mpi off
2019-04-04 00:38:05 +02:00
-profile default: off
2018-03-28 01:50:19 +02:00
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;;
2019-01-15 15:17:34 +01:00
-mpi|--mpi)
mpi='-tag "package(mpi)"';;
2019-04-04 00:38:05 +02:00
-profile|--profile)
2019-04-04 00:38:57 +02:00
ocamloptflags=$ocamloptflags_profile;;
2019-02-15 11:08:10 +01:00
-h|-help|--help)
2018-03-28 01:50:19 +02:00
help;;
*)
echo "Unknown option $1, try -help"
exit 2;;
esac
shift
done
2019-01-15 15:17:34 +01:00
rm -f Parallel
2019-02-15 11:08:10 +01:00
if [ "x.$mpi" != "x." ] ; then
2019-01-15 15:17:34 +01:00
ln -s Parallel_mpi Parallel
else
ln -s Parallel_serial Parallel
fi
2018-03-28 01:50:19 +02:00
cat << EOF > Makefile
package_name=$package_name
prefix=$prefix
bin=$bin
lib=$lib
doc=$doc
share=$share
man=$man
etc=$etc
2019-01-15 15:17:34 +01:00
mpi=$mpi
2018-03-28 01:50:19 +02:00
ocamlcflags=$ocamlcflags
2018-10-17 10:15:02 +02:00
ocamllflags=$ocamllflags
2018-03-28 01:50:19 +02:00
ocamloptflags=$ocamloptflags
ocamldocflags=$ocamldocflags
include Makefile.include
EOF