File: configure.in

package info (click to toggle)
xmpi 2.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,232 kB
  • ctags: 1,656
  • sloc: ansic: 13,738; sh: 1,799; makefile: 233
file content (370 lines) | stat: -rw-r--r-- 10,281 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
dnl -*- shell-script -*-
dnl Process this file with autoconf to produce a configure script.

# Copyright 1998-1999, University of Notre Dame.
# Authors: Brian W. Barrett, Arun F. Rodrigues, Jeffrey M. Squyres,
# 	 and Andrew Lumsdaine
#
# This file is part of XMPI
#
# You should have received a copy of the License Agreement for XMPI 
# along with the software; see the file LICENSE.  If not, contact 
# Office of Research, University of Notre Dame, Notre Dame, IN 46556.
# 
# Permission to modify the code and to distribute modified code is
# granted, provided the text of this NOTICE is retained, a notice that
# the code was modified is included with the above COPYRIGHT NOTICE and
# with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE
# file is distributed with the modified code.
#
# LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
# By way of example, but not limitation, Licensor MAKES NO
# REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
# PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS
# OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS
# OR OTHER RIGHTS.
#
# Additional copyrights may follow.


dnl Disable caching.
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl

AC_INIT(./xmpi.1)
AC_CONFIG_AUX_DIR(./config)

dnl Header configuration
AC_CONFIG_HEADER(./xmpi_config.h:./config/xmpi_config.h.in)

AC_ARG_ENABLE(echo, [  --enable-echo           echo configure script commands],
[set -x])

lam_echo () {
    echo $ac_n $1"... $ac_c" 1>&6
}

AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED(XMPI_ARCH,"$host")

