Alexandre Julliard : makefiles: Add rules for cross-compiling static libraries.
Alexandre Julliard
julliard at winehq.org
Mon Jan 25 11:21:01 CST 2010
Module: wine
Branch: master
Commit: 1f254216d109f7a1c74e5cc79fbc7869f46722ac
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1f254216d109f7a1c74e5cc79fbc7869f46722ac
Author: Alexandre Julliard <julliard at winehq.org>
Date: Sat Jan 23 20:26:49 2010 +0100
makefiles: Add rules for cross-compiling static libraries.
---
Make.rules.in | 3 +++
configure | 4 ++--
configure.ac | 2 +-
dlls/Makedll.rules.in | 7 ++++++-
dlls/Makeimplib.rules.in | 5 +++++
5 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Make.rules.in b/Make.rules.in
index 05e82bd..057d9b8 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -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@
diff --git a/configure b/configure
index f856b23..9eabf3c 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/configure.ac b/configure.ac
index ef95fe7..4e9d263 100644
--- a/configure.ac
+++ b/configure.ac
@@ -772,7 +772,7 @@ then
done
if test -n "$target"
then
- AC_SUBST(CROSSTARGETFLAGS,"-b $target")
+ AC_SUBST(CROSSTARGET,"$target")
fi
fi
fi
diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in
index 044d336..c3c8c67 100644
--- a/dlls/Makedll.rules.in
+++ b/dlls/Makedll.rules.in
@@ -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
diff --git a/dlls/Makeimplib.rules.in b/dlls/Makeimplib.rules.in
index 380101f..da36eee 100644
--- a/dlls/Makeimplib.rules.in
+++ b/dlls/Makeimplib.rules.in
@@ -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)
More information about the wine-cvs
mailing list