makefiles: Add rules for cross-compiling static libraries.

This commit is contained in:
Alexandre Julliard 2010-01-23 20:26:49 +01:00
parent 07af19f3ab
commit 1f254216d1
5 changed files with 17 additions and 4 deletions

View File

@ -53,6 +53,9 @@ FONTFORGE = @FONTFORGE@
RSVG = @RSVG@
ICOTOOL = @ICOTOOL@
CROSSCC = @CROSSCC@
CROSSTARGET = @CROSSTARGET@
CROSSAR = $(CROSSTARGET)-ar
CROSSRANLIB = $(CROSSTARGET)-ranlib
FAKEEXT = $(DLLEXT:.so=.fake)
INCLUDES = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
EXTRACFLAGS = @EXTRACFLAGS@

4
configure vendored
View File

@ -653,7 +653,7 @@ X_PRE_LIBS
X_CFLAGS
XMKMF
LIBPTHREAD
CROSSTARGETFLAGS
CROSSTARGET
CROSSTEST
CROSSCC
CARBONLIB
@ -6950,7 +6950,7 @@ test -n "$CROSSCC" || CROSSCC="false"
done
if test -n "$target"
then
CROSSTARGETFLAGS="-b $target"
CROSSTARGET="$target"
fi
fi

View File

@ -772,7 +772,7 @@ then
done
if test -n "$target"
then
AC_SUBST(CROSSTARGETFLAGS,"-b $target")
AC_SUBST(CROSSTARGET,"$target")
fi
fi
fi

View File

@ -28,6 +28,8 @@ $(MODULE) $(MODULE).so $(MODULE).fake: $(MAINSPEC) $(OBJS) Makefile.in
# Rules for import libraries
IMPLIB_CROSSOBJS = $(IMPLIB_OBJS:.o=.cross.o)
.PHONY: implib $(IMPLIB_SRCS:%=__static_implib__%)
all implib: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%)
@ -43,7 +45,10 @@ $(IMPORTLIB:%=lib%.def.a): $(IMPLIB_OBJS)
$(RANLIB) $@
$(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_OBJS)
$(WINEBUILD) $(IMPLIBFLAGS) @CROSSTARGETFLAGS@ -w --implib -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPLIB_OBJS)
$(WINEBUILD) $(IMPLIBFLAGS) -w --implib -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPLIB_OBJS)
$(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_CROSSOBJS)
$(WINEBUILD) $(IMPLIBFLAGS) $(CROSSTARGET:%=-b %) -w --implib -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPLIB_CROSSOBJS)
$(SUBDIRS): implib

View File

@ -21,6 +21,11 @@ $(MODULE:%=lib%.a): $(OBJS) Makefile.in
$(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
$(MODULE:%=lib%.cross.a): $(CROSSOBJS) Makefile.in
$(RM) $@
$(CROSSAR) $(ARFLAGS) $@ $(CROSSOBJS)
$(CROSSRANLIB) $@
# Rules for installation
install install-dev:: $(MODULE:%=lib%.a) $(DESTDIR)$(dlldir)