Debian Codegraph @

configure.in

raw ◀ ▶
Source reconstructed at patch state 2 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1 ###########################################################################
2 # RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 # RXTX is a native interface to serial ports in java.
4 # Copyright 1997-2007 by Trent Jarvi [email protected] and others who
5 # actually wrote it. See individual source files for more information.
6 #
7 # A copy of the LGPL v 2.1 may be found at
8 # http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
9 # here for your convenience.
10 #
11 # This library is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU Lesser General Public
13 # License as published by the Free Software Foundation; either
14 # version 2.1 of the License, or (at your option) any later version.
15 #
16 # This library is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # Lesser General Public License for more details.
20 #
21 # An executable that contains no derivative of any portion of RXTX, but
22 # is designed to work with RXTX by being dynamically linked with it,
23 # is considered a "work that uses the Library" subject to the terms and
24 # conditions of the GNU Lesser General Public License.
25 #
26 # The following has been added to the RXTX License to remove
27 # any confusion about linking to RXTX. We want to allow in part what
28 # section 5, paragraph 2 of the LGPL does not permit in the special
29 # case of linking over a controlled interface. The intent is to add a
30 # Java Specification Request or standards body defined interface in the
31 # future as another exception but one is not currently available.
32 #
33 # http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
34 #
35 # As a special exception, the copyright holders of RXTX give you
36 # permission to link RXTX with independent modules that communicate with
37 # RXTX solely through the Sun Microsytems CommAPI interface version 2,
38 # regardless of the license terms of these independent modules, and to copy
39 # and distribute the resulting combined work under terms of your choice,
40 # provided that every copy of the combined work is accompanied by a complete
41 # copy of the source code of RXTX (the version of RXTX used to produce the
42 # combined work), being distributed under the terms of the GNU Lesser General
43 # Public License plus this exception. An independent module is a
44 # module which is not derived from or based on RXTX.
45 #
46 # Note that people who make modified versions of RXTX are not obligated
47 # to grant this special exception for their modified versions; it is
48 # their choice whether to do so. The GNU Lesser General Public License
49 # gives permission to release a modified version without this exception; this
50 # exception also makes it possible to release a modified version which
51 # carries forward this exception.
52 #
53 # You should have received a copy of the GNU Lesser General Public
54 # License along with this library; if not, write to the Free
55 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 # All trademarks belong to their respective owners.
57 ############################################################################
58 AC_INIT(src/SerialImp.c)
59 AM_CONFIG_HEADER(config.h)
60 AC_CANONICAL_SYSTEM
61 AC_MSG_WARN(Trying libtool. If the following fails install libtool)
62 AC_PROG_CC
63 # Comment these two lines out when compiling on SCO
64 AC_DISABLE_STATIC
65 AM_PROG_LIBTOOL
66 # end of SCO fixes
67 AM_INIT_AUTOMAKE(Serial,2.1-7)
68 AC_CHECK_HEADERS(fcntl.h)
69 AC_CHECK_HEADERS(sys/fcntl.h)
70 AC_CHECK_HEADERS(sys/file.h)
71 AC_CHECK_HEADERS(sys/time.h)
72 AC_CHECK_HEADERS(sys/signal.h)
73 AC_CHECK_HEADERS(signal.h)
74 AC_CHECK_HEADERS(sys/io.h)
75 AC_CHECK_HEADERS(termios.h)
76 AC_CHECK_HEADERS(grp.h)
77 AC_CHECK_HEADERS(pwd.h)
78 AC_PROG_GCC_TRADITIONAL
79 AC_SUBST(WINDOWS_JAVA_INCLUDE)
80 AC_SUBST(JAVAINCLUDEDIR)
81 AC_SUBST(JAVAINCLUDE)
82 AC_SUBST(JAVANATINC)
83 AC_SUBST(CLASSPATH)
84 AC_SUBST(TOP)
85 AC_SUBST(TARGETLIB)
86 AC_SUBST(LDFLAG)
87 AC_SUBST(CFLAGS)
88 AC_SUBST(THREAD_FLAG)
89 AC_SUBST(OS_NAME)
90 AC_SUBST(OS_ARCH)
91 AC_SUBST(OS_VERSION)
92 AC_SUBST(JAVA_VERSION)
93 AC_SUBST(JAVA_VENDOR)
94 AC_SUBST(JAVA_HOME)
95 AC_SUBST(JAVA_LIBRARY_PATH)
96 AC_SUBST(JAVA_CLASS_PATH)
97 AC_SUBST(JAVA_CLASS_VERSION)
98 AC_SUBST(JAVAH_FIX)
99 AC_SUBST(JPATH)
100 AC_SUBST(JHOME)
101 AC_SUBST(RXTX_PATH)
102 AC_SUBST(JAVAH)
103 AC_SUBST(JAVAC)
104 AC_SUBST(JAR)
105 AC_SUBST(JAVADOC)
106 AC_SUBST(EXTENSION)
107 AC_SUBST(LIBTOOL_FIX)
108 AC_SUBST(LDFLAGS)
109 AC_SUBST(LINK)
110 AC_SUBST(COMPILE)
111 AC_SUBST(OBJECT_EXTENSION)
112 AC_SUBST(LIB_EXTENSION)
113 AC_SUBST(GLIBTOOL)
114 # ftsoy
115 AM_MAINTAINER_MODE
116
117 JHOME=
118 RXTX_PATH=
119 EXTENSION="c"
120 OBJECT_EXTENSION="lo"
121 LIB_EXTENSION="la"
122 COMPILE="cc "
123 TOP="`pwd`"
124 GLIBTOOL="\$(SHELL) \$(TOP)/libtool"
125 LINK="\$(GLIBTOOL) --mode=link \$(CC) \$(CFLAGS) \$(LDFLAGS) -release \$(VERSION) -o librxtx\$*.la -rpath \$(RXTX_PATH)"
126
127 [case "$host_os" in
128 *-gnu)
129 CFLAGS=$CFLAGS" -D_POSIX_SOURCE";;
130 *);;
131 esac]
132 AC_ARG_ENABLE(PRINTER,
133 [ --enable-PRINTER PRINTER support (experimental) [default=yes]],
134 echo $enable_PRINTER,
135 enable_PRINTER="yes"
136 )
137 if test x$enable_PRINTER = xyes; then
138 TARGETLIB="\$(target_triplet)/librxtxSerial.la \
139 \$(target_triplet)/librxtxParallel.la \
140 \$(target_triplet)/librxtxI2C.la \
141 \$(target_triplet)/librxtxRaw.la \
142 \$(target_triplet)/librxtxRS485.la"
143 else
144 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
145 fi
146
147 AC_ARG_ENABLE(lockfiles,
148 [ --disable-lockfiles disable lock files (experimental) [default=no]],
149 if test x$lockfiles = xyes; then
150 echo "Using lock files"
151 else
152 echo "Disabling lock files"
153 CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES"
154 fi
155 )
156 AC_ARG_ENABLE(liblock,
157 [ --enable-liblock[=x] enable liblock [default=no]],
158 if test "x$liblock" != "xno"; then
159 echo "Using liblock"
160 CFLAGS=$CFLAGS" -DLIBLOCKDEV"
161 LDFLAGS=$LDFLAGS" -llockdev"
162 else
163 echo $liblock
164 echo "Disabling liblock"
165 fi
166 )
167
168 AC_ARG_ENABLE(lockfile_server,
169 [ --enable-lockfile_server Enable interaction with a lock file server [default=no]],
170 if test x$enable_lockfile_server = xyes; then
171 CFLAGS=$CFLAGS" -DLFS"
172 fi
173 )
174 AC_ARG_ENABLE(DEBUG,
175 [ --enable-DEBUG Print debugging info from SerialImp.c [default=no]],
176 if test x$enable_DEBUG = xyes; then
177 CFLAGS=$CFLAGS" -DDEBUG"
178 fi
179 )
180 AC_ARG_ENABLE(universallib,
181 [ --disable-universallib Disable building of universal libraries (MacOS X) [default=no]],
182 if test x$universallib = xyes; then
183 echo "Disabling universal lib"
184 fi
185 )
186 AC_PATH_PROG(XCODE_SELECT,xcode-select,no)
187
188 find_java_native_include()
189 {
190 JAVANATINC="-I\$(JAVAINCLUDEDIR)/`cd $JAVAINCLUDEDIR; find . -name $1|sed s#$1##|head -n1`"
191 if [ test `cd $JAVAINCLUDEDIR; find . -name $1|wc -l` != "1" ]; then
192 echo 1>&2
193 echo WARNING: configure is having a hard time determining which 1>&2
194 echo directory contains the file $1. Edit Makefile and fix the 1>&2
195 echo variable JAVANATINC to point to the correct directory. 1>&2
196 echo 1>&2
197 echo The following options are available: 1>&2
198 find $JAVAINCLUDEDIR -name $1|sed s#jni_md\.h## 1>&2
199 echo 1>&2
200 echo If there are more than one option available the first was selected. 1>&2
201 echo 1>&2
202 fi
203 }
204 build_conftest()
205 {
206 cat > conftest.java << EOF
207 /* this may be usefull for getting around java cobwebs during build */
208 public class conftest
209 {
210 public static void main(String[[]] args)
211 {
212 System.out.println(System.getProperty(args[[0]]));
213 }
214 }
215 EOF
216 CLASSPATH=.:$CLASSPATH
217 if test x$JAVA_HOME = x; then
218 javac -classpath .:$CLASSPATH: conftest.java
219 else
220 $JAVA_HOME/bin/javac -classpath .:$CLASSPATH: conftest.java
221 fi
222 }
223
224 run_conftest()
225 {
226 echo $ECHO_N checking $1 " " 1>&6
227 if test x$JPATH = x; then
228 VAR=`java -classpath .:$CLASSPATH: conftest $1`
229 else
230 VAR=`$JPATH/bin/java -classpath .:$CLASSPATH: conftest $1`
231 fi
232 echo $VAR 1>&6
233 echo $VAR
234 return
235 }
236
237 build_conftest
238 if test x$JAVA_HOME = x; then
239 JPATH=`run_conftest java.home| sed s#\/jre\\$##g`
240 else
241 JPATH=$JAVA_HOME
242 echo $JAVA_HOME
243 AC_MSG_WARN(using JAVA_HOME environmental variable)
244 fi
245 if test x$JPATH = x; then
246 AC_MSG_ERROR([Make sure java is in your path before running configure])
247 fi
248 echo adjusted java.home is $JPATH
249 if test "$target_alias" = i386-mingw32 ;then
250 OS_NAME=WIN32
251 else
252 OS_NAME=`run_conftest os.name`
253 fi
254 OS_ARCH=`run_conftest os.arch`
255 #JAVA_CLASS_PATH=`run_conftest java.class.path`
256 #JAVA_LIBRARY_PATH=`run_conftest java.library.path`
257 JAVA_VENDOR=`run_conftest java.vendor`
258 JAVA_VERSION=`run_conftest java.version`
259 rm -f conftest.java
260 rm -f conftest.class
261
262 echo $ECHO_N checking os.version " " 1>&6
263 OS_VERSION=`uname -r`
264 echo $OS_VERSION 1>&6
265
266 check_prefix()
267 {
268 if test $prefix != "/usr";then
269 echo 1>&2
270 echo "WARNING: configure was not run with option --prefix=/usr" 1>&2
271 echo " Unless /usr/local/lib or the specified prefix is in" 1>&2
272 echo " the linkers path this will cause problems later on." 1>&2
273 echo 1>&2
274 fi
275 }
276 # an attempt to compile on libc5 linux machines
277 check_java_headers()
278 {
279
280 cat > conftest.c << EOF
281 #include <features.h>
282 #include <stdio.h>
283 #include <stdlib.h>
284 int main(int argc, char *argv[])
285 {
286 #if defined (__GLIBC__)
287 printf("%i\n",__GLIBC__);
288 #else
289 printf("0\n");
290 #endif
291
292 exit(0);
293 }
294 EOF
295 cc conftest.c -o conftest
296 if [ test `./conftest` -lt 2 ];then
297 echo 1>&2
298 echo " WARNING: Older libc on linux detected. Patching a local copy of jni_md.h" 1>&2
299 echo 1>&2
300 ln -s `find $JAVAINCLUDEDIR -name jni.h` .
301 cp `find $JAVAINCLUDEDIR -name typedefs_md.h` .
302 # not pretty. could be cleaned up
303 patch << EOF
304 --- typedefs_md.h Tue Jan 11 14:17:08 2000
305 +++ typedefs_md.h.patchtaj Tue Jan 11 14:15:53 2000
306 @@ -17,9 +17,6 @@
307 */
308
309 /* sbb: Johan Vos, why isn't this #ifndef inside the solaris header guard? */
310 -#ifndef BITSPERCHAR
311 -#define BITSPERCHAR 8
312 -#endif
313
314 #ifndef _SOLARIS_TYPES_MD_H_
315 #define _SOLARIS_TYPES_MD_H_
316 @@ -28,50 +25,19 @@
317 #include <sys/stat.h>
318 #include "bool.h"
319
320 -#if defined(__alpha__)
321 -typedef unsigned long ptr_int;
322 -#define PTR_IS_64 1
323 -#define LONG_IS_64 1
324 -#else
325 typedef unsigned int ptr_int;
326 #define PTR_IS_32 1
327 -#endif
328
329 /* don't redefine typedef's on Solaris 2.6 or Later */
330
331 -#if !defined(_ILP32) && !defined(_LP64)
332 -
333 -#ifndef _UINT64_T
334 -#define _UINT64_T
335 -#ifdef LONG_IS_64
336 -typedef unsigned long uint64_t;
337 -#else
338 typedef unsigned long long uint64_t;
339 -#endif
340 -#define _UINT32_T
341 typedef unsigned int uint32_t;
342 -#if defined(__linux__)
343 typedef unsigned int uint_t;
344 -#endif
345 -#endif
346
347 -#ifndef __BIT_TYPES_DEFINED__
348 -#ifdef (__i386__)
349 -/* that should get Linux, at least */
350 #ifndef _INT64_T
351 #define _INT64_T
352 -#ifdef LONG_IS_64
353 -typedef long int64_t;
354 -#else
355 typedef long long int64_t;
356 -#endif
357 -#define _INT32_T
358 -typedef int int32_t;
359 -#if defined(__linux__)
360 -typdef int int_t;
361 -#endif
362 -#endif
363 -#endif /* i386 */
364 +typedef int int_t;
365 #endif /* __BIT_TYPES_DEFINED__ */
366
367 #endif /* !defined(_ILP32) && !defined(_LP64) */
368 @@ -110,27 +76,15 @@
369 #endif
370
371
372 -/* On Intel these conversions have to be method calls and not typecasts.
373 - See the win32 typedefs_md.h file */
374 -#if ((defined(i386) || defined (__i386)) && defined(__solaris__)) || defined(__powerpc__)
375 -
376 -extern int32_t float2l(float f);
377 -extern int32_t double2l(double d);
378 -extern int64_t float2ll(float f);
379 -extern int64_t double2ll(double d);
380 -
381 -#else /* not solaris x386 or linux powerpc*/
382 -
383 #define float2l(f) (f)
384 #define double2l(f) (f)
385 #define float2ll(f) ((int64_t) (f))
386 #define double2ll(f) ((int64_t) (f))
387
388 -#endif /* i386 */
389 -
390
391 #define ll2float(a) ((float) (a))
392 #define ll2double(a) ((double) (a))
393 +#define double2ll(f) ((int64_t) (f))
394
395 /* comparison operators */
396 #define ll_ltz(ll) ((ll)<0)
397 @@ -148,13 +102,7 @@
398
399 extern void ll2str(int64_t a, char *s, char *limit);
400
401 -#if defined(ppc) || defined(__ppc__) || defined(__alpha__) || defined(__sparc__)
402 -#ifndef HAVE_ALIGNED_DOUBLES
403 +#if defined(ppc) || defined(__ppc__) || defined(__alpha__)
404 #define HAVE_ALIGNED_DOUBLES
405 -#endif
406 -#ifndef HAVE_ALIGNED_LONGLONGS
407 #define HAVE_ALIGNED_LONGLONGS
408 #endif
409 -#endif
410 -
411 -#endif /* !_SOLARIS_TYPES_MD_H_ */
412 EOF
413 fi
414 rm -f conftest.c
415 rm -f conftest
416 }
417 check_kernel_headers()
418 {
419 cat > conftest.c << EOF
420
421 #include <linux/version.h>
422 #include <linux/utsrelease.h>
423 #include <stdio.h>
424 #include <stdlib.h>
425
426 int main(int argc, char *argv[])
427 {
428 printf(UTS_RELEASE"\n");
429 exit(0);
430 }
431 EOF
432 cc conftest.c -o conftest
433 if [ test `uname -r` != `./conftest` ];then
434 echo 1>&2
435 echo " WARNING: Kernel include files do not match the current kernel" 1>&2
436 echo 1>&2
437 fi
438 rm -f conftest.c
439 rm -f conftest
440 }
441 #fix_mac_groups()
442 #{
443 #this is what the Mac OS X installer does... untested
444 # sudo mkdir /var/spool/uucp
445 # sudo chmod 775 /var/spool/uucp
446 # sudo niutil -destroyval / /groups/uucp users `sudo id -p | grep 'login' | sed 's/login.//'`
447 # sudo niutil -appendprop / /groups/uucp users `sudo id -p | grep 'login' | sed 's/login.//'`
448 #}
449 fix_comm_jar()
450 {
451 if [ test -f $1 ];then
452 echo "------------------------------------------------------" 1>&2
453 echo "WARNING: A comm.jar file is already installed" 1>&2
454 echo "make sure your CLASSPATH points to RXTXcomm.jar!" 1>&2
455 echo 1>&2
456 echo $1
457 echo 1>&2
458 echo "------------------------------------------------------" 1>&2
459 fi;
460 }
461 [ case $OS_NAME in
462 Mac\ OS\ X)
463 JAVAINCLUDEDIR=$JPATH/../../../Headers
464 ;;
465 *)
466 JAVAINCLUDEDIR=$JPATH/include
467 ;;
468 esac ]
469
470 JAVAINCLUDE="-I\$(JAVAINCLUDEDIR)"
471 if test "$CC" = "gcc" || test "$CC"="egcs"; then
472 case $JAVA_VENDOR in
473 Tran*)
474 find_java_native_include jni.h
475 JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni"
476 JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3"
477 JAR="\$(JPATH)/bin/jar"
478 JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)"
479 CFLAGS=$CFLAGS" -D_BSD_SOURCE"
480 JAVAINCLUDE=""
481 JAVAH_FIX="if test ! -d \$(target_triplet);then mkdir \$(target_triplet);fi;"
482 JHOME=$JPATH"/share/kaffe/"
483 RXTX_PATH=$JPATH"/lib/kaffe/"
484 ;;
485 *)
486 find_java_native_include jni_md.h
487 JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni"
488 JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3"
489 JAR="\$(JPATH)/bin/jar"
490 JAVADOC="\$(JPATH)/bin/javadoc"
491 CFLAGS=$CFLAGS" -D_BSD_SOURCE"
492 ;;
493 esac
494 fi
495 if [ test -d $JPATH/share/kaffe/ ]
496 then fix_comm_jar $JPATH/share/kaffe/comm.jar
497 elif [ test -d $JPATH/jre/lib/ext ]
498 then fix_comm_jar $JPATH/jre/lib/ext/comm.jar
499 elif [ test -d $JPATH/lib/ext ]
500 then fix_comm_jar $JPATH/lib/ext/comm.jar
501 elif [ test -d $JPATH/lib ]
502 then fix_comm_jar $JPATH/lib/comm.jar
503 fi
504
505 # http://www.tolstoy.com/samizdat/sysprops.html
506
507 [ case $OS_NAME in
508 Linux)
509 LDFLAGS=$LDFLAGS" -lpthread"
510 #check_kernel_headers
511 check_java_headers
512 CFLAGS=$CFLAGS" -D__need_timespec"
513 case $JAVA_VERSION in
514
515 1.1*)
516 CLASSPATH=".:\$(TOP):\$(TOP)/src:"` \
517 if [ -d $JPATH/share/kaffe/ ]; then
518 find $JPATH/share/kaffe/ -name [cK]lasses.[jz][ai][rp]
519 elif [ -d $JPATH/lib/ ]; then
520 find $JPATH/lib/ -name [cK]lasses.[jz][ai][rp]
521 fi`":"`
522 if [ -d $JPATH/share/kaffe/ ]; then
523 find $JPATH/share/kaffe/ -name RXTXcomm.jar
524 elif [ -d $JPATH/lib/ ]; then
525 find $JPATH/lib/ -name RXTXcomm.jar
526 fi`
527
528 if test x"$RXTX_PATH" = x;then
529 # We are not using Kaffe
530 #fix_parameters $JPATH/lib/javax.comm.properties
531 check_prefix
532 RXTX_PATH="\$(prefix)/lib/"
533 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;";
534 else
535 # Kaffe
536 CLASSPATH=$CLASSPATH:`find $JHOME -name RXTXcomm.jar`
537 echo "Warning! Kaffe's comm.jar does not support rxtx"
538 echo "See INSTALL for details"
539 fi;
540 if test x"$JHOME" = x;then
541 JHOME=$JPATH/"lib"
542 fi
543 ;;
544 *)
545 #fix_parameters $JPATH/jre/lib/javax.comm.properties
546 CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1`
547 JHOME=$JPATH"/jre/lib/ext"
548 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
549 ;;
550 esac
551
552 # Cross Compilers
553 #echo ----------------------------
554 #echo $target_os
555 #echo ----------------------------
556 case $target_os in
557 linux*)
558 ;;
559 beos*)
560 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
561 EXTENSION="cpp"
562 LDFLAGS=$LDFLAGS" -ldevice"
563 #echo ----------------------------
564 #echo $target_os
565 #echo ----------------------------
566 ;;
567 freebsd*)
568 ;;
569 solaris*)
570 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
571 #echo ----------------------------
572 #echo $target_os
573 #echo ----------------------------
574 ;;
575 esac
576 ;;
577
578 *BSD)
579 LDFLAGS=$LDFLAGS" -lpthread"
580 JHOME=$JPATH/"lib"
581 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
582 TARGETLIB="\$(target_triplet)/librxtxSerial.la \
583 \$(target_triplet)/librxtxParallel.la"
584 case $JAVA_VERSION in
585 1.1*)
586 check_prefix
587 #fix_parameters $JPATH/lib/javax.comm.properties
588 CLASSPATH=".:\$(TOP):\$(TOP)/src:"` \
589 if [ -d $JPATH/share/kaffe/ ]; then
590 find $JPATH/share/kaffe/ -name [cK]lasses.[jz][ai][rp]
591 elif [ -d $JPATH/lib/ ]; then
592 find $JPATH/lib/ -name [cK]lasses.[jz][ai][rp]
593 fi`":"`
594 if [ -d $JPATH/share/kaffe/ ]; then
595 find $JPATH/share/kaffe/ -name RXTXcomm.jar
596 elif [ -d $JPATH/lib/ ]; then
597 find $JPATH/lib/ -name RXTXcomm.jar
598 fi`
599
600 if test x"$RXTX_PATH" = x;then
601 # We are not using Kaffe
602 #fix_parameters $JPATH/lib/javax.comm.properties
603 check_prefix
604 RXTX_PATH="\$(prefix)/lib/"
605 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;";
606 else
607 # Kaffe
608 CLASSPATH=$CLASSPATH:`find $JHOME -name RXTXcomm.jar`
609 echo "Warning! Kaffe's comm.jar does not support rxtx"
610 echo "See INSTALL for details"
611 fi;
612 RXTX_PATH="\$(prefix)/lib"
613 JHOME=$JPATH/"lib"
614 ;;
615 *)
616 #fix_parameters $JPATH/jre/lib/javax.comm.properties
617 CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1`
618 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
619 JHOME=$JPATH/"jre/lib/ext"
620 ;;
621 esac
622 ;;
623
624 Irix*)
625 JHOME=$JPATH/"lib"
626 CFLAGS=$CFLAGS" -I/usr/include"
627 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
628 RXTX_PATH="\$(JPATH)/lib/\$(OS_ARCH)"
629 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
630 ;;
631
632 # since the os.name is different for UnixWare and OpenUNIX we could use it to
633 # differentiate the lock files See SerialImp.h for comments on the lock files
634 # in SCO. Currently that would be a build time fix though.
635 # FIXME
636
637 UnixWare|OpenUNIX)
638 LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent"
639 JHOME=$JPATH/"jre/lib"
640 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__"
641 CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar"
642 TARGETLIB="\$(target_triplet)/librxtxSerial.so \
643 \$(target_triplet)/librxtxParallel.so"
644 COMPILE="\$(CC) \$(INCLUDES) \$(CPPFLAGS) \$(CFLAGS) \$(VERBOSE_IOEXCEPTIONS) -c "
645 LINK="\$(CC) \$(CFLAGS) \$(LDFLAGS)"
646 echo "In UnixWare, CLASSPATH is $CLASSPATH"
647 ;;
648
649 HP-UX)
650 LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent"
651 CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1"
652 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
653 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
654 case $JAVA_VERSION in
655 HP-UX\ Java\ C.01.2*|HP-UX\ Java\ C.01.3*)
656 #fix_parameters $JPATH/jre/lib/javax.comm.properties
657 JHOME=$JPATH"/jre/lib/ext"
658 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/jre/lib/ext/RXTXcomm.jar:$CLASSPATH"
659 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
660 echo WARNING $JAVA_VERSION is untested please email this message to [email protected] and let me know if it works.
661 ;;
662 HP-UX\ Java\ C.01.1*)
663 #fix_parameters $JPATH/lib/javax.comm.properties
664 JHOME=$JPATH/"lib"
665 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
666 RXTX_PATH="\$(prefix)/lib/"
667 ;;
668 *)
669 #fix_parameters $JPATH/lib/javax.comm.properties
670 JHOME=$JPATH"/lib"
671 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
672 RXTX_PATH="\$(prefix)/lib/"
673 echo WARNING $JAVA_VERSION is untested please email this message to [email protected] and let me know if it works.
674 ;;
675 esac
676 case $OS_ARCH in
677 PA-RISC)
678 ;;
679 *)
680 ;;
681 esac
682 case $OS_VERSION in
683 B.10.20)
684 ;;
685 *)
686 ;;
687 esac
688 case $JAVA_VENDOR in
689 Hewlett\ Packard\ Co\.)
690 ;;
691 *)
692 ;;
693 esac
694 ;;
695
696 BeOS)
697 echo WARNING: BeOS support is in RXTX-1.5
698 JHOME=$JPATH"/share/kaffe"
699 RXTX_PATH="\$(JPATH)/lib/"
700 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
701 CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
702 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
703 EXTENSION="cpp"
704 LDFLAGS=$LDFLAGS" -ldevice"
705 # sigh, from ltconfig
706 # beos*)
707 # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
708 # allow_undefined_flag=unsupported
709 # # Joseph Beckenbach <[email protected]> says some releases of gcc
710 # # support --undefined. This deserves some investigation. FIXME
711
712 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;"
713
714
715 ;;
716
717 WIN32)
718 case $JAVA_VERSION in
719 1.1*)
720 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
721 RXTX_PATH="\$(prefix)/lib/"
722 JHOME=$JPATH/"lib"
723 ;;
724 *)
725 CLASSPATH=".:\$(TOP):\$(TOP)/src:`find $JPATH/ -name RXTXcomm.jar |head -n1`:$CLASSPATH"
726 JHOME=$JPATH"/jre/lib/ext"
727 ;;
728 esac
729 if test x$WIN32INCLUDE = x; then
730 echo "We need to know what directory the windows java include files"
731 echo "are located in. Please enter the directory now."
732 echo
733 echo "example /home/jarvi/win32java/include"
734 echo
735 read REPLY
736 WINDOWS_JAVA_INCLUDE="-I$REPLY -I$REPLY/win32"
737 else
738 WINDOWS_JAVA_INCLUDE="-I$WIN32INCLUDE -I$WIN32INCLUDE/win32"
739 fi
740 TARGETLIB="\$(target_triplet)/rxtxSerial.dll \$(target_triplet)/rxtxParallel.dll"
741 echo "$WINDOWS_JAVA_INCLUDE"
742 ;;
743
744 Mac\ OS\ X)
745 #fix_mac_groups
746 #fix_parameters $JPATH/lib/javax.comm.properties
747 if test $XCODE_SELECT = no; then
748 SDKPATH="/Developer"
749 else
750 SDKPATH=`$XCODE_SELECT -print-path`
751 fi
752 SDK="$SDKPATH/SDKs/MacOSX10.4u.sdk"
753 if test "x$enable_universallib" != xno; then
754 if test -d "/Developer/SDKs/MacOSX10.4u.sdk"; then
755 echo "library os.arch... universal (i386 ppc)"
756 CFLAGS="$CFLAGS -O -g -mmacosx-version-min=10.4 -isysroot $SDK -arch i386 -arch ppc"
757 LDFLAGS="$LDFLAGS -isysroot $SDK -arch i386 -arch ppc "
758 else
759 echo "Warning: no universal SDK, will not build universal"
760 echo "library os.arch... "${OS_ARCH}
761 fi
762 else
763 echo "User disabled building of universal library"
764 echo "library os.arch... "${OS_ARCH}
765 fi
766
767 GLIBTOOL="\$(SHELL) glibtool"
768 LINK="cc $LDFLAGS -bundle -framework CoreFoundation -framework IOKit -o librxtx\$*.jnilib "
769 OBJECT_EXTENSION="o"
770 LIB_EXTENSION="jnilib"
771 TARGETLIB="\$(target_triplet)/librxtxSerial.jnilib"
772 RXTX_PATH="/usr/lib/java"
773 JHOME=$JPATH"/lib/ext"
774 CFLAGS=$CFLAGS" -bundle"
775 LDFLAGS=$LDFLAGS" -module -framework JavaVM -framework IOKit -framework CoreFoundation"
776 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH"
777 # email [email protected] if you know a nicer fix. Needed anymore?
778 # this fix was really old taj 6/05
779 # LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;"
780 ;;
781
782 Solaris*)
783 + LDFLAGS=$LDFLAGS" -lpthread"
784 TARGETLIB="\$(target_triplet)/librxtxSerial.la \
785 \$(target_triplet)/librxtxParallel.la"
786 JHOME=$JPATH/"lib"
787 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
788 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
789
790 case $JAVA_VERSION in
791 1.1*)
792 RXTX_PATH="\$(JPATH)/lib/"
793 ;;
794 *)
795 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
796 ;;
797 esac
798 ;;
799
800 OS*2)
801 # Place marker only
802 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
803 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
804 JHOME=$JPATH/"lib"
805 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
806 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
807
808 ;;
809
810 AIX)
811 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
812 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
813 JHOME=$JPATH/"lib"
814 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
815 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
816
817 ;;
818
819 Compaq\'s\ Digital\ Unix | OSF1 )
820 LDFLAGS=$LDFLAGS" -lpthread"
821 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
822 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
823 JHOME=$JPATH/"lib"
824 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
825 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
826
827 ;;
828
829 NetWare*)
830 # Place marker only
831 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
832 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
833 JHOME=$JPATH/"lib"
834 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
835 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
836
837 ;;
838
839 MPE*)
840 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
841 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
842 JHOME=$JPATH/"lib"
843 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
844 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
845 ;;
846
847
848 #os.name reported "QNX"
849 #java.vendor reported "IBM Corporation"
850 #java.version reported "1.3.0 subset"
851 #
852 #Originally nothing was reported. javac is called j9c and java is called
853 #j9 with the
854 #j9 vm. I created symbolic links temporarily to get by that. Currently
855 #I'm puking when
856 #it tries to jar things up since j9 doesn't ship with a jar tool.
857 #All right. Here is how things stand on porting 2.1 to QNX. (This is were
858 #I stumble and fall)
859 #I decided to try it without any mods initially. It made through
860 #./configure fine except for
861 #finding the java include dir. Since we are using j9, the include dir is
862 #under bin. I set
863 #JAVANATINC to point to it in Makefile and then ran make. J9 then puked
864 #on the -O arg to javac,
865 #so I removed it. Now it is puking on importing java.awt. What is the
866 #best way to filter out/
867 #isolate the gui pieces since I won't be using them on qnx?
868
869 QNX)
870 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
871 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
872 JHOME=$JPATH/"lib"
873 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
874 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
875 ;;
876
877 *)
878 TARGETLIB="\$(target_triplet)/librxtxSerial.la"
879 RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)"
880 JHOME=$JPATH/"lib"
881 CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1"
882 CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/classes.zip:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH"
883 ;;
884 esac ]
885
886 AC_OUTPUT(Makefile)
887
888
889
890 ################################ END ########################################
891
892
893
894 # Toys. Gota lovem.
895 #echo $ECHO_N checking java.library.path " "
896 #JAVA_LIBRARY_PATH=`java conftest "java.library.path"`
897 #echo $JAVA_LIBRARY_PATH
898 #echo $ECHO_N checking java.class.version " "
899 #JAVA_CLASS_VERSION=`java conftest "java.class.version"`
900 #echo $JAVA_CLASS_VERSION