]> code.delx.au - gnu-emacs/commitdiff
Miscellaneous fixes for non-default X toolkits.
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 31 Jul 2012 11:37:38 +0000 (15:37 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 31 Jul 2012 11:37:38 +0000 (15:37 +0400)
* configure.ac (MOTIF): Check for /usr/include/openmotif
and /usr/(lib|lib64)/openmotif if --with-x-toolkit=motif.
* lwlib/lwlib-Xm.c (make_menu_in_widget): Remove unused variable.
* src/xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
* src/xterm.c (x_frame_of_widget): Remove redundant prototype.
Move under #ifdef USE_LUCID.
(x_create_toolkit_scroll_bar): Adjust scroll_bar_name
definition and usage to avoid warnings.

ChangeLog
configure.ac
lwlib/ChangeLog
lwlib/lwlib-Xm.c
src/ChangeLog
src/xfns.c
src/xterm.c

index 0b1660ef853966ec2c4b0d06f7a42d28084237a2..698aa4f14ddaec9d5c756600b4ad5e7225dfb676 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Improve OpenMotif detection on GNU/Linux systems.
+       * configure.ac (MOTIF): Check for /usr/include/openmotif
+       and /usr/(lib|lib64)/openmotif if --with-x-toolkit=motif.
+
 2012-07-31  Andreas Schwab  <schwab@linux-m68k.org>
 
        * Makefile.in (install-arch-indep): Avoid eval.
index 6776c09a8bcfcbf40a5130ab04d2d9369e1cc7c0..1de8766c63f5fe079a48957a7067c756e3197daf 100644 (file)
@@ -2139,7 +2139,21 @@ fi
 
 LIBXP=
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
-  AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1,
+  # OpenMotif may be installed in such a way on some GNU/Linux systems.
+  if test -d /usr/include/openmotif; then
+    CPPFLAGS="-I/usr/include/openmotif $CPPFLAGS"
+    emacs_cv_openmotif=yes
+    case "$canonical" in
+      x86_64-*-linux-gnu* | powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*)
+      test -d /usr/lib64/openmotif && LDFLAGS="-L/usr/lib64/openmotif $LDFLAGS"
+      ;;
+      *)
+      test -d /usr/lib/openmotif && LDFLAGS="-L/usr/lib/openmotif $LDFLAGS"
+    esac
+  else
+    emacs_cv_openmotif=no
+  fi
+  AC_CACHE_CHECK(for (Open)Motif version 2.1, emacs_cv_motif_version_2_1,
   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <Xm/Xm.h>]],
     [[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1)
 int x = 5;
@@ -2149,6 +2163,9 @@ Motif version prior to 2.1.
     emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)])
   if test $emacs_cv_motif_version_2_1 = yes; then
     AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp)
+    if test x$emacs_cv_openmotif = xyes; then
+      REAL_CPPFLAGS="-I/usr/include/openmotif $REAL_CPPFLAGS"
+    fi
   else
     AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif,
     # We put this in CFLAGS temporarily to precede other -I options
index 0c0a88a8408064dbe0d89150bc75eb3085334d54..207a1200169bf2bef8556782ba5b9f5dc1571288 100644 (file)
@@ -1,3 +1,8 @@
+2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Avoid unused variable warning if --with-x-toolkit=motif.
+       * lwlib-Xm.c (make_menu_in_widget): Remove unused variable.
+
 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
