File: configure.in

package info (click to toggle)
jhdf 2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,312 kB
  • ctags: 6,966
  • sloc: java: 51,714; ansic: 17,051; sh: 1,963; makefile: 938
file content (831 lines) | stat: -rwxr-xr-x 20,462 bytes parent folder | download
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
#****************************************************************************/
#* NCSA HDF                                                                 *
#* National Comptational Science Alliance                                   *
#* University of Illinois at Urbana-Champaign                               *
#* 605 E. Springfield, Champaign IL 61820                                   *
#*                                                                          *
#* For conditions of distribution and use, see the accompanying             *
#* hdf-java/COPYING file.                                                   *
#*                                                                          *
#****************************************************************************/

dnl Process this file with autoconf to produce a configure script.

AC_INIT(native/hdflib/hdfImp.c)
AC_CONFIG_AUX_DIR(./Config)

dnl ----------------------------------------------------------------------
dnl Some platforms have broken tr, basename, and/or xargs programs. Check
dnl that it actually does what it's supposed to do. Catch this early
dnl since configure relies upon tr heavily and there's no use continuing
dnl if it's broken.
dnl
AC_MSG_CHECKING([if tr works])
TR_TEST="`echo Test | tr 'a-z,' 'A-Z '`"
if test $TR_TEST != "TEST"; then
  AC_MSG_ERROR([tr program doesn't work])
else
  AC_MSG_RESULT([yes])
fi

AC_PROG_AWK
dnl ----------------------------------------------------------------------
dnl Some platforms have broken 'expr' programs. Check
dnl that it actually does what it's supposed to do. Catch this early
dnl since configure relies upon 'expr' to process its arguments, and
dnl there isn't much use continuging if it's broken.
dnl
AC_MSG_CHECKING([if expr works])
yyy_ok="yes"
yyy_option="$*"
for yyy_option
do
  yyy_opt=`expr "x$yyy_option" : 'x.*=.*'`
  if test "$yyy_opt" != "0"; then
	  zzz_opt=`echo x$yyy_option | awk '{print [index($0,"=")]}'`
	  if test "$yyy_opt" != "$zzz_opt"; then
	#	AC_MSG_WARN([$yyy_option: option is empty?])
	#	yyy_ok="maybe"
	#  else
		  yyy_optarg=`expr "x$yyy_option" : 'x[[^=]]*=\(.*\)'`
		  if test -z "$yyy_optarg"; then
			AC_MSG_RESULT([option $yyy_option too long, configure will fail])
			yyy_ok="no"
		  fi
	  fi
  fi
done
if test "$yyy_ok" != "yes"; then
echo $yyy_ok
  AC_MSG_ERROR([expr program doesn't work])
else
  AC_MSG_RESULT([yes])
fi

dnl Checks for programs.
AC_PROG_CC

AC_PROG_MAKE_SET
AC_PROG_INSTALL

AC_HEADER_STDC                    
AC_CHECK_LIB(m,ceil)

if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then
  dnl ...for Solaris and hdf4
  AC_CHECK_LIB(nsl, xdr_int)
fi


AC_PREFIX_DEFAULT("")
AC_PATH_PROG(RM,rm,\"\",,)
AC_PATH_PROG(FIND,find,\"\",,)

dnl
dnl  Some platform specific settings for different Java implementations
dnl
AC_CANONICAL_SYSTEM
TARGET=$target
echo "FYI the target here is: "$target
case $target in
alpha-dec-osf*.*) TARGETLIB="alpha"
LD=$CC; LDOPT="-pthread -shared"; SLEXT="so";
LLEXT="a";
JSLEXT="so";
COPT="-pthread -shared"; COPTNOSHARED=;
;;
*aix*) TARGETLIB="aix"
LD=$CC; LDOPT=-G; SLEXT="so";
LLEXT="a";
JSLEXT="so";
COPT=-G; COPTNOSHARED=;
;;
*-*-solaris2*) TARGETLIB="solaris"
LD=$CC; LDOPT=-G; SLEXT="so";
LLEXT="a";  
JSLEXT="so";
COPT=-G; COPTNOSHARED=; 
;;
mips*-sgi-irix6*) 
TARGETLIB="irix"
LD=ld; 
LLEXT="a";  
JSLEXT="so";
;;
x86_64-pc-linux*) LD=$CC; LDOPT=-shared; SLEXT="so";
TARGETLIB="linux"
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared -Dx86_64 -fPIC" ; 
;;
ia64-pc-linux*) LD=$CC; LDOPT=-shared; SLEXT="so";
TARGETLIB="linux"
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared -Dia64 -fPIC" ; 
;;
*-pc-linux*) LD=$CC; LDOPT=-shared; SLEXT="so";
TARGETLIB="linux"
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared -DUNIX386" ; 
;;
*-freebsd*) LD=$CC; LDOPT=-shared;
TARGETLIB="freebsd"
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared" ;
;;
*powerpc-apple*) 
LD=$CC; LDOPT=-bundle; 
JSLEXT="jnilib";
LLEXT="a";
SLEXT="dylib";
;;
*) LD=$CC; LDOPT=-G; SLEXT="so";
LLEXT="a";
TARGETLIB="$target"
esac

