OpenWrt Forum Archive

Topic: compile rxtx for java

The content of this topic has been archived on 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi
I saw there is a JavaVM (SableVM) available for OpenWRT
I wonder if someone has ported RxTx package for OpenWrt
(http://users.frii.com/jarvi/rxtx/)
(RxTx is a Java to serial / parallel port api compatible with Sun CommAPI)

I'm not an expert programmer and I was not able to compile RxTx package following
the instruction on ipkg creation for OpenWrt (available in the documentation)

Any help?

Ciao
Marco

Here it is my advancement
- these are my conf files
  Config.in -------------------------------------------------------------------- :
  config BR2_PACKAGE_RXTX
        prompt "rxtx api to access serial/parallel port from JAVA"
        tristate
        default m if CONFIG_DEVEL
        help
            rxtx api to access serial/parallel port from JAVA
            look at http://users.frii.com/jarvi/rxtx/ for further info

  Makefile ---------------------------------------------------------------------- :
include $(TOPDIR)/rules.mk
PKG_NAME:=rxtx
PKG_VERSION:=2.1-7r2
PKG_RELEASE:=1
PKG_MD5SUM:=
PKG_SOURCE_URL:=ftp://ftp.qbang.org/pub/rxtx/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(TOPDIR)/package/rules.mk
$(eval $(call PKG_template,RXTX,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
        (cd $(PKG_BUILD_DIR); \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS)" \
                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
                LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
                ./configure \
                        --target=$(GNU_TARGET_NAME) \
                        --host=$(GNU_TARGET_NAME) \
                        --build=$(GNU_HOST_NAME) \
                        --prefix=/usr \
                        --without-libiconv-prefix \
                        --without-libintl-prefix \
                        --disable-nls \
        );
        ## Add software specific configurable options above
        ## See : ./configure --help
        touch $@
$(PKG_BUILD_DIR)/.built:
        rm -rf $(PKG_INSTALL_DIR)
        mkdir -p $(PKG_INSTALL_DIR)/usr/bin
        $(MAKE) -C $(PKG_BUILD_DIR)/src \
                $(TARGET_CONFIGURE_OPTS) \
                prefix="$(PKG_INSTALL_DIR)/usr"
        $(CP) $(PKG_BUILD_DIR)/src/rxtx $(PKG_INSTALL_DIR)/usr/bin
        touch $@
$(IPKG_RXTX):
        install -d -m0755 $(IDIR_RXTX)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/rxtx $(IDIR_RXTX)/usr/bin
        $(RSTRIP) $(IDIR_RXTX)
        $(IPKG_BUILD) $(IDIR_RXTX) $(PACKAGE_DIR)
mostlyclean:
        make -C $(PKG_BUILD_DIR) clean
        rm $(PKG_BUILD_DIR)/.built


- rxtx.control -------------------------------------------------------
Package: rxtx
Priority: optional
Section: misc
Description: RxTx Java Utility
 
- Unfortunately my 'inexperience' with programming and makefile related issue had forced me to
  download and repackage rxtx original zip pack to tar.gz format and put the tar.gz in the 'dl' directory
  to complete the compilation process


-------------------------------------------

Final result:

.......
make[2]: Entering directory `/home/marco/OpenWrt-SDK-Linux-i686-1/build_mipsel/rxtx-2.1-7r2/src'
make[2]: *** No targets specified and no makefile found.  Stop.
make[2]: Leaving directory `/home/marco/OpenWrt-SDK-Linux-i686-1/build_mipsel/rxtx-2.1-7r2/src'
make[1]: *** [/home/marco/OpenWrt-SDK-Linux-i686-1/build_mipsel/rxtx-2.1-7r2/.built] Error 2
make[1]: Leaving directory `/home/marco/OpenWrt-SDK-Linux-i686-1/package/rxtx'
make: *** [rxtx-compile] Error 2

No more advance since now

Any help?

Ciao
Marco

OK,
Finally I was able to create an (almost) complete directory with Makefile and patches to compile RXTX using Openwrt SDK

Unfortunately I was not able to make it run succesfully using Whiterussian v0.9 and sablevm already present in the repository (segmentation fault error in sablevm)

I think I need also to do some settings to point to correct classpath before compile RxTx in the Makefile .... but I'm not sure

I used SUN JDK 1.5 to compile it

You can find my work here
http://www.java-system.com/openwrt/rxtx-2.1-7r2.tar.gz
and I hope someone can check it and maybe give it a try with JamVM

Ciao
Marco

Someone managed to port the RXTX OpenWRT (MIPS)?

The discussion might have continued from here.