2
1

tinyx.mk 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #############################################################
  2. #
  3. # tinyx - a small footprint X-server for the TuxScreen
  4. #
  5. #############################################################
  6. # Copyright (C) 2002 by Tom Walsh <Tom@OpenHardware.net>
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU Library General Public License as
  10. # published by the Free Software Foundation; either version 2 of the
  11. # License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. # Library General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Library General Public
  19. # License along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. # USA
  22. #
  23. ifneq ($(strip $(BR2_PACKAGE_XORG)),y)
  24. ifeq ($(strip $(BR2_PACKAGE_TINYX)),y)
  25. ifeq ($(strip $(BR2_PACKAGE_TINYX_OLD)),y)
  26. #############################################################
  27. # You may want to change these.
  28. #############################################################
  29. TINYX_APPS:=xlsfonts/xlsfonts xmodmap/xmodmap
  30. #xset/xset xdpyinfo/xdpyinfo xsetroot/xsetroot \
  31. # xrdb/xrdb xrandr/xrandr \
  32. # xhost/xhost xauth/xauth oclock/oclock xeyes/xeyes
  33. #
  34. TINYX_LIBS:=ICE X11 Xext Xpm
  35. # Xaw SM Xt Xmu
  36. #############################################################
  37. # Stuff below this line shouldn't need changes.
  38. # if you do change, look in rxvt & matchbox for the impact!
  39. #############################################################
  40. #
  41. # Where resources are found.
  42. #
  43. TINYX_VERSION:=011010
  44. TINYX_DIR:=$(BUILD_DIR)/xc-$(TINYX_VERSION)
  45. TINYX_LDIR:=$(TINYX_DIR)/lib
  46. TINYX_PROGS:=$(TINYX_DIR)/programs
  47. TINYX_SOURCE:=xc-$(TINYX_VERSION).tar.bz2
  48. TINYX_SITE:= http://intimate.handhelds.org/jacques/
  49. TINYX_CF:=$(TINYX_DIR)/config/cf
  50. #
  51. # Some things that you may want to change.
  52. TINYX_XFBDEV:=$(TINYX_DIR)/programs/Xserver/Xfbdev
  53. TINYX_CAT:=$(BZCAT)
  54. TINYX_BINX:=$(TARGET_DIR)/usr/X11R6/bin/
  55. TINYX_LIBX:=$(TARGET_DIR)/usr/lib/
  56. #
  57. # These rules fetch various tinyx source files.
  58. #
  59. $(DL_DIR)/$(TINYX_SOURCE):
  60. $(WGET) -P $(DL_DIR) $(TINYX_SITE)/$(TINYX_SOURCE)
  61. #
  62. # rule to make sure that we have the source, and it is configured.
  63. #
  64. $(TINYX_DIR)/.configure: $(DL_DIR)/$(TINYX_SOURCE)
  65. $(TINYX_CAT) $(DL_DIR)/$(TINYX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  66. toolchain/patch-kernel.sh $(TINYX_DIR) package/tinyx/ tinyx\*.patch
  67. $(SED) 's:REPLACE_STAGING_DIR:$(STAGING_DIR):g' $(TINYX_CF)/cross.def
  68. $(SED) 's:REPLACE_ARCH:$(ARCH):g' $(TINYX_CF)/cross.def
  69. $(SED) 's:#define CcCmd.*:#define CcCmd $(TARGET_CROSS)gcc:g' $(TINYX_CF)/cross.def
  70. $(SED) 's:#define RanlibCmd.*:#define RanlibCmd $(TARGET_CROSS)ranlib:g' $(TINYX_CF)/cross.def
  71. $(SED) 's:#define LdCmd.*:#define LdCmd $(TARGET_CROSS)ld:g' $(TINYX_CF)/cross.def
  72. touch $(TINYX_DIR)/.configure
  73. #
  74. # Now that we have the source, build it...
  75. #
  76. $(TINYX_XFBDEV): $(TINYX_DIR)/.configure
  77. rm -f $(TINYX_BINX)/Xfbdev
  78. #make World CROSSCOMPILEFLAGS="CROSSCOMPILEDIR=<cross compiler dir>"
  79. #( cd $(TINYX_DIR); $(MAKE) World CROSSCOMPILEFLAGS="CROSSCOMPILEDIR=$(STAGING_DIR)/bin" )
  80. #( cd $(TINYX_DIR); $(MAKE) $(TARGET_CONFIGURE_OPTS) World )
  81. #
  82. #mv $(TINYX_DIR)/Makefile $(TINYX_DIR)/Makefile.xxxx
  83. #echo "AS=$(TARGET_CROSS)as" > $(TINYX_DIR)/Makefile
  84. #echo "LD=$(TARGET_CROSS)ld" >> $(TINYX_DIR)/Makefile
  85. #echo "NM=$(TARGET_CROSS)nm" >> $(TINYX_DIR)/Makefile
  86. #echo "CC=$(TARGET_CROSS)gcc" >> $(TINYX_DIR)/Makefile
  87. #echo "GCC=$(TARGET_CROSS)gcc" >> $(TINYX_DIR)/Makefile
  88. #echo "CXX=$(TARGET_CROSS)g++" >> $(TINYX_DIR)/Makefile
  89. #echo "RANLIB=$(TARGET_CROSS)ranlib" >> $(TINYX_DIR)/Makefile
  90. #echo "OBJCOPY=$(TARGET_CROSS)objcopy" >> $(TINYX_DIR)/Makefile
  91. #cat $(TINYX_DIR)/Makefile.xxxx >> $(TINYX_DIR)/Makefile
  92. ( cd $(TINYX_DIR); $(MAKE) $(TARGET_CONFIGURE_OPTS) World )
  93. #
  94. # Install x-includes and x-libraries in $(STAGING_DIR)/usr/X11R6/
  95. # and add a symbolic link between /usr/bin/X11 and /usr/X11R6/bin
  96. $(STAGING_DIR)/usr/X11R6/lib/libX11.so.6.2: $(TINYX_XFBDEV)
  97. mkdir -p $(STAGING_DIR)/usr/X11R6/lib
  98. mkdir -p $(STAGING_DIR)/usr/X11R6/include
  99. cp -fRL $(TINYX_DIR)/exports/include/* $(STAGING_DIR)/usr/X11R6/include/
  100. cp -fRL $(TINYX_DIR)/exports/lib/* $(STAGING_DIR)/usr/X11R6/lib/
  101. ln -s /usr/X11R6/bin $(TARGET_DIR)/usr/bin/X11
  102. #
  103. # Once Frame Buffer is built, we install executables.
  104. $(TINYX_BINX)/Xfbdev: $(TINYX_XFBDEV)
  105. -mkdir $(TARGET_DIR)/usr/X11R6
  106. -mkdir $(TINYX_BINX)
  107. for file in $(TINYX_APPS); do \
  108. cp -f $(TINYX_DIR)/programs/$$file $(TINYX_BINX); \
  109. $(STRIPCMD) $(TINYX_PROGS)/$$file; \
  110. done
  111. cp $(TINYX_DIR)/programs/Xserver/Xfbdev $(TINYX_BINX)
  112. $(STRIPCMD) $(TINYX_BINX)/Xfbdev
  113. cp -f $(TINYX_DIR)/startx $(TARGET_DIR)/bin
  114. chmod a+x $(TARGET_DIR)/bin/startx
  115. #
  116. # After we have executables installed, install the libraries.
  117. $(TINYX_LIBX)/libX11.so.6.2: $(TINYX_XFBDEV)
  118. for dirs in $(TINYX_LIBS); do \
  119. file=`find $(TINYX_LDIR)/$$dirs -type f -iname "lib$$dirs.so*"`; \
  120. $(STRIPCMD) --strip-unneeded $$file; \
  121. cp -f $$file $(TINYX_LIBX); \
  122. file=`find $(TINYX_LDIR)/$$dirs -type l -iname "lib$$dirs.so*"`; \
  123. cp -pRf $$file $(TINYX_LIBX); \
  124. done
  125. tinyx: zlib $(STAGING_DIR)/usr/X11R6/lib/libX11.so.6.2 \
  126. $(TINYX_LIBX)/libX11.so.6.2 $(TINYX_BINX)/Xfbdev
  127. tinyx-source: $(DL_DIR)/$(TINYX_SOURCE)
  128. tinyx-clean:
  129. -rm -rf $(TARGET_DIR)/usr/X11R6
  130. -$(MAKE) -C $(TINYX_DIR) clean
  131. tinyx-dirclean:
  132. -rm -rf $(TINYX_DIR)
  133. -rm -rf $(TARGET_DIR)/usr/X11R6
  134. #############################################################
  135. #
  136. # Toplevel Makefile options
  137. #
  138. #############################################################
  139. TARGETS+=tinyx
  140. endif
  141. endif
  142. endif