dnl ----------------
dnl  Check for the external compression libraries required by the 
dnl  HDF libraries.
dnl
dnl  Note:  we need to find static libraries, so we can't rely on
dnl  autoconf for these detections.
dnl

AC_MSG_CHECKING([gzip compression])
HAVE_ZLIB="no"
withval="";
AC_SUBST(ZLIB) ZLIB=""
AC_ARG_WITH(libz,[  --with-libz=LIB     Path to the gzip library (required if not in default path)],,)

case "$withval" in
  yes)
      ZLIB=""
	HAVE_ZLIB="no"
    ;;
  no)
      ZLIB=""
	HAVE_ZLIB="suppressed"
    ;;
  *)
    if test -n "$withval" ; then
        z_lib="`echo $withval |cut -f2 -d, -s`"
	ZLIB=$z_lib"/libz."$LLEXT
	HAVE_ZLIB="yes"
    else
      ZLIB=""
	HAVE_ZLIB="no"
    fi
;;
esac
if test -n "$ZLIB"; then
	LIBS="$LIBS $ZLIB"
	HAVE_ZLIB="yes"
fi
AC_MSG_RESULT([$HAVE_ZLIB])
if test $HAVE_ZLIB = "yes"; then
    	AC_MSG_RESULT([zlib found: $ZLIB]);
fi

AC_MSG_CHECKING([jpeg compression])
HAVE_JPEG="no"
withval="";
AC_SUBST(JPEGLIB) JPEGLIB=""
AC_ARG_WITH(libjpeg,[  --with-libjpeg=LIB     Path to the jpeg library (required if not in default path)],,)

case "$withval" in
  yes)
	HAVE_JPEG="no"
    ;;
  no)
      JPEGLIB=""
	HAVE_JPEG="suppressed"
    ;;
  *)
    if test -n "$withval" ; then
        jpeg_lib="`echo $withval |cut -f2 -d, -s`"
	JPEGLIB=$jpeg_lib"/libjpeg."$LLEXT
    	#AC_MSG_RESULT([jpeg found: $JPEGLIB]);
	HAVE_JPEG="yes"
    else
	HAVE_JPEG="no"
    fi
;;
esac
if test -n "$JPEGLIB"; then
	LIBS="$LIBS $JPEGLIB"
	HAVE_JPEG="yes"
fi
AC_MSG_RESULT([$HAVE_JPEG])
if test $HAVE_JPEG = "yes"; then
    	AC_MSG_RESULT([jpeg found: $JPEGLIB]);
fi

AC_MSG_CHECKING([szip compression])
HAVE_SZIP="no"
withval="";
AC_SUBST(SZLIB) SZLIB=""
AC_ARG_WITH(libsz,[  --with-libsz=LIB     Path to the szip library (required if not in default path)],,)

case "$withval" in
  yes)
      SZLIB=""
	HAVE_SZIP="no"
    ;;
  no)
      SZLIB=""
	HAVE_SZIP="suppressed"
    ;;
  *)
	if test -n "$withval" ; then
	    sz_lib="`echo $withval |cut -f2 -d, -s`"
		SZLIB=$sz_lib"/libsz."$LLEXT
		#AC_MSG_RESULT([szlib found: $SZLIB]);
		HAVE_SZIP="yes"
	else
	      SZLIB=""
		HAVE_SZIP="no"
	fi
  ;;
