[gtkada] autoconf macros

Stephen Leake stephen_leake at acm.org
Tue Nov 11 01:56:44 CET 2003


cb at alpha.dyndns.tv writes:

> Hello everybody, I am trying to compile gvd-1.2.6 with the mingw tools.
> The configure script does not know this toolschain.
> So I wanted to run autoconf, but the m4 macros for
> GNAT and GTKADA are missing. Does anybody have
> this macros? 

I started writing a pair of macros for this, for my own project. They
seem to work ...

---- gnat.m4 -----
dnl
dnl AM_GNAT
dnl
dnl error if gnat is not found.
dnl

AC_DEFUN([AM_GNAT],[
        AC_PATH_PROG(GNAT_GNATCHOP,gnatchop,no)
        if test x$GNAT_GNATCHOP = xno; then
		AC_MSG_ERROR(GNAT not installed or installation problem)
	fi
        gnat_bin=`dirname $GNAT_GNATCHOP`
        GNAT=`dirname $gnat_bin`
        dnl GNAT on Windows requires Windows device, not Cygwin
        dnl device. But Makefiles require forward slashes, or escaped
        dnl back slashes. Sigh...
        case $host_os in
        *cygwin* )
                GNAT=`echo $GNAT | sed -e "s@/cygdrive/\\(.\\)/@\\1:/@" -`
                EXEEXT=.exe
        esac
        OBJEXT=.o
	AC_SUBST(GNAT)
        AC_SUBST(EXEEXT)
        AC_SUBST(OBJEXT)
        GNAT_CLEANFILES="*.ali"
        AC_SUBST(GNAT_CLEANFILES)
        GNAT_INCLUDE=$GNAT/lib/gcc-lib/`gcc -dumpmachine`/`gcc -dumpversion`/adainclude
        AC_SUBST(GNAT_INCLUDE)
])

dnl end of file
--------
---- gtkada.m4 ----
dnl
dnl AM_GTKADA
dnl
dnl aborts if gtkada is not found.
dnl

AC_DEFUN([AM_GTKADA],[
	AC_PATH_PROG(GTKADA_GATE,gate-in,no)
        if test x$GTKADA_GATE = xno; then
		AC_MSG_ERROR(GtkAda not installed or installation problem)
	fi
        gtkada_bin=`dirname $GTKADA_GATE`
        GTKADA=`dirname $gtkada_bin`
        dnl GNAT on Windows requires Windows device, not Cygwin
        dnl device. And cygwin gnu Makefiles require forward slashes,
        dnl or escaped back slashes. So fix that here.
        dnl Also, gtkada-config does not work on Cygwin (yet), so fix
        dnl that as well.
        case $host_os in
        *cygwin* )
                GTKADA=`echo $GTKADA | sed -e "s@/cygdrive/\\(.\\)/@\\1:/@" -`
                GTKADA_INC_FLAGS=-I$GTKADA/lib
                GTKADA_LINK_FLAGS=-L$GTKADA/lib
        ;;
        *)
                GTKADA_INC_FLAGS=`gtkada-config --cflags`
                GTKADA_LINK_FLAGS="-largs `gtkada-config --libs`"
        esac
	AC_SUBST(GTKADA)
	AC_SUBST(GTKADA_INC_FLAGS)
	AC_SUBST(GTKADA_LINK_FLAGS)
])

dnl end of file
----------

I'm using the GNAT 3.15p binary, but I run it from cygwin. So you may
have to add mingw to these.

Hope this helps,

-- 
-- Stephe




More information about the gtkada mailing list