X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=configure;fp=configure;h=6195562fb3f63120bca09c5c4db5ecbf441b2baf;hb=0b190cc8fbca0f970eadd8c0f1d5792c41f71cf6;hp=0000000000000000000000000000000000000000;hpb=d6e3c2ecec2d78a1f07f1701a472d646d3165f71;p=glaze diff --git a/configure b/configure new file mode 100755 index 0000000..6195562 --- /dev/null +++ b/configure @@ -0,0 +1,261 @@ +#! /bin/sh + +PROJECT=glaze +PROJECT_BLURB="a shiny way to wrap OpenGL" + +srcdir=$(dirname "$0") + +# For a non-srcdir configure invocation (such as ../configure), create +# the directory structure and copy Makefiles. +if [ "$srcdir" != "." ]; then + + for dir in . $(grep "^subdirs *=" "$srcdir"/Makefile | sed -e "s/subdirs *= *//"); do + mkdir -p "$dir" + cp "$srcdir"/"$dir"/Makefile.local "$dir" + cp "$srcdir"/"$dir"/Makefile "$dir" + done +fi + +# Set several defaults (optionally specified by the user in +# environment variables) +CC=${CC:-gcc} +CFLAGS=${CFLAGS:--O2} +LDFLAGS=${LDFLAGS:-} + +# Set the defaults for values the user can specify with command-line +# options. +PREFIX=/usr/local + +usage () +{ + cat <-- Currently ignored + --host=-- Currently ignored + --infodir=DIR Currently ignored + --datadir=DIR Currently ignored + --localstatedir=DIR Currently ignored + --libexecdir=DIR Currently ignored + --disable-maintainer-mode Currently ignored + --disable-dependency-tracking Currently ignored + +EOF +} + +# Parse command-line options +for option; do + if [ "${option}" = '--help' ] ; then + usage + exit 0 + elif [ "${option%%=*}" = '--prefix' ] ; then + PREFIX="${option#*=}" + elif [ "${option%%=*}" = '--bindir' ] ; then + BINDIR="${option#*=}" + elif [ "${option%%=*}" = '--libdir' ] ; then + LIBDIR="${option#*=}" + elif [ "${option%%=*}" = '--mandir' ] ; then + MANDIR="${option#*=}" + elif [ "${option%%=*}" = '--sysconfdir' ] ; then + SYSCONFDIR="${option#*=}" + elif [ "${option%%=*}" = '--build' ] ; then + true + elif [ "${option%%=*}" = '--host' ] ; then + true + elif [ "${option%%=*}" = '--infodir' ] ; then + true + elif [ "${option%%=*}" = '--datadir' ] ; then + true + elif [ "${option%%=*}" = '--localstatedir' ] ; then + true + elif [ "${option%%=*}" = '--libexecdir' ] ; then + true + elif [ "${option}" = '--disable-maintainer-mode' ] ; then + true + elif [ "${option}" = '--disable-dependency-tracking' ] ; then + true + else + echo "Unrecognized option: ${option}" + echo "See:" + echo " $0 --help" + echo "" + exit 1 + fi +done + +printf "Checking for working C compiler (${CC})... " +printf "int main(void){return 42;}\n" > minimal.c +if ${CC} -o minimal minimal.c > /dev/null 2>&1 +then + printf "Yes.\n" +else + printf "No.\n" + cat < /dev/null 2>&1 + then + WARN_CFLAGS="${WARN_CFLAGS}${WARN_CFLAGS:+ }${flag}" + fi +done +printf "\t${WARN_CFLAGS}\n" + +rm -f minimal minimal.c + +printf "#include \nint main(void){return 0;}\n" > arch-minimal.c + +printf "Checking for machine-dependent compiler support:\n" + +printf " Compiler can create 32-bit binaries... " +have_m32=Yes +if ${CC} -m32 -o arch-minimal arch-minimal.c > /dev/null 2>&1 +then + printf "Yes.\n" +else + printf "No.\n" + have_m32=No +fi + +printf " Compiler can create 64-bit binaries... " +have_m64=Yes +if ${CC} -m64 -o arch-minimal arch-minimal.c > /dev/null 2>&1 +then + printf "Yes.\n" +else + printf "No.\n" + have_m64=No +fi + +if [ "$have_m32" = "No" ] || [ "$have_m64" = "No" ]; then + cat < Makefile.config <