On Friday 16 May 2008 19:09:33 Matthew Garrett wrote:

> libx86 can be downloaded from
> http://www.codon.org.uk/~mjg59/libx86/downloads

Here is a patch agains the makefiles that does the following:

- only define CFLAGS and LIBDIR for libx86 when they are not yet defined
- fix usage of LIBDIR, e.g. do not install to $(LIBDIR)/usr/lib
- preserve timestamp for libx86.h and make it not executable
- make symlink to libx86.so.1 relative
- append CFLAGS to user specified CFLAGS for x86emu

The patches regarding CFLAGS are helpful to specify the default flags of a 
distribution, e.g. for Fedora some of these are used:
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic 
-fasynchronous-unwind-tables 
-Werror-implicit-function-declaration

Btw. is it intended that the install target of x86emu is empty?

Regards,
Till
- only define CFLAGS and LIBDIR for libx86 when they are not yet defined
- fix usage of LIBDIR, e.g. do not install to $(LIBDIR)/usr/lib
- preserve timestamp for libx86.h and make it not executable
- make symlink to libx86.so.1 relative
- append CFLAGS to user specified CFLAGS for x86emu

diff -up libx86-1.0/Makefile.orig libx86-1.0/Makefile
--- libx86-1.0/Makefile.orig	2008-05-16 18:58:59.000000000 +0200
+++ libx86-1.0/Makefile	2008-05-17 16:41:41.408628731 +0200
@@ -1,6 +1,6 @@
 OBJECTS = x86-common.o
-CFLAGS = -O2 -Wall -DDEBUG -g
-LIBDIR = /usr/lib
+CFLAGS ?= -O2 -Wall -DDEBUG -g
+LIBDIR ?= /usr/lib
 
 ifeq ($(BACKEND),x86emu)
 	OBJECTS += thunk.o x86emu/decode.o x86emu/debug.o x86emu/fpu.o \
@@ -32,7 +32,7 @@ clean: objclean
 	rm -f *.so.1 *.a
 
 install: libx86.so.1
-	install -D libx86.so.1 $(DESTDIR)$(LIBDIR)/lib/libx86.so.1
-	install -D libx86.a $(DESTDIR)$(LIBDIR)/usr/lib/libx86.a
-	ln -sf /lib/libx86.so.1 $(DESTDIR)$(LIBDIR)/usr/lib/libx86.so
-	install -D lrmi.h $(DESTDIR)/usr/include/libx86.h
+	install -D libx86.so.1 $(DESTDIR)$(LIBDIR)/libx86.so.1
+	install -D libx86.a $(DESTDIR)$(LIBDIR)/libx86.a
+	ln -sf libx86.so.1 $(DESTDIR)$(LIBDIR)/libx86.so
+	install -p -m 0644 -D lrmi.h $(DESTDIR)/usr/include/libx86.h
diff -up libx86-1.0/x86emu/makefile.linux.orig libx86-1.0/x86emu/makefile.linux
--- libx86-1.0/x86emu/makefile.linux.orig	2008-05-17 16:45:49.220628969 +0200
+++ libx86-1.0/x86emu/makefile.linux	2008-05-17 16:44:14.013628662 +0200
@@ -47,7 +47,7 @@ $(TARGETLIB): $(OBJS)
 	ar rv $(TARGETLIB) $(OBJS)
 
 INCS   = -I. -Ix86emu -I../../include -I../x86emu_include
-CFLAGS = -fPIC -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG -DDEBUG
+CFLAGS += -fPIC -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG -DDEBUG
 
 .c.o:
 	gcc -g -O -Wall -c $(CFLAGS) $(INCS) $*.c

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to