Debian Codegraph @

configure.in

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