1 #############################################################
5 #############################################################
7 ifneq ($(strip $(BR2_PACKAGE_TINYX)),y)
8 ifeq ($(strip $(BR2_PACKAGE_XORG)),y)
10 XORG_APPS:=xlsfonts/xlsfonts xmodmap/xmodmap xinit/startx \
11 xauth/xauth xinit/xinit xsetroot/xsetroot xset/xset \
12 mkfontscale/mkfontscale mkfontdir/mkfontdir \
15 XORG_LIBS:= Xft fontconfig expat Xrender Xaw Xmu Xt \
16 SM ICE Xpm Xp Xext X11 Xmuu Xxf86misc
19 #############################################################
20 # Stuff below this line shouldn't need changes.
21 # if you do change, look in rxvt & matchbox for the impact!
22 #############################################################
24 # Where resources are found.
26 XORG_SOURCE:=X11R6.8.2-src.tar.bz2
27 XORG_SITE:=http://xorg.freedesktop.org/X11R6.8.2/src-single/
29 XORG_DIR:=$(BUILD_DIR)/xc
30 XORG_LDIR:=$(XORG_DIR)/lib
31 XORG_PROGS:=$(XORG_DIR)/programs
32 TARGET_BINX:=/usr/X11R6/bin
33 TARGET_LIBX:=/usr/X11R6/lib
34 XORG_BINX:=$(TARGET_DIR)$(TARGET_BINX)
35 XORG_LIBX:=$(TARGET_DIR)$(TARGET_LIBX)
36 XORG_CF:=$(XORG_DIR)/config/cf/cross.def
37 XORG_HOST_DEF:=$(XORG_DIR)/config/cf/host.def
39 # Install Xorg xserver
41 XORG_XSERVER:=$(XORG_DIR)/programs/Xserver/$(XSERVER)
42 TARGET_XSERVER:=$(XORG_BINX)/$(XSERVER)
44 # Check if we should use FreeType2.
45 ifeq ($(BR2_PACKAGE_FREETYPE),y)
51 # figure out Xorg's idea of corresponding architecture name
67 ifeq ($(BR2_mipsel),y)
70 ifeq ($(BR2_powerpc),y)
76 ifeq ($(BR2_x86_64),y)
80 $(DL_DIR)/$(XORG_SOURCE):
81 $(WGET) -P $(DL_DIR) $(XORG_SITE)/$(XORG_SOURCE)
83 $(XORG_DIR)/.configured: $(DL_DIR)/$(XORG_SOURCE)
84 $(XORG_CAT) $(DL_DIR)/$(XORG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
85 toolchain/patch-kernel.sh $(XORG_DIR) package/xorg/ \*.patch
86 $(SED) 's:REPLACE_STAGING_DIR:$(STAGING_DIR):g' $(XORG_HOST_DEF)
87 $(SED) 's:REPLACE_HAS_FREETYPE2:$(HAS_FREETYPE2):g' $(XORG_HOST_DEF)
88 $(SED) 's:REPLACE_GCCINC_DIR:$(shell $(TARGET_CROSS)gcc -print-file-name=include):g' $(XORG_CF)
89 $(SED) 's:REPLACE_STAGING_DIR:$(STAGING_DIR):g' $(XORG_CF)
90 $(SED) 's:REPLACE_ARCH:$(ARCH):g' $(XORG_CF)
91 $(SED) 's:#define CcCmd.*:#define CcCmd $(TARGET_CROSS)gcc:g' $(XORG_CF)
92 $(SED) 's:#define RanlibCmd.*:#define RanlibCmd $(TARGET_CROSS)ranlib:g' $(XORG_CF)
93 $(SED) 's:#define LdCmd.*:#define LdCmd $(TARGET_CROSS)ld:g' $(XORG_CF)
94 $(SED) 's:#.*define.*HasPam.*YES::g' $(XORG_DIR)/config/cf/linux.cf
95 $(SED) 's:#.*define.*CrossCompiling.*NO:#define CrossCompiling YES:g' $(XORG_DIR)/config/cf/Imake.tmpl
96 $(SED) 's:#.*undef.*CrossCompileDir.*:#define CrossCompileDir $(STAGING_DIR)/bin:g' $(XORG_DIR)/config/cf/Imake.tmpl
97 $(SED) 's:REPLACE_XORG_ARCH:$(XARCH):g' $(XORG_DIR)/config/cf/cross.def
98 touch $(XORG_DIR)/.configured
100 $(XORG_XSERVER): $(XORG_DIR)/.configured
101 rm -f $(TARGET_XSERVER) $(XORG_XSERVER)
102 ( cd $(XORG_DIR) ; $(MAKE) \
103 PKG_CONFIG=$(STAGING_DIR)/$(PKGCONFIG_TARGET_BINARY) \
104 World XCURSORGEN=xcursorgen MKFONTSCALE=mkfontscale )
105 touch -c $(XORG_XSERVER)
107 $(STAGING_DIR)$(TARGET_LIBX)/libX11.so.6.2: $(XORG_XSERVER)
108 -mkdir -p $(STAGING_DIR)$(TARGET_LIBX)
109 ( cd $(XORG_DIR); $(MAKE) \
110 DESTDIR=$(STAGING_DIR) install XCURSORGEN=xcursorgen MKFONTSCALE=mkfontscale )
111 touch -c $(STAGING_DIR)$(TARGET_LIBX)/libX11.so.6.2
113 $(TARGET_XSERVER): $(XORG_XSERVER)
114 -mkdir -p $(XORG_BINX)
115 for file in $(XORG_APPS) ; do \
116 cp -f $(XORG_DIR)/programs/$$file $(XORG_BINX) ; \
117 chmod a+x $(XORG_PROGS)/$$file ; \
118 $(STRIP) $(XORG_PROGS)/$$file || /bin/true ; \
120 cp $(XORG_XSERVER) $(TARGET_XSERVER)
121 (cd $(XORG_BINX); ln -snf $(XSERVER) X)
122 $(STRIP) $(TARGET_XSERVER)
123 mkdir -p $(XORG_LIBX)/modules
124 cp -LRf $(XORG_DIR)/exports/lib/modules/ $(XORG_LIBX)/
125 ( cd $(XORG_DIR)/fonts ; $(MAKE) \
126 DESTDIR=$(TARGET_DIR) install XCURSORGEN=xcursorgen MKFONTSCALE=mkfontscale )
127 cp -LRf $(XORG_DIR)/fonts/bdf/misc/*.bdf $(XORG_LIBX)/X11/fonts/misc/
128 ( cd $(XORG_LIBX)/X11/fonts/misc/; mkfontdir )
129 (cd $(TARGET_DIR)/usr/bin; ln -snf $(TARGET_BINX) X11)
130 mkdir -p $(TARGET_DIR)/etc/X11/
131 cp package/xorg/xorg.conf $(TARGET_DIR)/etc/X11/
132 cp -a $(STAGING_DIR)$(TARGET_LIBX)/X11/rgb* $(XORG_LIBX)/X11/
133 touch -c $(TARGET_XSERVER)
135 $(XORG_LIBX)/libX11.so.6.2: $(TARGET_XSERVER)
136 -mkdir -p $(XORG_LIBX)
137 set -e; for dirs in $(XORG_LIBS) ; do \
138 file=`find $(XORG_LDIR)/$$dirs -type f -iname "*$$dirs.so*"` ; \
139 $(STRIP) --strip-unneeded $$file ; \
140 cp -f $$file $(XORG_LIBX) ; \
141 file=`find $(XORG_LDIR)/$$dirs -type l -iname "*$$dirs.so*"` ; \
142 cp -pRf $$file $(XORG_LIBX) ; \
144 (cd $(TARGET_DIR)/usr/lib; ln -snf $(TARGET_LIBX) X11)
145 touch $(TARGET_DIR)/etc/ld.so.conf
146 if [ "`grep -c '$(TARGET_LIBX)' $(TARGET_DIR)/etc/ld.so.conf`" = "0" ] ; then \
147 echo "$(TARGET_LIBX)" >> $(TARGET_DIR)/etc/ld.so.conf; \
149 touch -c $(XORG_LIBX)/libX11.so.6.2
152 xorg: zlib png $(STAGING_DIR)$(TARGET_LIBX)/libX11.so.6.2 $(XORG_LIBX)/libX11.so.6.2
154 xorg-source: $(DL_DIR)/$(XORG_SOURCE)
157 -rm -rf $(TARGET_DIR)/usr/X11R6
158 -$(MAKE) -C $(XORG_DIR) clean
162 -rm -rf $(TARGET_DIR)/usr/X11R6
164 #############################################################
166 # Toplevel Makefile options
168 #############################################################