esac
if test -n "$SZLIB"; then
	LIBS="$LIBS $SZLIB"
	HAVE_SZIP="yes"
fi
AC_MSG_RESULT([$HAVE_SZIP])
if test $HAVE_SZIP = "yes"; then
    	AC_MSG_RESULT([szlib found: $SZLIB]);
fi

dnl
dnl  Look for HDF4 library, if selected.
dnl  Must find static libraries.
dnl
AC_MSG_CHECKING([HDF4 library])
HAVE_HDF4="no"
withval="";
AC_SUBST(HDF4LIB) HDF4LIB=""
AC_ARG_WITH(hdf4,[  --with-hdf4=LIB     Path to the hdf library (required if not in default path)],,)

case "$withval" in
  yes)
    #AC_MSG_ERROR(HDF4 library needed for compilation.)
      HDF4LIB=""
	HAVE_HDF4="no"
    ;;
  no)
      HDF4LIB=""
	HAVE_HDF4="suppressed"
    ;;
  *)
	if test -n "$withval" ; then
	    hdf4_inc="`echo $withval |cut -f1 -d,`"
	    if test -n "$hdf4_inc"; then
	      HDF4INC="$hdf4_inc"
	    fi
	    hdf4_lib="`echo $withval |cut -f2 -d, -s`"
	    if test -n "$hdf4_lib"; then
		HDF4LIB=$hdf4_lib
	    fi
	    HAVE_HDF4="yes"
	else
	      HDF4LIB=""
	    HAVE_HDF4="no"
	fi
	;;
esac
if test -n "$HDF4LIB"; then
	LIBS="$HDF4LIB/libdf.$LLEXT $HDF4LIB/libmfhdf.$LLEXT $LIBS"
	HAVE_HDF4="yes"
fi
AC_MSG_RESULT([$HAVE_HDF4])
if test $HAVE_HDF4 = "yes"; then
    	AC_MSG_RESULT([HDF4 found: $HDF4LIB]);
fi

dnl
dnl  Check that the libraries that HDF4 needs have been found
dnl
dnl  Must stop here if something is missing.
dnl
if test "$HAVE_HDF4" = "yes"; then
	AC_MSG_CHECKING([dependencies for HDF4 library])
	needjpg=`grep 'define H4_HAVE_LIBJPEG 1' $HDF4INC/h4config.h`
	needgzip=`grep 'define H4_HAVE_LIBZ 1' $HDF4INC/h4config.h`
	needszip=`grep 'define H4_HAVE_LIBSZ 1' $HDF4INC/h4config.h`
	if test -n "$needjpg"; then
		if test "$HAVE_JPEG" != "yes"; then
		    AC_MSG_ERROR([ HDF4 library needs JPEG, JPEG not defined.])
		fi
	fi

	if test -n "$needgzip"; then
		if test "$HAVE_ZLIB" != "yes"; then
		    AC_MSG_ERROR([ HDF4 library needs GZIP, GZIP not defined.])
		fi
	fi

	if test -n "$needszip"; then
		if test "$HAVE_SZIP" != "yes"; then
		    AC_MSG_ERROR([ HDF4 library needs SZIP, SZIP not defined.])
		fi
	fi
	AC_MSG_RESULT([OK])
fi


ac_cv_lib_HDF4=$HDF4LIB
ac_cv_lib_HDF4INC=$HDF4INC


AC_MSG_CHECKING([HDF5 library])
HAVE_HDF5="no"
withval="";
AC_SUBST(HDF5LIB) HDF5LIB=""
AC_ARG_WITH(hdf5,[  --with-hdf5=LIB     Path to the hdf5 library (required if not in default path)],,)

case "$withval" in
  yes)
      HDF5LIB=""
	HAVE_HDF5="no"
    ;;
  no)
      HDF5LIB=""
	HAVE_HDF5="suppressed"
    ;;
  *)
	if test -n "$withval" ; then
	    hdf5_lib="`echo $withval |cut -f2 -d, -s`"
		HDF5LIB=$hdf5_lib"/libhdf.$LLEXT"
	    hdf5_inc="`echo $withval |cut -f1 -d,`"
	    if test -n "$hdf5_inc"; then
	      HDF5INC="$hdf5_inc"
	    fi
	    hdf5_lib="`echo $withval |cut -f2 -d, -s`"
	    if test -n "$hdf5_lib"; then
		HDF5LIB=$hdf5_lib
	    fi
	    HAVE_HDF5="yes"
	else
	      HDF5LIB=""
	    HAVE_HDF5="no"
	fi
	;;
