Skip to main content

Solaris x86 build with Sun Studio?

1 reply [Last post]
Anonymous

Hi,

Does anyone know the availability of CLDC/MIDP-2.0 on Solaris x86? Or
any plan on offering that?

Since I cannot find it, I tried to built the CLDC/MIDP 2.0 on Solaris
x86 with Sun Studio. The first step I take is to build PCSL, and the
result is attached patch file.

Now the built is successful, I was wondering if there is a test suite to
test the library?

Cheers,
Henry

[pcsl_solaris.diff]
---------------------------------------------------------------------
To unsubscribe, e-mail: feature-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: feature-help@phoneme.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Danila Sinopalnikov

Hi Henry,

there is a donuts test suite for PCSL library.
To build it, run 'gmake donuts'.
It will produce a binary $PCSL_OUTPUT_DIR/bin/donuts.
Run this binary to test the lib.

Thanks,
Danila

Henry Jen wrote:
> Hi,
>
> Does anyone know the availability of CLDC/MIDP-2.0 on Solaris x86? Or
> any plan on offering that?
>
> Since I cannot find it, I tried to built the CLDC/MIDP 2.0 on Solaris
> x86 with Sun Studio. The first step I take is to build PCSL, and the
> result is attached patch file.
>
> Now the built is successful, I was wondering if there is a test suite to
> test the library?
>
> Cheers,
> Henry
>
> ------------------------------------------------------------------------
>
> Index: makefiles/share/sun.gmk
> ===================================================================
> --- makefiles/share/sun.gmk (revision 0)
> +++ makefiles/share/sun.gmk (revision 0)
> @@ -0,0 +1,54 @@
> +#
> +#
> +#
> +# Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
> +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License version
> +# 2 only, as published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# General Public License version 2 for more details (a copy is
> +# included at /legal/license.txt).
> +#
> +# You should have received a copy of the GNU General Public License
> +# version 2 along with this work; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> +# 02110-1301 USA
> +#
> +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
> +# Clara, CA 95054 or visit www.sun.com if you need additional
> +# information or have any questions.
> +#
> +######################################################################
> +#
> +# compiler specific designs
> +#
> +######################################################################
> +
> +CC=cc
> +AR=ar -r
> +CPP=CC
> +LD=ld
> +
> +CC_OUTPUT=-o
> +AR_OUTPUT=
> +LD_OUTPUT=-o
> +
> +LIB_EXT=.a
> +
> +CFLAGS=-c
> +
> +ifeq ($(USE_DEBUG), true)
> +CFLAGS+=-g
> +else
> +CFLAGS+=-xO3
> +endif
> +
> +LD_FLAGS=
> +ifeq ($(USE_GCOV), true)
> +LD_FLAGS += -lgcov
> +endif
> Index: makefiles/share/solaris.gmk
> ===================================================================
> --- makefiles/share/solaris.gmk (revision 0)
> +++ makefiles/share/solaris.gmk (revision 0)
> @@ -0,0 +1,35 @@
> +#
> +#
> +#
> +# Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
> +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License version
> +# 2 only, as published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# General Public License version 2 for more details (a copy is
> +# included at /legal/license.txt).
> +#
> +# You should have received a copy of the GNU General Public License
> +# version 2 along with this work; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> +# 02110-1301 USA
> +#
> +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
> +# Clara, CA 95054 or visit www.sun.com if you need additional
> +# information or have any questions.
> +#
> +######################################################################
> +#
> +# Makefile for building and packaging.
> +#
> +######################################################################
> +
> +EXE=
> +LIBS=
> +
> +CFLAGS+=-DSOLARIS
> Index: makefiles/platforms/solaris_i386_sun.gmk
> ===================================================================
> --- makefiles/platforms/solaris_i386_sun.gmk (revision 0)
> +++ makefiles/platforms/solaris_i386_sun.gmk (revision 0)
> @@ -0,0 +1,42 @@
> +#
> +#
> +#
> +# Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
> +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License version
> +# 2 only, as published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# General Public License version 2 for more details (a copy is
> +# included at /legal/license.txt).
> +#
> +# You should have received a copy of the GNU General Public License
> +# version 2 along with this work; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> +# 02110-1301 USA
> +#
> +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
> +# Clara, CA 95054 or visit www.sun.com if you need additional
> +# information or have any questions.
> +#
> +######################################################################
> +#
> +# To be included for linux_i386_gcc platforms
> +#
> +######################################################################
> +
> +PCSL_OS=solaris
> +PCSL_CPU=i386
> +
> +# define chunk memory implementation and src directory
> +PCSL_CHUNKMEM_IMPL=pcsl_chunkmmap_linux
> +PCSL_CHUNKMEM_DIR=$(PCSL_DIR)/memory/malloc
> +
> +include $(PCSL_DIR)/makefiles/share/sun.gmk
> +include $(PCSL_DIR)/makefiles/share/solaris.gmk
> +
> +# CFLAGS+=-DBSD_COMP
> Index: types/solaris_i386_sun/java_types_md.h
> ===================================================================
> --- types/solaris_i386_sun/java_types_md.h (revision 0)
> +++ types/solaris_i386_sun/java_types_md.h (revision 0)
> @@ -0,0 +1,57 @@
> +/*
> + *
> + *
> + * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
> + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License version
> + * 2 only, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * General Public License version 2 for more details (a copy is
> + * included at /legal/license.txt).
> + *
> + * You should have received a copy of the GNU General Public License
> + * version 2 along with this work; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA
> + *
> + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
> + * Clara, CA 95054 or visit www.sun.com if you need additional
> + * information or have any questions.
> + */
> +
> +/**
> + * @file
> + * @ingroup types
> + * @brief Basic types for linux_i386_gcc configuration
> + */
> +
> +#if !defined _JAVA_TYPES_H_
> +# error "Never include directly; use instead."
> +#endif
> +
> +#ifndef _JAVA_TYPES_MD_H_
> +#define _JAVA_TYPES_MD_H_
> +
> +#ifndef _JAVASOFT_JNI_H_
> +/** Byte parameter type. */
> +typedef signed char jbyte;
> +
> +/** Char paramater type. */
> +typedef unsigned short jchar;
> +
> +/** Integer parameter type. */
> +typedef int jint;
> +
> +/** Long parameter type. */
> +typedef long long jlong;
> +#endif /* _JAVASOFT_JNI_H_ */
> +
> +/** Platform-specific type specifier for 64-bit integer */
> +#define PCSL_LLD "%lld"
> +
> +#endif /* !_JAVA_TYPES_MD_H_ */
> Index: network/bsd/pcsl_socket.c
> ===================================================================
> --- network/bsd/pcsl_socket.c (revision 2298)
> +++ network/bsd/pcsl_socket.c (working copy)
> @@ -43,6 +43,11 @@
> #include
> #include
> #include
> +
> +#ifdef SOLARIS
> +#include
> +#endif
> +
> #include
> #include
> #include
> Index: network/bsd/pcsl_network.c
> ===================================================================
> --- network/bsd/pcsl_network.c (revision 2298)
> +++ network/bsd/pcsl_network.c (working copy)
> @@ -43,6 +43,11 @@
> #include
> #include
> #include
> +
> +#ifdef SOLARIS
> +#include
> +#endif
> +
> #include
> #include
> #include
> @@ -298,11 +303,59 @@
> /**
> * See pcsl_network.h for definition.
> */
> +#ifdef SOLARIS
> int pcsl_network_getLocalIPAddressAsString(
> char *pLocalIPAddress)
> {
> int sfd;
> int i;
> + struct lifnum ifnum;
> + struct lifconf ifconf;
> + struct lifreq *ifr;
> + struct sockaddr_in *sin;
> +
> + if ((sfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
> + lastError = errno;
> + return PCSL_NET_IOERROR;
> + }
> +
> + /* use AF_INET for IPv4 only, switch to AF_UNSPEC to enable IPv6 */
> + ifnum.lifn_family = AF_INET;
> + ifnum.lifn_flags = 0;
> + if (ioctl(sfd, SIOCGLIFNUM, &ifnum) != 0) {
> + lastError = errno;
> + return PCSL_NET_IOERROR;
> + }
> +
> + memset(&ifconf, 0, sizeof(ifconf));
> +
> + ifconf.lifc_family = AF_INET;
> + ifconf.lifc_len = sizeof(struct lifreq) * ifnum.lifn_count;
> + ifconf.lifc_buf = calloc(ifnum.lifn_count, sizeof(struct lifreq));
> +
> + if (ioctl(sfd, SIOCGLIFCONF, &ifconf) != 0) {
> + lastError = errno;
> + return PCSL_NET_IOERROR;
> + }
> +
> + for (i = 0; i < ifnum.lifn_count; i++) {
> + ifr = ifconf.lifc_req + i;
> + sin = (struct sockaddr_in *)&ifr->lifr_addr;
> + if (strcmp("lo0", ifr->lifr_name)) {
> + strcpy(pLocalIPAddress, inet_ntoa(sin->sin_addr));
> + break;
> + }
> + }
> +
> + free(ifconf.lifc_buf);
> + return PCSL_NET_SUCCESS;
> +}
> +#else
> +int pcsl_network_getLocalIPAddressAsString(
> + char *pLocalIPAddress)
> +{
> + int sfd;
> + int i;
> struct ifreq ifr;
> struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr;
>
> @@ -325,6 +378,7 @@
>
> return PCSL_NET_SUCCESS;
> }
> +#endif
>
> /**
> * See pcsl_network.h for definition.
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: feature-unsubscribe@phoneme.dev.java.net
> For additional commands, e-mail: feature-help@phoneme.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: feature-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: feature-help@phoneme.dev.java.net