pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/libX11 Teach libX11 about cross-compilation:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5249da34fa6b
branches:  trunk
changeset: 531525:5249da34fa6b
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Aug 01 16:46:16 2007 +0000

description:
Teach libX11 about cross-compilation:
- define an automake conditional for cross-compilation
- build xmakekeys in addition to makekeys when using
  cross-compilation. Provide manual compiliation rules to replace
  the default automake rules. We do use X11_CFLAGS, but we do *not*
  want CFLAGS as the latter can contain platform specific flags like
  -mieee on Alpha.
- Use either xmakekeys or makekeys depending on whether this is a native
  build or not.

Supported-by: Google SoC 2007

diffstat:

 x11/libX11/Makefile         |    6 +-
 x11/libX11/distinfo         |    8 +-
 x11/libX11/patches/patch-aa |   13 +
 x11/libX11/patches/patch-ac |   63 +++++
 x11/libX11/patches/patch-ad |   23 ++
 x11/libX11/patches/patch-ae |  368 ++++++++++++++++++++++++++++++++++
 x11/libX11/patches/patch-af |   24 ++
 x11/libX11/patches/patch-ag |  473 ++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 976 insertions(+), 2 deletions(-)

diffs (truncated from 1025 to 300 lines):

diff -r 7e0616b642c9 -r 5249da34fa6b x11/libX11/Makefile
--- a/x11/libX11/Makefile       Wed Aug 01 16:36:51 2007 +0000
+++ b/x11/libX11/Makefile       Wed Aug 01 16:46:16 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2007/07/12 15:01:59 joerg Exp $
+# $NetBSD: Makefile,v 1.7 2007/08/01 16:46:16 joerg Exp $
 #
 
 DISTNAME=              libX11-1.1.2
@@ -29,6 +29,10 @@
 CONFIGURE_ARGS+=       --disable-malloc0returnsnull
 .endif
 
+.if defined(USE_CROSS_COMPILE) && !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+MAKE_ENV+=     CC_FOR_BUILD=${NATIVE_CC:Q} CPPFLAGS_FOR_BUILD=-I${PREFIX}/include
+.endif
+
 .include "../../x11/bigreqsproto/buildlink3.mk"
 .include "../../x11/inputproto/buildlink3.mk"
 .include "../../x11/kbproto/buildlink3.mk"
diff -r 7e0616b642c9 -r 5249da34fa6b x11/libX11/distinfo
--- a/x11/libX11/distinfo       Wed Aug 01 16:36:51 2007 +0000
+++ b/x11/libX11/distinfo       Wed Aug 01 16:46:16 2007 +0000
@@ -1,6 +1,12 @@
-$NetBSD: distinfo,v 1.4 2007/07/12 15:02:01 joerg Exp $
+$NetBSD: distinfo,v 1.5 2007/08/01 16:46:16 joerg Exp $
 
 SHA1 (libX11-1.1.2.tar.bz2) = 7190d36389eb7903831cd9541d919f55ac5098e9
 RMD160 (libX11-1.1.2.tar.bz2) = c722e1eaa04a3d753660496d4e527b695c68db38
 Size (libX11-1.1.2.tar.bz2) = 1523644 bytes
+SHA1 (patch-aa) = 7c1905781ca9467adfb45e2cad9b710533bbcd17
 SHA1 (patch-ab) = 000f81dd5d21cbabf38e91b5066e8f1ce43ff957