case "$prefix" in
  /*) echo installing to directory \"$prefix\" ;;
  NONE) prefix=/usr/local/lam
	echo installing to default location \"$prefix\" ;;
  *) AC_MSG_ERROR(prefix \"$prefix\" must be an absolute directory path) ;;
esac

dnl check for where LAMHOME is
dnl AC_ARG_WITH(lamhome, [  --with-lamhome=LAMHOME  location of LAMHOME])
LAMHOME=$prefix;
AC_SUBST(LAMHOME)

dnl Checks for --with-sgi
AC_ARG_WITH(with_sgi,
    [  --with-sgi                  build with the default SGI libxmpi])

dnl Checks for if you are using a vendor lib, else, sets CC to hcc
dnl hcc is the default compiler
AC_ARG_WITH(vendor_libxmpi, 
    [  --with-vendor-libxmpi=DIR   build with vendor supplied libxmpi in DIR])
if test -n "$with_vendor_libxmpi"; then
    dnl do nothing...yet....
    echo;
elif test -n "$with_sgi"; then
    AC_MSG_WARN(*** You have selected the SGI libxmpi. We will use the )
    AC_MSG_WARN(*** MIPSpro cc compiler.)
    CC=cc;
else
    dnl if you are not using a vendor lib you are using lam libxmpi
    dnl if so, set CC to hcc

    CC=hcc;

fi

dnl check for specification of C compiler
dnl overrules default hcc with lam
AC_ARG_WITH(cc, [  --with-cc=CC            use C compiler CC])
AC_ARG_WITH(lam,[  --with-lam              builds the LAM libxmpi with the hcc compiler])

if test -n "$with_cc"; then
    if test $with_cc = yes; then
	AC_MSG_ERROR(the --with-cc option requires the compiler name)
    fi
    
    dnl warns them for dissing our compiler or the vendor compiler
    if test -z "$with_vendor_libxmpi"; then
	AC_MSG_WARN(*** You are not using the hcc compiler recommended)
	AC_MSG_WARN(*** for building the LAM libxmpi. Be sure to set)
	AC_MSG_WARN(*** the approprate include paths to the needed files)
    fi
    dnl warns them for dissing the MIPS compiler
    if test -z "$with_sgi"; then
	AC_MSG_WARN(*** You are not using the cc compiler recommended)
	AC_MSG_WARN(*** for building with the SGI libxmpi.)
    fi

    CC=$with_cc;
else
    if test -z "$with_vendor_libxmpi" -a -z "$with_sgi" -a -z "$with_lam"; then
	 AC_MSG_WARN(*** You have not specified a vendor library to use)
	 AC_MSG_WARN(*** or a specific C compiler so XMPI will use the)
	 AC_MSG_WARN(*** LAM hcc C compiler.)
    fi
fi

dnl check for specification of C compiler flags
AC_ARG_WITH(cflags, [  --with-cflags=CFLAGS    use C compiler flags CFLAGS])

if test -n "$with_cflags"; then
    CFLAGS=$with_cflags;
fi

lam_cflags_save=$CFLAGS

dnl Check for compilers
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL

if test -z "$lam_cflags_save"; then
    lam_cflags_save="$CFLAGS"
    if test "$GCC" = yes; then
	CFLAGS=-O
    else
	case "$host_os" in
	    solaris) CFLAGS=-fast;;
	    *) CFLAGS=-O;;
	esac
    fi
    LAM_TEST_COMPILE
    if test "$lam_test_compile_ok" = no; then
	CFLAGS="$lam_cflags_save";
    fi
fi

SOLINKFLAGS=
LIBXMPI=
LIBXMPIDIR=
LIBXMPIRPATH=
LIBEXT=
 
AC_ARG_WITH(with_shared,
    [  --with-shared           build the LAM libxmpi as a shared library])

dnl check for use with vendor libxmpi
dnl decides when and how to build the libxmpi
if test -n "$with_vendor_libxmpi"; then
    if test ! -d "$with_vendor_libxmpi"; then
	AC_MSG_ERROR(Vendor libxmpi dir \"$with_vendor_libxmpi\" does not exist)
    else
	LIBXMPIDIR="$with_vendor_libxmpi"
    fi
elif test -n "$with_sgi"; then
    AC_MSG_WARN(*** Using SGI libxmpi.)
    CFLAGS="$CFLAGS -n32"
    LIBXMPIDIR="./libxmpi -L/usr/lib32"
elif test -n "$with_shared"; then
    dnl if you are not using a vendor library, default to LAM libxmpi
    if test -z "$with_lam"; then
	AC_MSG_WARN(*** You have not specified a vendor xmpi library)
	AC_MSG_WARN(*** to use so XMPI will compile the LAM libxmpi)
	AC_MSG_WARN(*** as a shared library.)
    fi
    LIBXMPIDIR=libxmpi
    LIBXMPI=lib-lam

    if test "$GCC" = yes; then
	LIBEXT=so
        SOLINKFLAGS=-shared
        LIBXMPIRPATH='-Wl,-rpath,$LAMHOME/lib'
	case "$host_os" in
	    *hpux*) AC_MSG_ERROR(Dynamic library creation is not supported for HP-UX systems. You cannot use the --with-shared option. );;
	esac
    else
	case "$host_os" in 
	    *solaris*)  LIBEXT=so
			SOLINKFLAGS=-G;;
	    *hpux*) LIBEXT=sl
		    SOLINKFLAGS=-Wl,-b
		    AC_MSG_ERROR(Dynamic library creation is not supported for HP-UX systems. You cannot use the --with-shared option. );;
	    *irix*) LIBEXT=so
		    SOLINKFLAGS=-shared;;
	    *linux*) LIBEXT=so;;
	    *) LAM_SHARED_LIBS_UNSUPPORTED;;
	esac
    fi
else
    dnl default to libxmpi.a - static   
    if test -z "$with_lam"; then
	AC_MSG_WARN(*** You have not specified a vendor xmpi library)
	AC_MSG_WARN(*** to use so XMPI will compile the LAM libxmpi.)
	AC_MSG_WARN(*** as a static library.)
    fi


    LIBXMPIDIR=libxmpi
    LIBXMPI=lib-lam
    LIBEXT=a
fi

dnl override soname and link options
AC_ARG_WITH(with_soname,
    [  --with-soname=SONAME           Shared library major number])
AC_ARG_WITH(with_soversion,
    [  --with-soversion=SOVERSION           Shared library minor number])

SOVERSION=0
SONAME=0
if ! test -z "$with_soversion" ; then
    SOVERSION=$with_soversion;
fi
if ! test -z "$with_soname" ; then
    if test -z "$with_shared" ; then
	AC_MSG_WARN(*** Ignoring soname specified without --with-shared)
    else
	SONAME=$with_soname
	LIBEXT=so.$SONAME.$SOVERSION
	SOLINKFLAGS="-shared -Wl,-soname=libxmpi.so.$SONAME"
	LIBXMPIRPATH=''
    fi
fi
AC_SUBST(SONAME)
AC_SUBST(SOVERSION)


dnl takes care of o32/n32 problem
case "$host_os" in
    *irix*) CFLAGS="$CFLAGS -n32"
	    LIBXMPIDIR="./libxmpi -L/usr/lib32";;
esac

AC_SUBST(LIBXMPI)
AC_SUBST(LIBXMPIDIR)
AC_SUBST(LIBXMPIRPATH)
AC_SUBST(LIBEXT)
AC_SUBST(SOLINKFLAGS)

dnl Take care of some specific compiler options. 
dnl Force use of ANSI C under HP-UX.
if test "$ac_cv_prog_gcc" = no; then
    us=`(uname -s) 2>/dev/null` || us=unknown
    case "$us" in
        HP-UX) CFLAGS="$CFLAGS -Ae" ;;
	*)	;;
    esac
fi

AC_SUBST(CFLAGS)

if test "$with_shared_libxmpi" = yes; then
    LAM_SHARED_OBJ_FLAGS
fi

LAM_ANSI_PROTOS
if test "$lam_ac_ansi_protos" = no; then
    AC_MSG_ERROR(LAM requires a compiler which understands ANSI C prototypes)
fi

dnl How to specify a directory for the library archive search path.
us=`(uname -s) 2>/dev/null` || us=unknown
case "$us" in
    HP-UX) FLIBPATH="-Wl,-L" ;;
	*) FLIBPATH="-L" ;;
esac
AC_SUBST(FLIBPATH)

dnl Check for X11
AC_PATH_XTRA
if test "$no_x" = yes; then
    AC_MSG_ERROR([Could not find X includes or libs.  Cannot continue.])
fi

dnl Look for motif includes and lib
dnl Look where X ones found or where specified by
dnl --with-motif-includes=DIR and --with-motif-libraries=DIR
LAM_MOTIF_INCLUDES
LAM_MOTIF_LIBRARIES
if test "$lam_ac_motif_includes" = no; then
    AC_MSG_ERROR([Could not find Motif includes.  Cannot continue.])
fi
if test "$lam_ac_motif_libraries" = no; then
    AC_MSG_ERROR([Could not find Motif librares.  Cannot continue.])
fi
X_CFLAGS="$X_CFLAGS -I$lam_ac_motif_includes"

if test -n "$with_sgi"; then
    X_LIBS="-L/usr/lib32 -L$lam_ac_motif_libraries"
else
    X_LIBS="$X_LIBS -L$lam_ac_motif_libraries"
fi

dnl Check for programs.
dnl Abort if we cannot find one of them

AC_PROG_CPP
if test "$CPP" = ""; then
    AC_MSG_ERROR([Could not find C preprocessor.  Cannot continue.])
fi

AC_PATH_PROG(RM,rm)
if test "$RM" = ""; then
    AC_MSG_ERROR([Could not find rm.  Cannot continue.])
fi

AC_PROG_RANLIB
if test "$RANLIB" = ""; then
    AC_MSG_ERROR([Could not find ranlib.  Cannot continue.])
fi
 
AC_PATH_PROG(AR,ar)
if test "$AR" = ""; then
    AC_MSG_ERROR([Could not find ar.  Cannot continue.])
fi

AC_PATH_PROG(SHELL_CMD,sh)
if test "$SHELL_CMD" = ""; then
    AC_MSG_ERROR([Could not find Bourne shell.  Cannot continue.])
fi

dnl Used to Check for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN

dnl Check for library functions.
AC_CHECK_FUNCS(atexit getcwd)

AC_CACHE_CHECK([if need to include sys/select.h],
lam_cv_need_sys_select_h,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>], [fd_set s; FD_ZERO(&s);],
lam_cv_need_sys_select_h=no, lam_cv_need_sys_select_h=yes)])
if test $lam_cv_need_sys_select_h = yes; then
  AC_DEFINE(NEED_SYS_SELECT_H)
fi

LAM_CHECK_TYPE(int4)
LAM_CHECK_TYPE(float8)

AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(float, 4)
AC_CHECK_SIZEOF(double, 4)


dnl Checks for header files
AC_HEADER_STDC
dnl Only check MPI headers if you are not using a vendor lib
if test -z "$with_vendor_lib" -a -z "$with_sgi"; then
    LSC_CHECK_MPI_H
fi

dnl if test "$with_fc" != no; then
dnl     LAM_GET_FORTRAN_EXT_NAME_CONVENTION($FCOMPILER)
dnl fi

AC_OUTPUT(
    ./config.mk:./config/config.mk.in
    ./XMPI
    ./Makefile
    ./libxmpi/Makefile
)