index acd11aec6b567290cf1cf6e67a30c55b2723cafe..eccb4db23a6adf99ff042a5355d2f9e5765cbf27 100644 (file)
@@ -490,7 +490,6 @@ make_menu_in_widget (widget_instance* instance,
   int child_index;
   widget_value* cur;
   Widget button = 0;
-  Widget title = 0;
   Widget menu;
   Arg al [256];
   int ac;
@@ -554,7 +553,7 @@ make_menu_in_widget (widget_instance* instance,
        {
          ac = 0;
          XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
-         title = button = XmCreateLabel (widget, cur->name, al, ac);
+         button = XmCreateLabel (widget, cur->name, al, ac);
        }
       else if (lw_separator_p (cur->name, &separator, 1))
        {
index ac16e529b1e8eecfc01caeeec185c84a04545a09..0c791bcd17c09cdbd60cf9f951fb2ab05b88da31 100644 (file)
@@ -1,3 +1,12 @@
+2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Miscellaneous fixes for non-default X toolkits.
+       * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
+       * xterm.c (x_frame_of_widget): Remove redundant prototype.
+       Move under #ifdef USE_LUCID.
+       (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
+       definition and usage to avoid warnings.
+
 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsterm.m (openFiles): Fix previous checkin.
index c8c96b642f0d199a7c7f2d741aca65774c6c4a5a..bca43dbd306286caa27185a3d15f4b3436c31f1e 100644 (file)
@@ -5382,7 +5382,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories.  */)
   /* Create the dialog with PROMPT as title, using DIR as initial
      directory and using "*" as pattern.  */
   dir = Fexpand_file_name (dir, Qnil);
-  dir_xmstring = XmStringCreateLocalized (SDATA (dir));
+  dir_xmstring = XmStringCreateLocalized (SSDATA (dir));
   pattern_xmstring = XmStringCreateLocalized ("*");
 
   XtSetArg (al[ac], XmNtitle, SDATA (prompt)); ++ac;
@@ -5435,12 +5435,12 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories.  */)
 
       XmTextPosition last_pos = XmTextFieldGetLastPosition (wtext);
       XmTextFieldReplace (wtext, 0, last_pos,
-                          (SDATA (Ffile_name_nondirectory (default_filename))));
+                          (SSDATA (Ffile_name_nondirectory (default_filename))));
 
       /* Select DEFAULT_FILENAME in the files list box.  DEFAULT_FILENAME
          must include the path for this to work.  */
 
-      default_xmstring = XmStringCreateLocalized (SDATA (default_filename));
+      default_xmstring = XmStringCreateLocalized (SSDATA (default_filename));
 
       if (XmListItemExists (list, default_xmstring))
         {
index b5c5ce33d6c211fe01f72ccc01b85706ea09d987..60f65aa95088a125b80a30f2c3e4eea4e1086442 100644 (file)
@@ -1438,12 +1438,12 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
 
 #ifdef USE_X_TOOLKIT
 
-static struct frame *x_frame_of_widget (Widget);
 static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *,
                                     XrmValue *, XrmValue *, XtPointer *);
 static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer,
                             XrmValue *, Cardinal *);
 
+#ifdef USE_LUCID
 
 /* Return the frame on which widget WIDGET is used.. Abort if frame
    cannot be determined.  */
@@ -1478,9 +1478,6 @@ x_frame_of_widget (Widget widget)
   abort ();
 }
 
-
-#ifdef USE_LUCID
-
 /* Allocate a color which is lighter or darker than *PIXEL by FACTOR
    or DELTA.  Try a color with RGB values multiplied by FACTOR first.
    If this produces the same color as PIXEL, try a color where all RGB
@@ -1496,7 +1493,7 @@ x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap cmap
   return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta);
 }
 
-#endif
+#endif /* USE_LUCID */
 
 
 /* Structure specifying which arguments should be passed by Xt to
@@ -4635,7 +4632,7 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
   Widget widget;
   Arg av[20];
   int ac = 0;
-  char const *scroll_bar_name = SCROLL_BAR_NAME;
+  const char *scroll_bar_name = SCROLL_BAR_NAME;
   unsigned long pixel;
 
   BLOCK_INPUT;
@@ -4665,7 +4662,7 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
     }
 
   widget = XmCreateScrollBar (f->output_data.x->edit_widget,
-                             scroll_bar_name, av, ac);
+                             (char *) scroll_bar_name, av, ac);
 
   /* Add one callback for everything that can happen.  */
   XtAddCallback (widget, XmNdecrementCallback, xm_scroll_callback,