if /bin/false ; then

dnl Configure.in.in for the JPilotPlugin proxy conduit for KPilot.
dnl
dnl Copyright (C) 2000,2001 Adriaan de Groot
dnl Copyright (C) 2002 Reinhold Kainhofer
dnl
dnl This file is released under the terms of the Gnu General Public
dnl Licence (GPL) Version 2.

dnl
dnl Check to see if gtk header and library are available
dnl Also check for jpilot??
dnl

dnl
dnl Questions and comments can be sent to reinhold@kainhofer.com
dnl

dnl Check for the headers first. The first test is the somewhat-
dnl sophisticated one AC uses, and incorporates all the extra-includes
dnl and whatnot stuff.
dnl
HAVE_GTK=0
HAVE_GDK=0
HAVE_GLIB=0
HAVE_GDBM=0
HAVE_JPILOT=0

kpilot_save_cflags="$CPPFLAGS"
kpilot_save_ldflags="$LDFLAGS"




dnl
dnl First check for GTK, then for gdk, then for glib, and finally for gdbm
dnl



dnl ********************************************************************************
dnl *                                       GLIB                                 
dnl ********************************************************************************

CPPFLAGS="$CPPFLAGS $all_includes"
LDFLAGS="$LDFLAGS $all_libraries"


GLIB_LIB=""
GLIB_INCLUDE=""

AC_CHECK_HEADER(glib.h,[HAVE_GLIB=1], )

dnl Warn if no headers found. Maybe this should be collected at the end
dnl of the build as well, like other this-won't-be-built messages?

if  test "$HAVE_GLIB" = "0" ; then
	AC_MSG_CHECKING([for glib.h alternate])
	for i in /usr/local/include /usr/include/glib /usr/include/glib-1.2 /vol/gnome/support/include ; do
		test -f $i/glib.h && HAVE_GLIB=1
		test -f $i/glib.h && GLIB_INCLUDE="-I$i"
	done


	if test "$HAVE_GLIB" = "0" ; then
		AC_MSG_WARN([JPilotPluginProxy: no glib headers found.])
	else
		AC_MSG_RESULT([found])
	fi
fi


dnl Search the library

CPPFLAGS="$kpilot_save_cflags  $all_includes $GLIB_INCLUDE"
LDFLAGS="$kpilot_save_ldflags  $all_libraries"

if test "$HAVE_GLIB" = "1" ; then
	HAVE_GLIB=0
	AC_CHECK_LIB(glib, g_free,
			[GLIB_LIB="-lglib"
			HAVE_GLIB=1],[],[])

	for i in /usr/local/glib /usr/local/lib /usr/lib /vol/kde/support/lib ; do
		if test "$HAVE_GLIB" = "0" ; then
			CPPFLAGS="$kpilot_save_cflags  $all_includes $GLIB_INCLUDE"
			LDFLAGS="$kpilot_save_ldflags  $all_libraries -L$i -R$i"

			unset ac_cv_lib_glib_g_free
			AC_CHECK_LIB(glib, g_free,
				[GLIB_LIB="-L$i -R$i -lglib"
				HAVE_GLIB=1],[],[])
		fi
	done
fi

if test "$HAVE_GLIB" = "0" ; then
	AC_MSG_WARN([JPilotPluginProxy: glib library or header files not found])
	DO_NOT_COMPILE="$DO_NOT_COMPILE kpilot/conduits/JPilotPluginProxy"
fi

AC_SUBST(GLIB_LIB)
AC_SUBST(GLIB_INCLUDE)



dnl ********************************************************************************
dnl *                                       GDK                                 
dnl ********************************************************************************

CPPFLAGS="$CPPFLAGS $all_includes"
LDFLAGS="$LDFLAGS $all_libraries"


GDK_LIB=""
GDK_INCLUDE=""

AC_CHECK_HEADER(gdk/gdk.h,[HAVE_GDK=1], )

dnl Warn if no headers found. Maybe this should be collected at the end
dnl of the build as well, like other this-won't-be-built messages?

if  test "$HAVE_GDK" = "0" ; then
	AC_MSG_CHECKING([for gdk.h alternate])
	for i in /usr/local/include /usr/include/gtk-1.2 /vol/gnome/support/include  ; do
		test -f $i/gdk/gdk.h && HAVE_GDK=1
		test -f $i/gdk/gdk.h && GDK_INCLUDE="-I$i"
	done


	if test "$HAVE_GDK" = "0" ; then
		AC_MSG_WARN([JPilotPluginProxy: no gdk headers found.])
	else
		AC_MSG_RESULT([found])
	fi