esac
if test -n "$HDF5LIB"; then
	LIBS="$HDF5LIB/libhdf5.$LLEXT $LIBS"
	HAVE_HDF5="yes"
fi
AC_MSG_RESULT([$HAVE_HDF5])
if test $HAVE_HDF5 = "yes"; then
    	AC_MSG_RESULT([HDF5 found: $HDF5LIB]);
fi

dnl
dnl  Check that the libraries that HDF4 needs have been found
dnl
dnl  Must stop here if something is missing.
dnl
if test -n "$HDF5LIB"; then
	AC_MSG_CHECKING([dependencies for HDF5 library])
	DFL=`grep 'filters (external)' $HDF5LIB"/libhdf5.settings" | grep deflate`
	SZP=`grep 'filters (external)' $HDF5LIB"/libhdf5.settings" | grep szip`
	if test -n "$DFL";
	then
		if test "$HAVE_ZLIB" != "yes"; then
		    AC_MSG_ERROR([ HDF5 library needs GZIP, GZIP not defined.])
		fi
	fi
	if test -n "$SZP";
	then
		if test "$HAVE_SZIP" != "yes"; then
		    AC_MSG_ERROR([ HDF5 library needs SZIP, SZIP not defined.])
		fi
	fi
	AC_MSG_RESULT([OK])
fi
ac_cv_lib_HDF5=$HDF5LIB
ac_cv_lib_HDF5INC=$HDF5INC


dnl check for libh4toh5  == if with-h4toh5 is not set, then can
dnl only build hdf and hdf5 separately.
dnl
dnl  This code need to be updated to check all the dependencies,
dnl  as for H4 and H5 libs above.

AC_MSG_CHECKING([HDF4to5 library])
USEH45="no"
withval="";
AC_SUBST(LIBH45) LIBH45=""
AC_ARG_WITH(h4toh5,[  --with-h4toh5=INC,LIB     Path to the HDF 4 to 5 library (optional feature, if selected then path required is not in default path)],,)
case "$withval" in
  yes)
	USEH45="no"
    ;;
  no)
	H45LIB=""
	H45INC=""
	USEH45="suppressed"
    ;;
  *)
    if test -n "$withval"; then
        hdf45_inc="`echo $withval |cut -f1 -d,`"
        if test -n "$hdf45_inc"; then
          HDF45INC="$hdf45_inc"
          saved_CPPFLAGS="$CPPFLAGS"
          CPPFLAGS="$CPPFLAGS -I$hdf45_inc"
        fi
    
        AC_CHECK_HEADERS(h4toh5.h,,
                         CPPFLAGS="$saved_CPPFLAGS"
                         AC_MSG_ERROR(cannot find HDF45 header files!))
    
        hdf45_lib="`echo $withval | cut -f2 -d, -s`"
    
        if test -n "$hdf45_lib"; then
          HDF45LIB="$hdf45_lib"
          saved_LDFLAGS="$LDFLAGS"
          LDFLAGS="$LDFLAGS -L$hdf45_lib"
          AC_CHECK_LIB(h4toh5, H4toh5open,, LDFLAGS="$saved_LDFLAGS"
                     AC_MSG_ERROR(cannot find HDF45 library.))
        else
    	 AC_MSG_ERROR(cannot find HDF45 library path.)
        fi
	USEH45="yes"
    fi
    ;;
esac

AC_MSG_RESULT([$USEH45])
if test -n "$H45LIB"; then
	AC_MSG_RESULT([h4toh5 library found at: $HDF45LIB])
fi
H45LIB=$HDF45LIB
H45INC=$HDF45INC

ac_cv_lib_HDF45=$HDF45LIB
ac_cv_lib_HDF45INC=$HDF45INC

dnl  find java stuff:  use -with-jdk

withval="";
AC_SUBST(jdkclasses) jdkclasses=""
AC_ARG_WITH(jdkclasses,[  --with-classpath=LIB],,)

jdkclasses=$withval

