-
Notifications
You must be signed in to change notification settings - Fork 0
/
aclocal.m4
1514 lines (1394 loc) · 52.9 KB
/
aclocal.m4
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
# generated automatically by aclocal 1.12 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
# Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
dnl
dnl AC_PATH_NETCDF()
dnl
dnl This macro looks for version 4 of the netcdf library. Specifically, it looks for a
dnl version-4 netcdf library that includes the script "nc-config", which is queried
dnl for the information. "nc-config" first appeared in netcdf release 4.1-beta2, which
dnl is what this is tested with.
dnl
dnl Defines NETCDF_LIBS, NETCDF_CPPFLAGS, and NETCDF_LDFLAGS, or exits with an error message.
dnl I.e., the intent is to have this used when the application REQUIRES the netcdf v4 library.
dnl
dnl version 1.0
dnl 21 Jan 2010
dnl David W. Pierce
dnl Climate Research Division
dnl Scripps Institution of Oceanography
dnl dpierce@ucsd.edu
dnl
dnl *******************************************************************************
dnl This code is in the public domain, and can be used for any purposes whatsoever.
dnl *******************************************************************************
dnl
dnl
AC_DEFUN([AC_PATH_NETCDF],[
AC_ARG_WITH( nc_config, [ --with-nc-config=path to nc-config script from netcdf v4 package], NC_CONFIG=$withval)
dnl
dnl
dnl =================================================================================
dnl check for netcdf include directory
dnl
err=0
if test x$NC_CONFIG = x; then
NC_CONFIG_SHORT=nc-config
NC_CONFIG_FULLQUAL=nc-config
NC_CONFIG_PATH=$PATH
else
echo "user specified nc-config is $NC_CONFIG"
NC_CONFIG_SHORT=`basename $NC_CONFIG`
NC_CONFIG_FULLQUAL=$NC_CONFIG
NC_CONFIG_PATH=`dirname $NC_CONFIG`
fi
AC_CHECK_PROG( HAS_NC_CONFIG, [$NC_CONFIG_SHORT], [yes], [no], [$NC_CONFIG_PATH] )
if test x$HAS_NC_CONFIG = xno; then
echo "-----------------------------------------------------------------------------------"
echo "Error, nc-config not found or not executable. This is a script that comes with the"
echo "netcdf library, version 4.1-beta2 or later, and must be present for configuration"
echo "to succeed."
echo " "
echo "If you installed the netcdf library (and nc-config) in a standard location, nc-config"
echo "should be found automatically. Otherwise, you can specify the full path and name of"
echo "the nc-config script by passing the --with-nc-config=/full/path/nc-config argument"
echo "flag to the configure script. For example:"
echo " "
echo "./configure --with-nc-config=/sw/dist/netcdf4/nc-config"
echo " "
echo "Special note for R users:"
echo "-------------------------"
echo "To pass the configure flag to R, use something like this:"
echo " "
echo "R CMD INSTALL --configure-args=\"--with-nc-config=/home/joe/bin/nc-config\" ncdf4"
echo " "
echo "where you should replace /home/joe/bin etc. with the location where you have"
echo "installed the nc-config script that came with the netcdf 4 distribution."
echo "-----------------------------------------------------------------------------------"
exit -1
fi
dnl
NETCDF_CC=`$NC_CONFIG_FULLQUAL --cc`
NETCDF_LDFLAGS=`$NC_CONFIG_FULLQUAL --libs`
NETCDF_CPPFLAGS=`$NC_CONFIG_FULLQUAL --cflags`
NETCDF_VERSION=`$NC_CONFIG_FULLQUAL --version`
dnl
dnl The following will be either "yes" or "no"
NETCDF_V4=`$NC_CONFIG_FULLQUAL --has-nc4`
dnl
dnl If we get here, we assume that netcdf exists. It might not if, for example,
dnl the package was installed and nc-config is present, but then the libraries
dnl were erased. Assume such deliberately broken behavior is not the case.
dnl
AC_DEFINE([HAVE_NETCDF],1,[Define if you have the NETCDF library, either v3 or v4])
dnl
if test x$NETCDF_V4 = xyes; then
AC_DEFINE([HAVE_NETCDF4],1,[Define if you have version 4 of the NETCDF library])
fi
dnl -----------------------------------------------------------------------------------
dnl At this piont, $NETCDF_V4 will be either "yes" or "no"
dnl
echo "Netcdf library version: $NETCDF_VERSION"
echo "Netcdf library has version 4 interface present: $NETCDF_V4"
echo "Netcdf library was compiled with C compiler: $NETCDF_CC"
dnl
dnl Export our variables
dnl
AC_SUBST(NETCDF_CPPFLAGS)
AC_SUBST(NETCDF_LDFLAGS)
AC_SUBST(NETCDF_LIBS)
AC_SUBST(NETCDF_VERSION)
AC_SUBST(NETCDF_CC)
dnl
])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES
dnl
dnl AC_PATH_PNG()
dnl
dnl Defines PNG_INCDIR and PNG_LIBDIR if they exist, and leaves them undefined
dnl otherwise.
dnl
dnl 13 July 2011
dnl David W. Pierce
dnl Climate Research Division
dnl Scripps Institution of Oceanography
dnl dpierce@ucsd.edu
dnl
dnl *******************************************************************************
dnl This code is in the public domain, and can be used for any purposes whatsoever.
dnl *******************************************************************************
dnl
dnl
AC_DEFUN([AC_PATH_PNG],[
AC_ARG_WITH( png_incdir, [ --with-png_incdir=dir directory containing png includes], PNG_INCDIR=$withval)
dnl
dnl
dnl =================================================================================
dnl check for png include directory
dnl
err=0
if test x$PNG_INCDIR != x; then
AC_CHECK_HEADER( $PNG_INCDIR/png.h,
echo "Using user-specified png include dir=$PNG_INCDIR",
err=1 )
if test $err -eq 1; then
echo "--------------------------------------------------------------------------------"
echo "Error: You specified that the pnginclude directory is $PNG_INCDIR"
echo "but that directory does NOT have required png include file png.h."
echo "You must specify a directory that has the png include files"
echo "--------------------------------------------------------------------------------"
exit -1
fi
fi
if test $err -eq 1; then
echo "Error: user specified png include directory does not have png.h!"
exit -1
fi
if test x$PNG_INCDIR = x; then
AC_CHECK_HEADER( png.h, PNG_INCDIR=. )
fi
if test x$PNG_INCDIR = x; then
AC_CHECK_HEADER( /usr/local/include/png.h, PNG_INCDIR=/usr/local/include )
fi
if test x$PNG_INCDIR = x; then
AC_CHECK_HEADER( /usr/include/png.h, PNG_INCDIR=/usr/include )
fi
if test x$PNG_INCDIR = x; then
AC_CHECK_HEADER( $HOME/include/png.h, PNG_INCDIR=$HOME/include )
fi
if test x$PNG_INCDIR = x; then
AC_CHECK_HEADER( /sw/include/png.h, PNG_INCDIR=/sw/include )
fi
dnl
PNG_INC_PRESENT=no
if test x$PNG_INCDIR != x; then
PNG_INC_PRESENT=yes
PNG_CPPFLAGS=-I$PNG_INCDIR
else
echo "** Could not find the png.h file, so -frames support will not be included **"
echo "** Install the PNG library (and development headers) to fix this **"
fi
dnl =================================================================================
dnl check for png lib directory
dnl
PNG_LIBNAME=libpng.so
dnl
AC_ARG_WITH( png_libdir, [ --with-png_libdir=dir directory containing png library], PNG_LIBDIR=$withval)
err=0
if test x$PNG_LIBDIR != x; then
AC_CHECK_FILE( $PNG_LIBDIR/$PNG_LIBNAME,
echo "Using user-specified png library dir=$PNG_LIBDIR",
err=1 )
fi
if test $err -eq 1; then
echo "Error: user specified png library directory does not have $PNG_LIBNAME !"
exit -1
fi
if test x$PNG_LIBDIR = x; then
AC_CHECK_LIB( png, png_write_png, PNG_LIBDIR=. )
fi
if test x$PNG_LIBDIR = x; then
AC_CHECK_FILE( /usr/local/lib/$PNG_LIBNAME, PNG_LIBDIR=/usr/local/lib )
fi
if test x$PNG_LIBDIR = x; then
AC_CHECK_FILE( /usr/lib/$PNG_LIBNAME, PNG_LIBDIR=/usr/lib )
fi
if test x$PNG_LIBDIR = x; then
AC_CHECK_FILE( /lib/$PNG_LIBNAME, PNG_LIBDIR=/lib )
fi
if test x$PNG_LIBDIR = x; then
AC_CHECK_FILE( $HOME/lib/$PNG_LIBNAME, PNG_LIBDIR=$HOME/lib )
fi
if test x$PNG_LIBDIR = x; then
AC_CHECK_FILE( /sw/lib/$PNG_LIBNAME, PNG_LIBDIR=/sw/lib )
fi
PNG_LIBNAME=`echo $PNG_LIBNAME | sed s/lib// | sed s/\.so//`
dnl
PNG_PRESENT=no
if test $PNG_INC_PRESENT = yes; then
if test x$PNG_LIBDIR != x; then
PNG_PRESENT=yes
PNG_LIBS=-l$PNG_LIBNAME
PNG_LDFLAGS="-L$PNG_LIBDIR $PNG_LIBS"
AC_DEFINE([HAVE_PNG],1,[Define if you have PNG library])
fi
fi
dnl
dnl Export our variables
dnl
AC_SUBST(PNG_CPPFLAGS)
AC_SUBST(PNG_LDFLAGS)
AC_SUBST(PNG_LIBS)
dnl
])
dnl
dnl AC_PATH_UDUNITS2()
dnl
dnl Defines UDUNITS2_INCDIR and UDUNITS2_LIBDIR if they exist, and leaves them undefined
dnl otherwise.
dnl
dnl version 0.2
dnl 21 Feb 2010
dnl David W. Pierce
dnl Climate Research Division
dnl Scripps Institution of Oceanography
dnl dpierce@ucsd.edu
dnl
dnl *******************************************************************************
dnl This code is in the public domain, and can be used for any purposes whatsoever.
dnl *******************************************************************************
dnl
dnl
AC_DEFUN([AC_PATH_UDUNITS2],[
AC_ARG_WITH( udunits2_incdir, [ --with-udunits2_incdir=dir directory containing udunits2 includes], UDUNITS2_INCDIR=$withval)
dnl
dnl
dnl =================================================================================
dnl check for udunits2 include directory
dnl
err=0
if test x$UDUNITS2_INCDIR != x; then
AC_CHECK_HEADER( $UDUNITS2_INCDIR/converter.h,
echo "Using user-specified udunits2 include dir=$UDUNITS2_INCDIR",
err=1 )
if test $err -eq 1; then
echo "--------------------------------------------------------------------------------"
echo "Error: You specified that the udunits-2 include directory is $UDUNITS2_INCDIR"
echo "but that directory does NOT have required udunits-2 include file converter.h."
echo "You must specify a directory that has ALL the udunits-2 include files"
echo "(converter.h as well as udunits2.h)."
echo "--------------------------------------------------------------------------------"
exit -1
fi
AC_CHECK_HEADER( $UDUNITS2_INCDIR/udunits2.h,
echo "Using user-specified udunits2 include dir=$UDUNITS2_INCDIR",
err=1 )
fi
if test $err -eq 1; then
echo "Error: user specified udunits2 include directory does not have udunits2.h!"
exit -1
fi
if test x$UDUNITS2_INCDIR = x; then
AC_CHECK_HEADER( udunits2.h, UDUNITS2_INCDIR=. )
fi
if test x$UDUNITS2_INCDIR = x; then
AC_CHECK_HEADER( /usr/local/include/udunits2.h, UDUNITS2_INCDIR=/usr/local/include )
fi
if test x$UDUNITS2_INCDIR = x; then
AC_CHECK_HEADER( /usr/include/udunits2.h, UDUNITS2_INCDIR=/usr/include )
fi
if test x$UDUNITS2_INCDIR = x; then
AC_CHECK_HEADER( $HOME/include/udunits2.h, UDUNITS2_INCDIR=$HOME/include )
fi
if test x$UDUNITS2_INCDIR = x; then
AC_CHECK_HEADER( /sw/include/udunits2.h, UDUNITS2_INCDIR=/sw/include )
fi
dnl
UDUNITS2_INC_PRESENT=no
if test x$UDUNITS2_INCDIR != x; then
UDUNITS2_INC_PRESENT=yes
UDUNITS2_CPPFLAGS=-I$UDUNITS2_INCDIR
else
echo "** Could not find the udunits2.h file, udunits support will not be included **"
fi
dnl =================================================================================
dnl check for udunits2 lib directory
dnl
UDUNITS2_LIBNAME=libudunits2.a
dnl
AC_ARG_WITH( udunits2_libdir, [ --with-udunits2_libdir=dir directory containing udunits2 library], UDUNITS2_LIBDIR=$withval)
err=0
if test x$UDUNITS2_LIBDIR != x; then
AC_CHECK_FILE( $UDUNITS2_LIBDIR/$UDUNITS2_LIBNAME,
echo "Using user-specified udunits2 library dir=$UDUNITS2_LIBDIR",
err=1 )
fi
if test $err -eq 1; then
echo "Error: user specified udunits2 library directory does not have $UDUNITS2_LIBNAME !"
exit -1
fi
if test x$NETCDF_LIBDIR = x; then
AC_CHECK_LIB( udunits2, ut_read_xml, UDUNITS2_LIBDIR=. )
fi
if test x$UDUNITS2_LIBDIR = x; then
AC_CHECK_FILE( /usr/local/lib/$UDUNITS2_LIBNAME, UDUNITS2_LIBDIR=/usr/local/lib )
fi
if test x$UDUNITS2_LIBDIR = x; then
AC_CHECK_FILE( /usr/lib/$UDUNITS2_LIBNAME, UDUNITS2_LIBDIR=/usr/lib )
fi
if test x$UDUNITS2_LIBDIR = x; then
AC_CHECK_FILE( /lib/$UDUNITS2_LIBNAME, UDUNITS2_LIBDIR=/lib )
fi
if test x$UDUNITS2_LIBDIR = x; then
AC_CHECK_FILE( $HOME/lib/$UDUNITS2_LIBNAME, UDUNITS2_LIBDIR=$HOME/lib )
fi
if test x$UDUNITS2_LIBDIR = x; then
AC_CHECK_FILE( /sw/lib/$UDUNITS2_LIBNAME, UDUNITS2_LIBDIR=/sw/lib )
fi
UDUNITS2_LIBNAME=`echo $UDUNITS2_LIBNAME | sed s/lib// | sed s/\.a//`
dnl
UDUNITS2_PRESENT=no
if test $UDUNITS2_INC_PRESENT = yes; then
if test x$UDUNITS2_LIBDIR != x; then
UDUNITS2_PRESENT=yes
UDUNITS2_LIBS=-l$UDUNITS2_LIBNAME
UDUNITS2_LDFLAGS="-L$UDUNITS2_LIBDIR $UDUNITS2_LIBS"
AC_DEFINE([HAVE_UDUNITS2],1,[Define if you have udunits-2 library])
fi
fi
dnl
dnl ------------------------------------------------------------------------
dnl New feature of udunits2: it now depends on the expat library. Add that
dnl to the flags as well.
dnl ------------------------------------------------------------------------
if test $UDUNITS2_PRESENT = yes; then
haveExpat=yes
LIBSsave=$LIBS
CFLAGSsave=$CFLAGS
LIBS=$UDUNITS2_LDFLAGS
AC_MSG_CHECKING([for expat library (required by udunits2)])
AC_MSG_RESULT()
AC_CHECK_LIB(expat,XML_GetBase,[],[haveExpat=no])
if test x"$haveExpat"x != "xyesx"; then
AC_MSG_ERROR([Could not find the expat library despite the fact that the udunits2 library is installed. This probably means some sort of configuration file error. Please consult with the package maintainer.])
exit -1
fi
EXPAT_LIBS=$LIBS
echo "Expat libraries (needed by udunits2): $EXPAT_LIBS"
UDUNITS2_LDFLAGS="$UDUNITS2_LDFLAGS $LIBS"
LIBS=$LIBSsave
CFLAGS=$CFLAGSsave
fi
dnl Export our variables
dnl
AC_SUBST(UDUNITS2_CPPFLAGS)
AC_SUBST(UDUNITS2_LDFLAGS)
AC_SUBST(UDUNITS2_LIBS)
dnl
])
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.12'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.12], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.12])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 10
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 16
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], [UPC], [depcc="$UPC" am_compiler_list=],
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named 'D' -- because '-MD' means "put the output
# in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
# Solaris 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle '-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# After this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE([dependency-tracking], [dnl
AS_HELP_STRING(
[--enable-dependency-tracking],
[do not reject slow dependency extractors])
AS_HELP_STRING(
[--disable-dependency-tracking],
[speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 6
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 18
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl