On Mon, 19 Mar 2007 22:21:16 +0100
"Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote:

> Hm, I think I misunderstood the issue.
> 
> Can anyone please explain to me what the current situation is and why it may
> be a good idea to change it (or not)?

libx86 is a dependency of vbetool. Since the new release of vbetool it
is split of in a different library, packaged in a different tarball. We
probably wont be doing much development on libx86 so Stefan purged that
part from CVS. People compiling will now need to get the tarball from
Matthews website.

So far so good. 

Now I would argue: let people just get that tarball, unpack, type make
&& make install, just like they would for liblzf or libgcrypt.
Stefan however, has implemented a hack to help people compile suspend
in one go. You know can unpack the tarball, make a symlink and type
make.

I was arguing that was unnecessary, and would just clutter our makefile.

Well, I'm not going to get religious over this, I made a patch that
keeps stefans idea, but makes it a bit better to read (IMHO), it also 
makes it a bit easier to add other CONFIG_EMBEDDED_ stuff and will help 
with my ppc-support patch that I will send in a few days.
I also removed some cruft left over from the pre-libx86 days.

OK, to commit?

grts Tim



Index: Makefile
===================================================================
RCS file: /cvsroot/suspend/suspend/Makefile,v
retrieving revision 1.52
diff -u -r1.52 Makefile
--- Makefile    16 Mar 2007 15:03:08 -0000      1.52
+++ Makefile    19 Mar 2007 22:28:13 -0000
@@ -20,19 +20,25 @@
 CC_FLAGS=-I/usr/local/include -DS2RAM $(CFLAGS)
 LD_FLAGS=-L/usr/local/lib
 
-ifdef CONFIG_EMBEDDED_LIBX86
-CC_FLAGS += -Ilibx86/
-endif
-
 BINARIES=s2disk s2both s2ram swap-offset resume
 BINARIES_MIN=s2disk swap-offset
 
-S2RAM_OBJ=vt.o vbetool/x86-common.o vbetool/vbetool.o radeontool.o dmidecode.o
+S2RAM_OBJ=vt.o vbetool/vbetool.o radeontool.o dmidecode.o
 SWSUSP_OBJ=vt.o md5.o encrypt.o config.o loglevel.o splash.o bootsplash.o 
 
-S2RAM_LD_FLAGS = $(LD_FLAGS) -lpci -lz
+S2RAM_LD_FLAGS = $(LD_FLAGS) -lpci -lz -lx86
 SWSUSP_LD_FLAGS = $(LD_FLAGS)
 
+ifeq ($(ARCH), x86_64)
+LIBX86_MAKE = BACKEND=x86emu
+endif
+
+ifdef CONFIG_EMBEDDED_LIBX86
+CC_FLAGS += -Ilibx86/
+S2RAM_LD_FLAGS += -Llibx86/
+subdirs += libx86
+endif
+
 ifndef CONFIG_RESUME_DYN
 STATIC_LD_FLAGS = -static
 endif
@@ -70,25 +76,28 @@
 STATIC_CC_FLAGS=$(shell directfb-config --cflags)\
                $(shell pkg-config --static --cflags glib-2.0)
 endif
+ifdef CONFIG_RESUME_DYN
+SWSUSP_LD_FLAGS += -lgcc_s
 endif
-
-###
-ifdef CONFIG_EMBEDDED_LIBX86
-ifeq ($(ARCH), x86_64)
-LIBX86_MAKE = BACKEND=x86emu
 endif
 
-S2RAM_OBJ += libx86/libx86.a 
-else
-S2RAM_LD_FLAGS += -lx86
-endif
 
-all: $(BINARIES)
 
-clean:
-       make -C libx86 clean || true
-       rm -f $(BINARIES) suspend-keygen suspend.keys *.o vbetool/*.o
+all: $(subdirs) $(BINARIES) 
 
+clean: 
+       rm -f $(BINARIES) suspend-keygen suspend.keys *.o vbetool/*.o
+       rm -f libx86/libx86.h
+       for dir in $(subdirs); do \
+           $(MAKE) -C $$dir clean; \
+       done
+
+$(subdirs):
+       $(MAKE) -C $@
+
+libx86:
+       $(MAKE) $(LIBX86_MAKE) -C $@ static
+       -ln -s lrmi.h libx86/libx86.h 
 
 #### Rules for objects
 s2ram-both.o: s2ram.c s2ram.h whitelist.c
@@ -101,21 +110,13 @@
        $(CC) $(CC_FLAGS) -DHAVE_INTTYPES_H -DHAVE_STDINT_H -c $< -o $@
 
 # Simple objects with header
-config.o vt.o bootsplash.o splash.o splashy_funcs.o vbetool/x86-common.o 
vbetool/vbetool.o: %.o : %.c %.h
+config.o vt.o bootsplash.o splash.o splashy_funcs.o vbetool/vbetool.o: %.o : 
%.c %.h
        $(CC) $(CC_FLAGS) -c $< -o $@
 
 # Simple object without header
 dmidecode.o radeontool.o : %.o: %.c
        $(CC) $(CC_FLAGS) -c $< -o $@
 
-libx86/libx86.a:
-       ln -sf lrmi.h libx86/libx86.h
-       make -C libx86 $(LIBX86_MAKE) static
-
-libx86/lrmi.o libx86/thunk.o: %.o: %.c
-       $(CC) $(CC_FLAGS) -c $< -o $@
-
-
 #### Rules for binaries
 s2disk:        $(SWSUSP_OBJ) suspend.c
        $(CC) -g $(CC_FLAGS)  $^ -o $@ $(SWSUSP_LD_FLAGS)
@@ -169,3 +170,4 @@
 install: $(patsubst %,install-%,$(BINARIES)) $(SNAPSHOT) install-conf
 
 
+.PHONY: clean $(subdirs) install install-minimal install-resume-on-initrd 
install-resume-new-initrd $(patsubst %,install-%,$(BINARIES))

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to