changeset 108019:b235d39e4457

Remove some more cpp in favor of autoconf. * configure.in (LIBSELINUX_LIBS): Always substitute in Makefiles. (GTK_OBJ, DBUS_OBJ, LIBXSM, XMENU_OBJ, XOBJ): New output variables. * src/Makefile.in (DBUS_OBJ, GTK_OBJ, XMENU_OBJ, XOBJ): Define using autoconf, not cpp. (LIBXSM): New variable, set by autoconf. (LIBXT): Use $LIBXSM.
author Glenn Morris <rgm@gnu.org>
date Tue, 20 Apr 2010 23:35:35 -0700
parents a60efd79d8af
children 1b88085c2df4
files ChangeLog configure.in src/ChangeLog src/Makefile.in
diffstat 4 files changed, 34 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Apr 20 22:47:56 2010 -0700
+++ b/ChangeLog	Tue Apr 20 23:35:35 2010 -0700
@@ -1,6 +1,7 @@
 2010-04-21  Glenn Morris  <rgm@gnu.org>
 
 	* configure.in (LIBSELINUX_LIBS): Always substitute in Makefiles.
+	(GTK_OBJ, DBUS_OBJ, LIBXSM, XMENU_OBJ, XOBJ): New output variables.
 
 2010-04-21  Karel Klíč  <kklic@redhat.com>
 
--- a/configure.in	Tue Apr 20 22:47:56 2010 -0700
+++ b/configure.in	Tue Apr 20 23:35:35 2010 -0700
@@ -1612,6 +1612,7 @@
 fi
 
 
+GTK_OBJ=
 if test x"$pkg_check_gtk" = xyes; then
 
   AC_SUBST(GTK_CFLAGS)
@@ -1629,6 +1630,7 @@
   else
     HAVE_GTK=yes
     AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
+    GTK_OBJ=gtkutil.o
     USE_X_TOOLKIT=none
     if $PKG_CONFIG --atleast-version=2.10 gtk+-2.0; then
       :
@@ -1642,6 +1644,7 @@
   fi
 
 fi
+AC_SUBST(GTK_OBJ)
 
 
 if test "${HAVE_GTK}" = "yes"; then
@@ -1713,14 +1716,17 @@
 dnl other platforms.  Support for higher D-Bus versions than 1.0 is
 dnl also not configured.
 HAVE_DBUS=no
+DBUS_OBJ=
 if test "${with_dbus}" = "yes"; then
    PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
    if test "$HAVE_DBUS" = yes; then
      LIBS="$LIBS $DBUS_LIBS"
      AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
      AC_CHECK_FUNCS([dbus_watch_get_unix_fd])
+     DBUS_OBJ=dbusbind.o
    fi
 fi
+AC_SUBST(DBUS_OBJ)
 
 dnl GConf has been tested under GNU/Linux only.
 dnl The version is really arbitrary, it is about the same age as Gtk+ 2.6.
@@ -2243,18 +2249,21 @@
 
 ### Use session management (-lSM -lICE) if available
 HAVE_X_SM=no
+LIBXSM=
 if test "${HAVE_X11}" = "yes"; then
   AC_CHECK_HEADER(X11/SM/SMlib.h,
     [AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, , -lICE)])
 
   if test "${HAVE_X_SM}" = "yes"; then
     AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
+    LIBXSM="-lSM -lICE"
     case "$LIBS" in
       *-lSM*) ;;
-      *)      LIBS="-lSM -lICE $LIBS" ;;
+      *)      LIBS="$LIBXSM $LIBS" ;;
     esac
   fi
 fi
+AC_SUBST(LIBXSM)
 
 # If netdb.h doesn't declare h_errno, we must declare it by hand.
 AC_CACHE_CHECK(whether netdb declares h_errno,
@@ -2762,10 +2771,17 @@
 AC_DEFINE_UNQUOTED(UNEXEC_SRC,       ${UNEXEC_SRC},
 		   [Define to the unexec source file name.])
 
+XMENU_OBJ=
+XOBJ=
 if test "${HAVE_X_WINDOWS}" = "yes" ; then
   AC_DEFINE(HAVE_X_WINDOWS, 1,
 	    [Define to 1 if you want to use the X window system.])
+  XMENU_OBJ=xmenu.o
+  XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
 fi
+AC_SUBST(XMENU_OBJ)
+AC_SUBST(XOBJ)
+
 if test "${USE_X_TOOLKIT}" != "none" ; then
   AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.])
   if test "${USE_X_TOOLKIT}" = "LUCID"; then
--- a/src/ChangeLog	Tue Apr 20 22:47:56 2010 -0700
+++ b/src/ChangeLog	Tue Apr 20 23:35:35 2010 -0700
@@ -1,3 +1,10 @@
+2010-04-21  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (DBUS_OBJ, GTK_OBJ, XMENU_OBJ, XOBJ):
+	Define using autoconf, not cpp.
+	(LIBXSM): New variable, set by autoconf.
+	(LIBXT): Use $LIBXSM.
+
 2010-04-21  Dan Nicolaescu  <local_user@dannlt>
 
 	Remove NOMULTIPLEJOBS, unused.
--- a/src/Makefile.in	Tue Apr 20 22:47:56 2010 -0700
+++ b/src/Makefile.in	Tue Apr 20 23:35:35 2010 -0700
@@ -82,10 +82,18 @@
 
 DBUS_CFLAGS = @DBUS_CFLAGS@
 DBUS_LIBS = @DBUS_LIBS@
+DBUS_OBJ = @DBUS_OBJ@
 
 GCONF_CFLAGS = @GCONF_CFLAGS@
 GCONF_LIBS = @GCONF_LIBS@
 
+GTK_OBJ=@GTK_OBJ@
+
+LIBXSM=@LIBXSM@
+
+XMENU_OBJ=@XMENU_OBJ@
+XOBJ=@XOBJ@
+
 LIBSOUND= @LIBSOUND@
 CFLAGS_SOUND= @CFLAGS_SOUND@
 
@@ -241,10 +249,6 @@
 shared=no
 #endif
 
-#ifdef HAVE_DBUS
-DBUS_OBJ = dbusbind.o
-#endif
-
 /* DO NOT use -R.  There is a special hack described in lastfile.c
    which is used instead.  Some initialized data areas are modified
    at initial startup, then labeled as part of the text area when
@@ -282,16 +286,8 @@
 #endif
 
 #ifdef HAVE_X_WINDOWS
-XMENU_OBJ = xmenu.o
-XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o \
-      xsettings.o xgselect.o
-
 #ifdef HAVE_MENUS
 
-#ifdef USE_GTK
-GTK_OBJ= gtkutil.o
-#endif
-
 /* The X Menu stuff is present in the X10 distribution, but missing
    from X11.  If we have X10, just use the installed library;
    otherwise, use our own copy.  */
@@ -354,11 +350,7 @@
 LIBXMENU=
 #endif /* USE_GTK */
 
-#ifdef HAVE_X_SM
-LIBXT=$(LIBW) -lSM -lICE
-#else
-LIBXT=$(LIBW)
-#endif
+LIBXT=$(LIBW) $(LIBXSM)
 #endif /* not USE_X_TOOLKIT */
 
 #ifdef HAVE_X11