summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/glew
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-02-16 20:56:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-18 07:39:30 +0000
commitaea0746cbb7b9d286d12007bd7d2a346f27cfc62 (patch)
treedd79e69f7e95c85c162b8d0eb76af4c69c81175d /meta/recipes-graphics/glew
parent0b1c3240ad1c1880740e68312b28f5e83915bd44 (diff)
downloadpoky-aea0746cbb7b9d286d12007bd7d2a346f27cfc62.tar.gz
glew: rewrite to use upstream build system
Instead of patching in a whole new build system using autotools, use the makefile-based system in upstream with careful variable assignments so that it cross-compiles correctly. One small patch was required to stop an unavoidable strip. Upstream does have a cmake-based build but it's not used or supported by the maintainer, and is quite buggy (for example: doesn't version the libraries, fails to link to required libraries). (From OE-Core rev: c77d0dfa18b2467f8856571837e7007f8fcd9b20) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/glew')
-rw-r--r--meta/recipes-graphics/glew/glew/autotools.patch149
-rw-r--r--meta/recipes-graphics/glew/glew/fix-glew.pc-install.patch46
-rw-r--r--meta/recipes-graphics/glew/glew/glew_fix_for_automake-1.12.patch25
-rw-r--r--meta/recipes-graphics/glew/glew/no-strip.patch12
-rw-r--r--meta/recipes-graphics/glew/glew_1.12.0.bb28
5 files changed, 33 insertions, 227 deletions
diff --git a/meta/recipes-graphics/glew/glew/autotools.patch b/meta/recipes-graphics/glew/glew/autotools.patch
deleted file mode 100644
index 7dfe087d52..0000000000
--- a/meta/recipes-graphics/glew/glew/autotools.patch
+++ /dev/null
@@ -1,149 +0,0 @@
1
2Upstream-Status: Inappropriate [configuration]
3
4Index: glew/Makefile.am
5===================================================================
6--- /dev/null 1970-01-01 00:00:00.000000000 +0000
7+++ glew/Makefile.am 2009-12-02 00:30:23.296641663 +0100
8@@ -0,0 +1,5 @@
9+
10+ACLOCAL_AMFLAGS = -I m4 --install
11+
12+SUBDIRS = include src
13+
14Index: glew/configure.ac
15===================================================================
16--- /dev/null 1970-01-01 00:00:00.000000000 +0000
17+++ glew/configure.ac 2009-12-02 00:30:23.296641663 +0100
18@@ -0,0 +1,67 @@
19+# -*- Autoconf -*-
20+# Process this file with autoconf to produce a configure script.
21+
22+AC_PREREQ([2.62])
23+AC_INIT([glew], [1.9.0], [BUG-REPORT-ADDRESS])
24+AC_CONFIG_SRCDIR([src/glew.c])
25+AC_CONFIG_HEADERS([config.h])
26+AM_INIT_AUTOMAKE([-Wall -Werror foreign])
27+AC_CONFIG_MACRO_DIR([m4])
28+
29+LT_INIT
30+
31+# Checks for programs.
32+AC_PROG_CC
33+AC_PROG_INSTALL
34+AC_PROG_LN_S
35+
36+# Checks for libraries.
37+
38+# Checks for header files.
39+AC_CHECK_HEADERS([inttypes.h stddef.h stdint.h stdlib.h string.h])
40+
41+# Checks for typedefs, structures, and compiler characteristics.
42+AC_TYPE_INT32_T
43+AC_TYPE_INT64_T
44+AC_TYPE_UINT64_T
45+AC_CHECK_TYPES([ptrdiff_t])
46+
47+# Checks for library functions.
48+AC_FUNC_MALLOC
49+AC_CHECK_FUNCS([strtol])
50+
51+# Check for pkgconfig libs
52+
53+PKG_CHECK_MODULES([X11], [x11])
54+AC_SUBST([X11_LIBS])
55+AC_SUBST([X11_CFLAGS])
56+
57+PKG_CHECK_MODULES([XMU], [xmu])
58+AC_SUBST([XMU_LIBS])
59+AC_SUBST([XMU_CFLAGS])
60+
61+PKG_CHECK_MODULES([XI], [xi])
62+AC_SUBST([XI_LIBS])
63+AC_SUBST([XI_CFLAGS])
64+
65+PKG_CHECK_MODULES([XEXT], [xext])
66+AC_SUBST([XEXT_LIBS])
67+AC_SUBST([XEXT_CFLAGS])
68+
69+# Check for GLU is enough and imples gl so no doubled -lGL in LDFLAGS
70+PKG_CHECK_MODULES([GLU], [glu])
71+AC_SUBST([GLU_LIBS])
72+AC_SUBST([GLU_CFLAGS])
73+
74+# ENABLE option for Multiple Rendering Contexts support
75+AC_CHECK_ENABLE_GLEWMX
76+
77+# for now we use the same version as the package, but that should be avoided
78+# in the future
79+
80+AC_SUBST([LIBGLEW_SO_VERSION], [1:9:0])
81+
82+AC_CONFIG_FILES([Makefile
83+ include/Makefile
84+ src/Makefile])
85+AC_OUTPUT
86Index: glew/src/Makefile.am
87===================================================================
88--- /dev/null 1970-01-01 00:00:00.000000000 +0000
89+++ glew/src/Makefile.am 2009-12-02 00:33:48.690786110 +0100
90@@ -0,0 +1,35 @@
91+
92+AM_CPPFLAGS = -I$(top_srcdir)/include
93+
94+if ENABLE_GLEWMX
95+AM_CPPFLAGS += -DGLEW_MX
96+endif
97+
98+AM_CFLAGS = @X11_CFLAGS@ \
99+ @XMU_CFLAGS@ \
100+ @XI_CFLAGS@ \
101+ @XEXT_CFLAGS@ \
102+ @GLU_CFLAGS@
103+
104+lib_LTLIBRARIES = libGLEW.la
105+
106+libGLEW_la_SOURCES = glew.c
107+
108+libGLEW_la_LIBADD = @X11_LIBS@ \
109+ @XMU_LIBS@ \
110+ @XI_LIBS@ \
111+ @XEXT_LIBS@ \
112+ @GLU_LIBS@
113+
114+libGLEW_la_LDFLAGS = -version-number @LIBGLEW_SO_VERSION@
115+
116+bin_PROGRAMS = glewinfo visualinfo
117+
118+glewinfo_SOURCES = glewinfo.c
119+
120+glewinfo_LDADD = libGLEW.la
121+
122+visualinfo_SOURCES = visualinfo.c
123+
124+visualinfo_LDADD = libGLEW.la
125+
126Index: glew/m4/glewmx.m4
127===================================================================
128--- /dev/null 1970-01-01 00:00:00.000000000 +0000
129+++ glew/m4/glewmx.m4 2009-12-02 00:30:23.296641663 +0100
130@@ -0,0 +1,11 @@
131+
132+AC_DEFUN([AC_CHECK_ENABLE_GLEWMX],[
133+AC_MSG_CHECKING([whether to include Multiple Rendering Contexts support])
134+AC_ARG_ENABLE([glewmx],
135+ [AS_HELP_STRING([--enable-glewmx], [enable GLEW Multiple Rendering Contexts (default is no)])],
136+ [ENABLE_GLEWMX="$enableval"],
137+ [ENABLE_GLEWMX="no"])
138+AC_MSG_RESULT([${ENABLE_GLEWMX}])
139+AM_CONDITIONAL([ENABLE_GLEWMX], [test x"${ENABLE_GLEWMX}" = "xyes"])
140+])
141+
142Index: glew/include/Makefile.am
143===================================================================
144--- /dev/null 1970-01-01 00:00:00.000000000 +0000
145+++ glew/include/Makefile.am 2009-12-02 00:30:23.296641663 +0100
146@@ -0,0 +1,3 @@
147+
148+nobase_include_HEADERS = GL/glew.h GL/glxew.h GL/wglew.h
149+
diff --git a/meta/recipes-graphics/glew/glew/fix-glew.pc-install.patch b/meta/recipes-graphics/glew/glew/fix-glew.pc-install.patch
deleted file mode 100644
index fea071d1e0..0000000000
--- a/meta/recipes-graphics/glew/glew/fix-glew.pc-install.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1
2We maintain the autotools configure.ac and Makefile.am, to correctly
3provide the glew.pc, the following patch is needed.
4
5Upstream-Status: Inappropriate
6
7Signed-off-by: Saul Wold <sgw@linux.intel.com>
8
9Index: glew-1.11.0/Makefile.am
10===================================================================
11--- glew-1.11.0.orig/Makefile.am
12+++ glew-1.11.0/Makefile.am
13@@ -3,3 +3,5 @@ ACLOCAL_AMFLAGS = -I m4 --install
14
15 SUBDIRS = include src
16
17+pkgconfigdir = $(libdir)/pkgconfig
18+pkgconfig_DATA = glew.pc
19Index: glew-1.11.0/configure.ac
20===================================================================
21--- glew-1.11.0.orig/configure.ac
22+++ glew-1.11.0/configure.ac
23@@ -66,5 +66,6 @@ AC_SUBST([LIBGLEW_SO_VERSION], [1:9:0])
24
25 AC_CONFIG_FILES([Makefile
26 include/Makefile
27- src/Makefile])
28+ src/Makefile
29+ glew.pc])
30 AC_OUTPUT
31Index: glew-1.11.0/glew.pc.in
32===================================================================
33--- glew-1.11.0.orig/glew.pc.in
34+++ glew-1.11.0/glew.pc.in
35@@ -5,7 +5,7 @@ includedir=${prefix}/include/GL
36
37 Name: glew
38 Description: The OpenGL Extension Wrangler library
39-Version: @version@
40-Cflags: -I${includedir} @cflags@
41-Libs: -L${libdir} -l@libname@
42-Requires: @requireslib@
43+Version: @VERSION@
44+Cflags: -I${includedir}
45+Libs: -L${libdir} -lGLEW
46+Requires: glu
diff --git a/meta/recipes-graphics/glew/glew/glew_fix_for_automake-1.12.patch b/meta/recipes-graphics/glew/glew/glew_fix_for_automake-1.12.patch
deleted file mode 100644
index 0707efba26..0000000000
--- a/meta/recipes-graphics/glew/glew/glew_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1Upstream-Status: Pending
2
3This patch fixes following issue with automake 1.12
4
5| automake: warnings are treated as errors
6| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libGLEW.la': linking libtool libraries using a non-POSIX
7| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
8
9Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
102012/05/03
11
12Index: glew-1.7.0/configure.ac
13===================================================================
14--- glew-1.7.0.orig/configure.ac
15+++ glew-1.7.0/configure.ac
16@@ -14,6 +14,9 @@ LT_INIT
17 AC_PROG_CC
18 AC_PROG_INSTALL
19 AC_PROG_LN_S
20+# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
21+m4_pattern_allow([AM_PROG_AR])
22+AM_PROG_AR
23
24 # Checks for libraries.
25
diff --git a/meta/recipes-graphics/glew/glew/no-strip.patch b/meta/recipes-graphics/glew/glew/no-strip.patch
new file mode 100644
index 0000000000..e411f11cb5
--- /dev/null
+++ b/meta/recipes-graphics/glew/glew/no-strip.patch
@@ -0,0 +1,12 @@
1Don't forcibly strip the binaries.
2
3Signed-off-by: Ross Burton <ross.burton@intel.com>
4Upstream-Status: Pending
5
6diff --git a/Makefile b/Makefile
7index 6a9803c..170c0ce 100644
8--- a/Makefile
9+++ b/Makefile
10@@ -285 +285 @@ install.bin: glew.bin
11- $(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/"
12+ $(INSTALL) -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/"
diff --git a/meta/recipes-graphics/glew/glew_1.12.0.bb b/meta/recipes-graphics/glew/glew_1.12.0.bb
index ef416ec257..f1707d6655 100644
--- a/meta/recipes-graphics/glew/glew_1.12.0.bb
+++ b/meta/recipes-graphics/glew/glew_1.12.0.bb
@@ -8,12 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2"
8 8
9DEPENDS = "virtual/libx11 virtual/libgl libglu libxext libxi libxmu" 9DEPENDS = "virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
10 10
11
12SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \ 11SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \
13 file://autotools.patch \ 12 file://no-strip.patch"
14 file://glew_fix_for_automake-1.12.patch \
15 file://fix-glew.pc-install.patch \
16 "
17 13
18SRC_URI[md5sum] = "01246c7ecd135d99be031aa63f86dca1" 14SRC_URI[md5sum] = "01246c7ecd135d99be031aa63f86dca1"
19SRC_URI[sha256sum] = "af58103f4824b443e7fa4ed3af593b8edac6f3a7be3b30911edbc7344f48e4bf" 15SRC_URI[sha256sum] = "af58103f4824b443e7fa4ed3af593b8edac6f3a7be3b30911edbc7344f48e4bf"
@@ -21,6 +17,24 @@ SRC_URI[sha256sum] = "af58103f4824b443e7fa4ed3af593b8edac6f3a7be3b30911edbc7344f
21UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/glew/files/glew" 17UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/glew/files/glew"
22UPSTREAM_CHECK_REGEX = "/glew/(?P<pver>(\d+[\.\-_]*)+)/" 18UPSTREAM_CHECK_REGEX = "/glew/(?P<pver>(\d+[\.\-_]*)+)/"
23 19
24inherit autotools lib_package pkgconfig distro_features_check 20inherit lib_package pkgconfig distro_features_check
25# depends on virtual/libx11 21
26REQUIRED_DISTRO_FEATURES = "x11" 22REQUIRED_DISTRO_FEATURES = "x11"
23
24# Override SYSTEM to avoid calling config.guess, we're cross-compiling. Pass
25# our CFLAGS via POPT as that's the optimisation variable and safely
26# overwritten.
27EXTRA_OEMAKE = "SYSTEM='linux' \
28 CC='${CC}' LD='${CC}' STRIP='' \
29 LDFLAGS.EXTRA='${LDFLAGS}' \
30 POPT='${CFLAGS}' \
31 GLEW_PREFIX='${prefix}' BINDIR='${bindir}' \
32 LIBDIR='${libdir}' INCDIR='${includedir}/GL'"
33
34do_compile() {
35 oe_runmake
36}
37
38do_install() {
39 oe_runmake 'DESTDIR=${D}' install.all
40}