withval="";
AC_SUBST(JAVALIB) JAVALIB=""
AC_ARG_WITH(jdk,[  --with-jdk=INC,LIB     Path to the JDK (required if not in default path)],,)
case "$withval" in
  yes)
    AC_MSG_ERROR(JDK needed for compilation.)
    ;;
  no)
    AC_MSG_ERROR(JDK needed for compilation.)
    ;;
  *)
    jdk_inc="`echo $withval |cut -f1 -d,`"
    if test -n "$jdk_inc"; then
      JAVAINC="$jdk_inc"
      saved_CPPFLAGS="$CPPFLAGS"
      CPPFLAGS="$CPPFLAGS $COPT -I$jdk_inc -I$jdk_inc/$TARGETLIB"
    fi

    AC_CHECK_HEADERS(jni.h,,
                     CPPFLAGS="$saved_CPPFLAGS"
                     AC_MSG_ERROR(cannot find JDK header files!))

    jdk_lib="`echo $withval | cut -f2 -d, -s`"

    if test -n "$jdk_lib"; then
      JAVALIB="$jdk_lib"
    else
	 AC_MSG_ERROR(cannot find jdk library path.)
    fi
    ;;
esac

if test -n "$jdkclasses"; then

if test -f $jdkclasses/classes.jar ; then
	JAVACLASSES=$jdkclasses/classes.jar
	JAVACLASSPATH_FOUND=1
else
	 AC_MSG_ERROR(cannot find jdk classes in JDK lib path.)
fi
else

if test -f $JAVALIB/classes.zip ; then
	JAVACLASSES=$JAVALIB/classes.zip
	JAVACLASSPATH_FOUND=1
elif test -f $JAVALIB/core.jar ; then
	JAVACLASSES=$JAVALIB/rt.jar
	JAVACLASSPATH_FOUND=1
elif test -f $JAVALIB/rt.jar ; then
	JAVACLASSES=$JAVALIB/rt.jar
	JAVACLASSPATH_FOUND=1
elif test -d $JAVALIB/classes ; then
	JAVACLASSES=$JAVALIB/classes
	JAVACLASSPATH_FOUND=1
else
	JL=`dirname $JAVALIB`
	if test -f $JL/jre/lib/rt.jar; then
		JAVACLASSES=$JL/jre/lib/rt.jar
		JAVACLASSPATH_FOUND=1
		JAVALIB=$JL/jre/lib
		AC_SUBST(JAVALIB) JAVALIB=""
	else
		 AC_MSG_ERROR(cannot find jdk classes in JDK lib path.)
	fi
fi
fi
HERE=`pwd`
CLASSPATH="$JAVACLASSES"":""$HERE"

withval="";
AC_SUBST(javabin) javabin=""
AC_ARG_WITH(javabin,[  --with-javabin=LIB],,)
javabin=$withval

if test -n "$javabin" ; then
JAVABIN=$javabin
else
JAVABIN=`dirname $JAVAINC`
JAVABIN="$JAVABIN/bin"
fi

AC_PATH_PROG(JAVA,java,,$JAVABIN,)
AC_PATH_PROG(JAVAC,javac,,$JAVABIN,)
AC_PATH_PROG(JAVADOC,javadoc,,$JAVABIN,)
AC_PATH_PROG(JAR,jar,,$JAVABIN,)

dnl  optional find the jhdf wrappers 

withval="";
AC_ARG_WITH(jhdf4,[  --with-jhdf4=LIB     Path to the jhdf4,jar (optional override, used only by H4 to H5) ],,)
case "$withval" in
  yes)
    AC_MSG_ERROR(jhdf4 path needed for compilation.)
    ;;
  no)
    #AC_MSG_ERROR(jhdf4 needed for compilation.)
	# use default path
    ;;
  *)
    jhdf_jar="`echo $withval |cut -f1 -d,`"
    if test -n "$jhdf_jar"; then
	CLASSPATH="$CLASSPATH"":""$jhdf_jar""/jhdf.jar"
    #else
        #AC_MSG_ERROR(jhdf.jar needed for compilation.)
	# use default path...
    fi
    ;;
esac

