On Mon, 7 Jan 2013 19:25:22 -0200
Gustavo Sverzut Barbieri <barbi...@profusion.mobi> wrote:

> Hi Joel,
> 
> Just go to this mail, did you try that with SVN EFL (trunk, single
> tree)? I'm trying to get it right for release 1.8, so if you find
> something that applies there, let me know.
> 
> From memory the XTRA stuff should also be wrong, if you send the
> patch I'll apply.

Yes I did, most of the missing CFLAGS & LIBS handling from evas 1.7.x
was copied over to merged trunk efl.

Attached is an updated patch based on r82364 that includes what I need
to be able to compile efl with either x11 or xcb backend including GL
without modifying environment variables.

But the whole patch builds on the premise that AC_PATH_X and
AC_PATH_XTRA gives correct results.

For old (pre modular Xorg) X11 this is not a problem, AC_PATH_X uses
xmkmf to get include and lib directories (or uses the --x-includes,
--x-libraries arguments given to configure).
For modern X11 the whole Imakefile system is probably missing
(including xmkmf). Some distros do what I do, create a fake xmkmf
that just returns what AC_PATH_X needs. Some modify AC_PATH_X to use
pkg-config. A lot just put everything in /usr/include. I do
not pretend to know what all of them do...

To put it another way, my patch tries to unify the flags used in the
configure checks and the flags used in the compilation. Without the
patch the compilation uses the results of AC_PATH_X but the configure
checks do not.

/JK
 
> On Sun, Jan 6, 2013 at 8:54 AM, Joel Klinghed <the...@spawned.biz>
> wrote:
> 
> > On Sun, 6 Jan 2013 15:04:23 +0900
> > Carsten Haitzler (The Rasterman) <ras...@rasterman.com> wrote:
> >
> > [snip]
> >
> > > > >
> > > > > > > > * evas-1.7.2-configure-xorg.patch
> > > > > > > > Use X_CFLAGS when checking X11 and GL headers and X_LIBS
> > > > > > > > when checking X11 and GL libs.
> > > > > > > > Also use X_CFLAGS when compiling gl_common as GL headers
> > > > > > > > might use the same prefix.
> > > > > > >
> > > > > > > ummm configure.ac is a lot different now... try again?
> > > > > >
> > > > > > I've included an patch for the merged efl tree.
> > > > > > Also an updated patch for the evas-1.7 and ecore-1.7
> > > > > > branches.
> > > > >
> > > > > no ecore one attached.
> > > > >
> > > > > so now this is up to date... i'll base my comments on the efl
> > > > > merged patch. why do you use "X_CFLAGS" and "X_LIBS" (i also
> > > > > spot X_PRE_LIBS)? are they not detectable by just modifying
> > > > > your regular CFLAGS and LDFLAGS before configure is run? why
> > > > > does this need a special set of env vars? basically - what
> > > > > about the existing setup is broken/doesnt work right there? i
> > > > > smell some other issue...
> > > >
> > > > Right, forgot the ecore one, included this time.
> > > >
> > > > X_CFLAGS, X_LIBS, X_PRE_LIBS and X_EXTRA_LIBS are all set by
> > > > AC_PATH_XTRA. So not env vars.
> > > > They are more or less what x_cflags and x_libs ends up being.
> > > >
> > > > AC_PATH_X on the other hand sets x_includes and x_libraries.
> > > >
> > > > I could have used x_includes and x_libraries instead but then I
> > > > would had to move the header and lib checks below the x_lib,
> > > > x_cflags, x_libs calculations as I don't want to do that work
> > > > twice.
> > > >
> > > > To summarise, my problem is that AC_PATH_X and AC_PATH_XTRA
> > > > full and well find my X11 path (/usr/xorg as it happens) but
> > > > the next test AC_CHECK_HEADER([X11/X.h]) fails because it
> > > > doesn't use any of the results from those macros.
> > >
> > > ok... so hereĀ“s the question. it seems you are putting xorg in its
> > > own prefix ala the good old /usr/X11R6 (or /usr/xorg now)... which
> > > has kind of been dropped as a standard x location amongst a lot of
> > > distros/os's - why should this be handled specially anymore when
> > > adding -I/usr/xorg/include and -L/usr/xorg/lib to your $CFLAGS and
> > > $LDFLAGs (also maybe adjust LD_LIBRARY_PATH, PATH and
> > > PKG_CONFIG_PATH).. exactly like you need to do with every other
> > > package you install from scratch this is why fribidi was a problem
> > > - right? u put it in /usr/fribidi or something?) ... ? i'm just
> > > wondering here why we need to add even more autofluff special
> > > cases here when it's becoming increasingly less common and env
> > > vars solve the problem in a ingle universal common way for every
> > > case like this? :)
> >
> > Well, for most packages you have some way of asking where it was
> > installed so you don't have to write infernal long CFLAGS and
> > LDFLAGS. You have pkg-config, *-config scripts and so on.
> > To me, the whole point of checking if and where a package is
> > installed is so compiling will just work on every dist and OS.
> >
> > Old X11 you located by using xmkmf (which is what AC_PATH_X* does).
> > For Xorg you actually have nice pkg-config files but they are only
> > used for xcb.
> >
> > The thing is, even if I put my Xorg in /usr/X11R6 the configure
> > check as they are now would not work. They *only* work if
> > X11/Xlib.h is places in /usr/include or /usr/local/include or one
> > of the standard includes. Same for libs as both AC_CHECK_HEADER and
> > AC_CHECK_LIB doesn't use x_includes or x_libraries that you later
> > use to actually compile everything.
> >
> > But yes, it is unusual not to put your X11 files all over /usr
> > and /usr/X11R6. Perhaps because of all these broken configure
> > scripts? ;)
> >
> > I can take that I'll have to add -I/usr/xorg/include
> > -L/usr/xorg/lib64 to CFLAGS and LDFLAGS respectively but then I
> > must ask, why do you bother calling AC_PATH_X and AC_PATH_XTRA? You
> > don't use it and unless everything is accessible from /usr/include
> > and /usr/lib anyway it wont work as both the X11/X.h and
> > XCreateImage in libX11.so checks will fail.
> >
> > [snip]
> >
> > /JK
> >
> >
> > ------------------------------------------------------------------------------
> > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills
> > current with LearnDevNow - 3,200 step-by-step video tutorials by
> > Microsoft MVPs and experts. ON SALE this month only -- learn more
> > at: http://p.sf.net/sfu/learnmore_123012
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
> 
> 
> 

