ia64/xen-unstable

changeset 11843:a5ef8e491da7

[SOLARIS] On Solaris, GCC is configured to use Sun's LD. Fix the build to use
the correct flags, and link against libsocket where necessary.

Signed-off-by: John Levon <john.levon@sun.com>
author kfraser@localhost.localdomain
date Tue Oct 17 17:17:57 2006 +0100 (2006-10-17)
parents 4154ba04725a
children 3ccd876603a0
files config/Linux.mk config/SunOS.mk tools/blktap/lib/Makefile tools/console/Makefile tools/libxc/Makefile tools/vnet/libxutil/Makefile tools/xenstat/libxenstat/Makefile tools/xenstat/xentop/Makefile tools/xenstore/Makefile
line diff
     1.1 --- a/config/Linux.mk	Tue Oct 17 16:53:39 2006 +0100
     1.2 +++ b/config/Linux.mk	Tue Oct 17 17:17:57 2006 +0100
     1.3 @@ -20,6 +20,10 @@ INSTALL_PROG = $(INSTALL) -m0755
     1.4  
     1.5  LIB64DIR = lib64
     1.6  
     1.7 +SOCKET_LIBS =
     1.8 +SONAME_LDFLAG = -soname
     1.9 +SHLIB_CFLAGS = -shared
    1.10 +
    1.11  ifneq ($(debug),y)
    1.12  # Optimisation flags are overridable
    1.13  CFLAGS ?= -O2 -fomit-frame-pointer
     2.1 --- a/config/SunOS.mk	Tue Oct 17 16:53:39 2006 +0100
     2.2 +++ b/config/SunOS.mk	Tue Oct 17 17:17:57 2006 +0100
     2.3 @@ -20,6 +20,10 @@ INSTALL_PROG = $(INSTALL) -m0755
     2.4  
     2.5  LIB64DIR = lib/amd64
     2.6  
     2.7 +SOCKET_LIBS = -lsocket
     2.8 +SONAME_LDFLAG = -h
     2.9 +SHLIB_CFLAGS = -static-libgcc -shared
    2.10 +
    2.11  ifneq ($(debug),y)
    2.12  # Optimisation flags are overridable
    2.13  CFLAGS ?= -O2 -fno-omit-frame-pointer
     3.1 --- a/tools/blktap/lib/Makefile	Tue Oct 17 16:53:39 2006 +0100
     3.2 +++ b/tools/blktap/lib/Makefile	Tue Oct 17 17:17:57 2006 +0100
     3.3 @@ -52,8 +52,8 @@ clean:
     3.4  	rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
     3.5  
     3.6  libblktap.a: $(OBJS) 
     3.7 -	$(CC) $(CFLAGS) -Wl,-soname -Wl,$(SONAME) -shared         \
     3.8 -	      -L$(XEN_XENSTORE) -l xenstore                       \
     3.9 +	$(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_CFLAGS) \
    3.10 +	      -L$(XEN_XENSTORE) -l xenstore                                \
    3.11  	      -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
    3.12  	ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
    3.13  	ln -sf libblktap.so.$(MAJOR) libblktap.so
     4.1 --- a/tools/console/Makefile	Tue Oct 17 16:53:39 2006 +0100
     4.2 +++ b/tools/console/Makefile	Tue Oct 17 17:17:57 2006 +0100
     4.3 @@ -22,11 +22,11 @@ clean:
     4.4  
     4.5  xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c))
     4.6  	$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
     4.7 -              -lxenctrl -lxenstore
     4.8 +              $(SOCKET_LIBS) -lxenctrl -lxenstore
     4.9  
    4.10  xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
    4.11  	$(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_XENSTORE) \
    4.12 -	      -lxenctrl -lxenstore
    4.13 +	      $(SOCKET_LIBS) -lxenctrl -lxenstore
    4.14  
    4.15  .PHONY: install
    4.16  install: $(BIN)
     5.1 --- a/tools/libxc/Makefile	Tue Oct 17 16:53:39 2006 +0100
     5.2 +++ b/tools/libxc/Makefile	Tue Oct 17 17:17:57 2006 +0100
     5.3 @@ -117,7 +117,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(
     5.4  	ln -sf $< $@
     5.5  
     5.6  libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
     5.7 -	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR) -shared -o $@ $^
     5.8 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
     5.9  
    5.10  # libxenguest
    5.11  
    5.12 @@ -130,7 +130,7 @@ libxenguest.so.$(MAJOR): libxenguest.so.
    5.13  	ln -sf $< $@
    5.14  
    5.15  libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
    5.16 -	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenguest.so.$(MAJOR) -shared -o $@ $^ -lz -lxenctrl
    5.17 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lz -lxenctrl
    5.18  
    5.19  -include $(DEPS)
    5.20  
     6.1 --- a/tools/vnet/libxutil/Makefile	Tue Oct 17 16:53:39 2006 +0100
     6.2 +++ b/tools/vnet/libxutil/Makefile	Tue Oct 17 17:17:57 2006 +0100
     6.3 @@ -55,7 +55,7 @@ libxutil.so.$(MAJOR): libxutil.so.$(MAJO
     6.4  	ln -sf $^ $@
     6.5  
     6.6  libxutil.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
     6.7 -	$(CC) $(CFLAGS) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
     6.8 +	$(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxutil.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
     6.9  
    6.10  libxutil.a: $(LIB_OBJS)
    6.11  	$(AR) rc $@ $^
     7.1 --- a/tools/xenstat/libxenstat/Makefile	Tue Oct 17 16:53:39 2006 +0100
     7.2 +++ b/tools/xenstat/libxenstat/Makefile	Tue Oct 17 17:17:57 2006 +0100
     7.3 @@ -30,7 +30,7 @@ LIB=src/libxenstat.a
     7.4  SHLIB=src/libxenstat.so.$(MAJOR).$(MINOR)
     7.5  SHLIB_LINKS=src/libxenstat.so.$(MAJOR) src/libxenstat.so
     7.6  OBJECTS=src/xenstat.o
     7.7 -SONAME_FLAGS=-Wl,-soname -Wl,libxenstat.so.$(MAJOR)
     7.8 +SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR)
     7.9  
    7.10  WARN_FLAGS=-Wall -Werror
    7.11  
    7.12 @@ -45,7 +45,7 @@ all: $(LIB)
    7.13  	$(RANLIB) $@
    7.14  
    7.15  $(SHLIB): $(OBJECTS)
    7.16 -	$(CC) $(CFLAGS) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS) \
    7.17 +	$(CC) $(CFLAGS) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_CFLAGS) -o $@ $(OBJECTS) \
    7.18  		-lxenstore -lxenctrl
    7.19  
    7.20  src/xenstat.o: src/xenstat.c src/xenstat.h
    7.21 @@ -97,7 +97,7 @@ PYTHON_FLAGS=-I/usr/include/python$(PYTH
    7.22  	swig -python $(SWIG_FLAGS) -outdir $(@D) -o $(PYSRC) $<
    7.23  
    7.24  $(PYLIB): $(PYSRC)
    7.25 -	$(CC) $(CFLAGS) $(LDFLAGS) $(PYTHON_FLAGS) -shared -lxenstat -o $@ $<
    7.26 +	$(CC) $(CFLAGS) $(LDFLAGS) $(PYTHON_FLAGS) $(SHLIB_CFLAGS) -lxenstat -o $@ $<
    7.27  
    7.28  python-bindings: $(PYLIB) $(PYMOD)
    7.29  
    7.30 @@ -118,7 +118,7 @@ PERL_FLAGS=`perl -MConfig -e 'print "$$C
    7.31  	swig -perl $(SWIG_FLAGS) -outdir $(@D) -o $(PERLSRC) $<
    7.32  
    7.33  $(PERLLIB): $(PERLSRC)
    7.34 -	$(CC) $(CFLAGS) $(LDFLAGS) $(PERL_FLAGS) -shared -lxenstat -o $@ $<
    7.35 +	$(CC) $(CFLAGS) $(LDFLAGS) $(PERL_FLAGS) $(SHLIB_CFLAGS) -lxenstat -o $@ $<
    7.36  
    7.37  .PHONY: perl-bindings
    7.38  perl-bindings: $(PERLLIB) $(PERLMOD)
     8.1 --- a/tools/xenstat/xentop/Makefile	Tue Oct 17 16:53:39 2006 +0100
     8.2 +++ b/tools/xenstat/xentop/Makefile	Tue Oct 17 17:17:57 2006 +0100
     8.3 @@ -25,7 +25,7 @@ sbindir=$(prefix)/sbin
     8.4  
     8.5  CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT)
     8.6  LDFLAGS += -L$(XEN_LIBXENSTAT)
     8.7 -LDLIBS += -lxenstat -lncurses
     8.8 +LDLIBS += -lxenstat -lncurses $(SOCKET_LIBS)
     8.9  
    8.10  .PHONY: all
    8.11  all: xentop
     9.1 --- a/tools/xenstore/Makefile	Tue Oct 17 16:53:39 2006 +0100
     9.2 +++ b/tools/xenstore/Makefile	Tue Oct 17 17:17:57 2006 +0100
     9.3 @@ -41,19 +41,19 @@ test_interleaved_transactions: test_inte
     9.4  testcode: xs_test xenstored_test xs_random
     9.5  
     9.6  xenstored: $(XENSTORED_OBJS)
     9.7 -	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
     9.8 +	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl $(SOCKET_LIBS) -o $@
     9.9  
    9.10  $(CLIENTS): xenstore-%: xenstore_%.o libxenstore.so
    9.11 -	$(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
    9.12 +	$(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
    9.13  
    9.14  $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
    9.15  	$(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
    9.16  
    9.17  xenstore-control: xenstore_control.o libxenstore.so
    9.18 -	$(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
    9.19 +	$(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
    9.20  
    9.21  xenstore-ls: xsls.o libxenstore.so
    9.22 -	$(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
    9.23 +	$(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
    9.24  
    9.25  xenstored_test: xenstored_core_test.o xenstored_watch_test.o xenstored_domain_test.o xenstored_transaction_test.o xs_lib.o talloc_test.o fake_libxc.o utils.o tdb.o
    9.26  	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
    9.27 @@ -90,7 +90,7 @@ libxenstore.so.$(MAJOR): libxenstore.so.
    9.28  	ln -sf $< $@
    9.29  
    9.30  libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic
    9.31 -	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so.$(MAJOR) -shared -o $@ $^ -lpthread
    9.32 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ -lpthread
    9.33  
    9.34  libxenstore.a: xs.o xs_lib.o
    9.35  	$(AR) rcs libxenstore.a $^