+SHA1 (patch-ac) = ee92c9dd48a60b5597260f6bd1a02eddc1cc26a7
+SHA1 (patch-ad) = 30497b3fe22bc2ed477449afa79bf98076031e61
+SHA1 (patch-ae) = c59b6f63b95814285e8d6c8bcf32fb8755930bd0
+SHA1 (patch-af) = 20531d93e19e61c2eb08612f976083f36b460a9e
+SHA1 (patch-ag) = d7a92f25a84a8d2240fe0a38206c8d78f076106b
diff -r 7e0616b642c9 -r 5249da34fa6b x11/libX11/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/libX11/patches/patch-aa       Wed Aug 01 16:46:16 2007 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.3 2007/08/01 16:48:41 joerg Exp $
+
+--- configure.ac.orig  2007-07-27 18:02:55.000000000 +0200
++++ configure.ac
+@@ -304,6 +304,8 @@ else
+ fi
+ AC_SUBST(XKBPROTO_REQUIRES)
+ 
++AM_CONDITIONAL(CROSS_COMPILING, [ test $cross_compiling = yes ])
++
+ AC_FUNC_MMAP()
+ composecache_default=$ac_cv_func_mmap_fixed_mapped
+ AC_CHECK_FUNC(nl_langinfo, , [composecache_default=no])
diff -r 7e0616b642c9 -r 5249da34fa6b x11/libX11/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/libX11/patches/patch-ac       Wed Aug 01 16:46:16 2007 +0000
@@ -0,0 +1,63 @@
+$NetBSD: patch-ac,v 1.1 2007/08/01 16:48:41 joerg Exp $
+
+--- configure.orig     2007-06-04 06:44:39.000000000 +0200
++++ configure
+@@ -924,6 +924,8 @@ XKB_FALSE
+ XKBPROTO_CFLAGS
+ XKBPROTO_LIBS
+ XKBPROTO_REQUIRES
++CROSS_COMPILING_TRUE
++CROSS_COMPILING_FALSE
+ LINT
+ LINT_FLAGS
+ LINT_TRUE
+@@ -23199,6 +23201,17 @@ fi
+ 
+ 
+ 
++if  test $cross_compiling = yes ; then
++  CROSS_COMPILING_TRUE=
++  CROSS_COMPILING_FALSE='#'
++else
++  CROSS_COMPILING_TRUE='#'
++  CROSS_COMPILING_FALSE=
++fi
++
++
++
++
+ for ac_header in stdlib.h unistd.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+@@ -24299,6 +24312,13 @@ echo "$as_me: error: conditional \"XKB\"
+ Usually this means the macro was only invoked conditionally." >&2;}
+    { (exit 1); exit 1; }; }
+ fi
++if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
++  { { echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILING\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"CROSS_COMPILING\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++   { (exit 1); exit 1; }; }
++fi
+ if test -z "${LINT_TRUE}" && test -z "${LINT_FALSE}"; then
+   { { echo "$as_me:$LINENO: error: conditional \"LINT\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+@@ -25112,6 +25132,8 @@ XKB_FALSE!$XKB_FALSE$ac_delim
+ XKBPROTO_CFLAGS!$XKBPROTO_CFLAGS$ac_delim
+ XKBPROTO_LIBS!$XKBPROTO_LIBS$ac_delim
+ XKBPROTO_REQUIRES!$XKBPROTO_REQUIRES$ac_delim
++CROSS_COMPILING_TRUE!$CROSS_COMPILING_TRUE$ac_delim
++CROSS_COMPILING_FALSE!$CROSS_COMPILING_FALSE$ac_delim
+ LINT!$LINT$ac_delim
+ LINT_FLAGS!$LINT_FLAGS$ac_delim
+ LINT_TRUE!$LINT_TRUE$ac_delim
+@@ -25133,7 +25155,7 @@ LIBOBJS!$LIBOBJS$ac_delim
+ LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+ 
+-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then
++  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 79; then
+     break
+   elif $ac_last_try; then
+     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff -r 7e0616b642c9 -r 5249da34fa6b x11/libX11/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/libX11/patches/patch-ad       Wed Aug 01 16:46:16 2007 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-ad,v 1.1 2007/08/01 16:48:41 joerg Exp $
+
+--- src/util/Makefile.am.orig  2006-10-04 19:43:17.000000000 +0200
++++ src/util/Makefile.am
+@@ -1,11 +1,15 @@
+ # $XdotOrg: lib/X11/src/util/Makefile.am,v 1.4 2006-02-19 02:14:12 jamey Exp $
+ 
+-noinst_PROGRAMS=makekeys
++noinst_PROGRAMS=      makekeys$(EXEEXT) $(MAKEKEYS_PROG)
+ 
+ makekeys_CFLAGS=$(X11_CFLAGS)
++if CROSS_COMPILING
++MAKEKEYS_PROG=                xmakekeys$(EXEEXT)
+ 
+-#override CC = gcc
+-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++xmakekeys$(EXEEXT): makekeys.c
++      $(CC_FOR_BUILD) $(X11_CFLAGS) $(CPPFLAGS_FOR_BUILD) \
++          $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ makekeys.c
++endif
+ 
+ EXTRA_DIST = mkks.sh
+ 
diff -r 7e0616b642c9 -r 5249da34fa6b x11/libX11/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/libX11/patches/patch-ae       Wed Aug 01 16:46:16 2007 +0000
@@ -0,0 +1,368 @@
+$NetBSD: patch-ae,v 1.1 2007/08/01 16:48:42 joerg Exp $
+
+--- src/util/Makefile.in.orig  2007-06-04 06:44:50.000000000 +0200
++++ src/util/Makefile.in
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.9.6 from Makefile.am.
++# Makefile.in generated by automake 1.10 from Makefile.am.
+ # @configure_input@
+ 
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004, 2005  Free Software Foundation, Inc.
++# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -16,15 +16,11 @@
+ 
+ # $XdotOrg: lib/X11/src/util/Makefile.am,v 1.4 2006-02-19 02:14:12 jamey Exp $
+ 
+-srcdir = @srcdir@
+-top_srcdir = @top_srcdir@
+ VPATH = @srcdir@
+ pkgdatadir = $(datadir)/@PACKAGE@
+ pkglibdir = $(libdir)/@PACKAGE@
+ pkgincludedir = $(includedir)/@PACKAGE@
+-top_builddir = ../..
+ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+-INSTALL = @INSTALL@
+ install_sh_DATA = $(install_sh) -c -m 644
+ install_sh_PROGRAM = $(install_sh) -c
+ install_sh_SCRIPT = $(install_sh) -c
+@@ -38,7 +34,6 @@ PRE_UNINSTALL = :
+ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+-noinst_PROGRAMS = makekeys$(EXEEXT)
+ subdir = src/util
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+@@ -52,27 +47,31 @@ CONFIG_HEADER = $(top_builddir)/src/conf
+ CONFIG_CLEAN_FILES =
+ PROGRAMS = $(noinst_PROGRAMS)
+ makekeys_SOURCES = makekeys.c
+-makekeys_OBJECTS = makekeys-makekeys.$(OBJEXT)
++makekeys_OBJECTS = makekeys.$(OBJEXT)
+ makekeys_LDADD = $(LDADD)
+-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/src -I$(top_builddir)/include/X11
++xmakekeys_SOURCES = xmakekeys.c
++xmakekeys_OBJECTS = xmakekeys.$(OBJEXT)
++xmakekeys_LDADD = $(LDADD)
++DEFAULT_INCLUDES = -I. -I$(top_builddir)/src -I$(top_builddir)/include/X11@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+-      $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+-      $(AM_CFLAGS) $(CFLAGS)
++LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
++      --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
++      $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ CCLD = $(CC)
+-SOURCES = makekeys.c
+-DIST_SOURCES = makekeys.c
++LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
++      --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
++      $(LDFLAGS) -o $@
++SOURCES = makekeys.c xmakekeys.c
++DIST_SOURCES = makekeys.c xmakekeys.c
+ ETAGS = etags
+ CTAGS = ctags
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ ACLOCAL = @ACLOCAL@
+ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+-AMDEP_FALSE = @AMDEP_FALSE@
+-AMDEP_TRUE = @AMDEP_TRUE@
+ AMTAR = @AMTAR@
+ APP_MAN_DIR = @APP_MAN_DIR@
+ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+@@ -109,6 +108,7 @@ FILE_MAN_DIR = @FILE_MAN_DIR@
+ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+ GREP = @GREP@
+ I18N_MODULE_LIBS = @I18N_MODULE_LIBS@
++INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+@@ -121,23 +121,16 @@ LIBTOOL = @LIBTOOL@
+ LIB_MAN_DIR = @LIB_MAN_DIR@
+ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+ LINT = @LINT@
+-LINT_FALSE = @LINT_FALSE@
+ LINT_FLAGS = @LINT_FLAGS@
+-LINT_TRUE = @LINT_TRUE@
+ LN_S = @LN_S@
+ LTLIBOBJS = @LTLIBOBJS@
+ MAINT = @MAINT@
+-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+ MAKEINFO = @MAKEINFO@
+ MALLOC_ZERO_CFLAGS = @MALLOC_ZERO_CFLAGS@
+-MANPAGES_FALSE = @MANPAGES_FALSE@
+-MANPAGES_TRUE = @MANPAGES_TRUE@
+ MISC_MAN_DIR = @MISC_MAN_DIR@
+ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
++MKDIR_P = $(mkdir_p)
+ OBJEXT = @OBJEXT@
+-OS2_FALSE = @OS2_FALSE@
+-OS2_TRUE = @OS2_TRUE@
+ PACKAGE = @PACKAGE@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+ PACKAGE_NAME = @PACKAGE_NAME@
+@@ -152,10 +145,6 @@ RAWCPPFLAGS = @RAWCPPFLAGS@
+ SET_MAKE = @SET_MAKE@
+ SHELL = @SHELL@
+ STRIP = @STRIP@
+-THRSTUBS_FALSE = @THRSTUBS_FALSE@
+-THRSTUBS_TRUE = @THRSTUBS_TRUE@
+-UDC_FALSE = @UDC_FALSE@
+-UDC_TRUE = @UDC_TRUE@
+ VERSION = @VERSION@
+ WCHAR32 = @WCHAR32@
+ X11_CFLAGS = @X11_CFLAGS@
+@@ -166,26 +155,16 @@ X11_LIBS = @X11_LIBS@
+ X11_LOCALEDATADIR = @X11_LOCALEDATADIR@
+ X11_LOCALEDIR = @X11_LOCALEDIR@
+ X11_LOCALELIBDIR = @X11_LOCALELIBDIR@
+-XCB_FALSE = @XCB_FALSE@
+-XCB_TRUE = @XCB_TRUE@
+-XCMS_FALSE = @XCMS_FALSE@
+-XCMS_TRUE = @XCMS_TRUE@
+ XDMCP_CFLAGS = @XDMCP_CFLAGS@
+ XDMCP_LIBS = @XDMCP_LIBS@
+ XERRORDB = @XERRORDB@
+ XKBPROTO_CFLAGS = @XKBPROTO_CFLAGS@
+ XKBPROTO_LIBS = @XKBPROTO_LIBS@
+ XKBPROTO_REQUIRES = @XKBPROTO_REQUIRES@
+-XKB_FALSE = @XKB_FALSE@
+-XKB_TRUE = @XKB_TRUE@
+ XKEYSYMDB = @XKEYSYMDB@
+-XLIB_LOADABLE_I18N_FALSE = @XLIB_LOADABLE_I18N_FALSE@
+-XLIB_LOADABLE_I18N_TRUE = @XLIB_LOADABLE_I18N_TRUE@
+ XLOCALEDATADIR = @XLOCALEDATADIR@
+ XLOCALEDIR = @XLOCALEDIR@
+ XLOCALELIBDIR = @XLOCALELIBDIR@
+-XLOCALE_FALSE = @XLOCALE_FALSE@
+-XLOCALE_TRUE = @XLOCALE_TRUE@



Home | Main Index | Thread Index | Old Index