withval="";
AC_ARG_WITH(jhdf5,[  --with-jhdf5=LIB     Path to the jhdf45.jar (optional override, used only by the H4 to H5 library) ],,)
case "$withval" in
  yes)
    AC_MSG_ERROR( jhdf5 path needed for compilation.)
    ;;
  no)
    #AC_MSG_ERROR( jhdf5 needed for compilation.)
	# use default path
    ;;
  *)
    jhdf5_jar="`echo $withval |cut -f1 -d,`"
    if test -n "$jhdf5_jar"; then
	CLASSPATH="$CLASSPATH"":""$jhdf5_jar""/jhdf5.jar"
    #else
	   # AC_MSG_ERROR(jhdf5.jar needed for compilation.)
	# use default path...
    fi
    ;;
esac

ac_cv_lib_JAVAINC=$JAVAINC


if test "$prefix" != "NONE" ; then
	JH45INST="$prefix"
else
	JH45INST=""
fi

JH45INST_FOUND=1
if test -z "$JH45INST" ; then
AC_CACHE_CHECK("JH45 install directory",ac_cv_lib_JH45INST,JH45INST_FOUND=0)
fi
if test $JH45INST_FOUND -eq 1; then
	if test -z "$JH45INST" ; then
		JH45INST=$ac_cv_lib_JH45INST;
	fi
	if test \( ! -d "$JH45INST" \); then
		JH45INST_FOUND=0
	fi
	if test \( ! -w "$JH45INST" \); then
		AC_MSG_ERROR( [ $JAVINST : not writable ])
		JH45INST_FOUND=0
	fi
fi
until test $JH45INST_FOUND -eq 1; do
	echo "Please type the directory in which to install the JH45"
	read JH45INST
	JH45INST_FOUND=1
	if test \( ! -d "$JH45INST" \); then
		JH45INST_FOUND=0
	fi
	if test \( ! -w "$JH45INST" \); then
		AC_MSG_ERROR( [ $JAVINST : not writable ])
		JH45INST_FOUND=0
	fi
done

ac_cv_lib_JH45INST=$JH45INST
JHVINST=$JH45INST
JH5INST=$JH45INST

case $target in
alpha-dec-osf*.*)
LD=$CC; LDOPT="-pthread -shared"; SLEXT="so";
LLEXT="a";
JSLEXT="so";
COPT="-pthread -shared"; COPTNOSHARED=;
JAVAINC2=$JAVAINC/alpha ; JAVATARG=alpha;
;;
*aix*)
LD=$CC; LDOPT=-G; SLEXT="so";
LLEXT="a";
JSLEXT="so";
COPT=-G; COPTNOSHARED=;
JAVAINC2=$JAVAINC/aix ; JAVATARG=aix;
;;
*-*-solaris2*) 
LD=$CC; LDOPT=-G; SLEXT="so";
LLEXT="a";  
JSLEXT="so";
COPT=-G; COPTNOSHARED=; 
JAVAINC2=$JAVAINC/solaris ; JAVATARG=solaris;
;;
mips*-sgi-irix6*) 
LD=ld; 
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";  
OS=`uname -r`;
SYS=`uname -s`
if test "$SYS" = "IRIX"; then
LDOPT2="-check_registry /usr/lib/so_locations"; SLEXT="so";
if test "$GCC" = "yes" ; then
LDOPT="-shared";
COPT="-shared" ; COPTNOSHARED=""; 
else
LDOPT="-n32 -shared";
COPT="-n32 -shared" ; COPTNOSHARED="-n32"; 
fi
elif test "$SYS" = "IRIX64"; then
LDOPT2="-check_registry /usr/lib/so_locations"; SLEXT="so";
if test "$GCC" = "yes" ; then
LDOPT="-shared";
COPT="-shared" ; COPTNOSHARED=""; 
else
LDOPT="-n32 -shared";
COPT="-n32 -shared" ; COPTNOSHARED="-n32"; 
fi
else 
echo "No such system: "$SYS
fi
JSLEXT="so";
JAVAINC2=$JAVAINC/irix; JAVATARG=irix-$OS;
;;
x86_64-pc-linux*) LD=$CC; LDOPT=-shared;
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared -Dx86_64 -fPIC" ;
JAVAINC2=$JAVAINC/linux;
JAVATARG=linux;
;;
ia64-pc-linux*) LD=$CC; LDOPT=-shared;
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared -Dia64 -fPIC" ;
JAVAINC2=$JAVAINC/linux;
JAVATARG=linux;
;;
*-pc-linux*) LD=$CC; LDOPT=-shared; 
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared -DUNIX386" ; 
JAVAINC2=$JAVAINC/linux; 
JAVATARG=linux;
;;
*-freebsd*) LD=$CC; LDOPT=-shared;
SLEXT="so";
LLEXT="a";  # the extension for the HDF and other libraries to link to
JSLEXT="so";
COPT="-shared" ;
JAVAINC2=$JAVAINC/freebsd; 
JAVATARG=freebsd;
;;
*powerpc-apple*) 
LD=$CC; LDOPT=-bundle; 
JSLEXT="jnilib";
LLEXT="a";
SLEXT="dylib";
JAVAINC2=$JAVAINC/macosx; 
JAVATARG=macosx;
;;
*) LD=$CC; LDOPT=-G; SLEXT="so";
JSLEXT="so";
LLEXT="a";
COPT=-shared; COPTNOSHSARED=; JAVAINC2=$JAVAINC/$target; JAVATARG=$TARGET ;;
esac

