-
Notifications
You must be signed in to change notification settings - Fork 43
/
configure.in
8013 lines (6917 loc) · 296 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run to configure the
dnl Makefile in this directory.
# Copyright (c) 1997-2021 The Regents of the University of California.
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# above copyright notice and the following two paragraphs appear in all
# copies of this software.
#
# IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
# ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
# THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
# PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
# CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
# ENHANCEMENTS, OR MODIFICATIONS.
#
# PT_COPYRIGHT_VERSION_2
# COPYRIGHTENDKEY
# configure is derived from configure.in by running GNU autoconf
# on configure.in. Sadly, autoconf now requires Perl and is much
# slower than it used to be.
# See $PTII/doc/coding/develsetup.htm for details about how configure
# works.
# To modify configure:
# 1. Edit configure.in
# 2. Run: cd "$PTII"; rm config.*; autoconf; ./configure
# 3. When you are satisfied with your changes, check in configure.in:
# cvs commit -m "Added xxx package" configure.in
# 4. Since configure.in will have a more recent modification time than
# configure, be sure to run autoconf again
# 5. Check in configure:
# cvs commit -m "configure.in changed" configure
# NOTE: sometimes the order that the files are updated when cvs update
# is run can cause configure.in to have a more recent mod time than
# configure. If this is the case, try editing configure and adding
# a space to a comment line and commiting the change.
dnl Don't look for ptolemy/kernel/util/NamedObj.java here, or
dnl else we won't be able to rebuild after make extraclean.
AC_INIT(mk/ptII.mk.in)
#PT_VERBOSE=1
AC_ARG_ENABLE(verbose, [ --enable-verbose, configure prints verbose msgs],
PTVERBOSE=1)
if test "${PTVERBOSE:-none}" = "none"; then
AC_MSG_RESULT([For more verbose output, run ./configure --enable-verbose])
fi
dnl Define our own messages so that we can control verbosity.
dnl PT_MSG_RESULT prints 'ok' if PTVERBOSE is not set, otherwise
dnl PT_MSG_RESULT prints its first argument.
AC_DEFUN([PT_MSG_RESULT],
[if test "${PTVERBOSE:-none}" = "none"; then AC_MSG_RESULT([ok]); else AC_MSG_RESULT([$1]); fi ])# PT_MSG_RESULT
dnl PT_MSG_RESULT prints nothing if PTVERBOSE is not set, otherwise
dnl PT_MSG_RESULT prints its first argument.
AC_DEFUN([PT_MSG_STATUS],
[if test "${PTVERBOSE:-none}" != "none"; then AC_MSG_RESULT([$1]); fi ])# PT_MSG_STATUS
# Fix permissions on files.
# If the distribution was in a jar file, then some files might not be executable.
execFiles="ptolemy/util/test/junit/javachdir configure bin/ant bin/node bin/npm"
for file in $execFiles
do
if test -f $file -a ! -x $file; then
# PT_MSG_RESULT(Making $file executable.)
chmod a+x $file
fi
done
# Java does not find things in c:/program files/java
AC_MSG_CHECKING([if your path has 'program files/java' instead of 'Program Files/Java' ])
echo "$PATH" | egrep 'program files/java' > /dev/null
status=$?
if test "$status" -eq 0 ; then
AC_MSG_WARN([
Temporarily changing your path within configure for Java because
Java can't find c:/program files/java, but can find
c:/Program files/Java].)
PATH="`echo $PATH | sed 's@program files/java@Program Files/Java@g'`"
else
PT_MSG_RESULT([ok])
fi
# We must have PTII set before running configure.
if test -z "$PTII"; then
if test -n "$PTOLEMY"; then
if test -d "$PTOLEMY/tycho/java"; then
echo "\$PTOLEMY/tycho/java exists, setting PTII to that value"
PTII="$PTOLEMY/tycho/java"
# We should not have to call AC_PREFIX_DEFAULT($PTII) here
# but autoconf shuffles things around, so the call to
# AC_PREFIX_DEFAULT($PTII) that is 15 or so lines below
# actually appears at the top of configure.
ac_default_prefix=$PTII
else
echo "You must set the PTII environment variable before running configure"
exit 3
fi
else
echo "You must set the PTII environment variable before running configure"
exit 3
fi
fi
if test ! -d "$PTII"; then
echo "\$PTII is set to '$PTII', but it does not exist"
exit 3
fi
if test ! -w "$PTII"; then
echo "Warning: \$PTII is set to '$PTII', but it is not writable by you."
echo "This may or may not be a problem. If you are running under"
echo "Windows, then you might be able to ignore this problem and"
echo "proceed with the build. If you continue to have problems,"
echo "try upgrading to cygwin1.1.0 or later"
fi
AC_MSG_CHECKING([if \$PTII ('$PTII') has backslashes])
echo "$PTII" | egrep '\\' > /dev/null
status=$?
if test "$status" -eq 1 ; then
PT_MSG_RESULT([ok
'$PTII' does not contain backslashes])
else
AC_MSG_ERROR([
\$PTII == $PTII,
which contains backslashes. Even under Windows, please set
PTII to use forward slashes.])
fi
AC_MSG_CHECKING([if \$PTII ('$PTII') and the current directory are the same"])
canonicalPTII=`cd "$PTII"; pwd`
if test "$canonicalPTII" != "`pwd`" ; then
currentDirectory="`pwd`"
FINAL_WARNING="Perhaps $PTII is set to a directory other \
than the current directory? \
'cd \"$PTII\"; pwd' yields \"$canonicalPTII\", which is not the \
same as 'pwd', which is \"$currentDirectory\""
AC_MSG_WARN([$FINAL_WARNING])
fi
AC_MSG_CHECKING([if \$PTII ('$PTII') contains "cygdrive"])
echo "$PTII" | egrep 'cygdrive|cygwin' > /dev/null
status=$?
if test "$status" -eq 1 ; then
PT_MSG_RESULT([ok
'$PTII' does not contain cygdrive or cygwin, which is right.])
else
AC_MSG_WARN(['\$PTII == $PTII,
which contains 'cygdrive' or 'cygwin'.
It could be that you have incorrectly set PTII.
If you have installed Cygwin in c:/cygwin, and your Ptolemy II installation
is in a directory outside of the c:/cygwin tree, then Cygwin may
change your PTII variable to include "/cygdrive/c". This
will cause problems with non-Cygwin tools like javac that do
not understand /cygdrive/c
PTII can end up with cygdrive or cygwin in it if
you mistakenly do something like PTII=`pwd`.
Under Cygwin, try permanently setting PTII in the control panel
(Start->Control Panels->Advanced->Environment Variables)
or temporary set it within bash:
export PTII=c:/Users/YourLogin/ptII
and then rerun
./configure
See $PTII/doc/install.htm for details.'])
fi
case "`uname -s`" in
CYGWIN_NT-*)
AC_MSG_CHECKING([if \$PTII ('$PTII') contains "cygwin"])
cygpath -w "$PTII" | grep cygwin > /dev/null
status=$?
if test "$status" -eq 1 ; then
PT_MSG_RESULT([ok
\$PTII is '$PTII', which does not contain cygwin, which is right.])
else
AC_MSG_WARN([
'cygpath -w \$PTII' == '`cygpath -w $PTII`'
which contains 'cygwin'.
This could happen if your home directory is in the default location
for cygwin which cygwin thinks is /home/yourname,
but windows thinks is c:\\cygwin\\home\\yourname.
This will cause problems with non-Cygwin tools like javac that do
not understand Cygwin directory structure and mounts will not
be able to find files in $PTII.
The solution is to move the Ptolemy II tree outside of
c:\\cygwin and to set the PTII variable to point to that location
and then rerun
cd \$PTII
./configure
See $PTII/doc/install.htm for details.'])
fi
;;
esac
# If we are under Cygwin, check that we can find CMD
case "`uname -s`" in
CYGWIN_NT-*)
AC_PATH_PROG(CMD_PATH, cmd)
if test ! -x "$CMD_PATH"; then
AC_MSG_WARN([Failed to find the 'cmd' command, which
is used by the $PTII/bin/ptolemy script.
Under Windows 2000, cmd is usually found at c:\\winnt\\system32\\cmd.exe.
Under Windows XP, cmd is usually found at c:\\windows\\system32\\cmd.exe.
You may need to modify your PATH to explicitly include
c:\\winnt\\system32 by going or c:\\windows\\system32 by going to
to Start->Settings->Control Panels->System->Environment and changing
%SystemRoot%\\system32 to c:\\winnt\\system32 or c:\\windows\\system32.])
fi
;;
*) ;;
esac
PTII_DEFAULT=$PTII
# The default value of prefix
AC_PREFIX_DEFAULT($PTII)
#--------------------------------------------------------------------
# The PTII directory as a URL
#--------------------------------------------------------------------
# Read the PTII variable and substitute forward slashes
# for backward slashes
case "`uname -s`" in
CYGWIN_ME-*)
windows="yes"
# Windows ME is not a real os, and it does not have CMD.
# So, we punt
PTII_DIR=$PTII
;;
CYGWIN_98-*)
windows="yes"
# Windows 98 is not a real os, and it does not have CMD.
# So, we punt
PTII_DIR=$PTII
;;
CYGWIN*)
windows="yes"
# We use cmd /c chdir here to get rid of /cygwin/c
PTII_DIR=`(cd "$PTII"; cmd /c chdir) | tr -d '\r' | sed 's@\\\@/@g'`
;;
*)
windows="no"
PTII_DIR=$PTII
;;
esac
#--------------------------------------------------------------------
# Look for the "find" command
#--------------------------------------------------------------------
AC_ARG_WITH(find, [ --with-find=PATH use the find command from PATH,
PTJAVA_DIR environment variable],
FIND=$withval,
FIND=/usr/bin/find)
AC_PATH_PROG(FIND, find)
if test `echo "$FIND" | grep system32`; then
AC_MSG_WARN([Your path is probably messed up, you have a system32
directory in your path before /bin])
FIND=/bin/find
fi
if test ! -f "$FIND"; then
AC_MSG_WARN([Could not find the "find" command, looked in \"$FIND\"])
fi
# Substitute %20 for any spaces.
PTII_LOCALURL=`echo "file:///$PTII_DIR" | sed 's/ /%20/g'`
#--------------------------------------------------------------------
# See if there was a command-line option for where Java is; if
# not, check to see if the PTJAVA_DIR environment variable is set;
# if it is not, look for javac on the path.
# NOTE: If your javac compiler is in /usr/bin, then PTJAVA_DIR is
# likely to be set to /usr. Consider using PTJAVA_HOME if
# you are looking for Java jar files.
# Note that PTJAVA_HOME is set to the jre directory, wheras
# PTJAVA_DIR is set to the directory above the jre directory.
# PTJAVA_HOME will _not_ have a trailing slash.
#--------------------------------------------------------------------
AC_ARG_WITH(java, [ --with-java=DIR use Java binaries from DIR,
defaults to the value of the
PTJAVA_DIR environment variable],
PTJAVA_DIR=$withval)
if test -d "$PTJAVA_DIR"; then
PT_MSG_STATUS([
PTJAVA_DIR environment variable was set to
'$PTJAVA_DIR', and there is a directory
at that location, so we will try it.])
else
if test -z "$PTJAVA_DIR"; then
PT_MSG_STATUS([PTJAVA_DIR environment variable was not set,
so we search for the java compiler.])
else
AC_MSG_WARN([PTJAVA_DIR environment variable is set to
'${PTJAVA_DIR}', which is not a directory,
so we search for the java compiler.])
fi
AC_PATH_PROG(JAVAC, javac)
if test -x "$JAVAC"; then
JAVABIN=`dirname "$JAVAC"`
PTJAVA_DIR=`dirname "$JAVABIN"`
if test "$PTJAVA_DIR" = "/"; then
if test -d /usr/java; then
PTJAVA_DIR=/usr/java
AC_MSG_WARN([ Found javac in "$JAVABIN", /usr/java exists, so
we are setting PTJAVA_DIR to '$PTJAVA_DIR'])
fi
fi
if test "$PTJAVA_DIR" = "/usr"; then
# $PTII/vendors/ptinyos/tinyos-1.x/contrib/ptII/ptinyos/tools/make/ptII/ptII.rules
# uses -I$(PTJAVA_DIR). If PTJAVA_DIR is /usr, then compilation of the ptinyos
# demos fails.
AC_MSG_CHECKING([PTJAVA_DIR == /usr, checking for links])
startdir=$PTII
cd "$srcdir/config"
if "$JAVAC" RootDirectory.java ; then
AC_MSG_CHECKING([the value of the Java directory ])
AC_PATH_PROG(JAVA, java)
if env "$JAVA" -classpath "$PTII/config" RootDirectory "$JAVAC"> /dev/null; then
PTJAVA_DIR_TMP=`"$JAVA" -classpath "$PTII/config" RootDirectory "$JAVAC"`
# Use changequote to protect the square brackets in sed
changequote(<<, >>)dnl
# Remove /cygdrive so we can compile with MSVC
#PTJAVA_DIR_REAL=`echo "$PTJAVA_HOME_TMP" | sed 's@/cygdrive/\([a-zA-Z]\)/@\1:/@'`
changequote([, ])dnl
if test -d "$PTJAVA_DIR_TMP"; then
PTJAVA_DIR="$PTJAVA_DIR_TMP"
PT_MSG_RESULT('$PTJAVA_DIR');
else
AC_MSG_WARN(['$JAVA -classpath "$PTII/config" RootDirectory "$JAVAC"' failed.
We will not be able to search for the canonical Java home directory.]);
fi
else
AC_MSG_WARN(['cd config; $JAVAC RootDirectory.java' failed.
We will not be able to search for the canonical Java home directory.]);
fi
cd "$startdir"
fi
fi
else
AC_MSG_WARN([ Failed to find javac, perhaps Java is not installed?])
fi
# The default location that we look for the JDK. This should probably
# be a list that includes /usr/local/jdk and /opt/jdk
if test ! -d "$PTJAVA_DIR"; then
DEFAULT_JDK=/opt/jdk1.7
if test -d "$DEFAULT_JDK"; then
PTJAVA_DIR=`cd "$DEFAULT_JDK"; pwd`
AC_MSG_WARN(['${PTJAVA_DIR}' is not a directory, using the default '${DEFAULT_JDK}'])
else
DEFAULT_JDK=/usr/java
if test -d "$DEFAULT_JDK"; then
PTJAVA_DIR=`cd "$DEFAULT_JDK"; pwd`
AC_MSG_WARN(['${PTJAVA_DIR}' is not a directory, using the default '${DEFAULT_JDK}'])
else
AC_MSG_ERROR([
Java directory $DEFAULT_JDK doesn't exist.
Be sure that the directory that contains javac and java is in your path.
Typically, under Windows, this directory might be c:\Program Files\Java\jdk1.8.0_45\bin
For instructions about adding to a directory to your path permanently,
consult your user documentation.
Under bash, you may temporarily add a directory with something like:
PATH=/cygdrive/c/Program\ Files/Java/jdk1.8.0_45/bin:\$PATH
export PATH
rm config.*; ./configure
You may also try --with-java=DIR, or set the PTJAVA_DIR environment variable
to the directory where your jdk is located:
export PTJAVA_DIR=/cygdrive/c/Program\ Files/Java/jdk1.8.0_45
rm config.*; ./configure
but adding the directory to your path is likely to work best.])
fi
fi
fi
fi
# PTJAVA_DIR without /cygdrive
# Use changequote here to preserve square brackets
changequote(<<, >>)dnl
PTJAVA_DIR_NO_CYGDRIVE="`echo "$PTJAVA_DIR" | sed 's@/cygdrive/\([a-z]\)/@\1:/@'`"
changequote([, ])dnl
if test ! -d "ptolemy/actor/lib/fmi/"; then
PT_MSG_STATUS([ptolemy/actor/lib/ is not present,
so we need not find a 32-bit JVM for testing.])
else
#--------------------------------------------------------------------
# See if there was a command-line option for where the 32-bit Java is; if
# not, check to see if the PTJAVA32_DIR environment variable is set;
# if it is not, look for javac on the path.
# NOTE: If your javac compiler is in /usr/bin, then PTJAVA32_DIR is
# likely to be set to /usr. Consider using PTJAVA32_HOME if
# you are looking for Java jar files.
# Note that PTJAVA_HOME is set to the jre directory, wheras
# PTJAVA_DIR is set to the directory above the jre directory.
# PTJAVA_HOME will _not_ have a trailing slash.
#--------------------------------------------------------------------
AC_ARG_WITH(java32, [ --with-java32=DIR use 32-bit Java binaries from DIR,
defaults to the value of the
PTJAVA32_DIR environment variable],
PTJAVA32_DIR=$withval)
if test -d "$PTJAVA32_DIR"; then
PT_MSG_STATUS([
PTJAVA32_DIR environment variable was set to
'$PTJAVA32_DIR', and there is a directory
at that location, so we will try it.])
else
if test -z "$PTJAVA32_DIR"; then
PT_MSG_STATUS([PTJAVA32_DIR environment variable was not set,
so we search for the java compiler.])
else
AC_MSG_WARN([PTJAVA32_DIR environment variable is set to
'${PTJAVA32_DIR}', which is not a directory,
so we search for the java compiler.])
fi
java -d32 -version > /dev/null
retval=$?
if test $retval = 0; then
PTJAVA32_DIR=${PTJAVA_DIR}
PT_MSG_STATUS([Running java -d32 -version succeeded,
so PTJAVA32_DIR is $PTJAVA_32DIR])
else
AC_PATH_PROG(JAVA32, java32)
JAVA32BIN=`dirname "$JAVA32"`
PTJAVA32_DIR=`dirname "$JAVA32BIN"`
if test -x "$JAVA32"; then
if test "$PTJAV32_DIR" = "/"; then
if test -d /usr/java; then
PTJAVA32_DIR=/usr/java
AC_MSG_WARN([ Found java32 in "$JAVA32BIN", /usr/java exists, so
we are setting PTJAVA32_DIR to '$PTJAVA32_DIR'])
fi
fi
if test "$PTJAVA32_DIR" = "/usr" -o "$PTJAVA32_DIR" = "/usr/local"; then
# $PTII/vendors/ptinyos/tinyos-1.x/contrib/ptII/ptinyos/tools/make/ptII/ptII.rules
# uses -I$(PTJAVA_DIR). If PTJAVA_DIR is /usr, then compilation of the ptinyos
# demos fails.
AC_MSG_CHECKING([PTJAVA32_DIR == /usr or /usr/local, checking for links])
startdir=$PTII
cd "$srcdir/config"
if "$JAVAC" RootDirectory.java ; then
AC_MSG_CHECKING([the value of the Java directory ])
if env "$JAVA32" -classpath "$PTII/config" RootDirectory "$JAVA32"> /dev/null; then
PTJAVA32_DIR_TMP=`"$JAVA32" -classpath "$PTII/config" RootDirectory "$JAVA32"`
# Use changequote to protect the square brackets in sed
changequote(<<, >>)dnl
# Remove /cygdrive so we can compile with MSVC
#PTJAVA_DIR_REAL=`echo "$PTJAVA_HOME_TMP" | sed 's@/cygdrive/\([a-zA-Z]\)/@\1:/@'`
changequote([, ])dnl
if test -d "$PTJAVA32_DIR_TMP"; then
PTJAVA32_DIR="$PTJAVA32_DIR_TMP"
PT_MSG_RESULT('$PTJAVA_DIR');
else
AC_MSG_WARN(['$JAVA32 -classpath "$PTII/config" RootDirectory "$JAVA32"' failed.
We will not be able to search for the canonical 32-bit Java home directory.]);
fi
else
AC_MSG_WARN(['cd "$PTII/config"; $JAVAC RootDirectory.java' failed.
We will not be able to search for the canonical 32-bit Java home directory.]);
fi
cd "$startdir"
fi
fi
fi
if test ! -x "$PTJAVA32_DIR/bin/java"; then
AC_MSG_WARN([Running java -d32 -version failed,
and $PTJAVA32_DIR/bin/java does not exist.
Perhaps you need to install a separate 32-bit JVM
or rerun configure with --with-java32?
The 32-bit JVM is only needed for certain 32-bit FMI tests.
In general, under a 64-bit JVM, FMI will work fine without a 32-bit JVM.])
fi
fi
fi
# PTJAVA32_DIR without /cygdrive
# Use changequote here to preserve square brackets
changequote(<<, >>)dnl
PTJAVA32_DIR_NO_CYGDRIVE="`echo "$PTJAVA32_DIR" | sed 's@/cygdrive/\([a-z]\)/@\1:/@'`"
changequote([, ])dnl
fi # Test for ptolemy/actor/lib/fmi
#
# Check that we have the javac that corresponds with PTJAVA_DIR in our path
#
AC_MSG_CHECKING([for the java runtime in $PTJAVA_DIR/bin])
if test -f "$PTJAVA_DIR/bin/java" -o -f "$PTJAVA_DIR/bin/java.exe"; then
PT_MSG_RESULT($PTJAVA_DIR/bin/java)
AC_PATH_PROG(JAVA, java)
if test "$PTJAVA_DIR/bin/java" = "$JAVA"; then
PT_MSG_STATUS([ You have the right java in your path,
"$PTJAVA_DIR/bin/java"
= "$JAVA"])
else
AC_MSG_WARN(['$PTJAVA_DIR/bin/java' is not
the same as '$JAVA'.
Perhaps '$JAVA' is in your path before
'$PTJAVA_DIR/bin/java'?
If you have problems later, be sure that you don't have a mismatch
in JDK versions.])
JAVA="$PTJAVA_DIR/bin/java"
fi
else
if test -f "$PTJAVA_DIR/Commands/java"; then
PT_MSG_RESULT($PTJAVA_DIR/Commands/java)
AC_PATH_PROG(JAVA, java)
if test "$PTJAVA_DIR/Commands/java" = "$JAVA"; then
PT_MSG_STATUS([ You have the right java in your path,
"$PTJAVA_DIR/Commands/java"
= "$JAVA"])
else
AC_MSG_WARN(['$PTJAVA_DIR/Commands/java' is not
the same as '$JAVA'.
Perhaps '$JAVA' is in your path before
'$PTJAVA_DIR/Commands/java'?
If you have problems later, be sure that you don't have a mismatch
in JDK versions.])
JAVA="$PTJAVA_DIR/Commands/java"
fi
else
AC_MSG_ERROR([
Cannot find '$PTJAVA_DIR/bin/java' or '$PTJAVA_DIR/Commands/java'.
Try --with-java=DIR, or set the PTJAVA_DIR environment variable.
])
fi
fi
#
# Check that we have the javac that corresponds with PTJAVA_DIR in our path
#
AC_MSG_CHECKING([for the java compiler in $PTJAVA_DIR/bin])
if test -f "$PTJAVA_DIR/bin/javac"; then
PT_MSG_RESULT($PTJAVA_DIR/bin/javac)
AC_PATH_PROG(JAVAC, javac)
if test ! -x "$JAVAC"; then
AC_MSG_WARN([Failed to find the 'javac' command in your path.
This is not necessarily a problem, since
'$PTJAVA_DIR/bin/javac' was found, but if you have problems,
then you may want to adjust your path])
fi
if test "$PTJAVA_DIR/bin/javac" = "$JAVAC"; then
PT_MSG_STATUS([ You have the right javac in your path,
"$PTJAVA_DIR/bin/javac"
= "$JAVAC"])
else
AC_MSG_WARN(['$PTJAVA_DIR/bin/javac' is not
the same as '$JAVAC'.
Perhaps '$JAVAC' is in your path
before '$PTJAVA_DIR/bin/javac'?
If you have problems later, be sure that you don't have a mismatch
in JDK versions.])
JAVAC="$PTJAVA_DIR/bin/javac"
fi
else
if test -f "$PTJAVA_DIR/Commands/javac"; then
PT_MSG_RESULT($PTJAVA_DIR/Commands/javac)
AC_PATH_PROG(JAVAC, javac)
if test "$PTJAVA_DIR/Commands/javac" = "$JAVAC"; then
PT_MSG_STATUS([ You have the right java in your path,
"$PTJAVA_DIR/Commands/javac"
= "$JAVAC"])
else
AC_MSG_WARN(['$PTJAVA_DIR/Commands/javac' is not
the same as '$JAVAC'.
Perhaps '$JAVAC' is in your path before
'$PTJAVA_DIR/Commands/javac'?
If you have problems later, be sure that you don't have a mismatch
in JDK versions.])
JAVAC="$PTJAVA_DIR/Commands/javac"
fi
else
AC_MSG_ERROR([
Cannot find '$PTJAVA_DIR/bin/javac' or '$PTJAVA_DIR/Commands/javac'.
Try --with-java=DIR, or set the PTJAVA_DIR environment variable.])
fi
fi
#--------------------------------------------------------------------
# Test the Java Compiler (javac)
#--------------------------------------------------------------------
AC_MSG_CHECKING([the Java compiler with a simple compile])
JVERSION=unknown
# We need to run javac in the config directory so that javac from jdk1.1.6
# under NT and cygwin works properly
startdir="$PTII"
cd "$srcdir/config"
rm -f *.class
if "$JAVAC" confTest.java ; then
PT_MSG_RESULT(confTest.java compiled)
AC_MSG_CHECKING([the value of the java.version Property ])
# Older versions of cygwin might not have env, but 1.1 does
if env "$JAVA" -classpath "$PTII/config" confTest > /dev/null; then
# Run it again and get the results
JVERSION=`"$JAVA" -classpath "$PTII/config" confTest`
PT_MSG_RESULT($JVERSION)
else
case "`uname -s`" in
CYGWIN_NT-*)
# If $PTII is in /home, then suggest moving it.
echo "$PTII" | egrep "^/home/" > /dev/null
status=$?
if test "$status" -eq 0; then
AC_MSG_ERROR(['"$JAVA" -classpath "$PTII/config" confTest failed.
If java fails, then you will not be able to run Ptolemy II.'
You are running under Cygwin and $PTII and starts with /home/.
By default, Cygwin puts user home directories in /home.
However, Java will not be able to find directories in Cygwin's /home/ tree.
The fix is to move $PTII to the /cygdrive/Users/$USERNAME and set
PTII to c:/Users/$USERNAME/ptII:
mv $PTII /cygdrive/c/Users/$USERNAME
export PTII=c:/Users/c/$USERNAME/ptII
cd \$PTII
./configure
'])
fi
AC_MSG_ERROR(['"$JAVA" -classpath "$PTII/config" confTest failed.
If java fails, then you will not be able to run Ptolemy II.'
This could be because your PTII variable is set incorrectly, perhaps
it has 'cygwin' or 'cygdrive' in it?
Under Cygwin, try setting PTII in the control panel
(Start->Control Panels->Advanced->Environment Variables)
or temporary set it within bash:
export PTII=c:/Users/$USERNAME/ptII
and then rerun
./configure
See $PTII/doc/install.htm for details.'])
;;
*)
AC_MSG_ERROR(['"$JAVA" -classpath "$PTII/config" confTest failed.
If java fails, then you will not be able to run Ptolemy II.'])
;;
esac
fi
else
AC_MSG_ERROR(['cd "$PTII/config"; "$JAVAC" confTest.java failed.
If javac fails, then you will not be able to compile Ptolemy II.
This could be because your PTII variable is set incorrectly.
Under Cygwin, try setting PTII in the control panel
(Start->Control Panels->Advanced->Environment Variables)
or temporary set it within bash:
export PTII=c:/Users/YourLogin/ptII
and then rerun
./configure
See $PTII/doc/install.htm for details.'])
fi
# The Major and Minor version of the JDK. 1.6, 1.8 etc. Used by ant in build.xml.in.
# Sadly, javac 9 and later has a usability bug where "-target 9.0" fails, but "-target 9" works.
# See https://bugs.openjdk.java.net/browse/JDK-8190556
# If you get messages about "javac: invalid target release:", then check that JAVA_HOME
# is set to same JDK as the one that is in your path.
AC_MSG_CHECKING([for Java version for use with -target and by Ant in build.xml])
changequote(<<, >>)dnl
JVERSION_TARGET=`echo "$JVERSION" |
awk -F . '{ if ($1 > 8) {
print $1
} else {
print $1 "." $2
}
}'`
changequote([, ])dnl
PT_MSG_RESULT([$JVERSION_TARGET])
cd "$startdir"
#--------------------------------------------------------------------
# We require JDK 1.8 preferred
#--------------------------------------------------------------------
AC_MSG_CHECKING([the JDK version])
JDOCSIZE=
UPGRADE_JVM=no
# Ptalon uses generics, which are present only in Java 1.5 and later
HAS_GENERICS=no
JAVA1_6_OR_LATER=no
case "$JVERSION" in
1.1.*) UPGRADE_JVM=yes;;
1.2.*) UPGRADE_JVM=yes;;
1.3.*) UPGRADE_JVM=yes;;
1.4.*) UPGRADE_JVM=yes;;
1.5.*) UPGRADE_JVM=yes;;
1.6.*) case "`uname -s`" in
Darwin) AC_MSG_WARN([Java 1.6.x is the first JVM in your path.
Ptolemy II can be built and run with Java 1.6, but under Mac OS X, the Java 1.6 JVM
from Apple has bugs including occaisionally crashing when closing a window.
A possible solution is to download Java 1.7 or later for Oracle and be sure that
the path to the Oracle JDK is in your path before the path to the Apple JDK.
Typically, the Oracle JDK is installed at
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home.
To adjust the path in Bash, use
export PATH=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin:\${PATH}])
esac
UPGRADE_JVM=yes;;
1.7.*) UPGRADE_JVM=yes;;
1.8.*) STANDALONE_NASHORN_PROBLEM=yes;;
9.*) STANDALONE_NASHORN_PROBLEM=yes;;
10.*) STANDALONE_NASHORN_PROBLEM=yes;;
*) ;;
esac
if test "$STANDALONE_NASHORN_PROBLEM" = "yes"; then
AC_MSG_WARN([As of September, 2021, Ptolemy II is using
the standalone Nashorn.jar.
Please upgrade to JDK 11 or later to use the standalone Nashorn jar
and thus support CapeCode.])
fi
if test "$UPGRADE_JVM" = "yes"; then
case "`uname -s`" in
Darwin)
upgradeMessage="Mac OS X, ships with Java 1.6 from Apple, but
later versions of Java are available from Oracle";;
*)
upgradeMessage="";;
esac
AC_MSG_ERROR([Ptolemy II requires JDK 1.8 or later.
JDK 1.2.2 has a bug involving compiling inner classes with protected
methods.
The RTOS domain uses java.util.Timer, which is present in JDK 1.3
and later.
ptolemy/kernel/attributes/URIAttribute.java uses java.net.URI, which
is present in JDK 1.4 and later.
JDK 1.5 or later is required so that these packages can use generics:
- actor/gui/run, which uses org/mlc/swing
- actor/lib/vhdl
- ptalon
JDK 1.6 or later is needed to use javax.swing.GroupLayout.
JDK 1.8 is needed for nio and many other features.
Please upgrade your JDK to 1.8 or later and try again.
To use Nashorn and support CapeCode, upgrade to JDK 11 or later.
$upgradeMessage])
else
# -breakiterator is only present in jdk1.4 and later
JDOCBREAKITERATOR=-breakiterator
# Ptalon uses generics, assume 1.5 or greater here
HAS_GENERICS=yes
PT_MSG_RESULT([ok, you are running $JVERSION])
fi
# Set PTJAVA_HOME
# Under Cygwin, PTJAVA_HOME will not contain /cygdrive/c
# Under Cygwin, PTJAVA_DIR _will_ contain /cygdrive/c
# We need to run javac in the config directory so that javac from
# jdk1.1.6 under NT and cygwin works properly
startdir=$PTII
cd "$srcdir/config"
AC_MSG_CHECKING([for java.home property by compiling a test program ])
# Don't use 'env $JAVAC . . .' here, it will not work under Cygwin
if "$JAVAC" JavaHome.java ; then
PT_MSG_RESULT(JavaHome.java compiled)
AC_MSG_CHECKING([for java.home property by running a test program ])
if env "$JAVA" -classpath "$PTII/config" JavaHome > /dev/null; then
# Run it again and get the results with \ converted to /
PTJAVA_HOME=`"$JAVA" -classpath "$PTII/config" JavaHome`
PT_MSG_RESULT($PTJAVA_HOME)
PTDOCLETS_DIR=doclets
else
AC_MSG_WARN(['$JAVA -classpath "$PTII/config" JavaHome' failed.
Since we cannot determine where the JRE is, we cannot set PTJAVA_HOME.
for use with doclets or the serial communications protocol])
fi
fi
cd "$startdir"
#
# Check that jar can handle the -i argument
#
AC_MSG_CHECKING([for the jar command])
if test -f "$PTJAVA_DIR/bin/jar"; then
PT_MSG_RESULT($PTJAVA_DIR/bin/jar)
JAR="$PTJAVA_DIR/bin/jar"
else
if test -f "$PTJAVA_DIR/Commands/java"; then
PT_MSG_RESULT($PTJAVA_DIR/Commands/java)
JAR="$PTJAVA_DIR/Commands/jar"
else
AC_MSG_WARN([Cannot find '$PTJAVA_DIR/bin/jar'.
or '$PTJAVA/Commands/jar', looking in the path.
This is usually only a problem if you run 'make install'])
AC_PATH_PROG(JAR, jar)
fi
fi
AC_MSG_CHECKING([that $JAR can handle -i])
if test -x "$JAR"; then
cd "$srcdir/config"
"$JAR" -cf jarTest.jar confTest.class
if "$JAR" -i jarTest.jar; then
PT_MSG_RESULT([$JAR -i worked])
# JAR_INDEX now includes the JAR_FLAGS flag so that we can
# pass -J-Xss100m for linux
JAR_INDEX='"$(JAR)" $(JAR_FLAGS) -i $@'
else
AC_MSG_WARN([$JAR -i jarTest.jar failed,
so we will not index the jar files])
JAR_INDEX=""
fi
cd "$startdir"
else
AC_MSG_WARN([jar command "$JAR" is not executable or not found.
This is usually only a problem if you run 'make install'])
fi
#
# The jarsigner command is used to create signed jar files for Webstart JNLP files
#
AC_MSG_CHECKING([for the jarsigner command])
if test -f "$PTJAVA_DIR/bin/jarsigner"; then
PT_MSG_RESULT($PTJAVA_DIR/bin/jarsigner)
JARSIGNER="$PTJAVA_DIR/bin/jarsigner"
else
if test -f "$PTJAVA_DIR/Commands/java"; then
PT_MSG_RESULT($PTJAVA_DIR/Commands/java)
JARSIGNER="$PTJAVA_DIR/Commands/jarsigner"
else
AC_MSG_WARN([Cannot find '$PTJAVA_DIR/bin/jarsigner'.
or '$PTJAVA/Commands/jarsigner', looking in the path.
This is only a problem when testing the security actors.])
AC_PATH_PROG(JARSIGNER, jarsigner)
fi
fi
if test ! -x "$JARSIGNER"; then
AC_MSG_WARN([The jarsigner command "$JARSIGNER" is not executable or not found.
This is only a problem when testing the security actors.])
fi
#
# The javaws command is used to test Webstart JNLP files.
#
if test ! -f "mk/jnlp.mk"; then
PT_MSG_STATUS([mk/jnlp.mk is not present,
so we need not find javaws, the Java Web Start binary.])
else
AC_MSG_CHECKING([for the javaws command])
if test -f "$PTJAVA_DIR/bin/javaws"; then
PT_MSG_RESULT($PTJAVA_DIR/bin/javaws)
JAVAWS="$PTJAVA_DIR/bin/javaws"
else
if test -f "$PTJAVA_DIR/Commands/java"; then
PT_MSG_RESULT($PTJAVA_DIR/Commands/java)
JAVAWS="$PTJAVA_DIR/Commands/javaws"
else
AC_MSG_WARN([Cannot find '$PTJAVA_DIR/bin/javaws'.
or '$PTJAVA/Commands/javaws', looking in the path.
This is only a problem when testing the Java Webstart (JNLP) files.])
AC_PATH_PROG(JAVAWS, javaws)
fi
fi
if test ! -x "$JAVAWS"; then
AC_MSG_WARN([The javaws command "$JAVAWS" is not executable or not found.
This is only a problem when testing the Java Webstart (JNLP) files.])
fi
fi
#
# keytool command used to generate a certificate for testing actor.lib.security actors
#
if test ! -d "ptolemy/actor/lib/security/"; then
PT_MSG_STATUS([ptolemy/actor/lib/security/ is not present,
so we need not find keytool, the certifate command.])
else
AC_MSG_CHECKING([for the keytool command])
if test -f "$PTJAVA_DIR/bin/keytool"; then
PT_MSG_RESULT($PTJAVA_DIR/bin/keytool)
KEYTOOL="$PTJAVA_DIR/bin/keytool"
else
if test -f "$PTJAVA_DIR/Commands/java"; then
PT_MSG_RESULT($PTJAVA_DIR/Commands/java)
KEYTOOL="$PTJAVA_DIR/Commands/keytool"
else
AC_MSG_WARN([Cannot find '$PTJAVA_DIR/bin/keytool'.
or '$PTJAVA/Commands/keytool', looking in the path.
This is only a problem when testing the security actors.])
AC_PATH_PROG(KEYTOOL, keytool)
fi
fi
if test ! -x "$KEYTOOL"; then
AC_MSG_WARN([The keytool command "$KEYTOOL" is not executable or not found.
This is only a problem when testing the security actors.])
fi
fi
#--------------------------------------------------------------------
# Figure out which separator to use for CLASSPATH
# So much for write once, run everywhere.
# Find NT4 and Windows 2000 (CYGWIN_NT-4.0 and
# CYGWIN_NT-5.0 respectively)
#--------------------------------------------------------------------
AC_MSG_CHECKING([for the proper CLASSPATH separator])
# If you mess with this, consider changing the jdkClassPathSeparator
# proc in ptII/util/testsuite/jdktools.tcl
case "`uname -s`" in
CYGWIN_ME-*) CLASSPATHSEPARATOR=";";;
CYGWIN_NT-*) CLASSPATHSEPARATOR=";";;
CYGWIN_98-*) CLASSPATHSEPARATOR=";";;
*) CLASSPATHSEPARATOR=":";;
esac
PT_MSG_RESULT(['$CLASSPATHSEPARATOR'])
#--------------------------------------------------------------------
# Get ready to accumulate information for Eclipse and Ant
#--------------------------------------------------------------------
# These directories are always excluded from Eclipse
# To add to this list, edit .classpath.in
ECLIPSE_EXCLUDING_SRC="ptolemy/actor/lib/reactable/"
# Jar files to include in the Eclipse library
#ECLIPSE_CLASSPATHENTRY_LIBS='<classpathentry kind="lib" path="lib/diva.jar"/>'
ECLIPSE_CLASSPATHENTRY_LIBS=''
# Add any jar files in $HOME/.ptolemyII
# FIXME: Eclipse should support Java 1.6 style * classpaths
# The Cygwin value of $HOME is not understood by Java under Windows.
if test "$windows" = "yes"; then
tmpHOME="`cygpath --mixed $HOME`"
else
tmpHOME="$HOME"
fi
for jar in $tmpHOME/.ptolemyII/*.jar
do
if test -f "$jar"; then
if test "$windows" = "yes" ; then
# Avoid /cygdrive/c in .classpath
jar=`cygpath --mixed "$jar"`
fi
# Avoid adding .ptolemyII/*.jar to .classpath
ECLIPSE_CLASSPATHENTRY_LIBS="$ECLIPSE_CLASSPATHENTRY_LIBS \
<classpathentry kind=\"lib\" path=\"$jar\"/> "
# Ant understands * style classpaths, so no need to update Ant.
fi