Index: m4/evas_check_engine.m4
===================================================================
--- m4/evas_check_engine.m4	(revision 82364)
+++ m4/evas_check_engine.m4	(working copy)
@@ -11,14 +11,23 @@
 AC_PATH_X
 AC_PATH_XTRA
 
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${X_CFLAGS} ${CFLAGS}"
+CPPFLAGS_save="${CPPFLAGS}"
+CPPFLAGS="${X_CFLAGS} ${CPPFLAGS}"
 AC_CHECK_HEADER([X11/X.h], [have_dep="yes"])
+CPPFLAGS="${CPPFLAGS_save}"
+CFLAGS="${CFLAGS_save}"
 
 if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([X11], [XCreateImage], [have_dep="yes"], [have_dep="no"])
-fi
+   LIBS_save="${LIBS}"
+   LIBS="${LIBS} ${X_PRE_LIBS} ${X_LIBS}"
+   AC_CHECK_LIB([X11], [XCreateImage], [have_dep="yes"], [have_dep="no"], [${X_EXTRA_LIBS}])
 
-if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([Xext], [XShmCreateImage], [have_dep="yes"], [have_dep="no"])
+   if test "x${have_dep}" = "xyes" ; then
+      AC_CHECK_LIB([Xext], [XShmCreateImage], [have_dep="yes"], [have_dep="no"], [${X_EXTRA_LIBS}])
+   fi
+   LIBS="${LIBS_save}"
 fi
 
 if test "x${have_dep}" = "xyes" ; then
@@ -55,6 +64,10 @@
 AC_PATH_X
 AC_PATH_XTRA
 
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${X_CFLAGS} ${CFLAGS}"
+CPPFLAGS_save="${CPPFLAGS}"
+CPPFLAGS="${X_CFLAGS} ${CPPFLAGS}"
 AC_CHECK_HEADER([GL/gl.h],
    [have_dep="yes"],
    [have_dep="no"],
@@ -68,6 +81,8 @@
 #include <X11/extensions/Xrender.h>
 #include <X11/Xresource.h>
    ])
