From 485635dec5a1f26b9d049aee85fb3368f84393ba Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 24 Apr 2004 13:16:38 +0000 Subject: [PATCH] Portability fixes and auto* cleanups. SVN revision: 9884 --- configure.in | 31 ++++++++++++++----------------- dox/Makefile.am | 2 +- dox/dox.c | 16 ++++++++++++++++ dox/dox.h | 8 +++----- eesh/Makefile.am | 2 +- src/E.h | 7 ++----- src/Makefile.am | 7 ++++--- src/setup.c | 1 + src/x.c | 16 ++++++++++++++++ 9 files changed, 58 insertions(+), 32 deletions(-) diff --git a/configure.in b/configure.in index 2513316a..892f3776 100644 --- a/configure.in +++ b/configure.in @@ -99,11 +99,11 @@ dnl The following test must come after AM_GNU_GETTEXT as it relies on dnl ${DATADIRNAME} being defined. if test "x$enable_fsstd" = "xyes"; then - LOCALEDIR=${prefix}/${DATADIRNAME}/locale + LOCALEDIR=${prefix}/${DATADIRNAME}/locale else - datadir=${prefix} - exec_prefix=${prefix}/enlightenment - LOCALEDIR=${prefix}/enlightenment/locale + datadir=${prefix} + exec_prefix=${prefix}/enlightenment + LOCALEDIR=${prefix}/enlightenment/locale fi ENLIGHTENMENT_ROOT=`eval echo ${datadir}/enlightenment` ENLIGHTENMENT_BIN=`eval echo ${bindir}` @@ -122,7 +122,6 @@ echo "passed to your configure line." fi LDFLAGS="$LDFLAGS -L$prefix/lib" -LDFLAGS="$LDFLAGS -L$x_libraries" if test "x$with_imlib2" = "xyes"; then # Use Imlib2 @@ -164,16 +163,15 @@ echo "have been disabled (this will affect functionality)" AC_MSG_WARN([Module Support Disabled (no dynamic loader)])], -lm) AC_SUBST(DL_LIBS) -AC_CHECK_LIB(Xtst, XTestGrabControl, , , $X_LIBS) - -XTST_LIBS="" -AC_CHECK_LIB(Xtst, XTestQueryExtension, XTST_LIBS=-lXtst, , $X_LIBS) -AC_SUBST(XTST_LIBS) +AC_CHECK_LIB(Xtst, XTestQueryExtension, + E_X_LIBS="-lXtst $E_X_LIBS", , $X_LIBS) AC_CHECK_LIB(Xext, XkbQueryExtension, AC_DEFINE(WITH_TARTY_WARP, 1, [Tarty Warp]), , $X_LIBS) + AC_CHECK_LIB(Xinerama, XineramaQueryExtension, - AC_DEFINE(HAS_XINERAMA, 1, [Xinerama support]) XINERAMA_LIBS=-lXinerama, ,$X_LIBS) + AC_DEFINE(HAS_XINERAMA, 1, [Xinerama support]) + XINERAMA_LIBS="-lXinerama", ,$X_LIBS) AC_SUBST(XINERAMA_LIBS) AC_ARG_ENABLE(zoom, @@ -181,23 +179,20 @@ AC_ARG_ENABLE(zoom, if test "x$enable_zoom" = "xyes"; then AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, AC_DEFINE(WITH_ZOOM, 1, [Zoom Support]) - XVM_LIBS=-lXxf86vm, , $X_LIBS) + E_X_LIBS="-lXxf86vm $E_X_LIBS", , $X_LIBS) else echo "zoom has been turned off by request at compiletime" fi -AC_SUBST(XVM_LIBS) AC_ARG_ENABLE(xrandr, [ --enable-xrandr compile with RandR support [default=no]], ,enable_xrandr=no) if test "x$enable_xrandr" = "xyes"; then AC_CHECK_LIB(Xrandr, XRRQueryExtension, - AC_DEFINE(HAS_XRANDR, 1, [RandR support]) XRANDR_LIBS=-lXrandr, ,$X_LIBS) + AC_DEFINE(HAS_XRANDR, 1, [RandR support]) + E_X_LIBS="-lXrandr $E_X_LIBS", ,$X_LIBS) AC_CHECK_HEADERS(X11/extensions/Xrandr.h,,,[#include ]) -LIBS="$XRANDR_LIBS $LIBS" fi -AC_SUBST(XKB) - AC_CHECK_LIB(Fridge,mass_quantities_of_bass_ale) AC_CHECK_LIB(Fridge,mass_quantities_of_any_ale, , [ echo "Warning: No ales were found in your refrigerator." @@ -211,6 +206,8 @@ if test "x$enable_gcc_warnings" = "xyes"; then CFLAGS="$CFLAGS -W -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Waggregate-return -Wcast-align -Wpointer-arith -Wshadow -Wwrite-strings #-Wunreachable-code" fi +AC_SUBST(E_X_LIBS) + AC_OUTPUT([ Makefile src/Makefile diff --git a/dox/Makefile.am b/dox/Makefile.am index 8735492f..f8e92b9d 100644 --- a/dox/Makefile.am +++ b/dox/Makefile.am @@ -5,7 +5,7 @@ bin_PROGRAMS = edox edox_SOURCES = dox.c dox.h file.c format.c text.c ttfont.c -LDADD = $(TTF_LIBS) $(FNLIB_LIBS) $(IMLIB_LIBS) $(XINERAMA_LIBS) -lm +LDADD = $(TTF_LIBS) $(FNLIB_LIBS) $(IMLIB_LIBS) $(X_LIBS) $(XINERAMA_LIBS) -lX11 -lm INCLUDES = $(IMLIB_CFLAGS) -I$(top_builddir) -I$(top_srcdir)/intl diff --git a/dox/dox.c b/dox/dox.c index 450a8887..1c7d5178 100644 --- a/dox/dox.c +++ b/dox/dox.c @@ -691,3 +691,19 @@ main(int argc, char **argv) } } } + +void +ESetColor(XColor * pxc, int r, int g, int b) +{ + pxc->red = (r << 8) | r; + pxc->green = (g << 8) | g; + pxc->blue = (b << 8) | b; +} + +void +EGetColor(XColor * pxc, int *pr, int *pg, int *pb) +{ + *pr = pxc->red >> 8; + *pg = pxc->green >> 8; + *pb = pxc->blue >> 8; +} diff --git a/dox/dox.h b/dox/dox.h index ce6f62d5..db7ca105 100644 --- a/dox/dox.h +++ b/dox/dox.h @@ -52,11 +52,6 @@ #include #include -#define ESetColor(pxc, r, g, b) \ - ({ (pxc)->red = ((r)<<8)|r; (pxc)->green = ((g)<<8)|g; (pxc)->blue = ((b)<<8)|b; }) -#define EGetColor(pxc, pr, pg, pb) \ - ({ *(pr) = ((pxc)->red)>>8; *(pg) = ((pxc)->green)>>8; *(pb) = ((pxc)->blue)>>8; }) - #if USE_IMLIB2 #include @@ -279,6 +274,9 @@ typedef struct _link } Link; +void ESetColor(XColor * pxc, int r, int g, int b); +void EGetColor(XColor * pxc, int *pr, int *pg, int *pb); + void Efont_extents(Efont * f, const char *text, int *font_ascent_return, int *font_descent_return, int *width_return, diff --git a/eesh/Makefile.am b/eesh/Makefile.am index 01c4d333..53afa24c 100644 --- a/eesh/Makefile.am +++ b/eesh/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = eesh eesh_SOURCES = E.h comms.c globals.c lists.c main.c setup.c memory.c -LDADD = $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) -lm +LDADD = $(X_LIBS) -lX11 INCLUDES = $(IMLIB_CFLAGS) -I$(top_builddir) -I$(top_srcdir)/intl diff --git a/src/E.h b/src/E.h index d19c96ad..477848ec 100644 --- a/src/E.h +++ b/src/E.h @@ -50,11 +50,6 @@ #endif #endif -#define ESetColor(pxc, r, g, b) \ - ({ (pxc)->red = ((r)<<8)|r; (pxc)->green = ((g)<<8)|g; (pxc)->blue = ((b)<<8)|b; }) -#define EGetColor(pxc, pr, pg, pb) \ - ({ *(pr) = ((pxc)->red)>>8; *(pg) = ((pxc)->green)>>8; *(pb) = ((pxc)->blue)>>8; }) - #if USE_IMLIB2 #include @@ -2717,6 +2712,8 @@ Window ECreateEventWindow(Window parent, int x, int y, int w, int h); Window ECreateFocusWindow(Window parent, int x, int y, int w, int h); +void ESetColor(XColor * pxc, int r, int g, int b); +void EGetColor(XColor * pxc, int *pr, int *pg, int *pb); void GrabX(void); void UngrabX(void); void GetWinXY(Window win, int *x, int *y); diff --git a/src/Makefile.am b/src/Makefile.am index 8d07ff0f..c36911b8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -94,11 +94,12 @@ LDADD = \ $(TTF_LIBS) \ $(ESD_LIBS) \ $(IMLIB_LIBS) \ - $(XTST_LIBS) \ - $(XVM_LIBS) \ $(DL_LIBS) \ - $(XINERAMA_LIBS) \ $(X_PRE_LIBS) \ + $(X_LIBS) \ + $(X_EXTRA_LIBS) \ + $(XINERAMA_LIBS) \ + $(E_X_LIBS) \ -lX11 -lm INCLUDES = $(ESD_CFLAGS) $(IMLIB_CFLAGS) -I$(top_builddir) -I$(top_srcdir)/intl diff --git a/src/setup.c b/src/setup.c index 2c1b160b..219726c3 100644 --- a/src/setup.c +++ b/src/setup.c @@ -25,6 +25,7 @@ #if !USE_IMLIB2 #include #endif +#include void MapUnmap(int start) diff --git a/src/x.c b/src/x.c index c382a88a..4729c961 100644 --- a/src/x.c +++ b/src/x.c @@ -706,6 +706,22 @@ ECreateFocusWindow(Window parent, int x, int y, int w, int h) EDBUG_RETURN(win); } +void +ESetColor(XColor * pxc, int r, int g, int b) +{ + pxc->red = (r << 8) | r; + pxc->green = (g << 8) | g; + pxc->blue = (b << 8) | b; +} + +void +EGetColor(XColor * pxc, int *pr, int *pg, int *pb) +{ + *pr = pxc->red >> 8; + *pg = pxc->green >> 8; + *pb = pxc->blue >> 8; +} + void GrabX() {