File: configure.in

package info (click to toggle)
gmt 3.3.3-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,288 kB
  • ctags: 2,962
  • sloc: ansic: 50,470; sh: 1,760; makefile: 284; asm: 38
file content (408 lines) | stat: -rw-r--r-- 13,075 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
dnl -----------------------------------------------------------------
dnl @(#)configure.in	1.62  12/03/99
dnl
dnl Run GNU autoconf to produce a configure script from this input.
dnl
dnl -----------------------------------------------------------------
dnl
AC_REVISION(configure for GMT 3.3.3)
AC_INIT(src/gmt.h)
owncflags=${CFLAGS:-NONE}
AC_CONFIG_AUX_DIR(`pwd`)
AC_CANONICAL_SYSTEM
AC_LANG_C
AC_PROG_CC
AC_PROG_CPP
AC_PREFIX_DEFAULT(`pwd`)
AC_CONFIG_HEADER(src/gmt_notposix.h:src/gmt_notposix.h.in)
AC_CYGWIN
dnl
dnl -----------------------------------------------------------------
dnl GMT-specific make macros
dnl -----------------------------------------------------------------
dnl
AC_SUBST(EXE)
AC_SUBST(WIN32)
AC_SUBST(EMX)
AC_SUBST(COMPRESS)
AC_SUBST(TRIANGLE_D)
AC_SUBST(TRIANGLE_O)
AC_SUBST(ALPHA_SINCOS_O)
AC_SUBST(GMTLIB)
AC_SUBST(CC_OPT)
AC_SUBST(LD_OPT)
AC_SUBST(LDFLAGS)
AC_SUBST(SL)
AC_SUBST(rootdir)
AC_SUBST(wwwdir)
AC_SUBST(mansection)
dnl
dnl -----------------------------------------------------------------
dnl Special configure options for GMT installation
dnl -----------------------------------------------------------------
dnl
AC_ARG_ENABLE(debug, [  --enable-debug         Compile in debug-information instead of optimizing code])
AC_ARG_ENABLE(shared, [  --enable-shared         Build shared (dynamic) GMT libraries instead of static])
AC_ARG_ENABLE(triangle, [  --enable-triangle       Use J. Shewchuck fast triangulation routine])
AC_ARG_ENABLE(US, [  --enable-US             Choose US (inch) rather than SI (cm) units as default])
AC_ARG_ENABLE(www, [  --enable-www=dir             Directory in which to install GMT www pages [PREFIX/www]])
AC_ARG_ENABLE(mansect, [  --enable-mansect=sect             GMT man page section [l]])
dnl
dnl -----------------------------------------------------------------
dnl Get current OS and chip type
dnl -----------------------------------------------------------------
dnl
os=`uname -s`
chip=`uname -m`
Sun_rev=`uname -r | grep '^5.'`
dnl
dnl -----------------------------------------------------------------
dnl Misc. parameters
dnl -----------------------------------------------------------------
dnl
EXE=
WIN32=
EMX="@:"
COMPRESS="@:"
rootdir=`pwd`
dnl
dnl -----------------------------------------------------------------
dnl Special checking and action required for Cygwin
dnl -----------------------------------------------------------------
dnl
if test "$CYGWIN" = "yes" ; then
	EXE=".exe"
	WIN32="-D_WIN32"
	if test ! -d /tmp ; then
		AC_MSG_WARN(Cygwin: /tmp not found - created)
		mkdir /tmp
	fi
	if test ! -f /bin/sh.exe ; then
		AC_MSG_WARN(Cygwin: /bin/sh not found - created)
		this_sh=`type -p sh`
		cp -f $this_sh /bin
	fi
fi
dnl
dnl -----------------------------------------------------------------
dnl Special checking and action required for OS/2 with EMX support
dnl -----------------------------------------------------------------
dnl
if test "$os" = "OS2" ; then
	EXE=".exe"
	WIN32="-D__EMX__"
	EMX="emxbind -b -h64 -s"
	COMPRESS="lxlite /ML1"
fi
dnl
dnl -----------------------------------------------------------------
dnl Allow user to set --enable-www to set install www dir
dnl -----------------------------------------------------------------
dnl
wwwdir='${prefix}/www'
AC_MSG_CHECKING(for www directory)
if test "$enable_www" = "yes" ; then
	wwwdir='${prefix}/www'
elif test ! "$enable_www" = "" ; then
	wwwdir=$enable_www
fi
AC_MSG_RESULT($wwwdir)
dnl
dnl -----------------------------------------------------------------
dnl Allow user to set --enable-mansect to set man page section
dnl -----------------------------------------------------------------
dnl
AC_MSG_CHECKING(for man page section)
if test "$enable_mansect" = "yes" ; then
	mansection=l
elif test ! "$enable_mansect" = "" ; then
	mansection=$enable_mansect
else
	mansection=l
fi
AC_MSG_RESULT($mansection)
dnl
dnl -----------------------------------------------------------------
dnl Allow user to set --enable-debug to pass -g flag
dnl -----------------------------------------------------------------
dnl
AC_MSG_CHECKING(if we should compile with debugging switch -g)
if test "$enable_debug" = "yes" ; then
	AC_MSG_RESULT(yes)
	OPTG="-g "
	OPTGO="-g "
else
	OPTG=
	OPTGO="-O "
	AC_MSG_RESULT(no)
fi
dnl
dnl -----------------------------------------------------------------
dnl Allow user to set --enable-triangle to use J. Shewchuck's triangulation
dnl -----------------------------------------------------------------
dnl
AC_MSG_CHECKING(if the triangulation by Shewchuck should be used)
if test "$enable_triangle" = "yes" ; then
	AC_MSG_RESULT(yes)
	TRIANGLE_D=-DTRIANGLE_D
	TRIANGLE_O=triangle.o
else
	AC_MSG_RESULT(no)
fi
dnl
dnl -----------------------------------------------------------------
dnl Allow user to set --enable-shared to build shared libraries
dnl -----------------------------------------------------------------
dnl
shared_unknown=no
if test "$enable_shared" = "yes" ; then
	AC_MSG_CHECKING(if we can build shared libraries)
	if test "$os" = "Linux" ; then
		AC_MSG_RESULT(yes)
		GMTLIB='$(SHARED_LIB)'
	elif test "$os" = "FreeBSD" ; then
		AC_MSG_RESULT(yes)
		GMTLIB='$(SHARED_LIB)'
	elif test "$os" = "NetBSD" ; then
		AC_MSG_RESULT(yes)
		GMTLIB='$(SHARED_LIB)'
	elif test "$os" = "SunOS" ; then
		AC_MSG_RESULT(yes)
		GMTLIB='$(SHARED_LIB)'
	elif test "$os" = "HP-UX" ; then
		AC_MSG_RESULT(yes)
		GMTLIB='$(SHARED_LIB)'
	elif test "$os" = "IRIX64" ; then
		AC_MSG_RESULT(yes)
		GMTLIB='$(SHARED_LIB)'
	elif test "$os" = "OSF1" ; then
		AC_MSG_RESULT(yes)
		GMTLIB='$(SHARED_LIB)'
	else	# Not yet implemented
		AC_MSG_RESULT(not supported for GMT under $os)
		enable_shared=no
		shared_unknown=yes
		GMTLIB='$(STATIC_LIB)'
	fi
else
	GMTLIB='$(STATIC_LIB)'
fi
dnl
dnl -----------------------------------------------------------------
dnl Determine LD_OPT and LDFLAGS for this platform
dnl -----------------------------------------------------------------
dnl
LDFLAGS='-s'
LD_OPT=
SL="so"
if test "$enable_shared" = "yes" ; then
	AC_MSG_CHECKING(how to make a shared object)
	if test "$os" = "SunOS" ; then
		if test "$Sun_rev" = "" ; then	# SunOS
			LD_OPT="-Bdynamic"
			LDFLAGS='-s -Wl,-L$(bindir)'
		else				# Solaris
			LD_OPT="-G"
			LDFLAGS='-s -Wl,-R,$(bindir)'
		fi
	elif test "$os" = "Linux" ; then
		LD_OPT="-shared"
		LDFLAGS='-s -Wl,-rpath,$(bindir)'
	elif test "$os" = "FreeBSD" ; then
		LD_OPT="-shared"
		LDFLAGS='-s -Wl,-rpath,$(bindir)'
	elif test "$os" = "NetBSD" ; then
		LD_OPT="-shared"
		LDFLAGS='-s -Wl,-rpath,$(bindir)'
	elif test "$os" = "OSF1" ; then
		LD_OPT='-shared -expect_unresolved "*"'
		LDFLAGS='-s -Wl,-rpath,$(bindir)'
	elif test "$os" = "IRIX64" ; then
		LD_OPT="-shared"
		SL="sl"
		LDFLAGS= '-s -Wl,-rpath,$(bindir)'
	elif test "$os" = "HP-UX" ; then
		LD_OPT="-b"
		LDFLAGS='-s -Wl,+b,$(bindir)'
	fi
	AC_MSG_RESULT(ld $LD_OPT)
	AC_MSG_CHECKING(the file extension for a shared object)
	AC_MSG_RESULT($SL)
fi
AC_MSG_CHECKING(linker options for GMT)
AC_MSG_RESULT($LDFLAGS)
dnl
dnl -----------------------------------------------------------------
dnl Determine CC_OPT for this platform
dnl -----------------------------------------------------------------
dnl
AC_MSG_CHECKING(compiler options for GMT)
if test "$owncflags" = "NONE"; then
	if test "$GCC" = "yes"; then		# GNU cc options
		if test "$chip" = "alpha" ; then	# Alpha PC
			CC_OPT=$OPTG'-mieee'
		else
			CC_OPT=$OPTGO'-ansi -pedantic'
		fi
	elif test "$os" = "SunOS" ; then	# Sun Workshop CC options
		CC_OPT=$OPTGO'-Xc'
	elif test "$os" = "IRIX64" ; then	# SGI Irix cc options
		CC_OPT=$OPTGO'-ansiposix'
	elif test "$os" = "HP-UX" ; then	# HP cc options
		CC_OPT=$OPTG'-Aa +Ofltacc +O1 +Olibcalls'
		if test "$enable_shared" = "yes" ; then
			CC_OPT=$CC_OPT' +z'
		fi
	elif test "$os" = "AIX" ; then		# IBM AIX cc options
		CC_OPT=$OPTG'-O2'
	elif test "$os" = "AUX" ; then		# Apple A/UX cc options
		CC_OPT=$OPTG'-Daux'
	elif test "$os" = "OSF1" ; then		# Dec Alpha OSF cc options
		CC_OPT=$OPTG'-Olimit 1500 -ieee_with_inexact'
	elif test "$os" = "ULTRIX" ; then	# Dec Ultrix cc options
		CC_OPT=$OPTG'-O -Olimit 1500'
	elif test "$os" = "Windows_NT" ; then	# Interix w/ MS cc options
		CC_OPT=$OPTGO
		LDFLAGS=
	else					# Generic setting for unknown systems
		CC_OPT=$OPTGO
	fi
	AC_MSG_RESULT([$CC_OPT (preset for your platform)])
else
	CC_OPT=$CFLAGS
	AC_MSG_RESULT([$CC_OPT (taken from CFLAGS in your environment)])
fi
dnl
dnl -----------------------------------------------------------------
dnl	Create share/gmt.conf
dnl -----------------------------------------------------------------
dnl
AC_MSG_CHECKING(for default GMT units)
if test ! -f share/gmt.conf.orig ; then
	cp share/gmt.conf share/gmt.conf.orig
fi
\rm -f share/gmt.conf
if test "$enable_US" = "yes" ; then
	AC_MSG_RESULT(US (inch))
	echo "US        <- Set to SI or US" > share/gmt.conf
else
	AC_MSG_RESULT(SI (cm))
	echo "SI        <- Set to SI or US" > share/gmt.conf
fi
egrep -v '^SI|^US' share/gmt.conf.orig >> share/gmt.conf
AC_MSG_RESULT(Initialized share/gmt.conf)
dnl
dnl -----------------------------------------------------------------
dnl Check for libraries.  Most installs will need to have
dnl -lm but under Rhapsody it is not needed.  Thus, we look
dnl for sin in -lm which should set -lm on most platforms.
dnl We also look for sincos in -m and -lsunmath for Solaris.
dnl -----------------------------------------------------------------
dnl
AC_SEARCH_LIBS(sin, m)
AC_SEARCH_LIBS(sincos, [m sunmath], [SINCOS=1], [SINCOS=0])
dnl
dnl OSF specific check for broken sincos from Lloyd Parkes (lloyd@geo.vuw.ac.nz)
dnl
if test "$SINCOS" = "1" ; then
	AC_MSG_CHECKING(for a broken sincos function)
	AC_TRY_RUN([int main ()
	{
		double s = 0.1, c = 0.2;
		double s1, c1;

		s1 = s; c1 = c;
		sincos (0.5, &s, &c);
		return (s == s1 || c == c1);	/* FALSE if sincos works ok */
	}
	], [ AC_MSG_RESULT(no)
	AC_DEFINE(HAVE_SINCOS)
	], [
	case $target in
		alpha*-osf*)
			AC_DEFINE(HAVE_ALPHASINCOS)
			ALPHA_SINCOS_O=alpha-sincos.o
			AC_MSG_RESULT([yes.])
			AC_MSG_RESULT([An assembly language wrapper will be used to fix sincos.]
		)
		;;
		*)
			AC_MSG_RESULT([yes.])
			AC_MSG_RESULT([I don't know how to fix sincos on this machine.])
	esac
	], [
	AC_MSG_RESULT([no sincos found.])
	])
fi
dnl
dnl -----------------------------------------------------------------
dnl Check for ar, csh/bash, ld, awk, and ranlib
dnl -----------------------------------------------------------------
dnl
AC_CHECK_PROG(AR, ar, ar, :)
AC_CHECK_PROG(CSH, csh, csh, bash, )
AC_CHECK_PROG(LD, ld, ld, :)
AC_CHECK_PROG(AS, as, as, :)
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_RANLIB
dnl
dnl -----------------------------------------------------------------
dnl Check for the availability of many ANSI-C functions
dnl -----------------------------------------------------------------
dnl
AC_CHECK_FUNC(copysign, AC_DEFINE(HAVE_COPYSIGN), )
AC_CHECK_FUNC(log1p, AC_DEFINE(HAVE_LOG1P), )
AC_CHECK_FUNC(hypot, AC_DEFINE(HAVE_HYPOT), )
AC_CHECK_FUNC(acosh, AC_DEFINE(HAVE_ACOSH), )
AC_CHECK_FUNC(asinh, AC_DEFINE(HAVE_ASINH), )
AC_CHECK_FUNC(atanh, AC_DEFINE(HAVE_ATANH), )
AC_CHECK_FUNC(rint, AC_DEFINE(HAVE_RINT), )
AC_CHECK_FUNC(irint, AC_DEFINE(HAVE_IRINT), )
AC_CHECK_FUNC(isnanf, AC_DEFINE(HAVE_ISNANF), )
AC_CHECK_FUNC(isnand, AC_DEFINE(HAVE_ISNAND), )
AC_CHECK_FUNC(isnan, AC_DEFINE(HAVE_ISNAN), )
AC_CHECK_FUNC(j0, AC_DEFINE(HAVE_J0), )
AC_CHECK_FUNC(j1, AC_DEFINE(HAVE_J1), )
AC_CHECK_FUNC(jn, AC_DEFINE(HAVE_JN), )
AC_CHECK_FUNC(y0, AC_DEFINE(HAVE_Y0), )
AC_CHECK_FUNC(y1, AC_DEFINE(HAVE_Y1), )
AC_CHECK_FUNC(yn, AC_DEFINE(HAVE_YN), )
AC_CHECK_FUNC(erf, AC_DEFINE(HAVE_ERF), )
AC_CHECK_FUNC(erfc, AC_DEFINE(HAVE_ERFC), )
dnl
dnl -----------------------------------------------------------------
dnl Find out about byte order
dnl -----------------------------------------------------------------
dnl
AC_C_BIGENDIAN
dnl
dnl -----------------------------------------------------------------
dnl Update the GMT macros
dnl -----------------------------------------------------------------
dnl
AC_OUTPUT(src/makegmt.macros)
dnl
dnl -----------------------------------------------------------------
dnl Remove and, if trouble, write the .gmtconfigure file
dnl -----------------------------------------------------------------
dnl
if test -f .gmtconfigure ; then
	\rm -f .gmtconfigure
fi
if test "$shared_unknown" = "yes" ; then
	cat << EOF > .gmtconfigure
=============================================================
Shared libraries for GMT under $os are not implemented.  This
can mean that your OS does not support shared libraries at all
or that the GMT configure script simply does not know how to.
Therefore, configure has ignored the --enable-shared option.
However, if shared libraries ARE supported on this system you
may try edit src/makegmt.macros and manually set the macros
CC_OPT, LD_OPT, LDFLAGS, and GMTLIB accordingly.
Please include the output of uname -a and mail the working
makegmt.macros to pwessel@hawaii.edu.  Thanx.
=============================================================
EOF
	cat .gmtconfigure
fi