+CPPFLAGS="${CPPFLAGS_save}"
+CFLAGS=${CFLAGS_save}
 
 gl_pt_lib="";
 have_gl_pt="no"
@@ -95,15 +110,20 @@
 fi
 
 if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"])
-fi
+   LIBS_save="${LIBS}"
+   LIBS="${LIBS} ${X_PRE_LIBS} ${X_LIBS}"
 
-if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"])
-fi
+   AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"], [${X_EXTRA_LIBS}])
 
-if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], [-lX11 -lXext -lXrender -lm $gl_pt_lib])
+   if test "x${have_dep}" = "xyes" ; then
+      AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"])
+   fi
+
+   if test "x${have_dep}" = "xyes" ; then
+      AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], [-lX11 -lXext -lXrender -lm $gl_pt_lib ${X_EXTRA_LIBS}])
+   fi
+
+   LIBS="${LIBS_save}"
 fi
 
 if test "x${gl_flavor_gles}" = "xyes" ; then
@@ -129,6 +149,10 @@
       x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
       x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender"
    fi
+   CFLAGS_save="${CFLAGS}"
+   CFLAGS="${x_cflags} ${CFLAGS}"
+   CPPFLAGS_save="${CPPFLAGS}"
+   CPPFLAGS="${x_cflags} ${CPPFLAGS}"
    AC_CHECK_HEADER([GLES2/gl2.h],
       [have_egl="yes"],
       [have_egl="no"],
@@ -142,6 +166,8 @@
 #include <X11/extensions/Xrender.h>
 #include <X11/Xresource.h>
       ])
+   CPPFLAGS="${CPPFLAGS_save}"
+   CFLAGS="${CFLAGS_save}"
    if test "x${have_egl}" = "xyes" ; then
       AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib)
       if test "x${have_glesv2}" = "xyes" ; then
@@ -250,15 +276,20 @@
 fi
 
 if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"])
-fi
+   LIBS_save="${LIBS}"
+   LIBS="${LIBS} ${X_PRE_LIBS} ${X_LIBS}"
 
-if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"])
-fi
+   AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"], [${X_EXTRA_LIBS}])
 
-if test "x${have_dep}" = "xyes" ; then
-   AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], -lX11 -lXext -lXrender -lm $gl_pt_lib)
+   if test "x${have_dep}" = "xyes" ; then
+      AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"], [${X_EXTRA_LIBS}])
+   fi
+
+   if test "x${have_dep}" = "xyes" ; then
+      AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], [-lX11 -lXext -lXrender -lm $gl_pt_lib ${X_EXTRA_LIBS}])
+   fi
+
+   LIBS="${LIBS_save}"
 fi
 
 PKG_CHECK_EXISTS([x11-xcb xcb xcb-glx xcb-render xcb-renderutil],
@@ -305,6 +336,10 @@
       x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
       x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender"
    fi
+   CFLAGS_save="${CFLAGS}"
+   CFLAGS="${X_CFLAGS} ${CFLAGS}"
+   CPPFLAGS_save="${CPPFLAGS}"
+   CPPFLAGS="${X_CFLAGS} ${CPPFLAGS}"
    AC_CHECK_HEADER([GLES2/gl2.h],
       [have_egl="yes"],
       [have_egl="no"],
@@ -313,6 +348,8 @@
 #include <GLES2/gl2ext.h>
 #include <EGL/egl.h>
       ])
+   CPPFLAGS=${CPPFLAGS_save}
+   CFLAGS=${CFLAGS_save}
    if test "x${have_egl}" = "xyes" ; then
       AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib)
       if test "x${have_glesv2}" = "xyes" ; then
@@ -519,6 +556,10 @@
    gl_pt_lib=" -pthread"
 fi
 
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${X_CFLAGS} ${CFLAGS}"
+CPPFLAGS_save="${CPPFLAGS}"
+CPPFLAGS="${X_CFLAGS} ${CPPFLAGS}"
 AC_CHECK_HEADER([GL/gl.h],
    [have_dep="yes"],
    [have_dep="no"],
@@ -526,6 +567,8 @@
 #include <GL/gl.h>
 #include <GL/glext.h>
    ])