AC_SUBST(LD)
AC_SUBST(LDOPT)
AC_SUBST(LDOPT2)
AC_SUBST(LLEXT)
AC_SUBST(SLEXT)
AC_SUBST(JSLEXT)
AC_SUBST(COPT)
AC_SUBST(COPTNOSHARE)
AC_SUBST(RM)
AC_SUBST(AWK)
AC_SUBST(FIND)
AC_SUBST(JAVA)
AC_SUBST(JAVABIN)
AC_SUBST(JAVAC)
AC_SUBST(JAVADOC)
AC_SUBST(JAVAINC)
AC_SUBST(JAVAINC2)
AC_SUBST(HDF5LIB)
AC_SUBST(HDF5INC)
AC_SUBST(HDF4LIB)
AC_SUBST(HDF4INC)
AC_SUBST(H45LIB)
AC_SUBST(H45INC)
AC_SUBST(TARGET)
AC_SUBST(JAVATARG)
AC_SUBST(JAR)
AC_SUBST(CLASSPATH)
AC_SUBST(JH45INST)
AC_SUBST(JHVINST)
AC_SUBST(JH5INST)
AC_SUBST(ZLIB)
AC_SUBST(SZLIB)

AC_SUBST_FILE(VERSION)
VERSION=./VERSION
VERSSTRING=`/bin/cat ./VERSION | sed -e 's/VERSION=HDF-JAVA-//' `
AC_SUBST(VERSSTRING)


##
## Select one of the following, depending on what is being distributed.
##

OUTPUT_FILES="Makefile native/Makefile native/hdflib/Makefile native/hdf5lib/Makefile bin/hdfview.sh"
if test "$USEH45" = "yes"; then
##  want H4toH5 configured
if test -d "./test"; then
##
##  Everything
##
OUTPUT_FILES="$OUTPUT_FILES native/hdf5lib/Makefile test/Makefile test/object/testh4file.sh test/object/testh5file.sh test/object/Makefile test/object/runtests.sh examples/Makefile examples/intro/Makefile examples/datasets/Makefile examples/datatypes/Makefile examples/groups/Makefile"
else
##
##  H4, H5, H45, but NO tests
##
OUTPUT_FILES="Makefile native/Makefile native/hdflib/Makefile native/hdf5lib/Makefile"
fi
else
if test -d "./test"; then
##  Don't use H4toH5 (but do include some tests)
OUTPUT_FILES="$OUTPUT_FILES test/linktest/Makefile test/linktest/testlink test/linktest/testh4link test/Makefile test/object/Makefile test/object/testh4file.sh test/object/testh5file.sh test/object/runtests.sh test/h5/TestHDF5.sh test/object/TestH5Object.sh test/object/TestH5Table.sh test/object/TestH5MemoryLeak.sh test/unittests/Makefile test/unittests/unittests.sh examples/Makefile examples/intro/Makefile examples/datasets/Makefile examples/datatypes/Makefile examples/groups/Makefile examples/runExample.sh"
else
##  Don't use H4toH5 (no tests)
OUTPUT_FILES="$OUTPUT_FILES"
fi
fi

AC_OUTPUT($OUTPUT_FILES)

if test -d "./test"; then
chmod +x test/object/TestH5Object.sh
chmod +x test/object/TestH5Table.sh
chmod +x test/object/TestH5MemoryLeak.sh
chmod +x test/unittests/unittests.sh
fi