fi


dnl Search the library

CPPFLAGS="$kpilot_save_cflags  $all_includes $GDK_INCLUDE"
LDFLAGS="$kpilot_save_ldflags  $all_libraries"

if test "$HAVE_GDK" = "1" ; then
	AC_CHECK_LIB(gdk, gdk_init,
			[GDK_LIB="-lgdk"
			HAVE_GDK=1],[],[])

	for i in /usr/local/gtk /usr/local/lib /usr/lib /vol/kde/support/lib ; do
		if test "$HAVE_GDK" = "0" ; then
			CPPFLAGS="$kpilot_save_cflags  $all_includes $GDK_INCLUDE"
			LDFLAGS="$kpilot_save_ldflags  $all_libraries -L$i -R$i"

			unset ac_cv_lib_gdk_gdk_init
			AC_CHECK_LIB(gdk, gdk_init,
				[GDK_LIB="-L$i -R$i -lgdk"
				HAVE_GDK=1],[],[])
		fi
	done
fi

if test "$HAVE_GDK" = "0" ; then
	AC_MSG_WARN([JPilotPluginProxy: gdk library or header files not found])
	DO_NOT_COMPILE="$DO_NOT_COMPILE kpilot/conduits/JPilotPluginProxy"
fi

AC_SUBST(GDK_LIB)
AC_SUBST(GDK_INCLUDE)


dnl ********************************************************************************
dnl *                                       GTK                                 
dnl ********************************************************************************

CPPFLAGS="$CPPFLAGS $all_includes"
LDFLAGS="$LDFLAGS $all_libraries"


GTK_LIB=""
GTK_INCLUDE=""

AC_CHECK_HEADER(gtk/gtk.h,[HAVE_GTK=1], )

dnl Warn if no headers found. Maybe this should be collected at the end
dnl of the build as well, like other this-won't-be-built messages?

if  test "$HAVE_GTK" = "0" ; then
	AC_MSG_CHECKING([for gtk.h alternate])
	for i in /usr/local/include /usr/include/gtk-1.2 /vol/gnome/support/include  ; do
		test -f $i/gtk/gtk.h && HAVE_GTK=1
		test -f $i/gtk/gtk.h && GTK_INCLUDE="-I$i"
	done


	if test "$HAVE_GTK" = "0" ; then
		AC_MSG_WARN([JPilotPluginProxy: no gtk headers found.])
	else
		AC_MSG_RESULT([found])
	fi
fi


dnl Search the library

CPPFLAGS="$kpilot_save_cflags  $all_includes $GTK_INCLUDE"
LDFLAGS="$kpilot_save_ldflags  $all_libraries $GDK_LIB"

if test "$HAVE_GTK" = "1" ; then
	HAVE_GTK=0
	AC_CHECK_LIB(gtk, gtk_main,
			[GTK_LIB="-lgtk"
			HAVE_GTK=1],[],[])

	for i in /usr/local/gtk /usr/local/lib /usr/lib /vol/kde/support/lib ; do
		if test "$HAVE_GTK" = "0" ; then
			CPPFLAGS="$kpilot_save_cflags  $all_includes $GTK_INCLUDE"
			LDFLAGS="$kpilot_save_ldflags  $all_libraries -L$i -R$i"

			unset ac_cv_lib_gtk_gtk_main
			AC_CHECK_LIB(gtk, gtk_main,
				[GTK_LIB="-L$i -R$i -lgtk"
				HAVE_GTK=1],[],[])
		fi
	done
fi

if test "$HAVE_GTK" = "0" ; then
	AC_MSG_WARN([JPilotPluginProxy: gtk library or header files not found])
	DO_NOT_COMPILE="$DO_NOT_COMPILE kpilot/conduits/JPilotPluginProxy"
fi

AC_SUBST(GTK_LIB)
AC_SUBST(GTK_INCLUDE)





CPPFLAGS="$kpilot_save_cflags"
LDFLAGS="$kpilot_save_ldflags"
unset kpilot_save_cflags
unset kpilot_save_ldflags
fi