+CPPFLAGS="${CPPFLAGS_save}"
+CFLAGS="${CFLAGS_save}"
 
 if test "x$gl_flavor_gles" = "xyes" ; then
   have_dep=no
@@ -542,6 +585,8 @@
 #include <SDL/SDL_opengles.h>
 #include <EGL/egl.h>
       ])
+   CPPFLAGS=${CPPFLAGS_save}
+   CFLAGS=${CFLAGS_save}
    if test "x${have_egl}" = "xyes" ; then
       AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lm $gl_pt_lib)
       if test "x${have_glesv2}" = "xyes" ; then
Index: src/Makefile_Ecore_X.am
===================================================================
--- src/Makefile_Ecore_X.am	(revision 82364)
+++ src/Makefile_Ecore_X.am	(working copy)
@@ -141,6 +141,7 @@
 noinst_PROGRAMS += utils/ecore/makekeys
 
 utils_ecore_makekeys_SOURCES = utils/ecore/makekeys.c
+utils_ecore_makekeys_CFLAGS = @ECORE_X_CFLAGS@
 
 endif
 EXTRA_DIST += utils/ecore/mkks.sh
Index: src/Makefile_Ecore_Evas.am
===================================================================
--- src/Makefile_Ecore_Evas.am	(revision 82364)
+++ src/Makefile_Ecore_Evas.am	(working copy)
@@ -74,7 +74,8 @@
 -I$(top_srcdir)/src/lib/ecore_x \
 -I$(top_builddir)/src/lib/ecore_x \
 -I$(top_srcdir)/src/modules/evas/engines/software_x11 \
--I$(top_srcdir)/src/modules/evas/engines/gl_x11
+-I$(top_srcdir)/src/modules/evas/engines/gl_x11 \
+@ECORE_X_CFLAGS@
 modules_ecore_evas_engines_x_module_la_LIBADD = \
 lib/ecore_evas/libecore_evas.la \
 lib/ecore_x/libecore_x.la
Index: src/Makefile_Ecore_Imf.am
===================================================================
--- src/Makefile_Ecore_Imf.am	(revision 82364)
+++ src/Makefile_Ecore_Imf.am	(working copy)
@@ -155,7 +155,8 @@
 -I$(top_builddir)/src/lib/ecore_x \
 -I$(top_srcdir)/src/lib/ecore_imf \
 @ECORE_IMF_CFLAGS@ \
-@EFL_COV_CFLAGS@
+@EFL_COV_CFLAGS@ \
+@ECORE_X_CFLAGS@
 modules_ecore_immodules_xim_xim_la_LIBADD = \
 lib/ecore_imf/libecore_imf.la \
 lib/ecore_x/libecore_x.la \
Index: src/Makefile_Evas.am
===================================================================
--- src/Makefile_Evas.am	(revision 82364)
+++ src/Makefile_Evas.am	(working copy)
@@ -553,6 +553,9 @@
 -I$(top_srcdir)/src/lib/evas/cserve2 \
 -DEFL_EVAS_BUILD \
 @EVAS_CFLAGS@
+if BUILD_ENGINE_GL_X11
+modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS += @evas_engine_gl_xlib_cflags@
+endif
 modules_evas_engines_gl_common_libevas_engine_gl_common_la_LIBADD = \
 lib/eet/libeet.la \
 lib/evas/libevas.la
Index: configure.ac
===================================================================
--- configure.ac	(revision 82364)
+++ configure.ac	(working copy)
@@ -2623,7 +2623,7 @@
 use_Xcursor="no"
 if test "x${want_x11_xlib}" = "xyes" ; then
    CFLAGS_save="${CFLAGS}"
-   CFLAGS="$x_cflags $x_includes"
+   CFLAGS="$x_cflags"
    AC_CHECK_HEADER([X11/Xcursor/Xcursor.h],
       [use_Xcursor="yes"],
       [use_Xcursor="no"],
@@ -2672,7 +2672,7 @@
       [use_Xcursor="no"],
       [$x_libs -lXrender])
    EFL_ADD_LIBS([ECORE_X], [${Xcursor_libs}])
-   EFL_ADD_CFLAGS([ECORE_X], [$x_cflags $x_includes])
+   EFL_ADD_CFLAGS([ECORE_X], [$x_cflags])
 fi
 
 if test "x${want_x11_xlib}" = "xyes" ; then
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to