Improve detection libtool version detection
[sxemacs] / m4 / sxe-gui.m4
index 864b479..1ca6681 100644 (file)
@@ -126,7 +126,7 @@ AC_DEFUN([SXE_TEST_XAW_LIB], [dnl
 ])dnl SXE_TEST_XAW_LIB
 
 AC_DEFUN([SXE_TEST_XAW_INC], [dnl
-       ## arg1 are some additional INCLUDES 
+       ## arg1 are some additional INCLUDES
 
        ## unset the values before we get our dirty hands on them
        unset "ac_cv_header_X11_Xaw_XawInit_h"
@@ -200,6 +200,15 @@ AC_DEFUN([SXE_CHECK_XTOOLKITS], [
        CPPFLAGS="$CPPFLAGS $X_CFLAGS"
        LDFLAGS="$LDFLAGS $X_PRE_LIBS $X_LIBS $libs_x"
        AC_CHECK_HEADERS([X11/Xlib.h])
+
+       # Check for XkbKeycodeToKeysym to avoid XKeycodeToKeysym which is deprecated
+       AC_CHECK_HEADERS([X11/XKBlib.h])
+       if test "$ac_cv_header_X11_XKBlib_h" = "yes"; then
+               AC_CHECK_FUNC([XkbKeycodeToKeysym], [acx_xkbkeycodetokeysym=yes])
+                if test "$acx_xkbkeycodetokeysym" = "yes"; then
+                       AC_DEFINE([HAVE_XKBKEYCODETOKEYSYM],[1],[Has XkbKeycodeToKeysym])
+               fi
+        fi
        SXE_RESTORE_LIBS
 
        ## assume 3d first
@@ -209,21 +218,21 @@ AC_DEFUN([SXE_CHECK_XTOOLKITS], [
        ## initialise our have-vars
        have_athena=no
        have_motif=no
-         
+
        case "$with_athena" in
        ## autodetect, that is walk through the chain given above
        "auto" | "")
-               AC_MSG_CHECKING([for the Athena widgets])
+               AC_MSG_CHECKING([for the Athena widgets])
                AC_MSG_RESULT([])
 
-               ## ignite the chain :)
-               SXE_TEST_NEXTAW
-               SXE_TEST_XAW3D
-               SXE_TEST_XAWXPM
-               SXE_TEST_XAW95
-               SXE_TEST_XAW
+               ## ignite the chain :)
+               SXE_TEST_NEXTAW
+               SXE_TEST_XAW3D
+               SXE_TEST_XAWXPM
+               SXE_TEST_XAW95
+               SXE_TEST_XAW
                SXE_TEST_MOTIF
-               ;;
+               ;;
 
        "3d")
                SXE_TEST_XAW3D
@@ -242,16 +251,16 @@ AC_DEFUN([SXE_CHECK_XTOOLKITS], [
        "xaw")
                SXE_TEST_XAW
                ;;
-         
+
        ## force the motif chain
        "no")
                SXE_TEST_MOTIF
                ;;
        *)
-               SXE_DIE(["Unknown Athena widget set \`$with_athena'. This should not happen."])
+               SXE_DIE(["Unknown Athena widget set \`$with_athena'. This should not happen."])
                ;;
        esac
-         
+
        ## Do we actually have a usable Athena widget set? Please?
        if test -n "$athena_lib" -a -n "$athena_h_path"; then
                if test "athena_lib" = "Xaw"; then
@@ -305,13 +314,13 @@ AC_DEFUN([SXE_SUFFICIENT_ATHENA_P], [dnl
                if test "$have_xaw" != "yes"; then
                        SXE_DIE(["Could not find a suitable Athena library to build with."])
                fi
-       
+
                dnl Add the Lucid widget Athena code
                SXE_APPEND([lwlib-Xaw.o], [lwlib_objs])
-       
+
                dnl Add the Athena widget library we located earlier
                SXE_PREPEND([-l$athena_lib], [libs_x])
-       
+
                dnl Tell lwlib where to find the Athena header files.
                dnl Many people have tried to create a `smart' way of doing this,
                dnl but all have failed.  Before changing the following ugly definitions,
@@ -336,11 +345,11 @@ AC_DEFUN([SXE_SUFFICIENT_ATHENA_P], [dnl
                        [Description here!])
                AC_DEFINE_UNQUOTED([ATHENA_XawInit_h_], ["$athena_h_path/XawInit.h"],
                        [Description here!])
-       
+
                AC_DEFINE([LWLIB_USES_ATHENA], [1], [Description here!])
                AC_DEFINE([NEED_ATHENA], [1], [Description here!])
                need_athena="yes"
-       
+
                if test "$athena_3d" = "yes"; then
                        AC_DEFINE([HAVE_ATHENA_3D], [1], [Description here!])
                fi
@@ -361,7 +370,7 @@ AC_DEFUN([SXE_SUFFICIENT_ATHENA_P], [dnl
        if test "$with_dialogs" = "athena"; then
                AC_DEFINE([LWLIB_DIALOGS_ATHENA], [1], [Description here!])
        fi
-       
+
        if test "$athena_3d" = "yes" -a \
                "$with_scrollbars" = "athena"; then
                AC_DEFINE([LWLIB_SCROLLBARS_ATHENA3D], [1], [Description here!])
@@ -453,9 +462,7 @@ AC_DEFUN([SXE_CHECK_XT_DEPENDENCIES], [dnl
        SXE_SUFFICIENT_LUCID_P
 
        all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
-       if test "$with_x11" = "yes" -a \
-               "$with_gtk" != "yes" -a \
-               "$with_gnome" != "yes"; then
+       if test "$with_x11" = "yes"; then
 
                if test "$with_menubars" != "no"; then
                        SXE_ADD_SXEUIX11_OBJS([menubar-x.o])
@@ -476,37 +483,6 @@ AC_DEFUN([SXE_CHECK_XT_DEPENDENCIES], [dnl
 
 ])dnl SXE_CHECK_XT_DEPENDENCIES
 
-AC_DEFUN([SXE_CHECK_GTK_DEPENDENCIES], [dnl
-
-       all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
-       if test "$with_menubars" != "no"; then
-               SXE_ADD_SXEUIGTK_OBJS([menubar-gtk.o])
-       fi
-       if test "$with_scrollbars" != "no"; then
-               SXE_ADD_SXEUIGTK_OBJS([scrollbar-gtk.o])
-       fi
-       if test "$with_dialogs" != "no"; then
-               SXE_ADD_SXEUIGTK_OBJS([dialog-gtk.o])
-       fi
-       if test "$with_toolbars" != "no"; then
-               SXE_ADD_SXEUIGTK_OBJS([toolbar-gtk.o])
-       fi
-       if test "$all_widgets" != "no no no no no"; then
-               SXE_ADD_SXEUIGTK_OBJS([gui-gtk.o])
-       fi
-
-       AS_MESSAGE([
-
-Congratulations!!!  You've won already!!!
-
-You have been chosen to implement a GTK user interface for us!
-Finish all your work IMMEDIATELY and contact us to obtain detailed orders.
-
-])
-       sleep 30
-])dnl SXE_CHECK_GTK_DEPENDENCIES
-
-
 AC_DEFUN([SXE_CHECK_UI_SUFFICIENCY], [dnl
        ## common-to-all stuff
        if test "$with_menubars" != "no"; then
@@ -536,7 +512,6 @@ AC_DEFUN([SXE_CHECK_UI_SUFFICIENCY], [dnl
        SXE_SUBST_SXEUI_OBJS
        SXE_SUBST_SXEUITTY_OBJS
        SXE_SUBST_SXEUIX11_OBJS
-       SXE_SUBST_SXEUIGTK_OBJS
 
 ])dnl SXE_CHECK_UI_SUFFICIENCY