gnome-screensaver 2.28.3: fix up configure as well now
[openembedded.git] / recipes / lua / lua-gtk2 / lua-gtk2-0.3_fixbuild.patch
blob1115b6ffb6ae77a8438393ca306bcf1faf95ec3d
1 diff -NbBur lua-gtk2-0.3_orig/configure lua-gtk2-0.3/configure
2 --- lua-gtk2-0.3_orig/configure 2005-08-16 19:32:07.000000000 +0200
3 +++ lua-gtk2-0.3/configure 2006-05-14 02:52:39.000000000 +0200
4 @@ -2,25 +2,19 @@
6 # examine system
8 -CFLAGS="$(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src"
9 +CFLAGS="-g -Wall -DLINUX -Os -fomit-frame-pointer -Wall $(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src"
10 VERSION="0.3"
12 -if which gcc-4.0 > /dev/null; then
13 - GCC=gcc-4.0
14 -elif which gcc > /dev/null; then
15 - GCC=gcc
16 -else
17 - @echo "No GCC found."
18 - exit 1
19 -fi
21 -if true; then
22 - CFLAGS2="-DLINUX"
23 - LIBS="" # -lgtk-x11-2.0"
24 -else
25 - CFLAGS2="-DWIN32"
26 - LIBS=""
27 -fi
28 +PREFIX="/usr/local"
29 +GCC=arm-linux-gcc
30 +HGCC=gcc
32 +#if true; then
33 +# CFLAGS2="-DLINUX"
34 +# LIBS="" # -lgtk-x11-2.0"
35 +#else
36 +# CFLAGS2="-DWIN32"
37 +# LIBS=""
38 +#fi
41 # build makefile
42 @@ -28,13 +22,14 @@
43 cat > Makefile <<EOF
44 # automatically generated makefile
46 -# CFLAGS :=-DLINUX -Os -fomit-frame-pointer -Wall $CFLAGS
47 +#CFLAGS := \-DLINUX -Os -fomit-frame-pointer -Wall $CFLAGS
48 # CFLAGS :=-DLINUX -O2 -fomit-frame-pointer -Wall $CFLAGS
49 -CFLAGS :=$CFLAGS2 -g -Wall $CFLAGS
50 +CFLAGS =$CFLAGS
51 HASH :=hash2
52 ODIR :=build-linux/
53 VERSION :=$VERSION
54 CC :=$GCC
55 +HGCC :=$HGCC
57 all: \${ODIR}libluagtk2.so \${ODIR}main
59 @@ -46,6 +41,8 @@
60 @\${CC} -shared -o \$@ $^ /usr/lib/libffi.a $LIBS
62 \${ODIR}generate: \${ODIR}generate.o \${ODIR}\${HASH}.o
63 + @echo \$@
64 + @\${HGCC} -Wall -c -g -o \$@ $^
66 \${ODIR}main.o: src/main.c
67 @echo \$@
68 @@ -99,9 +96,9 @@
69 rm -f \${ODIR}file2c \${ODIR}override.luac \${ODIR}main
71 install: all
72 - mkdir -p ~/.lua50
73 - cp gtk2.lua ~/.lua50
74 - ln -sf \$(PWD)/build-linux/libluagtk2.so ~/.lua50
75 + install -d \$(DESTDIR)/\$(PREFIX)/lib/lua50
76 + install gtk2.lua \$(DESTDIR)/\$(PREFIX)/lib/lua50
77 + install \$(PWD)/build-linux/libluagtk2.so \$(DESTDIR)/\$(PREFIX)/lib/lua50
79 tar:
80 (cd ..; ln -s lua-gtk2 lua-gtk2-\${VERSION}; tar czvhf lua-gtk2-\${VERSION}.tar.gz \\
81 diff -NbBur lua-gtk2-0.3_orig/configure_orig lua-gtk2-0.3/configure_orig
82 --- lua-gtk2-0.3_orig/configure_orig 1970-01-01 01:00:00.000000000 +0100
83 +++ lua-gtk2-0.3/configure_orig 2006-05-13 18:22:03.000000000 +0200
84 @@ -0,0 +1,114 @@
85 +#! /bin/sh
87 +# examine system
89 +CFLAGS="$(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src"
90 +VERSION="0.3"
92 +if which gcc-4.0 > /dev/null; then
93 + GCC=gcc-4.0
94 +elif which gcc > /dev/null; then
95 + GCC=gcc
96 +else
97 + @echo "No GCC found."
98 + exit 1
99 +fi
101 +if true; then
102 + CFLAGS2="-DLINUX"
103 + LIBS="" # -lgtk-x11-2.0"
104 +else
105 + CFLAGS2="-DWIN32"
106 + LIBS=""
110 +# build makefile
112 +cat > Makefile <<EOF
113 +# automatically generated makefile
115 +# CFLAGS :=-DLINUX -Os -fomit-frame-pointer -Wall $CFLAGS
116 +# CFLAGS :=-DLINUX -O2 -fomit-frame-pointer -Wall $CFLAGS
117 +CFLAGS :=$CFLAGS2 -g -Wall $CFLAGS
118 +HASH :=hash2
119 +ODIR :=build-linux/
120 +VERSION :=$VERSION
121 +CC :=$GCC
123 +all: \${ODIR}libluagtk2.so \${ODIR}main
125 +Makefile: configure
126 + ./configure
128 +\${ODIR}libluagtk2.so: \${ODIR}libluagtk2.o \${ODIR}\${HASH}.o \${ODIR}hash.o \${ODIR}_funclist.o \${ODIR}_structlist.o \${ODIR}_enumlist.o \${ODIR}_override.o
129 + @echo \$@
130 + @\${CC} -shared -o \$@ $^ /usr/lib/libffi.a $LIBS
132 +\${ODIR}generate: \${ODIR}generate.o \${ODIR}\${HASH}.o
134 +\${ODIR}main.o: src/main.c
135 + @echo \$@
136 + @\${CC} -Wall -c -g -o \$@ $^ -I /usr/include/lua50
138 +\${ODIR}main: \${ODIR}main.o
139 + @echo \$@
140 + @\${CC} -o \$@ $^ -llua50 -llualib50
142 +\${ODIR}libluagtk2.o: src/libluagtk2.c \${ODIR}_typelist.c src/structinfo.h src/hash.h
144 +\${ODIR}_funclist.c: data/gtkdata.funcs \${ODIR}generate
145 + @echo \$@
146 + @\${ODIR}generate -s 4096 -o \$@ -p funclist_ -d $<
148 +\${ODIR}_structlist.c: data/gtkdata.structs.c
149 + cp -f \$< \$@
151 +\${ODIR}_typelist.c: data/gtkdata.types.c
152 + cp -f \$< \$@
154 +\${ODIR}_enumlist.c: data/gtkdata.enums src/extra_enum
155 + @echo \$@
156 + @cat $^ | \${ODIR}generate -s 1201 -o \$@ -p enumlist_ -d -f -
158 +\${ODIR}_override.c: \${ODIR}override.luac \${ODIR}file2c
159 + @echo \$@
160 + @\${ODIR}file2c < \$^ > \$@
162 +data/gtkdata.structs.c:
163 + (cd data; ../script/gen-list.pl)
165 +build-linux/%.o: build-linux/%.c
166 + @echo \$@
167 + @\${CC} \${CFLAGS} -c -o \$@ \$<
169 +build-linux/%.o: src/%.c
170 + @echo \$@
171 + @\${CC} \${CFLAGS} -c -o \$@ \$<
173 +build-linux/%.s: src/%.c
174 + @echo \$@
175 + @\${CC} \${CFLAGS} -S -o \$@ \$<
177 +build-linux/%.luac: src/%.lua
178 + @echo \$@
179 + @luac -s -o \$@ \$<
181 +clean:
182 + rm -f \${ODIR}libluagtk2.so \${ODIR}generate \${ODIR}_*.c \${ODIR}*.o
183 + rm -f \${ODIR}file2c \${ODIR}override.luac \${ODIR}main
185 +install: all
186 + mkdir -p ~/.lua50
187 + cp gtk2.lua ~/.lua50
188 + ln -sf \$(PWD)/build-linux/libluagtk2.so ~/.lua50
190 +tar:
191 + (cd ..; ln -s lua-gtk2 lua-gtk2-\${VERSION}; tar czvhf lua-gtk2-\${VERSION}.tar.gz \\
192 + lua-gtk2-\${VERSION} --exclude old --exclude "build-*" --exclude foreign --exclude lua50 \\
193 + --exclude test-dll; rm lua-gtk2-\${VERSION})
195 +EOF
197 +mkdir -p build-linux build-win32
199 diff -NbBur lua-gtk2-0.3_orig/gtk2.lua lua-gtk2-0.3/gtk2.lua
200 --- lua-gtk2-0.3_orig/gtk2.lua 2005-08-16 19:26:14.000000000 +0200
201 +++ lua-gtk2-0.3/gtk2.lua 1970-01-01 01:00:00.000000000 +0100
202 @@ -1,16 +0,0 @@
204 --- if compiled in, _gtk is set.
205 -if _gtk == nil then
207 - local init, err = loadlib(os.getenv("HOME") .. "/.lua50/libluagtk2.so",
208 - "luaopen_gtk2")
209 - if err then
210 - print(err)
211 - return
212 - end
213 - gtk = init()
215 -else
216 - gtk = _gtk
217 -end
219 diff -NbBur lua-gtk2-0.3_orig/gtk2.lua.in lua-gtk2-0.3/gtk2.lua.in
220 --- lua-gtk2-0.3_orig/gtk2.lua.in 1970-01-01 01:00:00.000000000 +0100
221 +++ lua-gtk2-0.3/gtk2.lua.in 2006-05-15 01:20:24.000000000 +0200
222 @@ -0,0 +1,16 @@
224 +-- if compiled in, _gtk is set.
225 +if _gtk == nil then
227 + local init, err = loadlib("PREFIX/lib/lua50/libluagtk2.so",
228 + "luaopen_gtk2")
229 + if err then
230 + print(err)
231 + return
232 + end
233 + gtk = init()
235 +else
236 + gtk = _gtk
237 +end
239 diff -NbBur lua-gtk2-0.3_orig/Makefile lua-gtk2-0.3/Makefile
240 --- lua-gtk2-0.3_orig/Makefile 2005-08-16 19:32:08.000000000 +0200
241 +++ lua-gtk2-0.3/Makefile 2006-05-16 03:09:41.000000000 +0200
242 @@ -1,31 +1,46 @@
243 # automatically generated makefile
245 -# CFLAGS :=-DLINUX -Os -fomit-frame-pointer -Wall -DXTHREADS -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include//lua50 -I build-linux -I src
246 -# CFLAGS :=-DLINUX -O2 -fomit-frame-pointer -Wall -DXTHREADS -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include//lua50 -I build-linux -I src
247 -CFLAGS :=-DLINUX -g -Wall -DXTHREADS -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include//lua50 -I build-linux -I src
248 +PACKAGE_CFLAGS =-g -Wall -DLINUX -Os -fomit-frame-pointer -Wall -DXTHREADS -DXUSE_MTSAFE_API `pkg-config --cflags gtk+-2.0`
249 HASH :=hash2
250 ODIR :=build-linux/
251 VERSION :=0.3
252 -CC :=gcc-4.0
253 +CC :=arm-linux-gcc
254 +HGCC :=gcc
255 +PREFIX := /usr/local
256 +LIBDIR := $(PREFIX)/lib/
258 -all: ${ODIR}libluagtk2.so ${ODIR}main
259 +all: ${ODIR}libluagtk2.so ${ODIR}main gtk2.lua
261 -Makefile: configure
262 - ./configure
263 +%.lua %.lua.in:
264 + sed 's:PREFIX:$(PREFIX):' < '$@.in' > $@
266 ${ODIR}libluagtk2.so: ${ODIR}libluagtk2.o ${ODIR}${HASH}.o ${ODIR}hash.o ${ODIR}_funclist.o ${ODIR}_structlist.o ${ODIR}_enumlist.o ${ODIR}_override.o
267 @echo $@
268 - @${CC} -shared -o $@ $^ /usr/lib/libffi.a
269 + @${CC} -shared -o $@ $^ ${LIBDIR}/libffi.a
271 -${ODIR}generate: ${ODIR}generate.o ${ODIR}${HASH}.o
272 +${ODIR}file2c:
273 + @echo $@
274 + @${HGCC} -o $@ src/file2c.c
276 +${ODIR}generate.o:
277 + @echo $@
278 + @${HGCC} -c -o $@ src/generate.c
280 +${ODIR}${HASH}_host.o:
281 + @echo $@
282 + @${HGCC} -c -o $@ src/${HASH}.c
284 +${ODIR}generate: ${ODIR}generate.o ${ODIR}${HASH}_host.o
285 + @echo $@
286 + @${HGCC} -Wall -g -o $@ $^
288 ${ODIR}main.o: src/main.c
289 @echo $@
290 - @${CC} -Wall -c -g -o $@ $^ -I /usr/include/lua50
291 + @${HGCC} $(CFLAGS) -Wall -c -g -o $@ $^ -I /usr/include/lua50
293 ${ODIR}main: ${ODIR}main.o
294 @echo $@
295 - @${CC} -o $@ $^ -llua50 -llualib50
296 + @${HGCC} $(CFLAGS) $(PACKAGE_CFLAGS) -o $@ $^ -llua -llualib
298 ${ODIR}libluagtk2.o: src/libluagtk2.c ${ODIR}_typelist.c src/structinfo.h src/hash.h
300 @@ -52,15 +67,15 @@
302 build-linux/%.o: build-linux/%.c
303 @echo $@
304 - @${CC} ${CFLAGS} -c -o $@ $<
305 + @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -c -o $@ $<
307 build-linux/%.o: src/%.c
308 @echo $@
309 - @${CC} ${CFLAGS} -c -o $@ $<
310 + @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -c -o $@ $<
312 build-linux/%.s: src/%.c
313 @echo $@
314 - @${CC} ${CFLAGS} -S -o $@ $<
315 + @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -S -o $@ $<
317 build-linux/%.luac: src/%.lua
318 @echo $@
319 @@ -68,12 +83,13 @@
321 clean:
322 rm -f ${ODIR}libluagtk2.so ${ODIR}generate ${ODIR}_*.c ${ODIR}*.o
323 - rm -f ${ODIR}file2c ${ODIR}override.luac ${ODIR}main
324 + rm -f ${ODIR}file2c ${ODIR}override.luac ${ODIR}main gtk2.lua
326 install: all
327 - mkdir -p ~/.lua50
328 - cp gtk2.lua ~/.lua50
329 - ln -sf $(PWD)/build-linux/libluagtk2.so ~/.lua50
330 + install -d $(DESTDIR)/$(PREFIX)/share/lua
331 + install gtk2.lua $(DESTDIR)/$(PREFIX)/share/lua
332 + install -d $(DESTDIR)/$(PREFIX)/lib/lua50
333 + install $(PWD)/build-linux/libluagtk2.so $(DESTDIR)/$(PREFIX)/lib/lua50
335 tar:
336 (cd ..; ln -s lua-gtk2 lua-gtk2-${VERSION}; tar czvhf lua-gtk2-${VERSION}.tar.gz \
337 diff -NbBur lua-gtk2-0.3_orig/src/libluagtk2.c lua-gtk2-0.3/src/libluagtk2.c
338 --- lua-gtk2-0.3_orig/src/libluagtk2.c 2005-08-16 18:22:00.000000000 +0200
339 +++ lua-gtk2-0.3/src/libluagtk2.c 2006-05-15 01:31:09.000000000 +0200
340 @@ -27,9 +27,9 @@
342 static const char *dll_list[] = {
343 #ifdef LINUX
344 - "/usr/lib/libgtk-x11-2.0.so",
345 - "/usr/lib/libgdk-x11-2.0.so",
346 - "/usr/lib/libpango-1.0.so",
347 + "/usr/lib/libgtk-x11-2.0.so.0",
348 + "/usr/lib/libgdk-x11-2.0.so.0",
349 + "/usr/lib/libpango-1.0.so.0",
350 #endif
351 #ifdef WIN32
352 "C:/GTK/bin/libgtk-win32-2.0-0.dll",