Makefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:= openjdk
  5. PKG_VERSION:= 6
  6. PKG_EXTRAVER:= b22-28_feb_2011
  7. PKG_RELEASE:= 2
  8. PKG_MD5SUM:= 2d2bbbb0f9b81f1fec41ec730da8a933 \
  9. fd3f35e8a8a2ef9a64c035ed66cea06d \
  10. ef7a8b3624ea904bf584bc46d79b5e75 \
  11. bc95c133620bd68c161cac9891592901 \
  12. 91adfd41e6f001add4f92ae31216b1e3 \
  13. d526d0848c88607ce4e3a0a4edb75d50
  14. PKG_DESCR:= OpenJDK Java VM
  15. PKG_SECTION:= lang
  16. PKG_BUILDDEP:= alsa-lib xproto jpeg zlib giflib libpng freetype cups
  17. PKG_BUILDDEP+= libX11 libXt libXp libXinerama libXrender libXtst libiconv
  18. PKG_DEPENDS:= zlib libstdcxx libffi libpthread libxtst libxi
  19. PKG_URL:= http://openjdk.org/
  20. PKG_SITES:= http://download.java.net/openjdk/jdk6/promoted/b22/ \
  21. http://mirror.netcologne.de/apache.org/xml/xalan-j/binaries/ \
  22. http://icedtea.classpath.org/download/drops/ \
  23. http://icedtea.classpath.org/download/source/
  24. PKG_HOST_DEPENDS:= !darwin !cygwin !openbsd !netbsd !freebsd
  25. PKG_ARCH_DEPENDS:= arm mips x86 x86_64
  26. PKG_SYSTEM_DEPENDS:= !lemote-yeelong !linksys-ag241 !fon-fon2100 !broadcom-bcm47xx
  27. # autotools infrastructure for OpenJDK
  28. ICEDTEA_NAME:= icedtea6
  29. ICEDTEA_VERSION:= 1.10
  30. # bootstrap JARs
  31. XALAN_NAME= xalan-j
  32. XALAN_VERSION= 2_7_0
  33. # override generic extraction
  34. EXTRACT_OVERRIDE:= 1
  35. DISTFILES:= $(PKG_NAME)-$(PKG_VERSION)-src-$(PKG_EXTRAVER).tar.gz \
  36. $(ICEDTEA_NAME)-$(ICEDTEA_VERSION).tar.gz \
  37. jaxp144_01.zip \
  38. jdk6-jaf-b20.zip \
  39. jdk6-jaxws-b20.zip \
  40. ${XALAN_NAME}_${XALAN_VERSION}-bin.tar.gz
  41. WRKDIST= ${WRKDIR}
  42. WRKSRC= ${WRKDIST}/${ICEDTEA_NAME}-${ICEDTEA_VERSION}
  43. PKG_SUBPKGS:= OPENJDK
  44. PKG_CHOICES_OPENJDK:= ZERO SHARK CACAO
  45. PKGCD_ZERO:= zero-assembly backend
  46. PKGCD_SHARK:= Shark JIT backend (needs eglibc/glibc)
  47. PKGCB_SHARK:= llvm
  48. PKGCD_CACAO:= Cacao JIT backend
  49. include $(TOPDIR)/mk/package.mk
  50. $(eval $(call PKG_template,OPENJDK,openjdk,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  51. # segfaults with march=pentium-m/atom
  52. TARGET_CFLAGS:= $(subst march=pentium-m,march=i686,$(TARGET_CFLAGS))
  53. TARGET_CFLAGS:= $(subst march=atom,march=i686,$(TARGET_CFLAGS))
  54. TARGET_CFLAGS:= $(filter-out -fhonour-copts,$(TARGET_CFLAGS))
  55. BOOTSTRAPJDK:= ${STAGING_JAVA_HOST_DIR}/bootstrap-jdk
  56. ifeq ($(ADK_PACKAGE_OPENJDK_ZERO),y)
  57. CONFIGURE_BACKEND:= --enable-zero
  58. endif
  59. ifeq ($(ADK_PACKAGE_OPENJDK_SHARK),y)
  60. CONFIGURE_BACKEND:= --enable-shark \
  61. --with-llvm-config=$(STAGING_TARGET_DIR)/usr/bin/llvm-config
  62. endif
  63. ifeq ($(ADK_PACKAGE_OPENJDK_CACAO),y)
  64. CONFIGURE_BACKEND:= --enable-cacao
  65. endif
  66. CONFIGURE_COMMON:= --disable-docs \
  67. --enable-openjdk-cross-compilation \
  68. --with-openjdk-src-dir=$(WRKDIST)/$(PKG_NAME)-$(PKG_VERSION) \
  69. --with-xalan2-jar=${WRKDIST}/${XALAN_NAME}_${XALAN_VERSION}/xalan.jar \
  70. --with-xalan2-serializer-jar=${WRKDIST}/${XALAN_NAME}_${XALAN_VERSION}/serializer.jar \
  71. --with-xerces2-jar=${WRKDIST}/${XALAN_NAME}_${XALAN_VERSION}/xercesImpl.jar \
  72. --with-jdk-home=$(BOOTSTRAPJDK) \
  73. --with-java=$(BOOTSTRAPJDK)/bin/java \
  74. --with-javac=$(BOOTSTRAPJDK)/bin/javac \
  75. --with-javah=$(BOOTSTRAPJDK)/bin/javah \
  76. --with-jar=$(BOOTSTRAPJDK)/bin/jar \
  77. --with-rmic=$(BOOTSTRAPJDK)/bin/rmic \
  78. --with-native2ascii=$(BOOTSTRAPJDK)/bin/native2ascii \
  79. --with-gcj=$(STAGING_JAVA_HOST_DIR)/usr/bin/gcj \
  80. --without-rhino
  81. CONFIGURE_ARGS+= $(CONFIGURE_BACKEND)
  82. CONFIGURE_ARGS+= $(CONFIGURE_COMMON)
  83. CONFIGURE_ARGS+= --disable-bootstrap
  84. CONFIGURE_ENV+= PATH=$(STAGING_JAVA_HOST_DIR)/usr/bin:$${PATH}:${STAGING_TARGET_DIR}/usr/bin
  85. MAKE_ENV+= ALT_COMPILER_PATH=$(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME) \
  86. ADK_ECJ=$(STAGING_JAVA_HOST_DIR)/usr/bin/ecj \
  87. PATH=$(STAGING_JAVA_HOST_DIR)/usr/bin:$${PATH}:${STAGING_TARGET_DIR}/usr/bin \
  88. OTHER_CFLAGS='$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)' \
  89. OTHER_CXXFLAGS='$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)' \
  90. GCC_HONOUR_COPTS=s CROSS_COMPILE_ARCH=$(ARCH)
  91. ALL_TARGET:= icedtea
  92. # add include path for Xrender.h from staging directory
  93. post-patch:
  94. ifeq ($(QEMU),)
  95. $(error Fatal error: $$QEMU not set!)
  96. endif
  97. $(SED) "s#@ADK_TARGETDIR@#$(STAGING_TARGET_DIR)#" ${WRKDIST}/$(PKG_NAME)-$(PKG_VERSION)/jdk/make/sun/xawt/Makefile
  98. $(SED) "s#OTHER_CXXFLAGS#CXXFLAGS_COMMON#" ${WRKDIST}/$(PKG_NAME)-$(PKG_VERSION)/jdk/make/com/sun/java/pack/Makefile
  99. do-extract:
  100. cd ${WRKDIST}; mkdir $(PKG_NAME)-$(PKG_VERSION); \
  101. tar xzf $(TOPDIR)/dl/$(PKG_NAME)-$(PKG_VERSION)-src-$(PKG_EXTRAVER).tar.gz -C $(PKG_NAME)-$(PKG_VERSION)
  102. cd $(WRKDIST); tar xzf $(TOPDIR)/dl/$(ICEDTEA_NAME)-$(ICEDTEA_VERSION).tar.gz
  103. cd ${WRKDIST}; tar xzf ${TOPDIR}/dl/${XALAN_NAME}_${XALAN_VERSION}-bin.tar.gz
  104. mkdir -p ${WRKBUILD}/drops
  105. cd ${TOPDIR}/dl; cp jaxp144_01.zip jdk6-jaf-b20.zip jdk6-jaxws-b20.zip ${WRKBUILD}/drops
  106. pre-configure:
  107. cd ${WRKBUILD}; rm -rf config.{cache,status}; \
  108. export $(MAKE_ENV); ./configure \
  109. ${CONFIGURE_TRIPLE} \
  110. $(CONFIGURE_BACKEND) \
  111. --prefix=/usr \
  112. --bindir=/usr/bin \
  113. --datadir=/usr/share \
  114. --mandir=/usr/share/man \
  115. --libexecdir=/usr/libexec \
  116. --localstatedir=/var \
  117. --sysconfdir=/etc \
  118. --enable-bootstrap \
  119. $(CONFIGURE_COMMON) ;\
  120. env ${MAKE_ENV} $(MAKE) icedtea-ecj
  121. # fixup symlinks to bootstrap jdk
  122. ln -sf $(BOOTSTRAPJDK)/bin/java $(WRKBUILD)/openjdk.build-ecj/j2sdk-image/bin/java
  123. ln -sf $(BOOTSTRAPJDK)/bin/javac $(WRKBUILD)/openjdk.build-ecj/j2sdk-image/bin/javac
  124. ln -sf $(BOOTSTRAPJDK)/bin/javah $(WRKBUILD)/openjdk.build-ecj/j2sdk-image/bin/javah
  125. ln -sf $(BOOTSTRAPJDK)/bin/jar $(WRKBUILD)/openjdk.build-ecj/j2sdk-image/bin/jar
  126. openjdk-install:
  127. $(INSTALL_DIR) $(IDIR_OPENJDK)/usr
  128. $(CP) $(WRKBUILD)/openjdk.build/j2re-image/* $(IDIR_OPENJDK)/usr
  129. rm -rf $(IDIR_OPENJDK)/usr/man
  130. include ${TOPDIR}/mk/pkg-bottom.mk