Portability fixes and auto* cleanups.

SVN revision: 9884
This commit is contained in:
Kim Woelders 2004-04-24 13:16:38 +00:00
parent e4a8c6a63d
commit 485635dec5
9 changed files with 58 additions and 32 deletions

View File

@ -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 <X11/Xlib.h>])
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

View File

@ -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

View File

@ -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;
}

View File

@ -52,11 +52,6 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#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 <Imlib2.h>
@ -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,

View File

@ -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

View File

@ -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 <Imlib2.h>
@ -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);

View File

@ -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

View File

@ -25,6 +25,7 @@
#if !USE_IMLIB2
#include <X11/cursorfont.h>
#endif
#include <sys/time.h>
void
MapUnmap(int start)

16
src/x.c
View File

@ -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()
{