Find file
Fetching contributors…
Cannot retrieve contributors at this time
903 lines (834 sloc) 26.9 KB
#-------------------------------------------------------------------------
# rxtx is a native interface to serial ports in java.
# Copyright 1997-2005 by Trent Jarvi taj@www.linux.org.uk.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library 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
# Lesser General Public License for more details.
#
# The following has been added to allow RXTX to be distributed with Sun
# Microsystem's CommAPI library as suggested by the FSF.
#
# http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
#
# A program that contains no derivative of any portion of RXTX, but
# is designed to work with RXTX by being compiled or linked with it,
# is considered a "work that uses the Library" subject to the terms and
# conditions of the GNU Lesser General Public License.
#
# As a special exception, the copyright holders of RXTX give you
# permission to link RXTX with independent modules that communicate with
# RXTX solely through the Sun Microsytems CommAPI interface, regardless of
# the license terms of these independent modules, and to copy and distribute
# the resulting combined work under terms of your choice, provided that
# every copy of the combined work is accompanied by a complete copy of
# the source code of RXTX (the version of RXTX used to produce the
# combined work), being distributed under the terms of the GNU Lesser General
# Public License plus this exception. An independent module is a
# module which is not derived from or based on RXTX.
#
# Note that people who make modified versions of RXTX are not obligated
# to grant this special exception for their modified versions; it is
# their choice whether to do so. The GNU Lesser General Public License
# gives permission to release a modified version without this exception; this
# exception also makes it possible to release a modified version which
# carries forward this exception.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#-------------------------------------------------------------------------
AC_INIT(src/SerialImp.c)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
AC_MSG_WARN(Trying libtool. If the following fails install libtool)
AC_PROG_CC
# Comment these two lines out when compiling on SCO
AC_DISABLE_STATIC
AM_PROG_LIBTOOL
# end of SCO fixes
AM_INIT_AUTOMAKE(Serial,2.0.7)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(sys/fcntl.h)
AC_CHECK_HEADERS(sys/file.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(sys/signal.h)
AC_CHECK_HEADERS(signal.h)
AC_CHECK_HEADERS(termios.h)
AC_CHECK_HEADERS(asm/termbits.h)
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(pwd.h)
AC_PROG_GCC_TRADITIONAL
AC_SUBST(WINDOWS_JAVA_INCLUDE)
AC_SUBST(JAVAINCLUDEDIR)
AC_SUBST(JAVAINCLUDE)
AC_SUBST(JAVANATINC)
AC_SUBST(CLASSPATH)
AC_SUBST(TOP)
AC_SUBST(TARGETLIB)
AC_SUBST(LDFLAG)
AC_SUBST(CFLAGS)
AC_SUBST(THREAD_FLAG)
AC_SUBST(OS_NAME)
AC_SUBST(OS_ARCH)
AC_SUBST(OS_VERSION)
AC_SUBST(JAVA_VERSION)
AC_SUBST(JAVA_VENDOR)
AC_SUBST(JAVA_HOME)
AC_SUBST(JAVA_LIBRARY_PATH)
AC_SUBST(JAVA_CLASS_PATH)
AC_SUBST(JAVA_CLASS_VERSION)
AC_SUBST(JAVAH_FIX)
AC_SUBST(JPATH)
AC_SUBST(JHOME)
AC_SUBST(RXTX_PATH)
AC_SUBST(JAVAH)
AC_SUBST(JAVAC)
AC_SUBST(JAR)
AC_SUBST(JAVADOC)
AC_SUBST(EXTENSION)
AC_SUBST(LIBTOOL_FIX)
AC_SUBST(LDFLAGS)
AC_SUBST(LINK)
AC_SUBST(COMPILE)
AC_SUBST(OBJECT_EXTENSION)
AC_SUBST(LIB_EXTENSION)
AM_MAINTAINER_MODE
JHOME=
RXTX_PATH=
EXTENSION="c"
OBJECT_EXTENSION="lo"
LIB_EXTENSION="la"
COMPILE="cc "
TOP="`pwd`"
LINK="\$(TOP)/libtool --mode=link \$(CC) \$(CFLAGS) \$(LDFLAGS) -release \$(VERSION) -o librxtx\$*.la -rpath \$(RXTX_PATH)"
[case "$host_os" in
*-gnu)
CFLAGS=$CFLAGS" -D_POSIX_SOURCE";;
*);;
esac]
AC_ARG_ENABLE(PRINTER,
[ --enable-PRINTER PRINTER support (experimental) [default=yes]],
echo $enable_PRINTER,
enable_PRINTER="yes"
)
if test x$enable_PRINTER = xyes; then
TARGETLIB="\$(target_triplet)/librxtxSerial.la \
\$(target_triplet)/librxtxParallel.la"
else
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
fi
AC_ARG_ENABLE(lockfiles,
[ --disable-lockfiles disable lock files (experimental) [default=no]],
if test x$lockfiles = xyes; then
echo "Using lock files"
else
echo "Disabling lock files"
CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES"
fi
)
AC_ARG_ENABLE(lockfile_server,
[ --enable-lockfile_server Enable interaction with a lock file server [default=no]],
if test x$enable_lockfile_server = xyes; then
CFLAGS=$CFLAGS" -DLFS"
fi
)
AC_ARG_ENABLE(DEBUG,
[ --enable-DEBUG Print debugging info from SerialImp.c [default=no]],
if test x$enable_DEBUG = xyes; then
CFLAGS=$CFLAGS" -DDEBUG"
fi
)
find_java_native_include()
{
JAVANATINC="-I\$(JAVAINCLUDEDIR)/`cd $JAVAINCLUDEDIR; find . -name $1|sed s#$1##|head -n1`"
if [ test `cd $JAVAINCLUDEDIR; find . -name $1|wc -l` != "1" ]; then
echo 1>&2
echo WARNING: configure is having a hard time determining which 1>&2
echo directory contains the file $1. Edit Makefile and fix the 1>&2
echo variable JAVANATINC to point to the correct directory. 1>&2
echo 1>&2
echo The following options are available: 1>&2
find $JAVAINCLUDEDIR -name $1|sed s#jni_md\.h## 1>&2
echo 1>&2
echo If there are more than one option available the first was selected. 1>&2
echo 1>&2
fi
}
build_conftest()
{
cat > conftest.java << EOF
/* this may be usefull for getting around java cobwebs during build */
public class conftest
{
public static void main(String[[]] args)
{
System.out.println(System.getProperty(args[[0]]));
}
}
EOF
CLASSPATH=.:$CLASSPATH
if test x$JAVA_HOME = x; then
javac -classpath .:$CLASSPATH:`which java`../lib/comm.jar conftest.java
else
$JAVA_HOME/bin/javac -classpath .:$CLASSPATH:`which java`../lib/comm.jar conftest.java
fi
}
run_conftest()
{
echo $ECHO_N checking $1 " " 1>&6
if test x$JPATH = x; then
VAR=`java -classpath .:$CLASSPATH:\`which java\`../lib/comm.jar conftest $1`
else
VAR=`$JPATH/bin/java -classpath .:$CLASSPATH:\`which java\`../lib/comm.jar conftest $1`
fi
echo $VAR 1>&6
echo $VAR
return
}
build_conftest
if test x$JAVA_HOME = x; then
JPATH=`run_conftest java.home| sed s#\/jre\\$##g`
else
JPATH=$JAVA_HOME
echo $JAVA_HOME
AC_MSG_WARN(using JAVA_HOME environmental variable)
fi
if test x$JPATH = x; then
AC_MSG_ERROR([Make sure java is in your path before running configure])
fi
echo adjusted java.home is $JPATH
if test "$target_alias" = i386-mingw32 ;then
OS_NAME=WIN32
else
OS_NAME=`run_conftest os.name`
fi
OS_ARCH=`run_conftest os.arch`
#JAVA_CLASS_PATH=`run_conftest java.class.path`
#JAVA_LIBRARY_PATH=`run_conftest java.library.path`
JAVA_VENDOR=`run_conftest java.vendor`
JAVA_VERSION=`run_conftest java.version`
rm -f conftest.java
rm -f conftest.class
echo $ECHO_N checking os.version " " 1>&6
OS_VERSION=`uname -r`
echo $OS_VERSION 1>&6
fix_parameters()
{
echo fix_parameters
if [ grep "Driver=gnu.io.RXTXCommDriver" $1 > /dev/null ]; then
echo "javax.comm.properties appears to be installed"
else
echo "------------------------------------------------------" 1>&2
echo "RxTx requires the following information in" 1>&2
echo " $1:" 1>&2
echo 1>&2
echo "Driver=gnu.io.RXTXCommDriver" 1>&2
echo 1>&2
echo "The command configure will use to fix this is:" 1>&2
echo 1>&2
echo "echo \"Driver=gnu.io.RXTXCommDriver\" > $1" 1>&2
echo 1>&2
echo "------------------------------------------------------" 1>&2
echo $ECHO_N "Is it ok to place it there now? [[y/n]] "
read REPLY
if [ test "$REPLY" = "y" || test "$REPLY" = "Y" ];then 1>&2
echo "Driver=gnu.io.RXTXCommDriver" > $1; 1>&2
fi;
if [ test -w $1 ]; then
echo "javax.comm.properties installed."
else
echo "However, we don't have proper permissions, so please do it as root";
echo "*******************************************************************";
exit
fi;
fi;
}
check_prefix()
{
if test $prefix != "/usr";then
echo 1>&2
echo "WARNING: configure was not run with option --prefix=/usr" 1>&2
echo " Unless /usr/local/lib or the specified prefix is in" 1>&2
echo " the linkers path this will cause problems later on." 1>&2
echo 1>&2
fi
}
# an attempt to compile on libc5 linux machines
check_java_headers()
{
cat > conftest.c << EOF
#include <features.h>
int main(int argc, char *argv[])
{
#if defined (__GLIBC__)
printf("%i\n",__GLIBC__);
#else
printf("0\n");
#endif
exit(0);
}
EOF
cc conftest.c -o conftest
if [ test `./conftest` -lt 2 ];then
echo 1>&2
echo " WARNING: Older libc on linux detected. Patching a local copy of jni_md.h" 1>&2
echo 1>&2
ln -s `find $JAVAINCLUDEDIR -name jni.h` .
cp `find $JAVAINCLUDEDIR -name typedefs_md.h` .
# not pretty. could be cleaned up
patch << EOF
--- typedefs_md.h Tue Jan 11 14:17:08 2000
+++ typedefs_md.h.patchtaj Tue Jan 11 14:15:53 2000
@@ -17,9 +17,6 @@
*/
/* sbb: Johan Vos, why isn't this #ifndef inside the solaris header guard? */
-#ifndef BITSPERCHAR
-#define BITSPERCHAR 8
-#endif
#ifndef _SOLARIS_TYPES_MD_H_
#define _SOLARIS_TYPES_MD_H_
@@ -28,50 +25,19 @@
#include <sys/stat.h>
#include "bool.h"
-#if defined(__alpha__)
-typedef unsigned long ptr_int;
-#define PTR_IS_64 1
-#define LONG_IS_64 1
-#else
typedef unsigned int ptr_int;
#define PTR_IS_32 1
-#endif
/* don't redefine typedef's on Solaris 2.6 or Later */
-#if !defined(_ILP32) && !defined(_LP64)
-
-#ifndef _UINT64_T
-#define _UINT64_T
-#ifdef LONG_IS_64
-typedef unsigned long uint64_t;
-#else
typedef unsigned long long uint64_t;
-#endif
-#define _UINT32_T
typedef unsigned int uint32_t;
-#if defined(__linux__)
typedef unsigned int uint_t;
-#endif
-#endif
-#ifndef __BIT_TYPES_DEFINED__
-#ifdef (__i386__)
-/* that should get Linux, at least */
#ifndef _INT64_T
#define _INT64_T
-#ifdef LONG_IS_64
-typedef long int64_t;
-#else
typedef long long int64_t;
-#endif
-#define _INT32_T
-typedef int int32_t;
-#if defined(__linux__)
-typdef int int_t;
-#endif
-#endif
-#endif /* i386 */
+typedef int int_t;
#endif /* __BIT_TYPES_DEFINED__ */
#endif /* !defined(_ILP32) && !defined(_LP64) */
@@ -110,27 +76,15 @@
#endif
-/* On Intel these conversions have to be method calls and not typecasts.
- See the win32 typedefs_md.h file */
-#if ((defined(i386) || defined (__i386)) && defined(__solaris__)) || defined(__powerpc__)
-
-extern int32_t float2l(float f);
-extern int32_t double2l(double d);
-extern int64_t float2ll(float f);
-extern int64_t double2ll(double d);
-
-#else /* not solaris x386 or linux powerpc*/
-
#define float2l(f) (f)
#define double2l(f) (f)
#define float2ll(f) ((int64_t) (f))
#define double2ll(f) ((int64_t) (f))
-#endif /* i386 */
-
#define ll2float(a) ((float) (a))
#define ll2double(a) ((double) (a))
+#define double2ll(f) ((int64_t) (f))
/* comparison operators */
#define ll_ltz(ll) ((ll)<0)
@@ -148,13 +102,7 @@
extern void ll2str(int64_t a, char *s, char *limit);
-#if defined(ppc) || defined(__ppc__) || defined(__alpha__) || defined(__sparc__)
-#ifndef HAVE_ALIGNED_DOUBLES
+#if defined(ppc) || defined(__ppc__) || defined(__alpha__)
#define HAVE_ALIGNED_DOUBLES
-#endif
-#ifndef HAVE_ALIGNED_LONGLONGS
#define HAVE_ALIGNED_LONGLONGS
#endif
-#endif
-
-#endif /* !_SOLARIS_TYPES_MD_H_ */
EOF
fi
rm -f conftest.c
rm -f conftest
}
check_kernel_headers()
{
cat > conftest.c << EOF
#include <linux/version.h>
int main(int argc, char *argv[])
{
printf(UTS_RELEASE"\n");
exit(0);
}
EOF
cc conftest.c -o conftest
if [ test `uname -r` != `./conftest` ];then
echo 1>&2
echo " WARNING: Kernel include files do not match the current kernel" 1>&2
echo 1>&2
fi
rm -f conftest.c
rm -f conftest
}
fix_comm_jar()
{
# if ! test -f $1;then works on SCO I think I fixed this for Solaris
if [ test -f $1 ];then
echo "comm.jar appears to be installed already."
else
echo "------------------------------------------------------" 1>&2
echo "The JCL extension to RxTx requires comm.jar" 1>&2
echo "If you intend to use RxTx for commapi support comm.jar" 1>&2
echo "needs to be located in $1" 1>&2
echo 1>&2
echo "You can either quit configure and place the jar in the" 1>&2
echo "correct location or let this script do it." 1>&2
echo 1>&2
echo "------------------------------------------------------" 1>&2
echo $ECHO_N "Do you wish to [[Q]]uit or use the [[S]]cript? [[Q/S]]"
read REPLY
if [ test "$REPLY" = "q" || test "$REPLY" = "Q" ];then
echo "When you are done rerun configure"
exit
else if [ test "$REPLY" = "s" || test "$REPLY" = "S" ];then
FILE="null"
until test -f $FILE;do
echo "Please enter the full path to comm.jar (example /home/jarvi/tools/commapi/comm.jar):"
read FILE
done;
if grep Win32 $FILE > /dev/null;then
echo 1>&2
echo WARNING: 1>&2
echo 1>&2
echo "I've detected A Windows version of comm.jar. This is known to not work with" 1>&2
echo "rxtx on UNIX. Go to http://java.sun.com/products/javacomm/index.html and " 1>&2
echo "get the solaris-x86 CommAPI if your target is unix." 1>&2
echo 1>&2
echo "Press enter to continue."
read REPLY
fi
echo $ECHO_N "Is it ok to copy $FILE to $1? [[y/n]] "
read REPLY
if [ test "$REPLY" = "y" || test "$REPLY" = "Y" ];then
cp $FILE $1
fi;
fi;fi;
if [ test -w $1 ]; then
echo "comm.jar has been installed."
else
echo "However, we don't have proper permissions, so please do it as root";
echo "*******************************************************************";
echo "configure is unable to continue. Please try again or manually fix the problem." 1>&2
exit
fi;
fi;
}
[ case $OS_NAME in
Mac\ OS\ X)
JAVAINCLUDEDIR=/System/Library/Frameworks/JavaVM.framework/Headers/
;;
*)
JAVAINCLUDEDIR=$JPATH/include
;;
esac ]
JAVAINCLUDE="-I\$(JAVAINCLUDEDIR)"
if test "$CC" = "gcc" || test "$CC"="egcs"; then
case $JAVA_VENDOR in
Tran*)
find_java_native_include jni.h
JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni"
JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O"
JAR="\$(JPATH)/bin/jar"
JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)"
CFLAGS=$CFLAGS" -D_BSD_SOURCE"
JAVAINCLUDE=""
JAVAH_FIX="if test ! -d \$(target_triplet);then mkdir \$(target_triplet);fi;"
JHOME=$JPATH"/share/kaffe/"
RXTX_PATH=$JPATH"/lib/kaffe/"
;;
*)
find_java_native_include jni_md.h
JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni"
JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O"
JAR="\$(JPATH)/bin/jar"
JAVADOC="\$(JPATH)/bin/javadoc"
CFLAGS=$CFLAGS" -D_BSD_SOURCE"
;;
esac
fi
if [ test -d $JPATH/share/kaffe/ ]
then fix_comm_jar $JPATH/share/kaffe/comm.jar
elif [ test -d $JPATH/jre/lib/ext ]
then fix_comm_jar $JPATH/jre/lib/ext/comm.jar
elif [ test -d $JPATH/lib/ext ]
then fix_comm_jar $JPATH/lib/ext/comm.jar
elif [ test -d $JPATH/lib ]
then fix_comm_jar $JPATH/lib/comm.jar
fi
# http://www.tolstoy.com/samizdat/sysprops.html
[ case $OS_NAME in
Linux)
LDFLAGS=-lpthread
check_kernel_headers
check_java_headers
CFLAGS=$CFLAGS" -D__need_timespec"
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*|1.6*)
fix_parameters $JPATH/jre/lib/javax.comm.properties
CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name comm.jar |head -n1`
JHOME=$JPATH"/jre/lib/ext"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
;;
1.1*)
CLASSPATH=".:\$(TOP):\$(TOP)/src:"` \
if [ -d $JPATH/share/kaffe/ ]; then
find $JPATH/share/kaffe/ -name [cK]lasses.[jz][ai][rp]
elif [ -d $JPATH/lib/ ]; then
find $JPATH/lib/ -name [cK]lasses.[jz][ai][rp]
fi`":"`
if [ -d $JPATH/share/kaffe/ ]; then
find $JPATH/share/kaffe/ -name comm.jar
elif [ -d $JPATH/lib/ ]; then
find $JPATH/lib/ -name comm.jar
fi`
if test x"$RXTX_PATH" = x;then
# We are not using Kaffe
fix_parameters $JPATH/lib/javax.comm.properties
check_prefix
RXTX_PATH="\$(prefix)/lib/"
JAVAH_FIX="if [ ! -d com ]; then if [ ! -f \$(JPATH)/lib/comm.jar ]; then echo \"Please install comm.jar from CommAPI in \$(JPATH)/java/lib/ 1>&2\"; else mkdir -p com/sun/comm;\$(JAR) -xf \$(JPATH)/lib/comm.jar; fi; fi;";
else
# Kaffe
CLASSPATH=$CLASSPATH:`find $JHOME -name comm.jar`
echo "Warning! Kaffe's comm.jar does not support rxtx"
echo "See INSTALL for details"
fi;
if test x"$JHOME" = x;then
JHOME=$JPATH/"lib"
fi
;;
esac
# Cross Compilers
#echo ----------------------------
#echo $target_os
#echo ----------------------------
case $target_os in
linux*)
;;
beos*)
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
EXTENSION="cpp"
LDFLAGS="-ldevice"
#echo ----------------------------
#echo $target_os
#echo ----------------------------
;;
freebsd*)
;;
solaris*)
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
#echo ----------------------------
#echo $target_os
#echo ----------------------------
;;
esac
;;
*BSD)
LDFLAGS=-lc_r
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
TARGETLIB="\$(target_triplet)/librxtxSerial.la \
\$(target_triplet)/librxtxParallel.la"
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*|1.6*)
fix_parameters $JPATH/jre/lib/javax.comm.properties
CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name comm.jar |head -n1`
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"jre/lib/ext"
;;
1.1*)
check_prefix
fix_parameters $JPATH/lib/javax.comm.properties
CLASSPATH=".:\$(TOP):\$(TOP)/src:"` \
if [ -d $JPATH/share/kaffe/ ]; then
find $JPATH/share/kaffe/ -name [cK]lasses.[jz][ai][rp]
elif [ -d $JPATH/lib/ ]; then
find $JPATH/lib/ -name [cK]lasses.[jz][ai][rp]
fi`":"`
if [ -d $JPATH/share/kaffe/ ]; then
find $JPATH/share/kaffe/ -name comm.jar
elif [ -d $JPATH/lib/ ]; then
find $JPATH/lib/ -name comm.jar
fi`
if test x"$RXTX_PATH" = x;then
# We are not using Kaffe
#fix_parameters $JPATH/lib/javax.comm.properties
check_prefix
RXTX_PATH="\$(prefix)/lib/"
JAVAH_FIX="if [ ! -d com ]; then if [ ! -f \$(JPATH)/lib/comm.jar ]; then echo \"Please install comm.jar from CommAPI in \$(JPATH)/java/lib/ 1>&2\"; else mkdir -p com/sun/comm;\$(JAR) -xf \$(JPATH)/lib/comm.jar; fi; fi;";
else
# Kaffe
CLASSPATH=$CLASSPATH:`find $JHOME -name comm.jar`
echo "Warning! Kaffe's comm.jar does not support rxtx"
echo "See INSTALL for details"
fi;
RXTX_PATH="\$(prefix)/lib"
JHOME=$JPATH/"lib"
;;
*)
;;
esac
;;
Irix*)
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -I/usr/include"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
RXTX_PATH="\$(JPATH)/lib/\$(OS_ARCH)"
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
;;
# since the os.name is different for UnixWare and OpenUNIX we could use it to
# differentiate the lock files See SerialImp.h for comments on the lock files
# in SCO. Currently that would be a build time fix though.
# FIXME
UnixWare|OpenUNIX)
LDFLAGS=-lpthread_this_may_be_wrong__trent
JHOME=$JPATH/"jre/lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar"
TARGETLIB="\$(target_triplet)/librxtxSerial.so \
\$(target_triplet)/librxtxParallel.so"
COMPILE="\$(CC) \$(INCLUDES) \$(CPPFLAGS) \$(CFLAGS) \$(VERBOSE_IOEXCEPTIONS) -c "
LINK="\$(CC) \$(CFLAGS) \$(LDFLAGS)"
echo "In UnixWare, CLASSPATH is $CLASSPATH"
;;
HP-UX)
LDFLAGS=-lpthread_this_may_be_wrong__trent
CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
case $JAVA_VERSION in
HP-UX\ Java\ C.01.2*|HP-UX\ Java\ C.01.3*)
fix_parameters $JPATH/jre/lib/javax.comm.properties
JHOME=$JPATH"/jre/lib/ext"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/jre/lib/ext/comm.jar:$CLASSPATH"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
echo WARNING $JAVA_VERSION is untested please email this message to taj@www.linux.org.uk and let me know if it works.
;;
HP-UX\ Java\ C.01.1*)
fix_parameters $JPATH/lib/javax.comm.properties
JHOME=$JPATH/"lib"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
RXTX_PATH="\$(prefix)/lib/"
;;
*)
fix_parameters $JPATH/lib/javax.comm.properties
JHOME=$JPATH"/lib"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
RXTX_PATH="\$(prefix)/lib/"
echo WARNING $JAVA_VERSION is untested please email this message to taj@www.linux.org.uk and let me know if it works.
;;
esac
case $OS_ARCH in
PA-RISC)
;;
*)
;;
esac
case $OS_VERSION in
B.10.20)
;;
*)
;;
esac
case $JAVA_VENDOR in
Hewlett\ Packard\ Co\.)
;;
*)
;;
esac
;;
BeOS)
echo WARNING: BeOS support is in RXTX-1.5
JHOME=$JPATH"/share/kaffe"
RXTX_PATH="\$(JPATH)/lib/"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/comm.jar:$CLASSPATH"
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
EXTENSION="cpp"
LDFLAGS="-ldevice"
# sigh, from ltconfig
# beos*)
# if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
# allow_undefined_flag=unsupported
# # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# # support --undefined. This deserves some investigation. FIXME
LIBTOOL_FIX="sed s/deplibs_check_method=\\\"unknown\\\"/deplibs_check_method=\\\"pass_all\\\"/1 libtool > libtool.tmp; sed s/allow_undefined_flag=\\\"unsupported\\\"/allow_undefined_flag=\\\"supported\\\"/1 libtool.tmp > libtool;rm libtool.tmp;"
;;
WIN32)
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*|1.6*)
CLASSPATH=".:\$(TOP):\$(TOP)/src:`find $JPATH/ -name comm.jar |head -n1`:$CLASSPATH"
JHOME=$JPATH"/jre/lib/ext"
;;
1.1*)
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
RXTX_PATH="\$(prefix)/lib/"
#JAVAH_FIX="if [ ! -d com ]; then if [ ! -f \$(JPATH)/lib/comm.jar ]; then echo \"Please install comm.jar from CommAPI in \$(JPATH)/java/lib/ 1>&2\"; else mkdir -p com/sun/comm;\$(JAR) -xf \$(JPATH)/lib/comm.jar; fi; fi;"
JHOME=$JPATH/"lib"
;;
esac
if test x$WIN32INCLUDE = x; then
echo "We need to know what directory the windows java include files"
echo "are located in. Please enter the directory now."
echo
echo "example /home/jarvi/win32java/include"
echo
read REPLY
WINDOWS_JAVA_INCLUDE="-I$REPLY -I$REPLY/win32"
else
WINDOWS_JAVA_INCLUDE="-I$WIN32INCLUDE -I$WIN32INCLUDE/win32"
fi
TARGETLIB="\$(target_triplet)/rxtxSerial.dll \$(target_triplet)/rxtxParallel.dll"
;;
Mac\ OS\ X)
fix_parameters $JPATH/lib/javax.comm.properties
LINK="\$(TOP)/libtool --mode=link \$(CC) -bundle -framework CoreFoundation -framework IOKit -o librxtx\$*.jnilib "
OBJECT_EXTENSION="lo"
LIB_EXTENSION="jnilib"
TARGETLIB="\$(target_triplet)/librxtxSerial.jnilib"
RXTX_PATH="/Library/Java/Extensions"
JHOME="/Library/Java/Extensions"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/comm.jar:$CLASSPATH"
;;
Solaris*)
LDFLAGS=-lpthread
TARGETLIB="\$(target_triplet)/librxtxSerial.la \
\$(target_triplet)/librxtxParallel.la"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
case $JAVA_VERSION in
1.2*|1.3*|1.4*|1.5*|1.6*)
fix_parameters $JPATH/jre/lib/javax.comm.properties
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
;;
1.1*)
fix_parameters $JPATH/lib/javax.comm.properties
RXTX_PATH="\$(JPATH)/lib/"
;;
esac
;;
OS*2)
# Place marker only
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
;;
AIX)
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
;;
Compaq\'s\ Digital\ Unix | OSF1 )
LDFLAGS=-lpthread
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
;;
NetWare*)
# Place marker only
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
;;
MPE*)
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
;;
#os.name reported "QNX"
#java.vendor reported "IBM Corporation"
#java.version reported "1.3.0 subset"
#
#Originally nothing was reported. javac is called j9c and java is called
#j9 with the
#j9 vm. I created symbolic links temporarily to get by that. Currently
#I'm puking when
#it tries to jar things up since j9 doesn't ship with a jar tool.
#All right. Here is how things stand on porting 2.1 to QNX. (This is were
#I stumble and fall)
#I decided to try it without any mods initially. It made through
#./configure fine except for
#finding the java include dir. Since we are using j9, the include dir is
#under bin. I set
#JAVANATINC to point to it in Makefile and then ran make. J9 then puked
#on the -O arg to javac,
#so I removed it. Now it is puking on importing java.awt. What is the
#best way to filter out/
#isolate the gui pieces since I won't be using them on qnx?
QNX)
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
;;
*)
TARGETLIB="\$(target_triplet)/librxtxSerial.la"
RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
JHOME=$JPATH/"lib"
CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/comm.jar:$CLASSPATH"
;;
esac ]
AC_OUTPUT(Makefile)
################################ END ########################################
# Toys. Gota lovem.
#echo $ECHO_N checking java.library.path " "
#JAVA_LIBRARY_PATH=`java conftest "java.library.path"`
#echo $JAVA_LIBRARY_PATH
#echo $ECHO_N checking java.class.version " "
#JAVA_CLASS_VERSION=`java conftest "java.class.version"`
#echo $JAVA_CLASS_VERSION