[Gtk-sharp-list] How to check for gtk#

Gonzalo Paniagua Javier gonzalo@ximian.com
12 Mar 2003 09:03:17 +0100


> Hi,
> 
> well, in this case - what's the recommended way to check for gtk#, it doesn't have a
> pkg-config file ?

Other alternative would be something like this:

AC_DEFUN([MONO_HAVE_DLL],[

    if test -z "$2" ; then
	compiler=mcs
    else
	compiler="$2"
    fi

    if test -z "$3" ; then
	dll=mscorlib.dll
    else
	dll="$3"
    fi

    if test -z "$4" ; then
	type=int
    else
	type="$4"
    fi

    AC_MSG_CHECKING(for $dll)
    echo "class T { $type dummy; }" > conftest.cs
    $compiler /r:$dll /target:library conftest.cs 2>&1 > /dev/null
    if test $? -eq 0
    then
    	AC_SUBST($1)
	$1=1
	AC_MSG_RESULT(yes)
    else
    	AC_MSG_RESULT(no)
    fi
    rm -f conftest.cs conftest.dll
])

and then in configure.in:

MONO_HAVE_DLL(HAVE_GTK_SHARP,mcs, gtk-sharp.dll,Gtk.Button)

will define HAVE_GTK_SHARP.

-Gonzalo