From 100da29601f0ed1923ca3d6a1db3142929321f38 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 3 Apr 2003 16:22:34 +0000 Subject: autoconf stuff --- Makefile.am | 4 +++- configure.ac | 7 ++++--- mogltk-config.in | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ mogltk.m4 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/test.cc | 2 +- 5 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 mogltk-config.in create mode 100644 mogltk.m4 diff --git a/Makefile.am b/Makefile.am index e34e9ff..033a2d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,4 +3,6 @@ SUBDIRS = lib intl m4 po include src ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = config.rpath mkinstalldirs +EXTRA_DIST = config.rpath mkinstalldirs mogltk.m4 + +bin_SCRIPTS = mogltk-config diff --git a/configure.ac b/configure.ac index b1ae7a9..dd59ccd 100644 --- a/configure.ac +++ b/configure.ac @@ -82,9 +82,10 @@ else fi AC_CONFIG_FILES([Makefile - intl/Makefile - m4/Makefile - include/Makefile + mogltk-config + intl/Makefile + m4/Makefile + include/Makefile po/Makefile.in lib/Makefile src/Makefile]) diff --git a/mogltk-config.in b/mogltk-config.in new file mode 100644 index 0000000..962b018 --- /dev/null +++ b/mogltk-config.in @@ -0,0 +1,54 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +exec_prefix_set=no + +usage="\ +Usage: mogltk-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --version) + echo @VERSION@ + ;; + --cflags) + echo -I@includedir@/mogltk + ;; + --libs) + libdirs="-L@libdir@" + echo $libdirs -lmogltk @LIBS@ + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done diff --git a/mogltk.m4 b/mogltk.m4 new file mode 100644 index 0000000..7364c90 --- /dev/null +++ b/mogltk.m4 @@ -0,0 +1,54 @@ +# Configure paths for mogltk +# Nicolas Noble 2002-12-06 +# stolen from Sam Lantinga +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for MOGLTK, and define MOGLTK_CFLAGS and MOGLTK_LIBS +dnl +AC_DEFUN(AM_PATH_MOGLTK, +[dnl +dnl Get the cflags and libraries from the mogltk-config script +dnl +AC_ARG_WITH(mogltk-prefix,[ --with-mogltk-prefix=PFX Prefix where Baltisot is installed (optional)], + mogltk_prefix="$withval", mogltk_prefix="") +AC_ARG_WITH(mogltk-exec-prefix,[ --with-mogltk-exec-prefix=PFX Exec prefix where Baltisot is installed (optional)], + mogltk_exec_prefix="$withval", mogltk_exec_prefix="") + + if test x$mogltk_exec_prefix != x ; then + mogltk_args="$mogltk_args --exec-prefix=$mogltk_exec_prefix" + if test x${mogltk_CONFIG+set} != xset ; then + mogltk_CONFIG=$mogltk_exec_prefix/bin/mogltk-config + fi + fi + if test x$mogltk_prefix != x ; then + mogltk_args="$mogltk_args --prefix=$mogltk_prefix" + if test x${mogltk_CONFIG+set} != xset ; then + mogltk_CONFIG=$mogltk_prefix/bin/mogltk-config + fi + fi + + AC_REQUIRE([AC_CANONICAL_TARGET]) + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + AC_PATH_PROG(MOGLTK_CONFIG, mogltk-config, no, [$PATH]) + no_mogltk="" + if test "$MOGLTK_CONFIG" = "no" ; then + no_mogltk=yes + else + MOGLTK_CFLAGS=`$MOGLTK_CONFIG $mogltkconf_args --cflags` + MOGLTK_LIBS=`$MOGLTK_CONFIG $mogltkconf_args --libs` + fi + + if test "x$no_mogltk" = x ; then + ifelse([$1], , :, [$1]) + else + MOGLTK_CFLAGS="" + MOGLTK_LIBS="" + ifelse([$2], , :, [$2]) + fi + AC_SUBST(MOGLTK_CFLAGS) + AC_SUBST(MOGLTK_LIBS) +]) diff --git a/src/test.cc b/src/test.cc index 4ba9349..d93e50e 100644 --- a/src/test.cc +++ b/src/test.cc @@ -66,7 +66,7 @@ virtual int startup() throw (GeneralException) { sh->pcircle(320, 240, 50); // sh->arc(320, 240, 50, 0, 0); -// sh->box(MIN(sx1, sx2), MIN(sy1, sy2), MAX(sx1, sx2), MAX(sy1, sy2), AlphaBlue); + sh->box(MIN(sx1, sx2), MIN(sy1, sy2), MAX(sx1, sx2), MAX(sy1, sy2), AlphaBlue); font->putcursor(550, 400); font->printf("FPS: %.2f\n", mogltk::engine::FPS()); -- cgit v1.2.3