Revert "confdb: converted confdb to a submodule"

This reverts commit 90df0966fb.

Signed-off-by: Yanfei Guo <yguo@anl.gov>
Esse commit está contido em:
Ken Raffenetti
2017-11-07 21:39:05 -06:00
commit de Yanfei Guo
commit 659ab34a56
31 arquivos alterados com 10790 adições e 4 exclusões
+15
Ver Arquivo
@@ -131,6 +131,21 @@ Makefile.am-stamp
# created by maint/gen_subcfg_m4
/subsys_include.m4
# root confdb/ contents
/confdb/ar-lib
/confdb/compile
/confdb/config.guess
/confdb/config.sub
/confdb/depcomp
/confdb/install-sh
/confdb/libtool.m4
/confdb/ltmain.sh
/confdb/ltoptions.m4
/confdb/ltsugar.m4
/confdb/ltversion.m4
/confdb/lt~obsolete.m4
/confdb/missing
# random stuff
/maint/gcovmerge
/src/binding/fortran/mpif_h/buildiface-stamp
-3
Ver Arquivo
@@ -1,9 +1,6 @@
[submodule "src/mpid/ch4/netmod/ucx/ucx"]
path = src/mpid/ch4/netmod/ucx/ucx
url = https://github.com/openucx/ucx
[submodule "confdb"]
path = confdb
url = https://github.com/pmodels/confdb
[submodule "src/izem"]
path = src/izem
url = https://github.com/pmodels/izem
Submodule confdb deleted from 78c1524dba
+38
Ver Arquivo
@@ -0,0 +1,38 @@
dnl This version of aclocal.m4 simply includes all of the individual
dnl components
builtin(include,aclocal_am.m4)
builtin(include,aclocal_bugfix.m4)
builtin(include,aclocal_cache.m4)
builtin(include,aclocal_cc.m4)
builtin(include,aclocal_atomic.m4)
dnl aclocal_cross.m4 uses autoconf features dated back to 2.13.
dnl too old to be useful, 07/14/2010.
dnl builtin(include,aclocal_cross.m4)
builtin(include,aclocal_cxx.m4)
builtin(include,aclocal_f77.m4)
dnl aclocal_f77old.m4 contains PAC_PROG_F77_CMDARGS which is NOT used in MPICH
dnl but it is still used by other packages, so leave it in confdb.
dnl builtin(include,aclocal_f77old.m4)
builtin(include,aclocal_util.m4)
builtin(include,aclocal_subcfg.m4)
builtin(include,aclocal_make.m4)
builtin(include,aclocal_mpi.m4)
builtin(include,aclocal_shl.m4)
dnl fortran90.m4 defines [Fortran 90] as an AC_LANG
dnl which works for autoconf 2.63 and older, 07/14/2010.
dnl builtin(include,fortran90.m4)
builtin(include,aclocal_runlog.m4)
builtin(include,aclocal_fc.m4)
builtin(include,aclocal_libs.m4)
builtin(include,aclocal_attr_alias.m4)
builtin(include,ax_tls.m4)
builtin(include,aclocal_romio.m4)
dnl Add the libtool files that libtoolize wants
dnl Comment these out until libtool support is enabled.
dnl May need to change this anyway, since libtoolize
dnl does not seem to understand builtin
dnl builtin(include,libtool.m4)
dnl builtin(include,ltoptions.m4)
dnl builtin(include,ltversion.m4)
dnl builtin(include,ltsugar.m4)
dnl builtin(include,lt~obsolete.m4)
+6
Ver Arquivo
@@ -0,0 +1,6 @@
dnl AM_IGNORE is an extension that tells (a patched) automake not to
dnl include the specified AC_SUBST variable in the Makefile.in that
dnl automake generates. We don't use AC_DEFUN, since aclocal will
dnl then complain that AM_IGNORE is a duplicate (if you are using the
dnl patched automake/aclocal).
m4_ifdef([AM_IGNORE],[],[m4_define([AM_IGNORE],[])])
+227
Ver Arquivo
@@ -0,0 +1,227 @@
dnl /*D PAC_C_MEMATOMIC - Try and determine how to implement memory-atomic
dnl operations with the selected C compiler
dnl
dnl Synopsis:
dnl PAC_C_MEMATOMIC
dnl
dnl Notes:
dnl Defines names of the following form
dnl + HAVE_GCC_ASM_AND_X86_{MFENCE,LFENCE,SFENCE} - gcc __asm__ will issue
dnl mfence, lfence, or sfence
dnl . HAVE___ASM_AND_X86_{MFENCE,LFENCE,SFENCE} - __asm _emit will issue
dnl mfence, lfence, or sfence
dnl . HAVE_ASM_AND_X86_{MFENCE,LFENCE,SFENCE} - asm("...") will issue
dnl mfence, lfence, or sfence
dnl . HAVE__INTERLOCKEDEXCHANGE - _InterlockedExchange intrinsic is available
dnl (IA64)
dnl . HAVE_GCC_ASM_SPARC_MEMBAR - gcc __asm__ will issue SPARC architecture
dnl memory barrier instruction
dnl . HAVE_SOLARIS_ASM_SPARC_MEMBAR - Solaris asm() will issue SPARC
dnl architecture memory barrier instruction
dnl . HAVE_GCC_ASM_SPARC_STBAR - gcc __asm__ will issue stbar
dnl - HAVE_SOLARIS_ASM_SPARC_STBAR - Solaris __asm() will issue stbar
dnl
dnl D*/
AC_DEFUN([PAC_C_MEMATOMIC],[
AC_CACHE_CHECK([for x86 mfence instruction using __asm__],
pac_cv_have_gcc_asm_and_x86_mfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
__asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xf0" ::: "memory" );
exit(0);
}
],
pac_cv_have_gcc_asm_and_x86_mfence=yes,pac_cv_have_gcc_asm_and_x86_mfence=no)])
if test "$pac_cv_have_gcc_asm_and_x86_mfence" = "yes" ; then
AC_DEFINE(HAVE_GCC_ASM_AND_X86_MFENCE, 1, [Define if using gcc on a x86 system with the mfence instruction])
fi
AC_CACHE_CHECK([for x86 sfence instruction using __asm__],
pac_cv_have_gcc_asm_and_x86_sfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
__asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xf8" ::: "memory" );
exit(0);
}
],
pac_cv_have_gcc_asm_and_x86_sfence=yes,pac_cv_have_gcc_asm_and_x86_sfence=no)])
if test "$pac_cv_have_gcc_asm_and_x86_sfence" = "yes" ; then
AC_DEFINE(HAVE_GCC_ASM_AND_X86_SFENCE, 1, [Define if using gcc on a x86 system with the sfence instruction])
fi
AC_CACHE_CHECK([for x86 lfence instruction using __asm__],
pac_cv_have_gcc_asm_and_x86_lfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
__asm__ __volatile__ ( ".byte 0x0f, 0xae, 0xe8" ::: "memory" );
exit(0);
}
],
pac_cv_have_gcc_asm_and_x86_lfence=yes,pac_cv_have_gcc_asm_and_x86_lfence=no)])
if test "$pac_cv_have_gcc_asm_and_x86_lfence" = "yes" ; then
AC_DEFINE(HAVE_GCC_ASM_AND_X86_LFENCE, 1, [Define if using gcc on a x86 system with the lfence instruction])
fi
dnl Some compilers, like icc, may want __asm _emit
AC_CACHE_CHECK([for x86 mfence instruction using __asm],
pac_cv_have___asm_and_x86_mfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
__asm _emit 0x0f __asm _emit 0xae __asm _emit 0xf0 ;
exit(0);
}
],
pac_cv_have___asm_and_x86_mfence=yes,pac_cv_have___asm_and_x86_mfence=no)])
if test "$pac_cv_have___asm_and_x86_mfence" = "yes" ; then
AC_DEFINE(HAVE___ASM_AND_X86_MFENCE, 1, [Define if using __asm on a x86 system with the mfence instruction])
fi
AC_CACHE_CHECK([for x86 sfence instruction using __asm],
pac_cv_have___asm_and_x86_sfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
__asm sfence ;
exit(0);
}
],
pac_cv_have___asm_and_x86_sfence=yes,pac_cv_have___asm_and_x86_sfence=no)])
if test "$pac_cv_have___asm_and_x86_sfence" = "yes" ; then
AC_DEFINE(HAVE___ASM_AND_X86_SFENCE, 1, [Define if using __asm on a x86 system with the sfence instruction])
fi
AC_CACHE_CHECK([for x86 lfence instruction using __asm],
pac_cv_have___asm_and_x86_lfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
__asm _emit 0x0f __asm _emit 0xae __asm _emit 0xe8 ;
exit(0);
}
],
pac_cv_have___asm_and_x86_lfence=yes,pac_cv_have___asm_and_x86_lfence=no)])
if test "$lac_cv_have___asm_and_x86_lfence" = "yes" ; then
AC_DEFINE(HAVE___ASM_AND_X86_LFENCE, 1, [Define if using __asm on a x86 system with the lfence instruction])
fi
dnl
dnl Some compilers, such as pgcc, may require additional arguments.
dnl pgcc may need -Masmkeyword flag. We may want to try this with and
dnl without adding -Masmkeyword to CFLAGS
AC_CACHE_CHECK([for x86 mfence instruction using asm()],
pac_cv_have_asm_and_x86_mfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
asm("_emit 0x0f __asm _emit 0xae __asm _emit 0xf0");
exit(0);
}
],
pac_cv_have_asm_and_x86_mfence=yes,pac_cv_have_asm_and_x86_mfence=no)])
if test "$pac_cv_have_asm_and_x86_mfence" = "yes" ; then
AC_DEFINE(HAVE_ASM_AND_X86_MFENCE, 1, [Define if using asm() on a x86 system with the mfence instruction])
fi
AC_CACHE_CHECK([for x86 sfence instruction using asm()],
pac_cv_have_asm_and_x86_sfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
asm("sfence");
exit(0);
}
],
pac_cv_have_asm_and_x86_sfence=yes,pac_cv_have_asm_and_x86_sfence=no)])
if test "$pac_cv_have_asm_and_x86_sfence" = "yes" ; then
AC_DEFINE(HAVE_ASM_AND_X86_SFENCE, 1, [Define if using asm() on a x86 system with the sfence instruction])
fi
AC_CACHE_CHECK([for x86 lfence instruction using asm()],
pac_cv_have_asm_and_x86_lfence,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
asm("_emit 0x0f __asm _emit 0xae __asm _emit 0xe8");
exit(0);
}
],
pac_cv_have_asm_and_x86_lfence=yes,pac_cv_have_asm_and_x86_lfence=no)])
if test "$pac_cv_have_asm_and_x86_lfence" = "yes" ; then
AC_DEFINE(HAVE_ASM_AND_X86_LFENCE, 1, [Define if using asm() on a x86 system with the lfence instruction])
fi
AC_CACHE_CHECK([for _InterlockedExchange intrinsic],
pac_cv_have__InterlockedExchange,[
AC_TRY_RUN([
int main(int argc, char **argv)
{
unsigned long lock, *lock_ptr;
lock_ptr = &lock;
_InterlockedExchange(lock_ptr, 1);
exit(0);
}
],
pac_cv_have__InterlockedExchange=yes,pac_cv_have__InterlockedExchange=no)])
if test "$pac_cv_have__InterlockedExchange" = "yes" ; then
AC_DEFINE(HAVE__INTERLOCKEDEXCHANGE, 1, [Define if _InterlockedExchange intrinsic is available])
fi
AC_CACHE_CHECK([for SPARC membar instruction with gcc],
pac_cv_gcc_sparc_membar,[
AC_TRY_RUN([
int main(int argc, char **argv){
__asm__ __volatile__ ( "membar #StoreLoad | #StoreStore" : : : "memory" );
exit(0);
}],pac_cv_gcc_sparc_membar=yes,pac_cv_gcc_sparc_membar=no)])
if test "$pac_cv_gcc_sparc_membar" = yes ; then
AC_DEFINE(HAVE_GCC_ASM_SPARC_MEMBAR,1,[Define if gcc asm membar supported])
fi
AC_CACHE_CHECK([for SPARC membar instruction with Solaris C],
pac_cv_solaris_sparc_membar,[
AC_TRY_RUN([
int main(int argc, char **argv){
__asm ( "membar #StoreLoad | #StoreStore");
exit(0);
}],pac_cv_solaris_sparc_membar=yes,pac_cv_solaris_sparc_membar=no)])
if test "$pac_cv_solaris_sparc_membar" = yes ; then
AC_DEFINE(HAVE_SOLARIS_ASM_SPARC_MEMBAR,1,[Define if solaris asm membar supported])
fi
AC_CACHE_CHECK([for SPARC stbar instruction with gcc],
pac_cv_gcc_sparc_stbar,[
AC_TRY_RUN([
int main(int argc, char **argv){
__asm__ __volatile__ ( "stbar" : : : "memory" );
exit(0);
}],pac_cv_gcc_sparc_stbar=yes,pac_cv_gcc_sparc_stbar=no)])
if test "$pac_cv_gcc_sparc_stbar" = yes ; then
AC_DEFINE(HAVE_GCC_ASM_SPARC_STBAR,1,[Define if gcc asm stbar supported])
fi
AC_CACHE_CHECK([for SPARC stbar instruction with Solaris C],
pac_cv_solaris_sparc_stbar,[
AC_TRY_RUN([
int main(int argc, char **argv){
__asm ( "stbar" );
exit(0);
}],pac_cv_solaris_sparc_stbar=yes,pac_cv_solaris_sparc_stbar=no)])
if test "$pac_cv_solaris_sparc_stbar" = yes ; then
AC_DEFINE(HAVE_SOLARIS_ASM_SPARC_STBAR,1,[Define if solaris asm stbar supported])
fi
])
+504
Ver Arquivo
@@ -0,0 +1,504 @@
dnl
dnl Check for BSD or POSIZ style global symbol lister, nm.
dnl If found, pac_path_NM_G contains the absolute athname of nm + options
dnl pac_path_NM_G_type will be either POSIX or BSD. NM_G will be
dnl pac_path_NM_G without the absolute path. Preference is BSD style.
dnl
dnl The test checks if nm accepts the known options and also if nm produces
dnl the expected BSD or POSIX output format.
dnl
AC_DEFUN([PAC_PATH_NM_G],[
AC_MSG_CHECKING([for BSD/POSIX style global symbol lister])
AC_LANG_PUSH(C)
AC_PATH_PROGS_FEATURE_CHECK(NM_G, nm, [
# Check if nm accepts -g and BSD or POSIX compatible flag.
# Use the `sed 1q' to avoid HP-UX's unknown option message:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
#
# AIX's sed does not accept \+, 1) instead of doing 's|a\+||', do 's|aa*||'
# or 2) instead of 's|A \+B|AB|g', do 's|A *B|AB|g'
# Check if nm accepts -g
case `${ac_path_NM_G} -g /dev/null 2>&1 | sed '1q'` in
*/dev/null* | *'Invalid file or object type'*)
ac_path_NM_G="${ac_path_NM_G} -g"
# Check if nm accepts -B
case `${ac_path_NM_G} -B /dev/null 2>&1 | sed '1q'` in
*/dev/null* | *'Invalid file or object type'*)
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([int iglobal;])
],[
changequote(,)
case `${ac_path_NM_G} -B conftest.$OBJEXT | sed -e 's|[0-9][0-9]* *[A-Z] *iglobal|XXXX|g'` in
*XXXX*)
pac_path_NM_G="${ac_path_NM_G} -B"
pac_path_NM_G_type="BSD"
;;
esac
changequote([,])
])
;;
*)
# Check if nm accepts -P
case `${ac_path_NM_G} -P /dev/null 2>&1 | sed '1q'` in
*/dev/null* | *'Invalid file or object type'*)
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([int iglobal;])
],[
changequote(,)
case `${ac_path_NM_G} -P conftest.$OBJEXT | sed -e 's|iglobal *[A-Z] *[0-9][0-9]*|XXXX|g'` in
*XXXX*)
pac_path_NM_G="${ac_path_NM_G} -P"
pac_path_NM_G_type="POSIX"
;;
esac
changequote([,])
])
;;
esac # Endof case `${ac_path_NM_G} -P
;;
esac # Endof case `${ac_path_NM_G} -B
;;
esac # Endof case `${ac_path_NM_G} -g
if test "X$pac_path_NM_G" != "X" ; then
AC_MSG_RESULT([$pac_path_NM_G_type style,$pac_path_NM_G])
NM_G="`echo $pac_path_NM_G | sed -e 's|^.*nm |nm |g'`"
else
AC_MSG_RESULT(no)
fi
ac_cv_path_NM_G=${ac_path_NM_G}
ac_path_NM_G_found=:
], [AC_MSG_RESULT(no)],
[$PATH$PATH_SEPARATOR/usr/ccs/bin/elf$PATH_SEPARATOR/usr/ccs/bin$PATH_SEPARATOR/usr/ucb$PATH_SEPARATOR/bin])
AC_LANG_POP(C)
]) dnl Endof AC_DEFUN([PAC_PATH_NM_G]
dnl
dnl PAC_C_MULTI_ATTR_ALIAS()
dnl
dnl The checks if multiple __attribute__((alias)) is available
dnl If the multiple __attribute((alias)) support is found,
dnl pac_c_multi_attr_alias=yes is set.
dnl
dnl The default is to do a runtime test. When cross_compiling=yes,
dnl pac_path_NM_G will be used to determine the test result.
dnl If CFLAGS(or CPPFLAGS) contains ATTR_ALIAS_DEBUG, the runtime will print
dnl out addresses of struct(s) for debugging purpose.
dnl
dnl
AC_DEFUN([PAC_C_MULTI_ATTR_ALIAS],[
AC_REQUIRE([PAC_PATH_NM_G])
AC_LANG_PUSH(C)
AC_CHECK_HEADERS([stdio.h])
AC_MSG_CHECKING([for multiple __attribute__((alias)) support])
#Compile the "other" __attribute__ object file.
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
struct mpif_cmblk_t_ { int imember; };
typedef struct mpif_cmblk_t_ mpif_cmblk_t;
/* NOT initialize these structure so it appears in BSS or as COMMON symbols */
mpif_cmblk_t mpifcmb;
mpif_cmblk_t MPIFCMB;
/*
Do the test in this file instead in the file
where __attribute__((alias)) is used.
This is needed for pgcc since pgcc seems to
define aliased symbols if they are in the same file.
*/
/*
We can't do the following comparision in one test:
ilogical = (( &mpifcmb == ptr && &MPIFCMB == ptr ) ? TRUE : FALSE) ;
because some compiler, like gcc 4.4.2's -O* optimizes the code
such that the ilogical expression is FALSE. The likely reason is that
mpifcmb and MPIFCMB are defined in the same scope in which C optimizer
may have treated them as different objects (with different addresses),
&mpifcmb != &MPIFCMB, before actually running the test and hence the
illogical expression is assumed to be always FALSE. The solution taken
here is to prevent the optimizer the opportunity to equate &mpifcmb and
&MPIFCMB (in same scope), e.g. using 2 separate tests and combine the
test results in a different scope.
*/
int same_addrs1( void *ptr );
int same_addrs1( void *ptr )
{
#if defined(ATTR_ALIAS_DEBUG)
printf( "others: addr(mpifcmb)=%p, addr(input ptr)=%p\n", &mpifcmb, ptr );
#endif
return ( &mpifcmb == ptr ? 1 : 0 );
}
int same_addrs2( void *ptr );
int same_addrs2( void *ptr )
{
#if defined(ATTR_ALIAS_DEBUG)
printf( "others: addr(MPIFCMB)=%p, addr(input ptr)=%p\n", &MPIFCMB, ptr );
#endif
return ( &MPIFCMB == ptr ? 1 : 0 );
}
])
],[
rm -f pac_conftest_other.$OBJEXT
PAC_RUNLOG([cp conftest.$OBJEXT pac_conftest_other.$OBJEXT])
test -s pac_conftest_other.$OBJEXT && pac_c_attr_alias_other=yes
dnl cp conftest.$ac_ext pac_conftest_other.$ac_ext
dnl echo
dnl echo "pac_conftest_other.$OBJEXT"
dnl nm -P -g pac_conftest_other.$OBJEXT | grep -i "mpifcmb"
],[
pac_c_attr_alias_other=no
]) dnl Endof AC_COMPILE_IFELSE
pac_c_attr_alias_main=no
if test "$pac_c_attr_alias_other" = "yes" ; then
# Push LIBS for later restoration.
PAC_PUSH_FLAG([LIBS])
LIBS="pac_conftest_other.$OBJEXT $LIBS"
# Link the "other" __attribute__ object file.
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
struct mpif_cmblk_t_ { int imember; };
typedef struct mpif_cmblk_t_ mpif_cmblk_t;
mpif_cmblk_t mpifcmbr = {0};
extern mpif_cmblk_t MPIFCMB __attribute__ ((alias("mpifcmbr")));
extern mpif_cmblk_t mpifcmb __attribute__ ((alias("mpifcmbr")));
extern int same_addrs1( void *ptr );
extern int same_addrs2( void *ptr );
],[
int iaddr = 0;
#if defined(ATTR_ALIAS_DEBUG)
printf( "main: addr(mpifcmbr) = %p\n", &mpifcmbr );
printf( "main: addr(mpifcmb) = %p\n", &mpifcmb );
printf( "main: addr(MPIFCMB) = %p\n", &MPIFCMB );
#endif
iaddr = same_addrs1( &mpifcmbr ) && same_addrs2( &mpifcmbr );
FILE *file = fopen( "pac_conftestval", "w" );
if (!file) return 1;
fprintf( file, "%d\n", iaddr );
])
],[
rm -f pac_conftest_main$EXEEXT
PAC_RUNLOG([cp conftest$EXEEXT pac_conftest_main$EXEEXT])
test -x pac_conftest_main$EXEEXT && pac_c_attr_alias_main=yes
dnl cp conftest.$ac_ext pac_conftest_main.$ac_ext
dnl echo
dnl echo "pac_conftest_main$EXEEXT"
dnl nm -P -g pac_conftest_main$EXEEXT | grep -i "mpifcmb"
],[
pac_c_attr_alias_main=no
dnl cp conftest.$ac_ext pac_conftest_main.$ac_ext
]) dnl Endof AC_LINK_IFELSE
# Restore the previously pushed LIBS
PAC_POP_FLAG([LIBS])
rm -f pac_conftest_other.$OBJEXT
fi dnl Endof if test "$pac_c_attr_alias_other" = "yes"
if test "$pac_c_attr_alias_main" = "yes" ; then
if test "$cross_compiling" = "yes" ; then
changequote(,)
# echo "PAC CROSS-COMPILING" dnl
# POSIX NM = nm -P format dnl
if test "$pac_path_NM_G_type" = "POSIX" ; then
addrs=`${pac_path_NM_G} ./pac_conftest_main$EXEEXT | grep -i mpifcmb | sed -e 's% *[a-zA-Z][a-zA-Z]* *[a-zA-Z] *\([0-9abcdef][0-9abcdef]*\).*%\1%g'`
fi
# BSD NM = nm -B format dnl
if test "$pac_path_NM_G_type" = "BSD" ; then
addrs=`${pac_path_NM_G} -g ./pac_conftest_main$EXEEXT | grep -i mpifcmb | sed -e "s% *\([0-9abcdef][0-9abcdef]*\) *[a-zA-Z] *[a-zA-Z][a-zA-A]*.*%\1%g"`
fi
changequote([,])
cmp_addr=""
diff_addrs=no
for addr in ${addrs} ; do
if test "X${cmp_addr}" != "X" ; then
if test "${cmp_addr}" != "${addr}" ; then
diff_addrs=yes
break
fi
else
cmp_addr=${addr}
fi
done
if test "$diff_addrs" != "yes" ; then
dnl echo "Same addresses. Multiple aliases support"
AC_MSG_RESULT([${NM_G} says yes])
pac_c_multi_attr_alias=yes
else
dnl echo "Different addresses. No multiple aliases support."
AC_MSG_RESULT([${NM_G} says no])
pac_c_multi_attr_alias=no
fi
else # if test "$cross_compiling" != "yes"
rm -f pac_conftestval
ac_try="./pac_conftest_main$EXEEXT"
if AC_TRY_EVAL(ac_try) ; then
pac_c_attr_alias_val=0
if test -s pac_conftestval ; then
eval pac_c_attr_alias_val=`cat pac_conftestval`
fi
if test "$pac_c_attr_alias_val" -eq 1 ; then
AC_MSG_RESULT(yes)
pac_c_multi_attr_alias=yes
else
AC_MSG_RESULT(no)
pac_c_multi_attr_alias=no
fi
rm -f pac_conftestval
fi
fi
dnl Endof if test "$cross_compiling" = "yes"
rm -f pac_conftest_main$EXEEXT
else
AC_MSG_RESULT(no! link failure)
pac_c_multi_attr_alias=no
fi dnl Endof if test "$pac_c_attr_alias_main" = "yes"
AC_LANG_POP(C)
]) dnl Endof AC_DEFUN([PAC_C_MULTI_ATTR_ALIAS]
dnl
dnl PAC_C_ATTR_ALIGNED()
dnl
dnl Check if __attribute__((aligned)) support is there.
dnl If so, set pac_c_attr_aligned=yes.
dnl
dnl Do a link test instead of compile test to check if the linker
dnl would emit an error.
dnl
AC_DEFUN([PAC_C_ATTR_ALIGNED],[
AC_LANG_PUSH(C)
AC_MSG_CHECKING([for __attribute__((aligned)) support])
#Link the __attribute__ object file.
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
struct mpif_cmblk_t_ { int imembers[5]; };
typedef struct mpif_cmblk_t_ mpif_cmblk_t;
mpif_cmblk_t mpifcmbr __attribute__((aligned)) = {0};
],[])
],[pac_c_attr_aligned=yes], [pac_c_attr_aligned=no])
AC_MSG_RESULT([$pac_c_attr_aligned])
AC_LANG_POP(C)
])
dnl
dnl PAC_F2C_ATTR_ALIGNED_SIZE(ARRAY_SIZE, [OUTPUT_VAR], [MIN_ALIGNMENT])
dnl
dnl ARRAY_SIZE : Size of the integer array within the fortran commmon block.
dnl OUTPUT_VAR : Optional variable to be set.
dnl if test succeeds, set OUTPUT_VAR=$pac_f2c_attr_aligned_str.
dnl if test fails, set OUTPUT_VAR="unknown".
dnl MIN_ALIGNMENT : Optional value.
dnl Minimum alignment size to be used in OUTPUT_VAR.
dnl pac_f2c_attr_aligned_str won't be modified.
dnl
dnl "pac_f2c_attr_aligned_str" will be set with
dnl 1) __attribute__((aligned(ALIGNMENT_SIZE))),
dnl 2) __attribute__((aligned)).
dnl 3) "", i.e. empty string.
dnl
dnl 2) means the test can't find a good alignment value, but both the Fortran
dnl and C compilers are OK with "aligned" which in principle means the C
dnl compiler will pick the maximum useful alignment supported by the
dnl architecture.
dnl 3) means that the test has failed to find the alignment.
dnl
AC_DEFUN([PAC_F2C_ATTR_ALIGNED_SIZE],[
cmblksize=$1
AC_MSG_CHECKING([the minimum alignment of Fortran common block of $cmblksize integers])
dnl To find the minmium alignment of Fortran common block (of integer array)
dnl as seen by C object file, C object files of various (typical) alignments
dnl are linked to the Fortran code using the common block of integer array.
#
dnl Since the incorrect alignment results only a warning messages from the
dnl fortran compiler(or linker), so we use "diff" to compare the fortran
dnl compiler/linker output. We cannot use AC_LANG_WERROR,
dnl i.e. ac_fc_werror_flag=yes, because compiler like pgf77 at version 10.x)
dnl has non-zero stderr output if a fortran program is used in the linking.
dnl The stderr contains the name of fortran program even if the linking is
dnl successful. We could avoid the non-zero stderr output in pgf77 by
dnl compiling everthing into object files and linking all the object files
dnl with pgf77. Doing that would need us to use AC_TRY_EVAL instead of
dnl AC_LINK_IFELSE, so "diff" approach is used instead.
#
dnl Using diff of compiler(linker) output requires a reference output file
dnl as the base of diff. The process of creating this reference output file
dnl has to be exactly the same as the testing process, because pgf77 has
dnl the following weird behavour
dnl pgf77 -o ftest ftest.f => when $?=0 with zero stderr output
dnl pgf77 -o ftest ftest.f dummy.o => when $?=0 with non-zero stderr output.
dnl stderr has "ftest.f:".
dnl
# First create a fortran CONFTEST which will be used repeatedly.
AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77])
AC_LANG_CONFTEST([
AC_LANG_SOURCE([
program fconftest
integer isize
parameter (isize=$cmblksize)
integer status_array(isize)
common /mpifcmb/ status_array
save /mpifcmb/
end
])
])
AC_LANG_POP([Fortran]) dnl AC_LANG_POP([Fortran 77])
dnl
dnl
dnl
# Compile a C dummy.$OBJEXT and link with Fortran test program to create
# a reference linker output file, pac_align0.log, as the base of "diff".
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],[
cp conftest.$ac_ext pac_conftest.c
PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
PAC_PUSH_FLAG([LIBS])
LIBS="pac_conftest.$OBJEXT $LIBS"
AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77])
PAC_PUSH_FLAG([ac_link])
ac_link="`echo $ac_link | sed -e 's|>.*$|> $pac_logfile 2>\&1|g'`"
pac_logfile="pac_align0.log"
rm -f $pac_logfile
AC_LINK_IFELSE([],[
pac_f2c_alignedn_diffbase=yes
],[
pac_f2c_alignedn_diffbase=no
])
# Be sure NOT to remove the conftest.f which is still needed for later use.
# rm -f conftest.$ac_ext
# Restore everything in autoconf that has been overwritten
PAC_POP_FLAG([ac_link])
# restore previously pushed LIBS
PAC_POP_FLAG([LIBS])
AC_LANG_POP([Fortran]) dnl AC_LANG_POP([Fortran 77])
],[
pac_f2c_alignedn_diffbase=no
])
AC_LANG_POP([C])
dnl
dnl
if test "$pac_f2c_alignedn_diffbase" = "yes" ; then
# Initialize pac_result_str to empty string since part of the test
# depends on pac_result_str is empty or non-empty string.
pac_result_str=""
# Initialize pac_f2c_attr_aligned_str to empty string and
# it will remain as empty string if the following test fails.
pac_f2c_attr_aligned_str=""
for asize in 4 8 16 32 64 128 max ; do
if test "$asize" != "max" ; then
pac_attr_aligned_str="__attribute__((aligned($asize)))"
else
pac_attr_aligned_str="__attribute__((aligned))"
fi
AC_LANG_PUSH([C])
#Compile the __attribute__ object file.
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([
changequote(,)
struct mpif_cmblk_t_ { $MPI_FINT imembers[$cmblksize]; };
changequote([,])
typedef struct mpif_cmblk_t_ mpif_cmblk_t;
mpif_cmblk_t mpifcmbr $pac_attr_aligned_str = {0};
extern mpif_cmblk_t _CMPIFCMB __attribute__ ((alias("mpifcmbr")));
extern mpif_cmblk_t MPIFCMB __attribute__ ((alias("mpifcmbr")));
extern mpif_cmblk_t MPIFCMB_ __attribute__ ((alias("mpifcmbr")));
extern mpif_cmblk_t _Cmpifcmb __attribute__ ((alias("mpifcmbr")));
extern mpif_cmblk_t mpifcmb __attribute__ ((alias("mpifcmbr")));
extern mpif_cmblk_t mpifcmb_ __attribute__ ((alias("mpifcmbr")));
])
],[
cp conftest.$ac_ext pac_conftest.c
PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
PAC_PUSH_FLAG([LIBS])
LIBS="pac_conftest.$OBJEXT $LIBS"
AC_LANG_PUSH([Fortran]) dnl AC_LANG_PUSH([Fortran 77])
PAC_PUSH_FLAG([ac_link])
ac_link="`echo $ac_link | sed -e 's|>.*$|> $pac_logfile 2>\&1|g'`"
pac_logfile="pac_align1.log"
rm -f $pac_logfile
# Use conftest.f created in CONFTEST.
AC_LINK_IFELSE([],[
PAC_RUNLOG_IFELSE([diff -b pac_align0.log pac_align1.log],[
pac_attr_alignedn=yes
],[
pac_attr_alignedn=no
cat $pac_logfile >&AS_MESSAGE_LOG_FD
echo "failed C program was:" >&AS_MESSAGE_LOG_FD
cat pac_conftest.c >&AS_MESSAGE_LOG_FD
echo "failed Fortran program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
])
],[
pac_attr_alignedn=no
])
# Restore everything in autoconf that has been overwritten
PAC_POP_FLAG([ac_link])
# restore previously pushed LIBS
PAC_POP_FLAG([LIBS])
AC_LANG_POP([Fortran]) dnl AC_LANG_POP([Fortran 77])
# remove previously generated object file and C file.
rm -f pac_conftest.$OBJEXT pac_conftest.c
rm -f $pac_logfile
if test "$pac_attr_alignedn" = yes ; then
ifelse([$3],[],[
pac_result_str="$asize"
pac_f2c_attr_aligned_str="$pac_attr_aligned_str"
break
],[
if test "$asize" != "max" -a "$asize" -lt "$3" ; then
if test "X$pac_result_str" = "X" ; then
pac_result_str="$asize"
pac_f2c_attr_aligned_str="$pac_attr_aligned_str"
fi
continue
else
pac_f2c_attr_aligned_str="$pac_attr_aligned_str"
if test "X$pac_result_str" != "X" ; then
pac_result_str="$pac_result_str, too small! reset to $asize"
else
pac_result_str="$asize"
fi
break
fi
])
fi
], [
pac_attr_alignedn=no
])
AC_LANG_POP([C])
done
ifelse([$2],[],[],[$2="$pac_f2c_attr_aligned_str"])
else
pac_result_str=""
# Since the test fails, set pac_f2c_attr_aligned_str to empty string.
pac_f2c_attr_aligned_str=""
fi
if test "X$pac_result_str" != "X" ; then
AC_MSG_RESULT([$pac_result_str])
else
AC_MSG_RESULT([unknown])
fi
rm -f pac_align0.log
])
dnl
+75
Ver Arquivo
@@ -0,0 +1,75 @@
dnl This internal macro fails to work properly with OTHER internal macros.
dnl Basically, if the prologue is [], then no message should be generated.
dnl This macro is in autoconf 2.52
m4_define([AC_LANG_PROGRAM(Fortran 77)],
[m4_if([$1],[[[]]],,[m4_ifval([$1],
[m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])])dnl
program main
$2
end])
dnl/*D
dnl PAC_PROG_CHECK_INSTALL_WORKS - Check whether the install program in INSTALL
dnl works.
dnl
dnl Synopsis:
dnl PAC_PROG_CHECK_INSTALL_WORKS
dnl
dnl Output Effect:
dnl Sets the variable 'INSTALL' to the value of 'ac_sh_install' if
dnl a file cannot be installed into a local directory with the 'INSTALL'
dnl program
dnl
dnl Notes:
dnl The 'AC_PROG_INSTALL' scripts tries to avoid broken versions of
dnl install by avoiding directories such as '/usr/sbin' where some
dnl systems are known to have bad versions of 'install'. Unfortunately,
dnl this is exactly the sort of test-on-name instead of test-on-capability
dnl that 'autoconf' is meant to eliminate. The test in this script
dnl is very simple but has been adequate for working around problems
dnl on Solaris, where the '/usr/sbin/install' program (known by
dnl autoconf to be bad because it is in /usr/sbin) is also reached by a
dnl soft link through /bin, which autoconf believes is good.
dnl
dnl No variables are cached to ensure that we do not make a mistake in
dnl our choice of install program.
dnl
dnl The Solaris configure requires the directory name to immediately
dnl follow the '-c' argument, rather than the more common
dnl.vb
dnl args sourcefiles destination-dir
dnl.ve
dnl D*/
AC_DEFUN([PAC_PROG_CHECK_INSTALL_WORKS],[
if test -z "$INSTALL" ; then
AC_MSG_RESULT([No install program available])
else
# first make any "confdb/install-sh -c" into an absolute path
# this is a hack, but it's still much cleaner than anything else I could
# come up with (see tt#1007) [goodell@]
AS_CASE(["$INSTALL"],
[/*],[:],
[*install-sh*],[INSTALL="$master_top_srcdir/$INSTALL"])
# Check that this install really works
rm -f conftest
echo "Test file" > conftest
if test ! -d .conftest ; then mkdir .conftest ; fi
AC_MSG_CHECKING([whether install works])
if $INSTALL conftest .conftest >/dev/null 2>&1 ; then
installOk=yes
else
installOk=no
fi
rm -rf .conftest conftest
AC_MSG_RESULT($installOk)
if test "$installOk" = no ; then
if test -n "$ac_install_sh" ; then
INSTALL=$ac_install_sh
else
AC_MSG_ERROR([Unable to find working install])
fi
fi
fi
])
+372
Ver Arquivo
@@ -0,0 +1,372 @@
dnl
dnl/*D
dnl AC_CACHE_LOAD - Replacement for autoconf cache load
dnl
dnl Notes:
dnl Caching in autoconf is broken (at least through version 2.13).
dnl The problem is that the cache is read
dnl without any check for whether it makes any sense to read it.
dnl A common problem is a build on a shared file system; connecting to
dnl a different computer and then building within the same directory will
dnl lead to at best error messages from configure and at worse a build that
dnl is wrong but fails only at run time (e.g., wrong datatype sizes used).
dnl Later versions of autoconf do include some checks for changes in the
dnl environment that impact the choices, but still misses problems with
dnl multiple different systems.
dnl
dnl This fixes that by requiring the user to explicitly enable caching
dnl before the cache file will be loaded.
dnl
dnl To use this version of 'AC_CACHE_LOAD', you need to include
dnl 'aclocal_cache.m4' in your 'aclocal.m4' file. The sowing 'aclocal.m4'
dnl file includes this file.
dnl
dnl If no --enable-cache or --disable-cache option is selected, the
dnl command causes configure to keep track of the system being configured
dnl in a config.system file; if the current system matches the value stored
dnl in that file (or there is neither a config.cache nor config.system file),
dnl configure will enable caching. In order to ensure that the configure
dnl tests make sense, the values of CC, F77, F90, and CXX are also included
dnl in the config.system file. In addition, the value of PATH is included
dnl to ensure that changes in the PATH that might select a different version
dnl of a program with the same name (such as a native make versus gnumake)
dnl are detected.
dnl
dnl Bugs:
dnl This does not work with the Cygnus configure because the enable arguments
dnl are processed *after* AC_CACHE_LOAD (!). To address this, we avoid
dnl changing the value of enable_cache, and use real_enable_cache, duplicating
dnl the "notgiven" value.
dnl
dnl The environment variable CONFIGURE_DEBUG_CACHE, if set to yes,
dnl will cause additional data to be written out during the configure process.
dnl This can be helpful in debugging the cache file process.
dnl
dnl See Also:
dnl PAC_ARG_CACHING
dnl D*/
define([AC_CACHE_LOAD],
[if test "$CONFIGURE_DEBUG_CACHE" = yes ; then
oldopts="$-"
clearMinusX=no
set -x
if test "$oldopts" != "$-" ; then
clearMinusX=yes
fi
fi
if test "X$cache_system" = "X" ; then
# A default file name, just in case
cache_system="config.system"
if test "$cache_file" != "/dev/null" ; then
# Get the directory for the cache file, if any
changequote(,)
dnl Be careful to ensure that there is no doubled slash
cache_system=`echo $cache_file | sed -e 's%^\(.*/\)[^/]*%\1config.system%'`
changequote([,])
test "x$cache_system" = "x$cache_file" && cache_system="config.system"
# else
# We must *not* set enable_cache to no because we need to know if
# enable_cache was not set.
# enable_cache=no
fi
fi
dnl
dnl The "action-if-not-given" part of AC_ARG_ENABLE is not executed until
dnl after the AC_CACHE_LOAD is executed (!). Thus, the value of
dnl enable_cache if neither --enable-cache or --disable-cache is selected
dnl is null. Just in case autoconf ever fixes this, we test both cases.
dnl
dnl Include PATH in the cache.system file since changing the path can
dnl change which versions of programs are found (such as vendor make
dnl or GNU make).
dnl
#
# Get a test value and flag whether we should remove/replace the
# cache_system file (do so unless cache_system_ok is yes)
# FC and F77 should be synonyms. Save both in case
# We include the xxxFLAGS in case the user is using the flags to change
# the language (either input or output) of the compiler. E.g.,
# using -xarch=v9 on Solaris to select 64 bit output or using -D_BSD_SOURCE
# with gcc to get different header files on input.
cleanargs=`echo "$CC $F77 $FC $CXX $F90 $CFLAGS $FFLAGS $CXXFLAGS $F90FLAGS $PATH" | tr '"' ' '`
if uname -srm >/dev/null 2>&1 ; then
cache_system_text="`uname -srm` $cleanargs"
else
cache_system_text="-no-uname- $cleanargs"
fi
cache_system_ok=no
#
if test -z "$real_enable_cache" ; then
real_enable_cache=$enable_cache
if test -z "$real_enable_cache" ; then real_enable_cache="notgiven" ; fi
fi
if test "X$real_enable_cache" = "Xnotgiven" ; then
# check for valid cache file
if test -z "$cache_system" ; then cache_system="config.system" ; fi
if uname -srm >/dev/null 2>&1 ; then
if test -f "$cache_system" -a -n "$cache_system_text" ; then
if test "$cache_system_text" = "`cat $cache_system`" ; then
real_enable_cache="yes"
cache_system_ok=yes
fi
elif test ! -f "$cache_system" -a -n "$cache_system_text" ; then
# remove the cache file because it may not correspond to our
# system
if test "$cache_file" != "/dev/null" ; then
rm -f $cache_file
fi
real_enable_cache="yes"
fi
fi
fi
if test "X$real_enable_cache" = "Xyes" -a "$cache_file" = "/dev/null" ; then
real_enable_cache=no
fi
if test "X$real_enable_cache" = "Xyes" ; then
if test -r "$cache_file" ; then
echo "loading cache $cache_file"
if test -w "$cache_file" ; then
# Clean the cache file (ergh)
PAC_CACHE_CLEAN
fi
. $cache_file
else
echo "Configure in `pwd` creating cache $cache_file"
> $cache_file
rm -f $cache_system
fi
else
cache_file="/dev/null"
fi
# Remember our location and the name of the cachefile
pac_cv_my_conf_dir=`pwd`
dnl do not include the cachefile name, since this may contain the process
dnl number and cause comparisons looking for changes to the cache file
dnl to detect a change that isn't real.
dnl pac_cv_my_cachefile=$cachefile
#
# Update the cache_system file if necessary
if test "$cache_system_ok" != yes ; then
if test -n "$cache_system" ; then
rm -f $cache_system
echo $cache_system_text > $cache_system
fi
fi
if test "$clearMinusX" = yes ; then
set +x
fi
])
dnl
dnl/*D
dnl PAC_ARG_CACHING - Enable caching of results from a configure execution
dnl
dnl Synopsis:
dnl PAC_ARG_CACHING
dnl
dnl Output Effects:
dnl Adds '--enable-cache' and '--disable-cache' to the command line arguments
dnl accepted by 'configure'.
dnl
dnl See Also:
dnl AC_CACHE_LOAD
dnl D*/
dnl Add this call to the other ARG_ENABLE calls. Note that the values
dnl set here are redundant; the LOAD_CACHE call relies on the way autoconf
dnl initially processes ARG_ENABLE commands.
AC_DEFUN([PAC_ARG_CACHING],[
AC_ARG_ENABLE(cache,
AC_HELP_STRING([--enable-cache], [Turn on configure caching]),,
[enable_cache="notgiven"])
])
dnl Clean the cache of extraneous quotes that AC_CACHE_SAVE may add
dnl
AC_DEFUN([PAC_CACHE_CLEAN],[
rm -f confcache
sed -e "s/'\\\\''//g" -e "s/'\\\\/'/" -e "s/\\\\'/'/" \
-e "s/'\\\\''//g" $cache_file > confcache
if cmp -s $cache_file confcache ; then
:
else
if test -w $cache_file ; then
echo "updating cache $cache_file"
cat confcache > $cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
if test "$DEBUG_AUTOCONF_CACHE" = "yes" ; then
echo "Results of cleaned cache file:"
echo "--------------------------------------------------------"
cat $cache_file
echo "--------------------------------------------------------"
fi
])
dnl/*D
dnl PAC_SUBDIR_CACHE - Create a cache file before ac_output for subdirectory
dnl configures.
dnl
dnl Synopsis:
dnl PAC_SUBDIR_CACHE(when)
dnl
dnl Input Parameter:
dnl . when - Indicates when the cache should be created (optional)
dnl If 'always', create a new cache file. This option
dnl should be used if any of the cache parameters (such as
dnl CFLAGS or LDFLAGS) may have changed.
dnl
dnl Output Effects:
dnl
dnl Create a cache file before ac_output so that subdir configures don't
dnl make mistakes.
dnl We can't use OUTPUT_COMMANDS to remove the cache file, because those
dnl commands are executed *before* the subdir configures.
dnl
dnl D*/
AC_DEFUN([PAC_SUBDIR_CACHE],[])
AC_DEFUN([PAC_SUBDIR_CACHE_OLD],[
if test "x$1" = "xalways" -o \( "$cache_file" = "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" \) ; then
# Use an absolute directory to help keep the subdir configures from getting
# lost
cache_file=`pwd`/$$conf.cache
touch $cache_file
dnl
dnl For Autoconf 2.52+, we should ensure that the environment is set
dnl for the cache. Make sure that we get the values and set the
dnl xxx_set variables properly
ac_cv_env_CC_set=set
ac_cv_env_CC_value=$CC
ac_cv_env_CFLAGS_set=${CFLAGS+set}
ac_cv_env_CFLAGS_value=$CFLAGS
ac_cv_env_CPP_set=set
ac_cv_env_CPP_value=$CPP
ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_cv_env_CPPFLAGS_value=$CPPFLAGS
ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
ac_cv_env_LDFLAGS_value=$LDFLAGS
ac_cv_env_LIBS_set=${LIBS+set}
ac_cv_env_LIBS_value=$LIBS
ac_cv_env_FC_set=${FC+set}
ac_cv_env_FC_value=$FC
ac_cv_env_F77_set=${F77+set}
ac_cv_env_F77_value=$F77
ac_cv_env_F90_set=${F90+set}
ac_cv_env_F90_value=$F90
ac_cv_env_FFLAGS_set=${FFLAGS+set}
ac_cv_env_FFLAGS_value=$FFLAGS
ac_cv_env_CXX_set=${CXX+set}
ac_cv_env_CXX_value=$CXX
ac_env_CC_set=set
ac_env_CC_value=$CC
ac_env_CFLAGS_set=${CFLAGS+set}
ac_env_CFLAGS_value=$CFLAGS
ac_env_CPP_set=set
ac_env_CPP_value=$CPP
ac_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_env_CPPFLAGS_value=$CPPFLAGS
ac_env_LDFLAGS_set=${LDFLAGS+set}
ac_env_LDFLAGS_value=$LDFLAGS
ac_env_LIBS_set=${LIBS+set}
ac_env_LIBS_value=$LIBS
ac_env_FC_set=${FC+set}
ac_env_FC_value=$FC
ac_env_F77_set=${F77+set}
ac_env_F77_value=$F77
ac_env_F90_set=${F90+set}
ac_env_F90_value=$F90
ac_env_FFLAGS_set=${FFLAGS+set}
ac_env_FFLAGS_value=$FFLAGS
ac_env_CXX_set=${CXX+set}
ac_env_CXX_value=$CXX
dnl other parameters are
dnl build_alias, host_alias, target_alias
# It turns out that A C CACHE_SAVE can't be invoked more than once
# with data that contains blanks. What happens is that the quotes
# that it adds get quoted and then added again. To avoid this,
# we strip off the outer quotes for all cached variables
dnl We add pac_cv_my_conf_dir to give the source of this cachefile,
dnl and pac_cv_my_cachefile to indicate how it chose the cachefile.
pac_cv_my_conf_dir=`pwd`
pac_cv_my_cachefile=$cachefile
AC_CACHE_SAVE
PAC_CACHE_CLEAN
ac_configure_args="$ac_configure_args -enable-cache"
fi
dnl Unconditionally export these values. Subdir configures break otherwise
export CC
export CFLAGS
export LDFLAGS
export LIBS
export CPPFLAGS
export CPP
export FC
export F77
export F90
export CXX
export FFLAGS
export CCFLAGS
])
AC_DEFUN([PAC_SUBDIR_CACHE_CLEANUP],[])
AC_DEFUN([PAC_SUBDIR_CACHE_CLEANUP_OLD],[
if test "$cache_file" != "/dev/null" -a "X$real_enable_cache" = "Xnotgiven" ; then
rm -f $cache_file
cache_file=/dev/null
fi
])
dnl
dnl The following three macros support the sharing of configure results
dnl by configure scripts, including ones that are not run with
dnl AC_CONFIG_SUBDIRS (the cachefiles managed by --enable-cache can
dnl only be used with AC_CONFIG_SUBDIRS; creating a autoconf-style
dnl cachefile before the the end of the autoconf process will often
dnl cause problems.
dnl
AC_DEFUN([PAC_CREATE_BASE_CACHE],[
AC_ARG_ENABLE(base-cache,
AC_HELP_STRING([--enable-base-cache],
[Enable the use of a simple cache for the subsidiary
configure scripts]),,enable_base_cache=default)
# The default case is controlled by the environment variable CONF_USE_CACHEFILE
if test "$enable_base_cache" = "default" ; then
if test "$CONF_USE_CACHEFILE" = yes ; then
enable_base_cache=yes
else
enable_base_cache=no
fi
fi
if test "$enable_base_cache" != no ; then
if test "$enable_base_cache" = yes ; then
basecachefile=`pwd`/cache.base
else
basecachefile=`pwd`/$enable_base_cache
fi
set | grep ac_cv > $basecachefile
# Tell other configures to load this file
echo "Creating and exporting the base cache file $basecachefile"
CONF_BASE_CACHEFILE=$basecachefile
export CONF_BASE_CACHEFILE
fi
])
AC_DEFUN([PAC_LOAD_BASE_CACHE],[
if test -n "$CONF_BASE_CACHEFILE" -a -s "$CONF_BASE_CACHEFILE" ; then
echo "Loading base cachefile $CONF_BASE_CACHEFILE"
. $CONF_BASE_CACHEFILE
export CONF_BASE_CACHEFILE
fi
])
AC_DEFUN([PAC_UPDATE_BASE_CACHE],[
if test -n "$CONF_BASE_CACHEFILE" -a -s "$CONF_BASE_CACHEFILE" ; then
set | grep ac_cv > $CONF_BASE_CACHEFILE.new
if cmp -s $CONF_BASE_CACHEFILE.new $CONF_BASE_CACHEFILE ; then
:
else
echo "Replacing $CONF_BASE_CACHEFILE"
mv $CONF_BASE_CACHEFILE.new $CONF_BASE_CACHEFILE
fi
fi
])
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+123
Ver Arquivo
@@ -0,0 +1,123 @@
# This macro set originally copied from hwloc.
# MPICH modifications:
# - renamed macro to PAC_CHECK_VISIBILITY
# - removed C compiler vendor check
# - sed -e 's/HWLOC/MPICH/gI'
#
# Copyright © 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright © 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright © 2004-2007 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright © 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright © 2006-2007 Cisco Systems, Inc. All rights reserved.
# and renamed/modified for hwloc:
# Copyright © 2009 Inria. All rights reserved.
# Copyright © 2009-2010 Université Bordeaux
# Copyright © 2010-2012 Cisco Systems, Inc. All rights reserved.
# See COPYING in top-level directory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer listed
# in this license in the documentation and/or other materials
# provided with the distribution.
#
# - Neither the name of the copyright holders nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# The copyright holders provide no reassurances that the source code
# provided does not infringe any patent, copyright, or any other
# intellectual property rights of third parties. The copyright holders
# disclaim any liability to any recipient for claims brought against
# recipient by any third party for infringement of that parties
# intellectual property rights.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# PAC_CHECK_VISIBILITY
# --------------------------------------------------------
AC_DEFUN([PAC_CHECK_VISIBILITY],[
# Be safe for systems that have ancient Autoconf's (e.g., RHEL5)
m4_ifdef([AC_PROG_GREP],
[AC_REQUIRE([AC_PROG_GREP])],
[GREP=grep])
# Check if the compiler has support for visibility, like some
# versions of gcc, icc, Sun Studio cc.
AC_ARG_ENABLE(visibility,
AC_HELP_STRING([--enable-visibility],
[enable visibility feature of certain compilers/linkers (default: enabled on platforms that support it)]))
case ${target} in
*-*-aix*|*-*-mingw*|*-*-cygwin*|*-*-hpux*)
enable_visibility=no
;;
esac
mpich_visibility_define=0
mpich_msg="whether to enable symbol visibility"
if test "$enable_visibility" = "no"; then
AC_MSG_CHECKING([$mpich_msg])
AC_MSG_RESULT([no (disabled)])
else
CFLAGS_orig=$CFLAGS
mpich_add=-fvisibility=hidden
CFLAGS="$CFLAGS_orig $mpich_add -Werror"
AC_MSG_CHECKING([if $CC supports $mpich_add])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
__attribute__((visibility("default"))) int foo;
]],[[fprintf(stderr, "Hello, world\n");]])],
[AS_IF([test -s conftest.err],
[$GREP -iq visibility conftest.err
# If we find "visibility" in the stderr, then
# assume it doesn't work
AS_IF([test "$?" = "0"], [mpich_add=])])
], [mpich_add=])
AS_IF([test "$mpich_add" = ""],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])])
CFLAGS=$CFLAGS_orig
VISIBILITY_CFLAGS=$mpich_add
if test "$mpich_add" != "" ; then
mpich_visibility_define=1
AC_MSG_CHECKING([$mpich_msg])
AC_MSG_RESULT([yes (via $mpich_add)])
elif test "$enable_visibility" = "yes"; then
AC_MSG_ERROR([Symbol visibility support requested but compiler does not seem to support it. Aborting])
else
AC_MSG_CHECKING([$mpich_msg])
AC_MSG_RESULT([no (unsupported)])
fi
unset mpich_add
fi
AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$mpich_visibility_define],
[Whether C compiler supports symbol visibility or not])
])
+90
Ver Arquivo
@@ -0,0 +1,90 @@
dnl Macro to add --enable-coverage option (disabled by default) and add
dnl appropriate compiler flags to permit usage of gcov if that option is
dnl enabled. If WRAPPER_xFLAGS variables are set then the flags will also be
dnl added to those variables.
dnl
dnl Sets "pac_cv_use_coverage=yes" and AC_DEFINEs USE_COVERAGE if coverage was
dnl successfully enabled. Also creates an AM_CONDITIONAL with the name
dnl "BUILD_COVERAGE" that is true iff pac_cv_use_coverage=yes.
dnl
dnl Usage: PAC_CONFIG_SUBDIR_ARGS
dnl
dnl Assumes that all of the compiler macros have already been invoked
dnl (AC_PROG_CC and friends).
AC_DEFUN([PAC_ENABLE_COVERAGE],[
AC_ARG_VAR([GCOV],[name/path for the gcov utility])
AC_CHECK_PROGS([GCOV],[gcov])
AC_ARG_ENABLE([coverage],
[AC_HELP_STRING([--enable-coverage],
[Turn on coverage analysis using gcc and gcov])],
[],[enable_coverage=no])
if test "$enable_coverage" = "yes" ; then
if test "$ac_cv_prog_gcc" = "yes" ; then
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
LIBS="$LIBS -lgcov"
if test ${WRAPPER_CFLAGS+set} = set ; then
WRAPPER_CFLAGS="$WRAPPER_CFLAGS -fprofile-arcs -ftest-coverage"
fi
else
AC_MSG_WARN([--enable-coverage only supported for GCC])
fi
if test "$enable_cxx" = "yes" ; then
if test "$ac_cv_cxx_compiler_gnu" = "yes" ; then
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
LIBS="$LIBS -lgcov"
if test ${WRAPPER_CXXFLAGS+set} = set ; then
WRAPPER_CXXFLAGS="$WRAPPER_CXXFLAGS -fprofile-arcs -ftest-coverage"
fi
else
AC_MSG_WARN([--enable-coverage only supported for GCC])
fi
fi
# Add similar options for g77 so that the Fortran tests will also
#
if test "$enable_f77" = yes ; then
if test "$ac_cv_f77_compiler_gnu" = "yes" ; then
FFLAGS="$FFLAGS -fprofile-arcs -ftest-coverage"
LIBS="$LIBS -lgcov"
if test ${WRAPPER_FFLAGS+set} = set ; then
WRAPPER_FFLAGS="$WRAPPER_FFLAGS -fprofile-arcs -ftest-coverage"
fi
else
AC_MSG_WARN([--enable-coverage only supported for G77/GFORTRAN])
fi
fi
if test "$enable_fc" = yes ; then
if test "$ac_cv_fc_compiler_gnu" = "yes" ; then
FCFLAGS="$FCFLAGS -fprofile-arcs -ftest-coverage"
LIBS="$LIBS -lgcov"
if test ${WRAPPER_FCFLAGS+set} = set ; then
WRAPPER_FCFLAGS="$WRAPPER_FCFLAGS -fprofile-arcs -ftest-coverage"
fi
else
AC_MSG_WARN([--enable-coverage only supported for GFORTRAN])
fi
fi
# On some platforms (e.g., Mac Darwin), we must also *link*
# with the -fprofile-args -ftest-coverage option.
AC_MSG_CHECKING([whether compilation with coverage analysis enabled works])
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(int argc, char **argv){return 1;}])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Unable to link programs when coverage analysis enabled])])
# Test for the routines that we need to use to ensure that the
# data files are (usually) written out
# FIXME: Some versions of Linux provide usleep, but it rounds times
# up to the next second (!)
AC_CHECK_FUNCS([usleep])
# NOTE: using a "pac_cv_" prefix but not caching because of xFLAGS "side effects"
pac_cv_use_coverage=yes
AC_DEFINE([USE_COVERAGE],[1],[Define if performing coverage tests])
fi
AM_CONDITIONAL([BUILD_COVERAGE],[test "X$pac_cv_use_coverage" = "Xyes"])
])
+187
Ver Arquivo
@@ -0,0 +1,187 @@
dnl PAC_CXX_SEARCH_LIST - expands to a whitespace separated list of C++
dnl compilers for use with AC_PROG_CXX that is more suitable for HPC software
dnl packages
AC_DEFUN([PAC_CXX_SEARCH_LIST],[$CCC icpc pgCC xlC pathCC g++ clang++ c++ cc++ cxx CC cl])
dnl PAC_PROG_CXX - reprioritize the C++ compiler search order
dnl NOTE: this macro suffers from a basically intractable "expanded before it
dnl was required" problem when libtool is also used
AC_DEFUN([PAC_PROG_CXX],[
PAC_PUSH_FLAG([CXXFLAGS])
# This test uses the list from a recent PROG_CXX, but with the
# addition of the Portland group, IBM, and Intel C++ compilers
# (While the Intel icc compiler will compile C++ programs, it will
# not *link* C++ object files unless there is at least one C++ source
# file present on the command that performs the linking. icpc is the
# Intel C++ compiler that both compiles and links C++ programs)
AC_PROG_CXX([PAC_CXX_SEARCH_LIST])
PAC_POP_FLAG([CXXFLAGS])
])
dnl This is from crypt.to/autoconf-archive, slightly modified.
dnl It defines bool as int if it is not availalbe
dnl
AC_DEFUN([AX_CXX_BOOL],
[AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
ac_cv_cxx_bool,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
int f(int x){return 1;}
int f(char x){return 1;}
int f(bool x){return 1;}
],[bool b = true; return f(b);],
ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_bool" != yes; then
AC_DEFINE(bool,int,[define if bool is a built-in type])
fi
])
dnl This is from crypt.to/autoconf-archive, slightly modified (name defined)
dnl
AC_DEFUN([AX_CXX_EXCEPTIONS],
[AC_CACHE_CHECK(whether the compiler supports exceptions,
ac_cv_cxx_exceptions,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE(,[try { throw 1; } catch (int i) { return i; }],
ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_exceptions" = yes; then
AC_DEFINE(HAVE_CXX_EXCEPTIONS,,[define if the compiler supports exceptions])
fi
])
dnl This is from crypt.to/autoconf-archive
dnl
AC_DEFUN([AX_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
[using namespace Outer::Inner; return i;],
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])
dnl Some compilers support namespaces but don't know about std
dnl
AC_DEFUN([AX_CXX_NAMESPACE_STD],
[AC_REQUIRE([AX_CXX_NAMESPACES])
AC_CACHE_CHECK(whether the compiler implements the namespace std,
ac_cv_cxx_namespace_std,
[ac_cv_cxx_namespace_std=no
if test "$ac_cv_cxx_namespaces" = yes ; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <iostream>
using namespace std;],
[cout << "message\n";],
ac_cv_cxx_namespace_std=yes, ac_cv_cxx_namespace_std=no)
AC_LANG_RESTORE
fi
])
if test "$ac_cv_cxx_namespace_std" = yes; then
AC_DEFINE(HAVE_NAMESPACE_STD,,[define if the compiler implements namespace std])
fi
])
dnl/*D
dnl PAC_CXX_CHECK_COMPILER_OPTION - Check that a C++ compiler option is
dnl accepted without warning messages
dnl
dnl Synopsis:
dnl PAC_CXX_CHECK_COMPILER_OPTION(optionname,action-if-ok,action-if-fail)
dnl
dnl Output Effects:
dnl
dnl If no actions are specified, a working value is added to 'CXXOPTIONS'
dnl
dnl Notes:
dnl This is now careful to check that the output is different, since
dnl some compilers are noisy.
dnl
dnl We are extra careful to prototype the functions in case compiler options
dnl that complain about poor code are in effect.
dnl
dnl Because this is a long script, we have ensured that you can pass a
dnl variable containing the option name as the first argument.
dnl D*/
AC_DEFUN([PAC_CXX_CHECK_COMPILER_OPTION],[
AC_MSG_CHECKING([whether C++ compiler accepts option $1])
pac_opt="$1"
AC_LANG_PUSH([C++])
CXXFLAGS_orig="$CXXFLAGS"
CXXFLAGS_opt="$pac_opt $CXXFLAGS"
pac_result="unknown"
AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
CXXFLAGS="$CXXFLAGS_orig"
rm -f pac_test1.log
PAC_LINK_IFELSE_LOG([pac_test1.log], [], [
CXXFLAGS="$CXXFLAGS_opt"
rm -f pac_test2.log
PAC_LINK_IFELSE_LOG([pac_test2.log], [], [
PAC_RUNLOG_IFELSE([diff -b pac_test1.log pac_test2.log],
[pac_result=yes],[pac_result=no])
],[
pac_result=no
])
], [
pac_result=no
])
AC_MSG_RESULT([$pac_result])
dnl Delete the conftest created by AC_LANG_CONFTEST.
rm -f conftest.$ac_ext
if test "$pac_result" = "yes" ; then
AC_MSG_CHECKING([whether routines compiled with $pac_opt can be linked with ones compiled without $pac_opt])
pac_result=unknown
CXXFLAGS="$CXXFLAGS_orig"
rm -f pac_test3.log
PAC_COMPILE_IFELSE_LOG([pac_test3.log], [
AC_LANG_SOURCE([
int foo(void);
int foo(void){return 0;}
])
],[
PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
saved_LIBS="$LIBS"
LIBS="pac_conftest.$OBJEXT $LIBS"
CXXFLAGS="$CXXFLAGS_opt"
rm -f pac_test4.log
PAC_LINK_IFELSE_LOG([pac_test4.log], [AC_LANG_PROGRAM()], [
PAC_RUNLOG_IFELSE([diff -b pac_test2.log pac_test4.log],
[pac_result=yes], [pac_result=no])
],[
pac_result=no
])
LIBS="$saved_LIBS"
rm -f pac_conftest.$OBJEXT
],[
pac_result=no
])
AC_MSG_RESULT([$pac_result])
rm -f pac_test3.log pac_test4.log
fi
rm -f pac_test1.log pac_test2.log
dnl Restore CXXFLAGS before 2nd/3rd argument commands are executed,
dnl as 2nd/3rd argument command could be modifying CXXFLAGS.
CXXFLAGS="$CXXFLAGS_orig"
if test "$pac_result" = "yes" ; then
ifelse([$2],[],[CXXOPTIONS="$CXXOPTIONS $1"],[$2])
else
ifelse([$3],[],[:],[$3])
fi
AC_LANG_POP([C++])
])
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+389
Ver Arquivo
@@ -0,0 +1,389 @@
dnl/*D
dnl PAC_PROG_F77_CMDARGS - Determine how to access the command line from
dnl Fortran 77
dnl
dnl Output Effects:
dnl The following variables are set:
dnl.vb
dnl F77_GETARG - Statement to get an argument i into string s
dnl F77_IARGC - Routine to return the number of arguments
dnl FXX_MODULE - Module command when using Fortran 90 compiler
dnl F77_GETARGDECL - Declaration of routine used for F77_GETARG
dnl F77_GETARG_FFLAGS - Flags needed when compiling/linking
dnl F77_GETARG_LDFLAGS - Flags needed when linking
dnl.ve
dnl If 'F77_GETARG' has a value, then that value and the values for these
dnl other symbols will be used instead. If no approach is found, all of these
dnl variables will have empty values.
dnl If no other approach works and a file 'f77argdef' is in the directory,
dnl that file will be sourced for the values of the above four variables.
dnl
dnl In most cases, you should add F77_GETARG_FFLAGS to the FFLAGS variable
dnl and F77_GETARG_LDFLAGS to the LDFLAGS variable, to ensure that tests are
dnl performed on the compiler version that will be used.
dnl
dnl 'AC_SUBST' is called for all six variables.
dnl
dnl One complication is that on systems with multiple Fortran compilers,
dnl some libraries used by one Fortran compiler may have been (mis)placed
dnl in a common location. We have had trouble with libg2c in particular.
dnl To work around this, we test whether iargc etc. work first. This
dnl will catch most systems and will speed up the tests.
dnl
dnl Next, the libraries are only added if they are needed to complete a
dnl link; they aren''t added just because they exist.
dnl
dnl f77argdef
dnl D*/
dnl
dnl Random notes
dnl You can export the command line arguments from C to the g77 compiler
dnl using
dnl extern char **__libc_argv;
dnl extern int __libc_argc;
dnl f_setarg( __libc_argc, __libc_argv );
dnl
AC_DEFUN([PAC_PROG_F77_CMDARGS],[
found_cached="yes"
AC_MSG_CHECKING([for routines to access the command line from Fortran 77])
AC_CACHE_VAL(pac_cv_prog_f77_cmdarg,
[
AC_MSG_RESULT([searching...])
found_cached="no"
# First, we perform a quick check. Does iargc and getarg work?
fxx_module="${FXX_MODULE:-}"
f77_getargdecl="${F77_GETARGDECL:-external getarg}"
f77_getarg="${F77_GETARG:-call GETARG(i,s)}"
f77_iargc="${F77_IARGC:-IARGC()}"
#
# Grumble. The Absoft Fortran compiler computes i - i as 0 and then
# 1.0 / 0 at compile time, even though the code may never be executed.
# What we need is a way to generate an error, so the second usage of i
# was replaced with f77_iargc.
cat > conftest.f <<EOF
program main
$fxx_module
integer i, j
character*20 s
$f77_getargdecl
i = 0
$f77_getarg
i=$f77_iargc
if (i .gt. 1) then
j = i - $f77_iargc
j = 1.0 / j
endif
end
EOF
found_answer="no"
if test -z "$ac_fcompilelink" ; then
ac_fcompilelink="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $LIBS 1>&AC_FD_CC"
fi
AC_MSG_CHECKING([whether ${F77-f77} $flags $libs works with GETARG and IARGC])
if AC_TRY_EVAL(ac_fcompilelink) && test -x conftest ; then
# Check that cross != yes so that this works with autoconf 2.52
# Check that cross_compiling != yes so that this works with
# autoconf 2.6x for some (but almost certainly not all)x
# Question: why do we test that this runs? It looks like we
# needed this for some old Fortran compilers that produced
# executable code that then did not run.
if test "$ac_cv_prog_f77_cross" != "yes" -a \
"$cross_compiling" != "yes" ; then
if ./conftest >/dev/null 2>&1 ; then
found_answer="yes"
FXX_MODULE="$fxx_module"
F77_GETARGDECL="$f77_getargdecl"
F77_GETARG="$f77_getarg"
F77_IARGC="$f77_iargc"
AC_MSG_RESULT(yes)
fi
fi
fi
if test $found_answer = "no" ; then
AC_MSG_RESULT(no)
# Grumph. Here are a bunch of different approaches
# We have several axes the check:
# Library to link with (none, -lU77 (HPUX), -lg2c (LINUX f77))
# PEPCF90 (Intel ifc)
# The first line is a dummy
# (we experimented with using a <space>, but this caused other
# problems because we need <space> in the IFS)
trial_LIBS="0 -lU77 -lPEPCF90"
if test "$NOG2C" != "1" ; then
trial_LIBS="$trial_LIBS -lg2c"
fi
# Discard libs that are not availble:
save_IFS="$IFS"
# Make sure that IFS includes a space, or the tests that run programs
# may fail
IFS=" ""
"
save_trial_LIBS="$trial_LIBS"
trial_LIBS=""
cat > conftest.f <<EOF
program main
end
EOF
ac_fcompilelink_test='${F77-f77} -o conftest $FFLAGS conftest.f $LDFLAGS $libs $LIBS 1>&AC_FD_CC'
for libs in $save_trial_LIBS ; do
if test "$libs" = "0" ; then
lib_ok="yes"
else
AC_MSG_CHECKING([whether Fortran 77 links with $libs])
if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
AC_MSG_RESULT([yes])
lib_ok="yes"
else
AC_MSG_RESULT([no])
lib_ok="no"
fi
fi
if test "$lib_ok" = "yes" ; then
trial_LIBS="$trial_LIBS
$libs"
fi
done
# Options to use when compiling and linking
# +U77 is needed by HP Fortran to access getarg etc.
# The -N109 was used for getarg before we realized that GETARG
# was necessary with the (non standard conforming) Absoft compiler
# (Fortran is monocase; Absoft uses mixedcase by default)
# The -f is used by Absoft and is the compiler switch that folds
# symbolic names to lower case. Without this option, the compiler
# considers upper- and lower-case letters to be unique.
# The -YEXT_NAMES=LCS will cause external names to be output as lower
# case letter for Absoft F90 compilers (default is upper case)
# The first line is "<space><newline>, the space is important
# To make the Absoft f77 and f90 work together, we need to prefer the
# upper case versions of the arguments. They also require libU77.
# -YCFRL=1 causes Absoft f90 to work with g77 and similar (f2c-based)
# Fortran compilers
#
# Problem: The Intel efc compiler hangs when presented with -N109 .
# The only real fix for this is to detect this compiler and exclude
# the test. We may want to reorganize these tests so that if we
# can compile code without special options, we never look for them.
#
using_intel_efc="no"
pac_test_msg=`$F77 -V 2>&1 | grep 'Intel(R) Fortran Itanium'`
if test "$pac_test_msg" != "" ; then
using_intel_efc="yes"
fi
if test "$using_intel_efc" = "yes" ; then
trial_FLAGS="000"
else
trial_FLAGS="000
-N109
-f
-YEXT_NAMES=UCS
-YEXT_NAMES=LCS
-YCFRL=1
+U77"
fi
# Discard options that are not available:
# (IFS already saved above)
IFS=" ""
"
save_trial_FLAGS="$trial_FLAGS"
trial_FLAGS=""
for flag in $save_trial_FLAGS ; do
if test "$flag" = " " -o "$flag" = "000" ; then
opt_ok="yes"
else
PAC_F77_CHECK_COMPILER_OPTION($flag,opt_ok=yes,opt_ok=no)
fi
if test "$opt_ok" = "yes" ; then
if test "$flag" = " " -o "$flag" = "000" ; then
fflag=""
else
fflag="$flag"
fi
# discard options that don't allow mixed-case name matching
cat > conftest.f <<EOF
program main
call aB()
end
subroutine Ab()
end
EOF
if test -n "$fflag" ; then flagval="with $fflag" ; else flagval="" ; fi
AC_MSG_CHECKING([whether Fortran 77 routine names are case-insensitive $flagval])
dnl we can use double quotes here because all is already
dnl evaluated
ac_fcompilelink_test="${F77-f77} -o conftest $fflag $FFLAGS conftest.f $LDFLAGS $LIBS 1>&AC_FD_CC"
if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
opt_ok="no"
fi
fi
if test "$opt_ok" = "yes" ; then
trial_FLAGS="$trial_FLAGS
$flag"
fi
done
IFS="$save_IFS"
# Name of routines. Since these are in groups, we use a case statement
# and loop until the end (accomplished by reaching the end of the
# case statement
# For one version of Nag F90, the names are
# call f90_unix_MP_getarg(i,s) and f90_unix_MP_iargc().
trial=0
while test -z "$pac_cv_prog_f77_cmdarg" ; do
case $trial in
0) # User-specified values, if any
if test -z "$F77_GETARG" -o -z "$F77_IARGC" ; then
trial=`expr $trial + 1`
continue
fi
MSG="Using environment values of F77_GETARG etc."
;;
1) # Standard practice, uppercase (some compilers are case-sensitive)
FXX_MODULE=""
F77_GETARGDECL="external GETARG"
F77_GETARG="call GETARG(i,s)"
F77_IARGC="IARGC()"
MSG="GETARG and IARGC"
;;
2) # Standard practice, lowercase
FXX_MODULE=""
F77_GETARGDECL="external getarg"
F77_GETARG="call getarg(i,s)"
F77_IARGC="iargc()"
MSG="getarg and iargc"
;;
3) # Posix alternative
FXX_MODULE=""
F77_GETARGDECL="external pxfgetarg"
F77_GETARG="call pxfgetarg(i,s,l,ier)"
F77_IARGC="ipxfargc()"
MSG="pxfgetarg and ipxfargc"
;;
4) # Nag f90_unix_env module
FXX_MODULE=" use f90_unix_env"
F77_GETARGDECL=""
F77_GETARG="call getarg(i,s)"
F77_IARGC="iargc()"
MSG="f90_unix_env module"
;;
5) # Nag f90_unix module
FXX_MODULE=" use f90_unix"
F77_GETARGDECL=""
F77_GETARG="call getarg(i,s)"
F77_IARGC="iargc()"
MSG="f90_unix module"
;;
6) # user spec in a file
if test -s f77argdef ; then
. ./f77argdef
MSG="Using definitions in the file f77argdef"
else
trial=`expr $trial + 1`
continue
fi
;;
7) # gfortran won't find getarg if it is marked as external
FXX_MODULE=""
F77_GETARGDECL="intrinsic GETARG"
F77_GETARG="call GETARG(i,s)"
F77_IARGC="IARGC()"
MSG="intrinsic GETARG and IARGC"
;;
*) # exit from while loop
FXX_MODULE=""
F77_GETARGDECL=""
F77_GETARG=""
F77_IARGC=""
break
;;
esac
# Create the program. Make sure that we can run it.
# Force a divide-by-zero if there is a problem (but only at runtime!
# (the Absoft compiler does divide-by-zero at compile time)
cat > conftest.f <<EOF
program main
$FXX_MODULE
integer i, j
character*20 s
$F77_GETARGDECL
i = 0
$F77_GETARG
i=$F77_IARGC
if (i .gt. 1) then
j = i - $F77_IARGC
j = 1.0 / j
endif
end
EOF
#
# Now, try to find some way to compile and link that program, looping
# over the possibilities of options and libraries
save_IFS="$IFS"
IFS=" ""
"
for libs in $trial_LIBS ; do
if test -n "$pac_cv_prog_f77_cmdarg" ; then break ; fi
if test "$libs" = " " -o "$libs" = "0" ; then libs="" ; fi
for flags in $trial_FLAGS ; do
if test "$flags" = " " -o "$flags" = "000"; then flags="" ; fi
AC_MSG_CHECKING([whether ${F77-f77} $flags $libs works with $MSG])
IFS="$save_IFS"
dnl We need this here because we've fiddled with IFS
ac_fcompilelink_test="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $libs $LIBS 1>&AC_FD_CC"
found_answer="no"
if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
if test "$ac_cv_prog_f77_cross" != "yes" -a \
"$cross_compiling" != "yes" ; then
if ./conftest >/dev/null 2>&1 ; then
found_answer="yes"
fi
else
found_answer="yes"
fi
fi
IFS=" ""
"
if test "$found_answer" = "yes" ; then
AC_MSG_RESULT([yes])
pac_cv_prog_f77_cmdarg="$MSG"
pac_cv_prog_f77_cmdarg_fflags="$flags"
pac_cv_prog_f77_cmdarg_ldflags="$libs"
break
else
AC_MSG_RESULT([no])
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.f >&AC_FD_CC
fi
done
done
IFS="$save_IFS"
rm -f conftest.*
trial=`expr $trial + 1`
done
fi
pac_cv_F77_GETARGDECL="$F77_GETARGDECL"
pac_cv_F77_IARGC="$F77_IARGC"
pac_cv_F77_GETARG="$F77_GETARG"
pac_cv_FXX_MODULE="$FXX_MODULE"
])
if test "$found_cached" = "yes" ; then
AC_MSG_RESULT([$pac_cv_prog_f77_cmdarg])
elif test -z "$pac_cv_F77_IARGC" ; then
AC_MSG_WARN([Could not find a way to access the command line from Fortran 77])
fi
# Set the variable values based on pac_cv_prog_xxx
F77_GETARGDECL="$pac_cv_F77_GETARGDECL"
F77_IARGC="$pac_cv_F77_IARGC"
F77_GETARG="$pac_cv_F77_GETARG"
FXX_MODULE="$pac_cv_FXX_MODULE"
F77_GETARG_FFLAGS="$pac_cv_prog_f77_cmdarg_fflags"
F77_GETARG_LDFLAGS="$pac_cv_prog_f77_cmdarg_ldflags"
AC_SUBST(F77_GETARGDECL)
AC_SUBST(F77_IARGC)
AC_SUBST(F77_GETARG)
AC_SUBST(FXX_MODULE)
AC_SUBST(F77_GETARG_FFLAGS)
AC_SUBST(F77_GETARG_LDFLAGS)
])
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+107
Ver Arquivo
@@ -0,0 +1,107 @@
dnl PAC_SET_HEADER_LIB_PATH(with_option,[default_path])
dnl This macro looks for the --with-xxx=, --with-xxx-include and --with-xxx-lib=
dnl options and sets the library and include paths.
dnl
dnl TODO as written, this macro cannot handle a "with_option" arg that has "-"
dnl characters in it. Use AS_TR_SH (and possibly AS_VAR_* macros) to handle
dnl this case if it ever arises.
AC_DEFUN([PAC_SET_HEADER_LIB_PATH],[
AC_ARG_WITH([$1],
[AC_HELP_STRING([--with-$1=PATH],
[specify path where $1 include directory and lib directory can be found])],
[AS_CASE(["$withval"],
[yes|no|''],
[AC_MSG_WARN([--with[out]-$1=PATH expects a valid PATH])
with_$1=""])],
[with_$1=$2])
AC_ARG_WITH([$1-include],
[AC_HELP_STRING([--with-$1-include=PATH],
[specify path where $1 include directory can be found])],
[AS_CASE(["$withval"],
[yes|no|''],
[AC_MSG_WARN([--with[out]-$1-include=PATH expects a valid PATH])
with_$1_include=""])],
[])
AC_ARG_WITH([$1-lib],
[AC_HELP_STRING([--with-$1-lib=PATH],
[specify path where $1 lib directory can be found])],
[AS_CASE(["$withval"],
[yes|no|''],
[AC_MSG_WARN([--with[out]-$1-lib=PATH expects a valid PATH])
with_$1_lib=""])],
[])
# The args have been sanitized into empty/non-empty values above.
# Now append -I/-L args to CPPFLAGS/LDFLAGS, with more specific options
# taking priority
AS_IF([test -n "${with_$1_include}"],
[PAC_APPEND_FLAG([-I${with_$1_include}],[CPPFLAGS])],
[AS_IF([test -n "${with_$1}"],
[PAC_APPEND_FLAG([-I${with_$1}/include],[CPPFLAGS])])])
AS_IF([test -n "${with_$1_lib}"],
[PAC_APPEND_FLAG([-L${with_$1_lib}],[LDFLAGS])],
[AS_IF([test -n "${with_$1}"],
dnl is adding lib64 by default really the right thing to do? What if
dnl we are on a 32-bit host that happens to have both lib dirs available?
[PAC_APPEND_FLAG([-L${with_$1}/lib],[LDFLAGS])
AS_IF([test -d "${with_$1}/lib64"],
[PAC_APPEND_FLAG([-L${with_$1}/lib64],[LDFLAGS])])
])
])
])
dnl PAC_CHECK_HEADER_LIB(header.h, libname, function, action-if-yes, action-if-no)
dnl This macro checks for a header and lib. It is assumed that the
dnl user can specify a path to the includes and libs using --with-xxx=.
dnl The xxx is specified in the "with_option" parameter.
dnl
dnl NOTE: This macro expects a corresponding PAC_SET_HEADER_LIB_PATH
dnl macro (or equivalent logic) to be used before this macro is used.
AC_DEFUN([PAC_CHECK_HEADER_LIB],[
failure=no
AC_CHECK_HEADER([$1],,failure=yes)
AC_CHECK_LIB($2,$3,,failure=yes)
if test "$failure" = "no" ; then
$4
else
$5
fi
])
dnl PAC_CHECK_HEADER_LIB_FATAL(with_option, header.h, libname, function)
dnl Similar to PAC_CHECK_HEADER_LIB, but errors out on failure
AC_DEFUN([PAC_CHECK_HEADER_LIB_FATAL],[
PAC_CHECK_HEADER_LIB($2,$3,$4,success=yes,success=no)
if test "$success" = "no" ; then
AC_MSG_ERROR(['$2 or lib$3 library not found. Did you specify --with-$1= or --with-$1-include= or --with-$1-lib=?'])
fi
])
dnl PAC_CHECK_PREFIX(with_option,prefixvar)
AC_DEFUN([PAC_CHECK_PREFIX],[
AC_ARG_WITH([$1-prefix],
[AS_HELP_STRING([[--with-$1-prefix[=DIR]]], [use the $1
library installed in DIR, rather than the
one included in the distribution. Pass
"embedded" to force usage of the included
$1 source.])],
[if test "$withval" = "system" ; then
:
elif test "$withval" = "embedded" ; then
:
else
PAC_APPEND_FLAG([-I${with_$1_prefix}/include],[CPPFLAGS])
if test -d "${with_$1_prefix}/lib64" ; then
PAC_APPEND_FLAG([-L${with_$1_prefix}/lib64],[LDFLAGS])
fi
PAC_APPEND_FLAG([-L${with_$1_prefix}/lib],[LDFLAGS])
fi
],
[with_$1_prefix="embedded"])
]
)
+315
Ver Arquivo
@@ -0,0 +1,315 @@
dnl
dnl We need routines to check that make works. Possible problems with
dnl make include
dnl
dnl It is really gnumake, and contrary to the documentation on gnumake,
dnl it insists on screaming everytime a directory is changed. The fix
dnl is to add the argument --no-print-directory to the make
dnl
dnl It is really BSD 4.4 make, and can't handle 'include'. For some
dnl systems, this can be fatal; there is no fix (other than removing this
dnl alleged make).
dnl
dnl It is the OSF V3 make, and can't handle a comment in a block of target
dnl code. There is no acceptable fix.
dnl
dnl
dnl
dnl
dnl Find a make program if none is defined.
AC_DEFUN([PAC_PROG_MAKE_PROGRAM],[true
if test "X$MAKE" = "X" ; then
AC_CHECK_PROGS(MAKE,make gnumake nmake pmake smake)
fi
])dnl
dnl/*D
dnl PAC_PROG_MAKE_INCLUDE - Check whether make supports include
dnl
dnl Synopsis:
dnl PAC_PROG_MAKE_INCLUDE([action if true],[action if false])
dnl
dnl Output Effect:
dnl None
dnl
dnl Notes:
dnl This checks for makes that do not support 'include filename'. Some
dnl versions of BSD 4.4 make required '#include' instead; some versions of
dnl 'pmake' have the same syntax.
dnl
dnl See Also:
dnl PAC_PROG_MAKE
dnl
dnl D*/
AC_DEFUN([PAC_PROG_MAKE_INCLUDE],[
AC_CACHE_CHECK([whether make supports include],pac_cv_prog_make_include,[
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest
cat > conftest <<.
ALL:
@echo "success"
.
cat > conftest1 <<.
include conftest
.
pac_str=`$MAKE -f conftest1 2>&1`
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest conftest1
if test "$pac_str" != "success" ; then
pac_cv_prog_make_include="no"
else
pac_cv_prog_make_include="yes"
fi
])
if test "$pac_cv_prog_make_include" = "no" ; then
ifelse([$2],,:,[$2])
else
ifelse([$1],,:,[$1])
fi
])dnl
dnl/*D
dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in
dnl shell commands in a makefile
dnl
dnl Synopsis:
dnl PAC_PROG_MAKE_ALLOWS_COMMENTS([false text])
dnl
dnl Output Effect:
dnl Issues a warning message if comments are not allowed in a makefile.
dnl Executes the argument if one is given.
dnl
dnl Notes:
dnl Some versions of OSF V3 make do not all comments in action commands.
dnl
dnl See Also:
dnl PAC_PROG_MAKE
dnl D*/
dnl
AC_DEFUN([PAC_PROG_MAKE_ALLOWS_COMMENTS],[
AC_CACHE_CHECK([whether make allows comments in actions],
pac_cv_prog_make_allows_comments,[
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest
cat > conftest <<.
SHELL=/bin/sh
ALL:
@# This is a valid comment!
@echo "success"
.
pac_str=`$MAKE -f conftest 2>&1`
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest
if test "$pac_str" != "success" ; then
pac_cv_prog_make_allows_comments="no"
else
pac_cv_prog_make_allows_comments="yes"
fi
])
if test "$pac_cv_prog_make_allows_comments" = "no" ; then
AC_MSG_WARN([Your make does not allow comments in target code.
Using this make may cause problems when building programs.
You should consider using gnumake instead.])
ifelse([$1],,[$1])
fi
])dnl
dnl/*D
dnl PAC_PROG_MAKE_VPATH - Check whether make supports source-code paths.
dnl
dnl Synopsis:
dnl PAC_PROG_MAKE_VPATH
dnl
dnl Output Effect:
dnl Sets the variable 'VPATH' to either
dnl.vb
dnl VPATH = .:${srcdir}
dnl.ve
dnl or
dnl.vb
dnl .PATH: . ${srcdir}
dnl.ve
dnl
dnl Notes:
dnl The test checks that the path works with implicit targets (some makes
dnl support only explicit targets with 'VPATH' or 'PATH').
dnl
dnl NEED TO DO: Check that $< works on explicit targets.
dnl
dnl See Also:
dnl PAC_PROG_MAKE
dnl
dnl D*/
AC_DEFUN([PAC_PROG_MAKE_VPATH],[
AC_SUBST(VPATH)
dnl AM_IGNORE(VPATH)
AC_CACHE_CHECK([for virtual path format],
pac_cv_prog_make_vpath,[
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -rf conftest*
mkdir conftestdir
cat >conftestdir/a.c <<EOF
A sample file
EOF
cat > conftest <<EOF
all: a.o
VPATH=.:conftestdir
.c.o:
@echo \$<
EOF
ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
if test -n "$ac_out" ; then
pac_cv_prog_make_vpath="VPATH"
else
rm -f conftest
cat > conftest <<EOF
all: a.o
.PATH: . conftestdir
.c.o:
@echo \$<
EOF
ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
if test -n "$ac_out" ; then
pac_cv_prog_make_vpath=".PATH"
else
pac_cv_prog_make_vpath="neither VPATH nor .PATH works"
fi
fi
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -rf conftest*
])
if test "$pac_cv_prog_make_vpath" = "VPATH" ; then
VPATH='VPATH=.:${srcdir}'
elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then
VPATH='.PATH: . ${srcdir}'
fi
])dnl
dnl/*D
dnl PAC_PROG_MAKE_SET_CFLAGS - Check whether make sets CFLAGS
dnl
dnl Synopsis:
dnl PAC_PROG_MAKE_SET_CFLAGS([action if true],[action if false])
dnl
dnl Output Effects:
dnl Executes the first argument if 'CFLAGS' is set by 'make'; executes
dnl the second argument if 'CFLAGS' is not set by 'make'.
dnl
dnl Notes:
dnl If 'CFLAGS' is set by make, you may wish to override that choice in your
dnl makefile.
dnl
dnl See Also:
dnl PAC_PROG_MAKE
dnl D*/
AC_DEFUN([PAC_PROG_MAKE_SET_CFLAGS],[
AC_CACHE_CHECK([whether make sets CFLAGS],
pac_cv_prog_make_set_cflags,[
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest
cat > conftest <<EOF
SHELL=/bin/sh
ALL:
@echo X[\$]{CFLAGS}X
EOF
pac_str=`$MAKE -f conftest 2>&1`
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest
if test "$pac_str" = "XX" ; then
pac_cv_prog_make_set_cflags="no"
else
pac_cv_prog_make_set_cflags="yes"
fi
])
if test "$pac_cv_prog_make_set_cflags" = "no" ; then
ifelse([$2],,:,[$2])
else
ifelse([$1],,:,[$1])
fi
])dnl
dnl/*D
dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with
dnl clock skew in suing make.
dnl
dnl Effect:
dnl Sets the cache variable 'pac_cv_prog_make_found_clock_skew' to yes or no
dnl D*/
AC_DEFUN([PAC_PROG_MAKE_CLOCK_SKEW],[
AC_CACHE_CHECK([whether clock skew breaks make],
pac_cv_prog_make_found_clock_skew,[
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest*
cat > conftest <<EOF
ALL:
@-echo "success"
EOF
$MAKE -f conftest > conftest.out 2>&1
if grep -i skew conftest >/dev/null 2>&1 ; then
pac_cv_prog_make_found_clock_skew=yes
else
pac_cv_prog_make_found_clock_skew=no
fi
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest*
])
dnl We should really do something if we detect clock skew. The question is,
dnl what?
if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then
AC_MSG_WARN([Clock skew found by make. The configure and build may fail.
Consider building in a local instead of NFS filesystem.])
fi
])
dnl/*D
dnl PAC_PROG_MAKE - Checks for the varieties of MAKE, including support for
dnl VPATH
dnl
dnl Synopsis:
dnl PAC_PROG_MAKE
dnl
dnl Output Effect:
dnl Sets 'MAKE' to the make program to use if 'MAKE' is not already set.
dnl Sets the variable 'SET_CFLAGS' to 'CFLAGS =' if make sets 'CFLAGS'.
dnl
dnl Notes:
dnl This macro uses 'PAC_PROG_MAKE_INCLUDE',
dnl 'PAC_PROG_MAKE_ALLOWS_COMMENTS', 'PAC_PROG_MAKE_VPATH', and
dnl 'PAC_PROG_MAKE_SET_CFLAGS'. See those commands for details about their
dnl actions.
dnl
dnl It may call 'AC_PROG_MAKE_SET', which sets 'SET_MAKE' to 'MAKE = @MAKE@'
dnl if the make program does not set the value of make, otherwise 'SET_MAKE'
dnl is set to empty; if the make program echos the directory name, then
dnl 'SET_MAKE' is set to 'MAKE = $MAKE'.
dnl D*/
AC_DEFUN([PAC_PROG_MAKE],[
PAC_PROG_MAKE_PROGRAM
PAC_PROG_MAKE_CLOCK_SKEW
PAC_PROG_MAKE_INCLUDE
PAC_PROG_MAKE_ALLOWS_COMMENTS
PAC_PROG_MAKE_VPATH
AC_SUBST(SET_CFLAGS)
dnl AM_IGNORE(SET_CFLAGS)
PAC_PROG_MAKE_SET_CFLAGS([SET_CFLAGS='CFLAGS='])
if test "$pac_cv_prog_make_echos_dir" = "no" ; then
AC_PROG_MAKE_SET
else
SET_MAKE="MAKE=${MAKE-make}"
fi
])
+519
Ver Arquivo
@@ -0,0 +1,519 @@
dnl
dnl/*D
dnl PAC_LIB_MPI - Check for MPI library
dnl
dnl Synopsis:
dnl PAC_LIB_MPI([action if found],[action if not found])
dnl
dnl Output Effect:
dnl
dnl Notes:
dnl Currently, only checks for lib mpi and mpi.h. Later, we will add
dnl MPI_Pcontrol prototype (const int or not?).
dnl
dnl Prerequisites:
dnl autoconf version 2.13 (for AC_SEARCH_LIBS)
dnl D*/
dnl Other tests to add:
dnl Version of MPI
dnl MPI-2 I/O?
dnl MPI-2 Spawn?
dnl MPI-2 RMA?
dnl PAC_LIB_MPI([found text],[not found text])
AC_DEFUN([PAC_LIB_MPI],[
dnl Set the prereq to 2.50 to avoid having
AC_PREREQ(2.50)
if test "X$pac_lib_mpi_is_building" != "Xyes" ; then
# Use CC if TESTCC is defined
if test "X$pac_save_level" != "X" ; then
pac_save_TESTCC="${TESTCC}"
pac_save_TESTCPP="${TESTCPP}"
CC="$pac_save_CC"
if test "X$pac_save_CPP" != "X" ; then
CPP="$pac_save_CPP"
fi
fi
# Look for MPILIB first if it is defined
AC_SEARCH_LIBS(MPI_Init,$MPILIB mpi mpich)
if test "$ac_cv_search_MPI_Init" = "no" ; then
ifelse($2,,
AC_MSG_ERROR([Could not find MPI library]),[$2])
fi
AC_CHECK_HEADER(mpi.h,pac_have_mpi_h="yes",pac_have_mpi_h="no")
if test $pac_have_mpi_h = "no" ; then
ifelse($2,,
AC_MSG_ERROR([Could not find mpi.h include file]),[$2])
fi
if test "X$pac_save_level" != "X" ; then
CC="$pac_save_TESTCC"
CPP="$pac_save_TESTCPP"
fi
fi
ifelse($1,,,[$1])
])
dnl This should also set MPIRUN.
dnl
dnl/*D
dnl PAC_ARG_MPI_TYPES - Add command-line switches for different MPI
dnl environments
dnl
dnl Synopsis:
dnl PAC_ARG_MPI_TYPES([default])
dnl
dnl Output Effects:
dnl Adds the following command line options to configure
dnl+ \-\-with\-mpich[=path] - MPICH. 'path' is the location of MPICH commands
dnl. \-\-with\-ibmmpi - IBM MPI
dnl. \-\-with\-lammpi[=path] - LAM/MPI
dnl. \-\-with\-mpichnt - MPICH NT
dnl- \-\-with\-sgimpi - SGI MPI
dnl If no type is selected, and a default ("mpich", "ibmmpi", or "sgimpi")
dnl is given, that type is used as if '--with-<default>' was given.
dnl
dnl Sets 'CC', 'F77', 'TESTCC', 'TESTF77', and 'MPILIBNAME'. Does `not`
dnl perform an AC_SUBST for these values.
dnl Also sets 'MPIBOOT' and 'MPIUNBOOT'. These are used to specify
dnl programs that may need to be run before and after running MPI programs.
dnl For example, 'MPIBOOT' may start demons necessary to run MPI programs and
dnl 'MPIUNBOOT' will stop those demons.
dnl
dnl The two forms of the compilers are to allow for tests of the compiler
dnl when the MPI version of the compiler creates executables that cannot
dnl be run on the local system (for example, the IBM SP, where executables
dnl created with mpcc will not run locally, but executables created
dnl with xlc may be used to discover properties of the compiler, such as
dnl the size of data types).
dnl
dnl Historical note:
dnl Some common autoconf tests, such as AC_CHECK_SIZEOF, used to require
dnl running a program. But some MPI compilers (often really compilation
dnl scripts) produced programs that could only be run with special commands,
dnl such as a batch submission system. To allow these test programs to be
dnl run, a separate set of compiler variables, TESTCC, TESTF77, etc.,
dnl were defined. However, in later versions of autoconf, it both became
dnl unnecessary to run programs for tests such as AC_CHECK_SIZEOF and
dnl it became necessary to define CC etc. before invoking AC_PROG_CC (and
dnl the othe language compilers), because those commands now do much, much
dnl more than just determining the compiler.
dnl
dnl To address the change, we still define the TESTCC etc. compilers where
dnl possible to allow the use of AC_TRY_RUN when required, but we define
dnl the CC etc variables and do not define ac_cv_prog_CC etc., as these
dnl cause autoconf to skip all of the other initialization code that
dnl AC_PROG_CC etc. runs. Note also that this command must occur before
dnl AC_PROG_CC (or anything that might cause AC_PROG_CC to be invoked).
dnl
dnl See also:
dnl PAC_LANG_PUSH_COMPILERS, PAC_LIB_MPI
dnl D*/
AC_DEFUN([PAC_ARG_MPI_TYPES],[
# known types
PAC_ARG_MPI_KNOWN_TYPES
# find compilers
PAC_MPI_FIND_COMPILER_SCRIPTS
PAC_MPI_FIND_COMPILERS
# check for MPI library
PAC_MPI_CHECK_MPI_LIB
])
dnl
dnl To keep autoconf from prematurely invoking the compiler check scripts,
dnl we need a command that first sets the compilers and a separate one
dnl that makes any necessary checks for libraries
dnl
AC_DEFUN([PAC_ARG_MPI_KNOWN_TYPES],[
AC_ARG_WITH(mpich,
[--with-mpich=path - Assume that we are building with MPICH],
ac_mpi_type=mpich)
# Allow MPICH as well as MPICH
AC_ARG_WITH(mpich,
[--with-mpich=path - Assume that we are building with MPICH],
ac_mpi_type=mpich)
AC_ARG_WITH(lammpi,
[--with-lammpi=path - Assume that we are building with LAM/MPI],
ac_mpi_type=lammpi)
AC_ARG_WITH(ibmmpi,
[--with-ibmmpi - Use the IBM SP implementation of MPI],
ac_mpi_type=ibmmpi)
AC_ARG_WITH(sgimpi,
[--with-sgimpi - Use the SGI implementation of MPI],
ac_mpi_type=sgimpi)
AC_ARG_WITH(mpichnt,
[--with-mpichnt - Use MPICH for Windows NT ],
ac_mpi_type=mpichnt)
AC_ARG_WITH(mpi,
[--with-mpi=path - Use an MPI implementation with compile scripts mpicc
and mpif77 in path/bin],ac_mpi_type=generic)
if test "X$ac_mpi_type" = "X" ; then
if test "X$1" != "X" ; then
ac_mpi_type=$1
else
ac_mpi_type=unknown
fi
fi
if test "$ac_mpi_type" = "unknown" -a "$pac_lib_mpi_is_building" = "yes" ; then
ac_mpi_type="mpich"
fi
])
dnl
dnl Because autoconf insists on moving code to the beginning of
dnl certain definitions, it is *not possible* to define a single command
dnl that selects compilation scripts and also check for other options.
dnl Thus, this needs to be divided into
dnl MPI_FIND_COMPILER_SCRIPTS
dnl which can fail (i.e., not find a script), and
dnl MPI_FIND_COMPILERS
dnl which runs the various PROC_xx for the compilers.
dnl WARNING: this function ignores --program-suffix and --program-prefix.
dnl However, this function is not currently used at all.
AC_DEFUN([PAC_MPI_FIND_COMPILER_SCRIPTS],[
# Set defaults
MPIRUN_NP="-np "
MPIEXEC_N="-n "
AC_SUBST(MPIRUN_NP)
AC_SUBST(MPIEXEC_N)
dnl
AC_ARG_VAR([MPIEXEC],[Name and path of mpiexec program])
AC_ARG_VAR([MPIRUN],[Name and path of mpirun program])
AC_ARG_VAR([MPIBOOT],[Name and path of program to run before mpirun])
AC_ARG_VAR([MPIUNBOOT],[Name and path of program to run after all mpirun])
AC_ARG_VAR([MPICC],[Name and absolute path of program used to compile MPI programs in C])
AC_ARG_VAR([MPIF77],[Name and absolute path of program used to compile MPI programs in F77])
AC_ARG_VAR([MPICXX],[Name and absolute path of program used to compile MPI programs in C++])
AC_ARG_VAR([MPIF90],[Name and absolute path of program used to compile MPI programs in F90])
#
# Check for things that will cause trouble. For example,
# if MPICC is defined but does not contain a / or \, then PATH_PROG will
# ignore the value
if test -n "$MPICC" ; then
case $MPICC in
changequote(<<,>>)
[\\/]* | ?:[\\/]*)
changequote([,])
# Ok, PATH_PROG will figure it out
;;
*)
AC_MSG_ERROR([MPICC must be set to an absolute path if it is set])
esac
fi
if test -n "$MPICXX" ; then
case $MPICXX in
changequote(<<,>>)
[\\/]* | ?:[\\/]*)
changequote([,])
# Ok, PATH_PROG will figure it out
;;
*)
AC_MSG_ERROR([MPICXX must be set to an absolute path if it is set])
esac
fi
if test -n "$MPIF77" ; then
case $MPIF77 in
changequote(<<,>>)
[\\/]* | ?:[\\/]*)
changequote([,])
# Ok, PATH_PROG will figure it out
;;
*)
AC_MSG_ERROR([MPIF77 must be set to an absolute path if it is set])
esac
fi
if test -n "$MPIF90" ; then
case $MPIF90 in
changequote(<<,>>)
[\\/]* | ?:[\\/]*)
changequote([,])
# Ok, PATH_PROG will figure it out
;;
*)
AC_MSG_ERROR([MPIF90 must be set to an absolute path if it is set])
esac
fi
case $ac_mpi_type in
mpich)
dnl
dnl This isn't correct. It should try to get the underlying compiler
dnl from the mpicc and mpif77 scripts or mpireconfig
if test "X$pac_lib_mpi_is_building" != "Xyes" ; then
PAC_PUSH_FLAG([PATH])
if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then
# Look for commands; if not found, try adding bin to the
# path
if test ! -x $with_mpich/mpicc -a -x $with_mpich/bin/mpicc ; then
with_mpich="$with_mpich/bin"
fi
PATH=$with_mpich:${PATH}
fi
AC_PATH_PROG(MPICC,mpicc)
if test -z "$TESTCC" ; then TESTCC=${CC-cc} ; fi
CC="$MPICC"
# Note that autoconf may unconditionally change the value of
# CC (!) in some other command. Thus, we define CCMASTER
CCMASTER=$CC
# Force autoconf to respect this choice
ac_ct_CC=$CC
# to permit configure codes to recover the correct CC. This
# is an ugly not-quite-correct workaround for the fact that
# does not want you to change the C compiler once you have set it
# (But since it does so unconditionally, it silently creates
# bogus output files.)
AC_PATH_PROG(MPIF77,mpif77)
if test -z "$TESTF77" ; then TESTF77=${F77-f77} ; fi
F77="$MPIF77"
AC_PATH_PROG(MPIFC,mpif90)
if test -z "$TESTFC" ; then TESTFC=${FC-f90} ; fi
FC="$MPIFC"
AC_PATH_PROG(MPICXX,mpiCC)
if test -z "$TESTCXX" ; then TESTCXX=${CXX-CC} ; fi
CXX="$MPICXX"
# We may want to restrict this to the path containing mpirun
AC_PATH_PROG(MPIEXEC,mpiexec)
AC_PATH_PROG(MPIRUN,mpirun)
AC_PATH_PROG(MPIBOOT,mpichboot)
AC_PATH_PROG(MPIUNBOOT,mpichstop)
PAC_POP_FLAG([PATH])
MPILIBNAME="mpich"
else
# All of the above should have been passed in the environment!
:
fi
;;
mpichnt)
;;
lammpi)
dnl
dnl This isn't correct. It should try to get the underlying compiler
dnl from the mpicc and mpif77 scripts or mpireconfig
PAC_PUSH_FLAG([PATH])
if test "$with_mpich" != "yes" -a "$with_mpich" != "no" ; then
# Look for commands; if not found, try adding bin to the path
if test ! -x $with_lammpi/mpicc -a -x $with_lammpi/bin/mpicc ; then
with_lammpi="$with_lammpi/bin"
fi
PATH=$with_lammpi:${PATH}
fi
AC_PATH_PROG(MPICC,mpicc)
if test -z "$TESTCC" ; then TESTCC=${CC-cc} ; fi
CC="$MPICC"
AC_PATH_PROG(MPIF77,mpif77)
if test -z "$TESTCC" ; then TESTF77=${F77-f77} ; fi
F77="$MPIF77"
AC_PATH_PROG(MPIFC,mpif90)
TESTFC=${FC-f90}
if test -z "$TESTFC" ; then TESTFC=${FC-f90} ; fi
FC="$MPIFC"
AC_PATH_PROG(MPICXX,mpiCC)
if test -z "$TESTCXX" ; then TESTCXX=${CXX-CC} ; fi
CXX="$MPICXX"
PAC_POP_FLAG([PATH])
MPILIBNAME="lammpi"
MPIBOOT="lamboot"
MPIUNBOOT="wipe"
MPIRUN="mpirun"
;;
ibmmpi)
AC_CHECK_PROGS(MPCC,mpcc)
AC_CHECK_PROGS(MPXLF,mpxlf mpfort)
if test -z "$MPCC" -o -z "$MPXLF" ; then
AC_MSG_ERROR([Could not find IBM MPI compilation scripts. Either mpcc or mpxlf/mpfort is missing])
fi
if test -z "$TESTCC" ; then TESTCC=${CC-xlC} ; fi
if test -z "$TESTF77" ; then TESTF77=${F77-xlf}; fi
CC=mpcc; F77=$MPXLF
# There is no mpxlf90, but the options langlvl and free can
# select the Fortran 90 version of xlf
if test "$enable_f90" != no ; then
AC_CHECK_PROGS(MPIXLF90,mpxlf90 mpfort)
if test -z "$TESTFC" ; then TESTFC=${FC-xlf90}; fi
if test "X$MPIXLF90" != "X" ; then
FC="$MPIXLF90"
else
FC="$MPXLF -qlanglvl=90ext -qfree=f90"
fi
fi
MPILIBNAME=""
cross_compiling=yes
# Turn off the autoconf version 3 warning message
ac_tool_warned=yes
;;
sgimpi)
if test -z "$TESTCC" ; then TESTCC=${CC:=cc} ; fi
if test -z "$TESTF77" ; then TESTF77=${F77:=f77} ; fi
if test -z "$TESTCXX" ; then TESTCXX=${CXX:=CC} ; fi
if test -z "$TESTFC" ; then TESTFC=${FC:=f90} ; fi
# Must check for the MPI library in a separate macro - adding
# a test here will cause autoconf to prematurely define the
# C compiler
MPIRUN=mpirun
MPIBOOT=""
MPIUNBOOT=""
;;
generic)
# in $with_mpi/bin or $with_mpi
if test "X$MPICC" = "X" ; then
if test -x "$with_mpi/bin/mpicc" ; then
MPICC=$with_mpi/bin/mpicc
elif test -x "$with_mpi/mpicc" ; then
MPICC=$with_mpi/mpicc
fi
fi
if test "X$MPICXX" = "X" ; then
if test -x "$with_mpi/bin/mpicxx" ; then
MPICXX=$with_mpi/bin/mpicxx
elif test -x "$with_mpi/mpicxx" ; then
MPICXX=$with_mpi/mpicxx
fi
fi
if test "X$MPIF77" = "X" ; then
if test -x "$with_mpi/bin/mpif77" ; then
MPIF77=$with_mpi/bin/mpif77
elif test -x "$with_mpi/mpif77" ; then
MPIF77=$with_mpi/mpif77
fi
fi
if test "X$MPIF90" = "X" ; then
if test -x "$with_mpi/bin/mpif90" ; then
MPIF90=$with_mpi/bin/mpif90
elif test -x "$with_mpi/mpif90" ; then
MPIF90=$with_mpi/mpif90
fi
fi
if test "X$MPIEXEC" = "X" ; then
if test -x "$with_mpi/bin/mpiexec" ; then
MPIEXEC=$with_mpi/bin/mpiexec
elif test -x "$with_mpi/mpiexec" ; then
MPIEXEC=$with_mpi/mpiexec
fi
fi
CC=$MPICC
F77=$MPIF77
if test "X$MPICXX" != "X" ; then CXX=$MPICXX ; fi
if test "X$MPIF90" != "X" ; then F90=$MPIF90 ; fi
;;
*)
# Use the default choices for the compilers
;;
esac
])
AC_DEFUN([PAC_MPI_FIND_COMPILERS],[
# Tell autoconf to determine properties of the compilers (these are the
# compilers for MPI programs)
PAC_PROG_CC
if test "$enable_f77" != no -a "$enable_fortran" != no ; then
AC_PROG_F77
fi
if test "$enable_cxx" != no ; then
AC_PROG_CXX
fi
if test "$enable_f90" != no ; then
PAC_PROG_FC
fi
])
dnl
dnl This uses the selected CC etc to check for include paths and libraries
AC_DEFUN([PAC_MPI_CHECK_MPI_LIB],[
AC_REQUIRE([AC_PROG_CC])
case $ac_mpi_type in
mpich)
;;
mpichnt)
dnl
dnl This isn't adequate, but it helps with using MPICH-NT/SDK.gcc
PAC_PUSH_FLAG([CFLAGS])
CFLAGS="$CFLAGS -I$with_mpichnt/include"
PAC_PUSH_FLAG([CPPFLAGS])
CPPFLAGS="$CPPFLAGS -I$with_mpichnt/include"
PAC_PUSH_FLAG([LDFLAGS])
LDFLAGS="$LDFLAGS -L$with_mpichnt/lib"
AC_CHECK_LIB(mpich,MPI_Init,found="yes",found="no")
if test "$found" = "no" ; then
AC_CHECK_LIB(mpich,MPI_Init,found="yes",found="no")
fi
if test "$enable_cxx" != no ; then
AC_PROG_CXX
fi
if test "$enable_f90" != no ; then
PAC_PROG_FC
fi
# Set defaults for the TEST versions if not already set
if test -z "$TESTCC" ; then TESTCC=${CC:=cc} ; fi
if test -z "$TESTF77" ; then TESTF77=${F77:=f77} ; fi
if test -z "$TESTCXX" ; then TESTCXX=${CXX:=CC} ; fi
if test -z "$TESTFC" ; then TESTFC=${FC:=f90} ; fi
if test "$found" = "no" ; then
PAC_POP_FLAG([CFLAGS])
PAC_POP_FLAG([CPPFLAGS])
PAC_POP_FLAG([LDFLAGS])
fi
;;
lammpi)
;;
ibmmpi)
;;
sgimpi)
AC_CHECK_LIB(mpi,MPI_Init)
if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then
MPILIBNAME="mpi"
fi
;;
generic)
AC_SEARCH_LIBS(MPI_Init,mpi mpich mpich)
if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then
MPILIBNAME="mpi"
fi
;;
*)
;;
esac
])
dnl
dnl/*D
dnl PAC_MPI_F2C - Determine if MPI has the MPI-2 functions MPI_xxx_f2c and
dnl MPI_xxx_c2f
dnl
dnl Output Effect:
dnl Define 'HAVE_MPI_F2C' if the routines are found.
dnl
dnl Notes:
dnl Looks only for 'MPI_Request_c2f'.
dnl D*/
AC_DEFUN([PAC_MPI_F2C],[
AC_CACHE_CHECK([for MPI F2C and C2F routines],
pac_cv_mpi_f2c,
[
AC_TRY_LINK([#include "mpi.h"],
[MPI_Request request;MPI_Fint a;a = MPI_Request_c2f(request);],
pac_cv_mpi_f2c="yes",pac_cv_mpi_f2c="no")
])
if test "$pac_cv_mpi_f2c" = "yes" ; then
AC_DEFINE(HAVE_MPI_F2C,1,[Define if MPI has F2C])
fi
])
dnl
dnl/*D
dnl PAC_HAVE_ROMIO - make mpi.h include mpio.h if romio enabled
dnl
dnl Output Effect:
dnl expands @HAVE_ROMIO@ in mpi.h into #include "mpio.h"
dnl D*/
AC_DEFUN([PAC_HAVE_ROMIO],[
if test "$enable_romio" = "yes" ; then HAVE_ROMIO='#include "mpio.h"'; fi
AC_SUBST(HAVE_ROMIO)
])
+850
Ver Arquivo
@@ -0,0 +1,850 @@
dnl
dnl This files contains additional macros for using autoconf to
dnl build configure scripts.
dnl
dnl Almost all of this file is taken from the aclocal.m4 of MPICH
dnl
dnl Get the format of Fortran names. Uses F77, FFLAGS, and sets WDEF.
dnl If the test fails, sets NOF77 to 1, HAVE_FORTRAN to 0.
dnl
dnl
AC_DEFUN([PAC_GET_FORTNAMES],[
rm -f confftest.f confftest.$OBJEXT
cat > confftest.f <<EOF
subroutine mpir_init_fop( a )
integer a
a = 1
return
end
EOF
$F77 $FFLAGS -c confftest.f > /dev/null 2>&1
if test ! -s confftest.$OBJEXT ; then
AC_MSG_WARN([Unable to test Fortran compiler. Compiling a test
program failed to produce an object file])
NOF77=1
elif test -z "$FORTRANNAMES" ; then
# MAC OS X (and probably FreeBSD need strings - (not strings -a)
# Cray doesn't accept -a ...
allstrings="-a"
if test $arch_CRAY ; then
allstrings=""
elif strings - confftest.$OBJEXT < /dev/null >/dev/null 2>&1 ; then
allstrings="-"
elif strings -a confftest.$OBJEXT < /dev/null >/dev/null 2>&1 ; then
allstrings="-a"
fi
nameform1=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop_ | head -1`
nameform2=`strings $allstrings confftest.$OBJEXT | grep MPIR_INIT_FOP | head -1`
nameform3=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop | head -1`
nameform4=`strings $allstrings confftest.$OBJEXT | grep mpir_init_fop__ | head -1`
rm -f confftest.f confftest.$OBJEXT
if test -n "$nameform4" ; then
echo "Fortran externals are lower case and have two trailing underscores"
FORTRANNAMES="FORTRANDOUBLEUNDERSCORE"
elif test -n "$nameform1" ; then
# We don't set this in CFLAGS; it is a default case
echo "Fortran externals have a trailing underscore and are lowercase"
FORTRANNAMES="FORTRANUNDERSCORE"
elif test -n "$nameform2" ; then
echo "Fortran externals are uppercase"
FORTRANNAMES="FORTRANCAPS"
elif test -n "$nameform3" ; then
echo "Fortran externals are lower case"
FORTRANNAMES="FORTRANNOUNDERSCORE"
else
AC_MSG_WARN([Unable to determine the form of Fortran external names.
Make sure that the compiler $F77 can be run on this system.
Turning off Fortran (-nof77 being assumed)])
NOF77=1
fi
fi
if test -n "$FORTRANNAMES" ; then
WDEF="-D$FORTRANNAMES"
fi
# Delete confftest files with any extension. This catches the case
# where auxillary files, such as coverage files, are removed.
rm -f confftest.*
])dnl
dnl
define(PAC_GET_SPECIAL_SYSTEM_INFO,[
#
if test -n "$arch_IRIX"; then
AC_MSG_CHECKING(for IRIX OS version)
dnl This block of code replaces a generic "IRIX" arch value with
dnl IRIX_<version>_<chip>
dnl For example
dnl IRIX_5_4400 (IRIX 5.x, using MIPS 4400)
osversion=`uname -r | sed 's/\..*//'`
dnl Note that we need to allow brackets here, so we briefly turn off
dnl the macro quotes
changequote(,)dnl
dnl Get the second field (looking for 6.1)
osvminor=`uname -r | sed 's/[0-9]\.\([0-9]*\)\..*/\1/'`
changequote([,])dnl
AC_MSG_RESULT($osversion)
dnl Get SGI processor count by quick hack
AC_MSG_CHECKING(for IRIX cpucount)
changequote(,)dnl
cpucount=`hinv | grep '[0-9]* [0-9]* MHZ IP[0-9]* Proc' | cut -f 1 -d' '`
if test "$cpucount" = "" ; then
cpucount=`hinv | grep 'Processor [0-9]*:' | wc -l | sed -e 's/ //g'`
fi
changequote([,])dnl
if test "$cpucount" = "" ; then
AC_MSG_RESULT([Could not determine cpucount. Please send])
hinv
AC_MSG_ERROR([to romio-maint@mcs.anl.gov])
fi
AC_MSG_RESULT($cpucount)
dnl
AC_MSG_CHECKING(for IRIX cpumodel)
dnl The tail -1 is necessary for multiple processor SGI boxes
dnl We might use this to detect SGI multiprocessors and recommend
dnl -comm=shared
cputype=`hinv -t cpu | tail -1 | cut -f 3 -d' '`
if test -z "$cputype" ; then
AC_MSG_RESULT([Could not get cputype from hinv -t cpu command. Please send])
hinv -t cpu 2>&1
hinv -t cpu | cut -f 3 -d' ' 2>&1
AC_MSG_ERROR([to romio-maint@mcs.anl.gov])
fi
AC_MSG_RESULT($cputype)
dnl echo "checking for osversion and cputype"
dnl cputype may contain R4400, R2000A/R3000, or something else.
dnl We may eventually need to look at it.
if test -z "$osversion" ; then
AC_MSG_RESULT([Could not determine OS version. Please send])
uname -a
AC_MSG_ERROR([to romio-maint@mcs.anl.gov])
elif test $osversion = 4 ; then
true
elif test $osversion = 5 ; then
true
elif test $osversion = 6 ; then
true
else
AC_MSG_RESULT([Could not recognize the version of IRIX (got $osversion).
ROMIO knows about versions 4, 5 and 6; the version being returned from
uname -r is $osversion. Please send])
uname -a 2>&1
hinv 2>&1
AC_MSG_ERROR([to romio-maint@mcs.anl.gov])
fi
AC_MSG_CHECKING(for cputype)
OLD_ARCH=IRIX
IRIXARCH="$ARCH_$osversion"
dnl Now, handle the chip set
changequote(,)dnl
cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr -d "[A-Z]"`
changequote([,])dnl
case $cputype in
3000) ;;
4000) ;;
4400) ;;
4600) ;;
5000) ;;
8000) ;;
10000);;
12000);;
*)
AC_MSG_WARN([Unexpected IRIX/MIPS chipset $cputype. Please send the output])
uname -a 2>&1
hinv 2>&1
AC_MSG_WARN([to romio-maint@mcs.anl.gov
ROMIO will continue and assume that the cputype is
compatible with a MIPS 4400 processor.])
cputype=4400
;;
esac
AC_MSG_RESULT($cputype)
IRIXARCH="$IRIXARCH_$cputype"
echo "IRIX-specific architecture is $IRIXARCH"
fi
])dnl
dnl
dnl
define(PAC_TEST_MPI,[
AC_MSG_CHECKING(if a simple MPI program compiles and links)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
MPI_Init(&argc,&argv);
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
cmd="$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB"
echo "$as_me:$LINENO: $cmd" >&5
$cmd >&5 2>&5
if test ! -x conftest$EXEEXT ; then
echo "$as_me:$LINENO: failed program was:" >&5
sed 's/^/| /' mpitest.c >&5
rm -f conftest$EXEEXT mpitest.c
AC_MSG_ERROR([Unable to compile a simple MPI program.
Use environment variables to provide the location of MPI libraries and
include directories])
else
rm -f conftest$EXEEXT mpitest.c
fi
AC_MSG_RESULT(yes)
])dnl
dnl
dnl
dnl
define(PAC_NEEDS_FINT,[
AC_MSG_CHECKING(if MPI_Fint is defined in the MPI implementation)
cat > mpitest1.c <<EOF
#include "mpi.h"
main()
{
MPI_Fint i;
i = 0;
}
EOF
rm -f mpitest1.$OBJEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -c mpitest1.c > /dev/null 2>&1
if test ! -s mpitest1.$OBJEXT ; then
NEEDS_MPI_FINT="#define NEEDS_MPI_FINT"
CFLAGS="$CFLAGS -DNEEDS_MPI_FINT"
AC_MSG_RESULT(no)
rm -f mpitest1.$OBJEXT mpitest1.c
else
NEEDS_MPI_FINT=""
AC_MSG_RESULT(yes)
rm -f mpitest1.$OBJEXT mpitest1.c
fi
])dnl
dnl
define(PAC_MPI_LONG_LONG_INT,[
AC_MSG_CHECKING(if MPI_LONG_LONG_INT is defined in mpi.h)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
long long i;
MPI_Init(&argc,&argv);
MPI_Send(&i, 1, MPI_LONG_LONG_INT, 0, 0, MPI_COMM_WORLD);
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPI_LONG_LONG_INT,,[Define if mpi has long long it])
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
dnl
dnl PAC_LONG_LONG_64: check if there is a 64-bit long long
dnl
define(PAC_LONG_LONG_64,[
if test -n "$longlongsize" ; then
if test "$longlongsize" = 8 ; then
echo "defining MPI_Offset as long long in C and integer*8 in Fortran"
AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits])
DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
FORTRAN_MPI_OFFSET="integer*8"
LL="\%lld"
elif test "$longlongsize" = "int" ; then # a hack to set MPI_Offset as int
echo "defining MPI_Offset as int in C and integer in Fortran"
DEFINE_MPI_OFFSET="typedef int MPI_Offset;"
FORTRAN_MPI_OFFSET="integer"
AC_DEFINE(MPI_OFFSET_IS_INT,,[Define if MPI_Offset is int])
LL="\%d"
MPI_OFFSET_KIND1="!"
MPI_OFFSET_KIND2="!"
else
echo "defining MPI_Offset as long in C and integer in Fortran"
DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
FORTRAN_MPI_OFFSET="integer"
LL="\%ld"
MPI_OFFSET_KIND1="!"
MPI_OFFSET_KIND2="!"
fi
else
PAC_GET_TYPE_SIZE(long long, longlongsize)
if test -n "$longlongsize" ; then
if test "$longlongsize" = 8 ; then
PAC_TEST_LONG_LONG()
else
echo "defining MPI_Offset as long in C and integer in Fortran"
DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
FORTRAN_MPI_OFFSET="integer"
LL="\%ld"
MPI_OFFSET_KIND1="!"
MPI_OFFSET_KIND2="!"
fi
else
dnl check if longlong is not supported or only its size cannot be determined
dnl because the program cannot be run.
rm -f ltest.c
cat > ltest.c <<EOF
main()
{
long long i=8;
return 0;
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -o conftest$EXEEXT ltest.c > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
echo "assuming size of long long is 8bytes; use '-longlongsize' to indicate otherwise"
rm -f conftest$EXEEXT ltest.c
echo "defining MPI_Offset as long long in C and integer*8 in Fortran"
AC_DEFINE(HAVE_LONG_LONG_64,,[Define if long long is 64 bits])
DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
FORTRAN_MPI_OFFSET="integer*8"
LL="\%lld"
else
echo "assuming long long is not available; use '-longlongsize' to indicate otherwise"
echo "defining MPI_Offset as long in C and integer in Fortran"
DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
FORTRAN_MPI_OFFSET="integer"
LL="\%ld"
MPI_OFFSET_KIND1="!"
MPI_OFFSET_KIND2="!"
fi
fi
fi
])dnl
dnl
dnl
define(PAC_MPI_INFO,[
AC_MSG_CHECKING(if MPI_Info functions are defined in the MPI implementation)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
MPI_Info info;
MPI_Init(&argc,&argv);
MPI_Info_create(&info);
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPI_INFO,1,[Define if MPI_Info available])
HAVE_MPI_INFO="#define HAVE_MPI_INFO"
MPI_FINFO1="!"
MPI_FINFO2="!"
MPI_FINFO3="!"
MPI_FINFO4="!"
else
AC_MSG_RESULT(no)
BUILD_MPI_INFO=1
MPI_FINFO1=" INTEGER MPI_MAX_INFO_KEY, MPI_MAX_INFO_VAL"
MPI_FINFO2=" PARAMETER (MPI_MAX_INFO_KEY=255, MPI_MAX_INFO_VAL=1024)"
MPI_FINFO3=" INTEGER MPI_INFO_NULL"
MPI_FINFO4=" PARAMETER (MPI_INFO_NULL=0)"
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
dnl
dnl
define(PAC_MPI_DARRAY_SUBARRAY,[
AC_MSG_CHECKING(if darray and subarray constructors are defined in the MPI implementation)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
int i=MPI_DISTRIBUTE_CYCLIC;
MPI_Datatype t;
MPI_Init(&argc,&argv);
MPI_Type_create_darray(i, i, i, &i, &i, &i, &i, i, MPI_INT, &t);
MPI_Type_create_subarray(i, &i, &i, &i, i, MPI_INT, &t);
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,,[Define if MPI Darray available])
HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
MPI_FARRAY1="!"
MPI_FARRAY2="!"
MPI_FARRAY3="!"
MPI_FARRAY4="!"
MPI_FARRAY5="!"
MPI_FARRAY6="!"
MPI_FARRAY7="!"
else
AC_MSG_RESULT(no)
BUILD_MPI_ARRAY=1
MPI_FARRAY1=" INTEGER MPI_ORDER_C, MPI_ORDER_FORTRAN"
MPI_FARRAY2=" PARAMETER (MPI_ORDER_C=56, MPI_ORDER_FORTRAN=57)"
MPI_FARRAY3=" INTEGER MPI_DISTRIBUTE_BLOCK, MPI_DISTRIBUTE_CYCLIC"
MPI_FARRAY4=" INTEGER MPI_DISTRIBUTE_NONE, MPI_DISTRIBUTE_DFLT_DARG"
MPI_FARRAY5=" PARAMETER (MPI_DISTRIBUTE_BLOCK=121, MPI_DISTRIBUTE_CYCLIC=122)"
MPI_FARRAY6=" PARAMETER (MPI_DISTRIBUTE_NONE=123)"
MPI_FARRAY7=" PARAMETER (MPI_DISTRIBUTE_DFLT_DARG=-49767)"
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
dnl
dnl
define(PAC_CHECK_MPI_SGI_INFO_NULL,[
AC_MSG_CHECKING([if MPI_INFO_NULL is defined in mpi.h])
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
int i;
i = MPI_INFO_NULL;
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
cp adio/sgi/mpi3.1/*.h include
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
dnl
dnl
dnl
define(PAC_CHECK_MPIOF_H,[
AC_MSG_CHECKING(if mpiof.h is included in mpif.h)
rm -f mpitest.f
cat > mpitest.f <<EOF
program main
implicit none
include 'mpif.h'
integer i
i = MPI_MODE_RDWR
stop
end
EOF
rm -f conftest$EXEEXT
$F77 $FFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.f $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
MPIOF_H_INCLUDED=1
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.f
])dnl
dnl
dnl
dnl check if pread64 is defined in IRIX. needed on IRIX 6.5
dnl
define(PAC_HAVE_PREAD64,[
AC_MSG_CHECKING(if pread64 is defined)
rm -f conftest.c
cat > conftest.c <<EOF
#include <unistd.h>
main()
{
int fd=0, buf=0, i=0;
off64_t off=0;
pread64(fd, &buf, i, off);
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -o conftest$EXEEXT conftest.c > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PREAD64,,[Define if pread64 available])
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT conftest.c
])dnl
dnl
dnl
define(PAC_TEST_MPI_SGI_type_is_contig,[
AC_MSG_CHECKING(if MPI_SGI_type_is_contig is defined)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
MPI_Datatype type;
int i;
MPI_Init(&argc,&argv);
i = MPI_SGI_type_is_contig(type);
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_DEFINE(NO_MPI_SGI_type_is_contig,,[Define if no MPI type is contig])
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
dnl
dnl
dnl
define(PAC_TEST_MPI_COMBINERS,[
AC_MSG_CHECKING(if MPI-2 combiners are defined in mpi.h)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
int i;
MPI_Init(&argc,&argv);
i = MPI_COMBINER_STRUCT;
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPI_COMBINERS,,[Define if MPI combiners available])
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
dnl
dnl
dnl PAC_MPI_OFFSET_KIND()
dnl
dnl tries to determine the Fortran 90 kind parameter for 8-byte integers
dnl
define(PAC_MPI_OFFSET_KIND,
[
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest*
# Determine the extension for Fortran 90 files (not all compilers accept
# .f and not all accept .f90)
if test -z "$ac_f90ext" ; then
if test -z "$FC" ; then
# This list should correspond to the list in aclocal_fc.m4
AC_CHECK_PROGS(FC,ifort pgf90 pathf90 pathf95 xlf90 xlf95 f90 epcf90 \
f95 fort lf95 gfortran g95 ifc efc)
fi
AC_MSG_CHECKING([for extension for Fortran 90 programs])
ac_f90ext="f90"
ac_f90compile='${FC-f90} -c $FCFLAGS conftest.$ac_f90ext 1>&AC_FD_CC'
cat > conftest.$ac_f90ext <<EOF
program conftest
end
EOF
if AC_TRY_EVAL(ac_f90compile) ; then
AC_MSG_RESULT([f90])
else
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest*
ac_f90ext="f"
cat > conftest.$ac_f90ext <<EOF
program conftest
end
EOF
if AC_TRY_EVAL(ac_f90compile) ; then
AC_MSG_RESULT([f])
else
AC_MSG_RESULT([unknown!])
fi
fi
fi
AC_MSG_CHECKING([for Fortran 90 KIND parameter for 8-byte integers])
cat <<EOF > conftest.$ac_f90ext
program main
integer i
i = selected_int_kind(16)
open(8, file="conftest.out", form="formatted")
write (8,*) i
close(8)
stop
end
EOF
if test -z "$FC" ; then
FC=f90
fi
KINDVAL=""
if $FC -o conftest$EXEEXT conftest.$ac_f90ext $FCFLAGS >/dev/null 2>&1 ; then
./conftest$EXEEXT >/dev/null 2>&1
if test -s conftest.out ; then
KINDVAL=`cat conftest.out`
fi
fi
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest*
if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then
AC_MSG_RESULT($KINDVAL)
MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$KINDVAL)"
else
AC_MSG_RESULT(unavailable)
fi
])dnl
dnl
dnl
define(PAC_TEST_MPI_HAVE_OFFSET_KIND,[
AC_MSG_CHECKING(if MPI_OFFSET_KIND is defined in mpif.h)
rm -f mpitest.f
cat > mpitest.f <<EOF
program main
implicit none
include 'mpif.h'
integer i
i = MPI_OFFSET_KIND
stop
end
EOF
rm -f conftest$EXEEXT
$F77 $FFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.f $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
MPI_OFFSET_KIND1="!"
MPI_OFFSET_KIND2="!"
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.f
])dnl
dnl
dnl
dnl PAC_GET_XFS_MEMALIGN
dnl
dnl
define(PAC_GET_XFS_MEMALIGN,
[AC_MSG_CHECKING([for memory alignment needed for direct I/O])
rm -f memalignval
rm -f /tmp/romio_tmp.bin
AC_TEST_PROGRAM([#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
main() {
struct dioattr st;
int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644);
FILE *f=fopen("memalignval","w");
if (fd == -1) exit(1);
if (!f) exit(1);
fcntl(fd, F_DIOINFO, &st);
fprintf( f, "%u\n", st.d_mem);
exit(0);
}],Pac_CV_NAME=`cat memalignval`,Pac_CV_NAME="")
rm -f memalignval
rm -f /tmp/romio_tmp.bin
if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
AC_MSG_RESULT($Pac_CV_NAME)
CFLAGS="$CFLAGS -DXFS_MEMALIGN=$Pac_CV_NAME"
else
AC_MSG_RESULT(unavailable, assuming 128)
CFLAGS="$CFLAGS -DXFS_MEMALIGN=128"
fi
])dnl
dnl
define(PAC_HAVE_MOUNT_NFS,[
AC_MSG_CHECKING([if MOUNT_NFS is defined in the include files])
rm -f conftest.c
cat > conftest.c <<EOF
#include <sys/param.h>
#include <sys/mount.h>
main()
{
int i=MOUNT_NFS;
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -o conftest$EXEEXT conftest.c > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
ROMIO_HAVE_MOUNT_NFS=1
AC_DEFINE(HAVE_MOUNT_NFS,,[Define if MOUNT_NFS defined])
else
ROMIO_HAVE_MOUNT_NFS=0
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT conftest.c
])dnl
dnl
dnl
dnl PAC_MPI_OFFSET_KIND_4BYTE()
dnl
dnl tries to determine the Fortran 90 kind parameter for 4-byte integers
dnl
define(PAC_MPI_OFFSET_KIND_4BYTE,
[AC_MSG_CHECKING([for Fortran 90 KIND parameter for 4-byte integers])
rm -f kind.f kind.$OBJEXT kind$EXEEXT
cat <<EOF > kind.f
program main
integer i
i = selected_int_kind(8)
open(8, file="k.out", form="formatted")
write (8,*) i
close(8)
stop
end
EOF
if test -z "$FC" ; then
FC=f90
fi
KINDVAL=""
if $FC -o kind$EXEEXT kind.f $FCFLAGS >/dev/null 2>&1 ; then
./kind >/dev/null 2>&1
if test -s k.out ; then
KINDVAL=`cat k.out`
fi
fi
rm -f kind$EXEEXT k.out kind.f kind.$OBJEXT
if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then
AC_MSG_RESULT($KINDVAL)
MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$KINDVAL)"
else
AC_MSG_RESULT(unavailable)
fi
])dnl
dnl
dnl
define(PAC_FUNC_STRERROR,[
AC_MSG_CHECKING([for strerror()])
rm -f conftest.c
cat > conftest.c <<EOF
#include <string.h>
main()
{
char *s = strerror(5);
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -o conftest$EXEXT conftest.c >> config.log 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STRERROR,,[Define if strerror available])
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING([for sys_errlist])
rm -f conftest.c
changequote(,)
cat > conftest.c <<EOF
#include <stdio.h>
main()
{
extern char *sys_errlist[];
printf("%s\n", sys_errlist[34]);
}
EOF
changequote([,])
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -o conftest$EXEEXT conftest.c > config.log 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SYSERRLIST,,[Define if syserrlist available])
else
AC_MSG_RESULT(no)
fi
fi
rm -f conftest$EXEEXT conftest.c
])dnl
dnl
define(PAC_TEST_MPIR_STATUS_SET_BYTES,[
AC_MSG_CHECKING(if MPIR_Status_set_bytes is defined)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
main(int argc, char **argv)
{
MPI_Status status;
MPI_Datatype type;
int err;
MPI_Init(&argc,&argv);
MPIR_Status_set_bytes(status,type,err);
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STATUS_SET_BYTES,,[Define if status set bytes available])
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
define(PAC_TEST_MPI_GREQUEST,[
AC_MSG_CHECKING(support for generalized requests)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
#include "stdio.h"
main(int argc, char **argv)
{
MPI_Request request;
MPI_Init(&argc, &argv);
MPI_Grequest_start(NULL, NULL, NULL, NULL, &request);
MPI_Finalize();
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPI_GREQUEST,1,[Define if generalized requests avaliable])
DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1"
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
define(PAC_TEST_MPI_GREQUEST_EXTENSIONS,[
AC_MSG_CHECKING(support for non-standard extended generalized requests)
rm -f mpitest.c
cat > mpitest.c <<EOF
#include "mpi.h"
#include "stdio.h"
main(int argc, char **argv)
{
MPIX_Grequest_class classtest
}
EOF
rm -f conftest$EXEEXT
$CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest$EXEEXT mpitest.c $MPI_LIB > /dev/null 2>&1
if test -x conftest$EXEEXT ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPI_GREQUEST_EXTENTIONS,1,[Define if non-standard generalized requests extensions avaliable])
DEFINE_HAVE_MPI_GREQUEST_EXTENSIONS="#define HAVE_MPI_GREQUEST_EXTENSIONS 1"
else
AC_MSG_RESULT(no)
fi
rm -f conftest$EXEEXT mpitest.c
])dnl
define(PAC_TEST_NEEDS_CONST,[
AC_MSG_CHECKING([const declarations needed in MPI routines])
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[ #include <mpi.h>
int MPI_File_delete(char *filename, MPI_Info info) { return (0); }
] )],
[
AC_MSG_RESULT(no)
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MPIIO_CONST, const, [Define if MPI-IO routines need a const qualifier])
])
])
+218
Ver Arquivo
@@ -0,0 +1,218 @@
dnl
dnl PAC_RUN_LOG mimics _AC_RUN_LOG which is autoconf internal routine.
dnl We also make sure PAC_RUN_LOG can be used in AS_IF, so the last
dnl test command should have terminating ]), i.e. without newline before ]).
dnl
AC_DEFUN([PAC_RUNLOG],[
{ AS_ECHO(["$as_me:$LINENO: $1"]) >&AS_MESSAGE_LOG_FD
(eval $1) 2>&AS_MESSAGE_LOG_FD
ac_status=$?
AS_ECHO(["$as_me:$LINENO: \$? = $ac_status"]) >&AS_MESSAGE_LOG_FD
test $ac_status = 0; }])
dnl
dnl PAC_COMMAND_IFELSE is written to replace AC_TRY_EVAL with added logging
dnl to config.log, i.e. AC_TRY_EVAL does not log anything to config.log.
dnl If autoconf provides AC_COMMAND_IFELSE or AC_EVAL_IFELSE,
dnl AC_COMMAND_IFELSE dnl should be replaced by the official autoconf macros.
dnl
dnl PAC_COMMAND_IFELSE(COMMMAND,[ACTION-IF-RUN-OK],[ACTION-IF-RUN-FAIL])
dnl
AC_DEFUN([PAC_COMMAND_IFELSE],[
AS_IF([PAC_RUNLOG([$1])],[
$2
],[
AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
m4_ifvaln([$3],[
(exit $ac_status)
$3
])
])
])
AC_DEFUN([PAC_RUNLOG_IFELSE],[
dnl pac_TESTLOG is the internal temporary logfile for this macro.
pac_TESTLOG="pac_test.log"
rm -f $pac_TESTLOG
PAC_COMMAND_IFELSE([$1 > $pac_TESTLOG],[
ifelse([$2],[],[],[$2])
],[
AS_ECHO(["*** $1 :"]) >&AS_MESSAGE_LOG_FD
cat $pac_TESTLOG >&AS_MESSAGE_LOG_FD
ifelse([$3],[],[],[$3])
])
rm -f $pac_TESTLOG
])
dnl PAC_VAR_PUSHVAL(VARNAME, [LastSavedValue]))
dnl
dnl Save the content of the shell variable, VARNAME, onto a stack.
dnl The saved value of VARNAME is restorable with respect to the nesting
dnl of the macro.
dnl
dnl The Last saved value of VARNAME on the stack is stored in shell variable
dnl pac_LastSavedValueOf_$VARNAME if the 2nd argument is NOT supplied.
dnl If the 2nd argument is present, the last saved value will be stored
dnl in the 2nd argument instead.
dnl
dnl The First saved value of VARNAME on the stack is stored in shell variable
dnl dnl pac_FirstSavedValueOf_$VARNAME.
dnl
AC_DEFUN([PAC_VAR_PUSHVAL],[
# START of PUSHVAL
dnl define local m4-name pac_stk_level.
AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level])
AS_VAR_SET_IF([pac_stk_level],[
AS_VAR_ARITH([pac_stk_level], [$pac_stk_level + 1])
],[
AS_VAR_SET([pac_stk_level], [0])
])
dnl AS_ECHO_N(["PUSHVAL: pac_stk_level = $pac_stk_level, "])
dnl Save the content of VARNAME, i.e. $VARNAME, onto the stack.
AS_VAR_SET([pac_stk_$1_$pac_stk_level],[$$1])
AS_VAR_IF([pac_stk_level], [0], [
dnl Save the 1st pushed value of VARNAME as pac_FirstSavedValueOf_$VARNAME
AS_VAR_COPY([pac_FirstSavedValueOf_$1],[pac_stk_$1_$pac_stk_level])
])
ifelse([$2],[],[
dnl Save the last pushed value of VARNAME as pac_LastSavedValueOf_$VARNAME
AS_VAR_COPY([pac_LastSavedValueOf_$1],[pac_stk_$1_$pac_stk_level])
dnl AS_ECHO(["pac_LastSavedValueOf_$1 = $pac_LastSavedValueOf_$1"])
],[
dnl Save the last pushed value of VARNAME as $2
AS_VAR_COPY([$2],[pac_stk_$1_$pac_stk_level])
dnl AS_ECHO(["$2 = $$2"])
])
AS_VAR_POPDEF([pac_stk_level])
# END of PUSHVAL
])
dnl
dnl
dnl
dnl PAC_VAR_POPVAL(VARNAME)
dnl
dnl Restore variable, VARNAME, from the stack.
dnl This macro is safe with respect to the nesting.
dnl Some minimal checking of nesting balance of PAC_VAR_PUSH[POP]VAL()
dnl is done here.
dnl
AC_DEFUN([PAC_VAR_POPVAL],[
# START of POPVAL
dnl define local m4-name pac_stk_level.
AS_VAR_PUSHDEF([pac_stk_level], [pac_stk_$1_level])
AS_VAR_SET_IF([pac_stk_level],[
AS_VAR_IF([pac_stk_level],[-1],[
AC_MSG_WARN(["Imbalance of PUSHVAL/POPVAL of $1"])
],[
dnl AS_ECHO_N(["POPVAL: pac_stk_level = $pac_stk_level, "])
AS_VAR_COPY([$1],[pac_stk_$1_$pac_stk_level])
dnl AS_ECHO(["popped_val = $$1"])
AS_VAR_ARITH([pac_stk_level], [ $pac_stk_level - 1 ])
])
],[
AC_MSG_WARN(["Uninitialized PUSHVAL/POPVAL of $1"])
])
AS_VAR_POPDEF([pac_stk_level])
# END of POPVAL
])
dnl
dnl
dnl
dnl PAC_COMPILE_IFELSE_LOG is a wrapper around AC_COMPILE_IFELSE with the
dnl output of ac_compile to a specified logfile instead of AS_MESSAGE_LOG_FD
dnl
dnl PAC_COMPILE_IFELSE_LOG(logfilename, input,
dnl [action-if-true], [action-if-false])
dnl
dnl where input, [action-if-true] and [action-if-false] are used
dnl in AC_COMPILE_IFELSE(input, [action-if-true], [action-if-false]).
dnl This macro is nesting safe.
dnl
AC_DEFUN([PAC_COMPILE_IFELSE_LOG],[
dnl
dnl Instead of defining our own ac_compile and do AC_TRY_EVAL
dnl on these variables. We modify ac_compile used by AC_*_IFELSE
dnl by piping the output of the command to a logfile. The reason is that
dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_compile
dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in
dnl these commands, i.e. deviate from how GNU standard uses these variables.
dnl
dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_compile.
dnl Save a copy of ac_compile on a stack
dnl which is safe through nested invocations of this macro.
PAC_VAR_PUSHVAL([ac_compile])
dnl Modify ac_compile based on the unmodified ac_compile.
ac_compile="`echo $pac_FirstSavedValueOf_ac_compile | sed -e 's|>.*$|> $1 2>\&1|g'`"
AC_COMPILE_IFELSE([$2],[
ifelse([$3],[],[:],[$3])
],[
ifelse([$4],[],[:],[$4])
])
dnl Restore the original ac_compile from the stack.
PAC_VAR_POPVAL([ac_compile])
])
dnl
dnl
dnl
dnl PAC_LINK_IFELSE_LOG is a wrapper around AC_LINK_IFELSE with the
dnl output of ac_link to a specified logfile instead of AS_MESSAGE_LOG_FD
dnl
dnl PAC_LINK_IFELSE_LOG(logfilename, input,
dnl [action-if-true], [action-if-false])
dnl
dnl where input, [action-if-true] and [action-if-false] are used
dnl in AC_LINK_IFELSE(input, [action-if-true], [action-if-false]).
dnl This macro is nesting safe.
dnl
AC_DEFUN([PAC_LINK_IFELSE_LOG],[
dnl
dnl Instead of defining our own ac_link and do AC_TRY_EVAL
dnl on these variables. We modify ac_link used by AC_*_IFELSE
dnl by piping the output of the command to a logfile. The reason is that
dnl 1) AC_TRY_EVAL is discouraged by Autoconf. 2) defining our ac_link
dnl could mess up the usage and order of *CFLAGS, LDFLAGS and LIBS in
dnl these commands, i.e. deviate from how GNU standard uses these variables.
dnl
dnl Replace ">&AS_MESSAGE_LOG_FD" by "> FILE 2>&1" in ac_link.
dnl Save a copy of ac_link on a stack
dnl which is safe through nested invocations of this macro.
PAC_VAR_PUSHVAL([ac_link])
dnl Modify ac_link based on the unmodified ac_link.
ac_link="`echo $pac_FirstSavedValueOf_ac_link | sed -e 's|>.*$|> $1 2>\&1|g'`"
dnl
AC_LINK_IFELSE([$2],[
ifelse([$3],[],[:],[$3])
],[
ifelse([$4],[],[:],[$4])
])
dnl Restore the original ac_link from the stack.
PAC_VAR_POPVAL([ac_link])
])
dnl
dnl
dnl
dnl PAC_COMPLINK_IFELSE (input1, input2, [action-if-true], [action-if-false])
dnl
dnl where input1 and input2 are either AC_LANG_SOURCE or AC_LANG_PROGRAM
dnl enclosed input programs.
dnl
dnl The macro first compiles input1 and uses the object file created
dnl as part of LIBS during linking. This macro is nesting safe.
dnl
AC_DEFUN([PAC_COMPLINK_IFELSE],[
AC_COMPILE_IFELSE([$1],[
PAC_RUNLOG([mv conftest.$OBJEXT pac_conftest.$OBJEXT])
PAC_VAR_PUSHVAL([LIBS])
LIBS="pac_conftest.$OBJEXT $pac_FirstSavedValueOf_LIBS"
AC_LINK_IFELSE([$2],[
ifelse([$3],[],[:],[$3])
],[
ifelse([$4],[],[:],[$4])
])
PAC_VAR_POPVAL([LIBS])
rm -f pac_conftest.$OBJEXT
],[
ifelse([$4],[],[:],[$4])
])
])
+500
Ver Arquivo
@@ -0,0 +1,500 @@
dnl
dnl Definitions for creating shared libraries
dnl
dnl The purpose of these definitions is to provide common support for
dnl shared libraries, with *or without* the use of the GNU Libtool package.
dnl For many of our important platforms, the Libtool approach is overkill,
dnl and can be particularly painful for developers.
dnl
dnl To use libtool, you need macros that are defined by libtool for libtool
dnl Don't even think about the consequences of this for updating and for
dnl using user-versions of libtool :(
dnl
dnl !!!!!!!!!!!!!!!!!!!!!
dnl libtool requires ac 2.50 !!!!!!!!!!!!!!!!!
dnl
dnl builtin(include,libtool.m4)
dnl
dnl/*D
dnl PAC_ARG_SHAREDLIBS - Add --enable-sharedlibs=kind to configure.
dnl
dnl Synopsis:
dnl PAC_ARG_SHAREDLIBS
dnl
dnl Output effects:
dnl Adds '--enable-sharedlibs=kind' to the command line. If this is enabled,
dnl then based on the value of 'kind', programs are selected for the
dnl names 'CC_SHL' and 'CC_LINK_SHL' that configure will substitute for in
dnl 'Makefile.in's. These symbols are generated by 'simplemake' when
dnl shared library support is selected.
dnl The variable 'C_LINKPATH_SHL' is set to the option to specify the
dnl path to search at runtime for libraries (-rpath in gcc/GNU ld).
dnl This can be turned off with --disable-rpath , which is appropriate
dnl for libraries and for executables that may be installed in different
dnl locations.
dnl The variable 'SHLIB_EXT' is set to the extension used by shared
dnl libraries; under most forms of Unix, this is 'so'; under Mac OS/X, this
dnl is 'dylib', and under Windows (including cygwin), this is 'dll'.
dnl
dnl Supported values of 'kind' include \:
dnl+ gcc - Use gcc to create both shared objects and libraries
dnl. osx-gcc - Use gcc on Mac OS/X to create both shared objects and
dnl libraries
dnl. solaris-cc - Use native Solaris cc to create shared objects and
dnl libraries
dnl. cygwin-gcc - Use gcc on Cygwin to create shared objects and libraries
dnl- none - The same as '--disable-sharedlibs'
dnl
dnl Others will be added as experience dictates. Likely names are
dnl + libtool - For general GNU libtool
dnl - linux-pgcc - For Portland group under Linux
dnl
dnl Notes:
dnl Shared libraries are only partially implemented. Additional symbols
dnl will probably be defined, including symbols to specify how shared library
dnl search paths are specified and how shared library names are set.
dnl D*/
AC_DEFUN([PAC_ARG_SHAREDLIBS],[
AC_ARG_ENABLE(shared,
AC_HELP_STRING([--enable-shared], [Enable shared library builds]),,
enable_shared=no)
AC_ARG_ENABLE(rpath,
AC_HELP_STRING([--enable-rpath],
[Determine whether the rpath is set when programs are
compiled and linked when shared libraries are built.
The default is yes; use --disable-rpath to turn this
feature off; in that case, shared libraries will be
found according to the rules for your system (e.g., in
LD_LIBRARY_PATH)]),,enable_rpath=yes)
AC_ARG_ENABLE(sharedlibs,
[ --enable-sharedlibs=kind - Enable shared libraries. kind may be
gcc - Standard gcc and GNU ld options for creating shared libraries
osx-gcc - Special options for gcc needed only on OS/X
solaris-cc - Solaris native (SPARC) compilers for 32 bit systems
cygwin-gcc - Special options for gcc needed only for cygwin
none - same as --disable-sharedlibs
Only gcc, osx-gcc, and solaris-cc are currently supported
],,enable_sharedlibs=default)
if test "$enable_sharedlibs" = "default" ; then
if test "$enable_shared" = "yes" ; then
AS_CASE([$host],
[*-*-darwin*], [enable_sharedlibs=gcc-osx],
[*-*-cygwin*|*-*-mingw*|*-*-pw32*|*-*-cegcc*], [enable_sharedlibs=cygwin-gcc],
[*-*-sunos*], [enable_sharedlibs=solaris-gcc],
[enable_sharedlibs=gcc])
else
enable_sharedlibs=none
fi
fi
# If --enable-sharedlibs is given, but --enable-shared is not, throw
# an error
if test "$enable_sharedlibs" != "no" -a "$enable_sharedlibs" != "none" ; then
if test "$enable_shared" = "no" ; then
AC_MSG_ERROR([--enable-sharedlibs cannot be used without --enable-shared])
fi
fi
CC_SHL=true
C_LINK_SHL=true
C_LINKPATH_SHL=""
SHLIB_EXT=unknown
SHLIB_FROM_LO=no
SHLIB_INSTALL='$(INSTALL_PROGRAM)'
case "$enable_sharedlibs" in
no|none)
;;
gcc-osx|osx-gcc)
AC_MSG_RESULT([Creating shared libraries using GNU for Mac OSX])
C_LINK_SHL='${CC} -dynamiclib -undefined suppress -single_module -flat_namespace'
CC_SHL='${CC} -fPIC'
# No way in osx to specify the location of the shared libraries at link
# time (see the code in createshlib in mpich/src/util)
# As of 10.5, -Wl,-rpath,dirname should work . The dirname
# must be a single directory, not a colon-separated list (use multiple
# -Wl,-rpath,path for each of the paths in the list). However, os x
# apparently records the library full path, so rpath isn't as useful
# as it is on other systems
C_LINKPATH_SHL=""
SHLIB_EXT="dylib"
enable_sharedlibs="osx-gcc"
;;
gcc)
AC_MSG_RESULT([Creating shared libraries using GNU])
# Not quite right yet. See mpich/util/makesharedlib
# Use syntax that works in both Make and the shell
#C_LINK_SHL='${CC} -shared -Wl,-r'
C_LINK_SHL='${CC} -shared'
# For example, include the libname as ${LIBNAME_SHL}
#C_LINK_SHL='${CC} -shared -Wl,-h,<finallibname>'
# May need -fPIC . Test to see which one works.
for sh_arg in "-fPIC" "-fpic" "-KPIC" ; do
PAC_C_CHECK_COMPILER_OPTION($sh_arg,works=yes,works=no)
if test "$works" = "yes" ; then
CC_SHL="${CC} ${sh_arg}"
break
fi
done
if test "$works" != "yes"; then
AC_MSG_ERROR([Cannot build shared libraries with this compiler])
fi
# This used to have -Wl,-rpath earlier, but that causes problems
# on many systems.
if test $enable_rpath = "yes" ; then
C_LINKPATH_SHL="-Wl,-rpath,"
fi
SHLIB_EXT=so
# We need to test that this isn't osx. The following is a
# simple hack
osname=`uname -s`
case $osname in
*Darwin*|*darwin*)
AC_MSG_ERROR([You must specify --enable-sharedlibs=osx-gcc for Mac OS/X])
;;
*CYGWIN*|*cygwin*)
AC_MSG_ERROR([You must specify --enable-sharedlibs=cygwin-gcc for Cygwin])
;;
*SunOS*)
AC_MSG_ERROR([You must specify --enable-sharedlibs=solaris-gcc for Solaris with gcc])
;;
esac
;;
cygwin|cygwin-gcc|gcc-cygwin)
AC_MSG_RESULT([Creating shared libraries using GNU under CYGWIN])
C_LINK_SHL='${CC} -shared'
CC_SHL='${CC}'
# DLL Libraries need to be in the user's path (!)
C_LINKPATH_SHL=""
SHLIB_EXT="dll"
enable_sharedlibs="cygwin-gcc"
;;
libtool)
# set TRY_LIBTOOL to yes to experiment with libtool. You are on your
# own - only send fixes, not bug reports.
if test "$TRY_LIBTOOL" != yes ; then
AC_MSG_ERROR([Creating shared libraries using libtool not yet supported])
else
# Using libtool requires a heavy-weight process to test for
# various stuff that libtool needs. Without this, you'll get a
# bizarre error message about libtool being unable to find
# configure.in or configure.ac (!)
# Libtool expects to see at least enable-shared.
if test "X$enable_shared" = "X" ; then enable_shared=yes ; fi
# Initialize libtool
# This works, but libtool version 2 places the object files
# in a different place, making it harder to integrate with
# our base approach. Disabling for now
dnl LT_PREREQ([2.2.6])
dnl LT_INIT([disable-shared])
AC_MSG_ERROR([To use this test verison, edit aclocal_shl.m4])
# Likely to be
# either CC or CC_SHL is libtool $cc
CC_SHL='${LIBTOOL} --mode=compile ${CC}'
# CC_LINK_SHL includes the final installation path
# For many systems, the link may need to include *all* libraries
# (since many systems don't allow any unsatisfied dependencies)
# We need to give libtool the .lo file, not the .o files
SHLIB_FROM_LO=yes
# We also need to add -no-undefined when the compiler is gcc and
# we are building under cygwin
sysname=`uname -s | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
isCygwin=no
case "$sysname" in
*CYGWIN*) isCygwin=yes ;;
esac
if test "$isCygwin" = yes ; then
C_LINK_SHL='${LIBTOOL} --mode=link ${CC} -no-undefined -rpath ${libdir}'
else
C_LINK_SHL='${LIBTOOL} --mode=link ${CC} -rpath ${libdir}'
fi
if test $enable_rpath = "yes" ; then
C_LINKPATH_SHL="-rpath "
fi
# We also need a special install process with libtool. Note that this
# will also install the static libraries
SHLIB_INSTALL='$(LIBTOOL) --mode=install $(INSTALL_PROGRAM)'
# Note we may still need to add
#'$(LIBTOOL) --mode=finish $(libdir)'
fi
;;
dnl
dnl Other, such as solaris-cc
solaris|solaris-cc)
AC_MSG_RESULT([Creating shared libraries using Solaris])
# pic32 is appropriate for both 32 and 64 bit Solaris
C_LINK_SHL='${CC} -G -xcode=pic32'
CC_SHL='${CC} -xcode=pic32'
if test $enable_rpath = "yes" ; then
C_LINKPATH_SHL="-R"
fi
SHLIB_EXT=so
enable_sharedlibs="solaris-cc"
;;
solaris-gcc)
# This is the same as gcc, except for the C_LINKPATH_SHL
AC_MSG_RESULT([Creating shared libraries using Solaris with gcc])
C_LINK_SHL='${CC} -shared'
CC_SHL='${CC} -fPIC'
if test $enable_rpath = "yes" ; then
C_LINKPATH_SHL="-R"
fi
SHLIB_EXT=so
enable_sharedlibs="solaris-gcc"
;;
linuxppc-xlc)
# This is only the beginning of xlc support, thanks to andy@vpac.org
CC_SHL='${CC} -qmkshrobj'
# More recent versions allow multiple args, separated by commas
if test $enable_rpath = "yes" ; then
C_LINKPATH_SHL="-Wl,-rpath,"
fi
#C_LINKPATH_SHL="-Wl,-rpath -Wl,"
C_LINK_SHL='${CC} -shared -qmkshrobj'
SHLIB_EXT=so
# Note that the full line should be more like
# $CLINKER -shared -qmkshrobj -Wl,-h,$libbase.$slsuffix -o ../shared/$libbase.$slsuffix *.o $OtherLibs
# for the appropriate values of $libbase and $slsuffix
# The -h name sets the name of the object; this is necessary to
# ensure that the dynamic linker can find the proper shared library.
;;
*)
AC_MSG_ERROR([Unknown value $enable_sharedlibs for enable-sharedlibs. Values should be gcc or osx-gcc])
enable_sharedlibs=no
;;
esac
# Check for the shared-library extension
PAC_CC_SHLIB_EXT
dnl
AC_SUBST(CC_SHL)
AC_SUBST(C_LINK_SHL)
AC_SUBST(C_LINKPATH_SHL)
AC_SUBST(SHLIB_EXT)
AC_SUBST(SHLIB_FROM_LO)
AC_SUBST(SHLIB_INSTALL)
])
dnl /*D
dnl PAC_xx_SHAREDLIBS - Get compiler and linker for shared libraries
dnl These routines may be used to determine the compiler and the
dnl linker to be used in creating shared libraries
dnl Rather than set predefined variable names, they set an argument
dnl (if provided)
dnl
dnl Synopsis
dnl PAC_CC_SHAREDLIBS(type,CCvar,CLINKvar)
dnl D*/
AC_DEFUN([PAC_CC_SHAREDLIBS],
[
pac_kinds=$1
ifelse($1,,[
pac_prog=""
AC_CHECK_PROG(pac_prog,gcc,yes,no)
# If we are gcc but OS X, set the special type
# We need a similar setting for cygwin
if test "$pac_prog" = yes ; then
osname=`uname -s`
case $osname in
*Darwin*|*darwin*) pac_kinds=gcc-osx
;;
*) pac_kinds=gcc
;;
esac
fi
pac_prog=""
AC_CHECK_PROG(pac_prog,libtool,yes,no)
if test "$pac_prog" = yes ; then pac_kinds="$pac_kinds libtool" ; fi
])
for pac_arg in $pac_kinds ; do
case $pac_arg in
gcc)
# For example, include the libname as ${LIBNAME_SHL}
#C_LINK_SHL='${CC} -shared -Wl,-h,<finallibname>'
pac_cc_sharedlibs='gcc -shared'
# Make sure we select the correct fpic option
PAC_C_CHECK_COMPILER_OPTION(-fPIC,fPIC_OK=yes,fPIC_OK=no)
if test "$fPIC_OK" != yes ; then
PAC_C_CHECK_COMPILER_OPTION(-fpic,fpic_ok=yes,fpic_ok=no)
if test "$fpic_ok" != yes ; then
AC_MSG_ERROR([Neither -fpic nor -fPIC accepted by $CC])
else
pac_cc_sharedlibs="$pac_cc_sharedlibs -fpic"
fi
else
pac_cc_sharedlibs="$pac_cc_sharedlibs -fPIC"
fi
pac_clink_sharedlibs='gcc -shared'
pac_type_sharedlibs=gcc
;;
gcc-osx|osx-gcc)
pac_clink_sharedlibs='${CC} -dynamiclib -undefined suppress -single_module -flat_namespace'
pac_cc_sharedlibs='${CC} -fPIC'
pac_type_sharedlibs=gcc-osx
;;
libtool)
AC_CHECK_PROGS(LIBTOOL,libtool,false)
if test "$LIBTOOL" = "false" ; then
AC_MSG_WARN([Could not find libtool])
else
# Likely to be
# either CC or CC_SHL is libtool $cc
pac_cc_sharedlibs'${LIBTOOL} -mode=compile ${CC}'
pac_clink_sharedlibs='${LIBTOOL} -mode=link ${CC} -rpath ${libdir}'
pac_type_sharedlibs=libtool
fi
;;
*)
;;
esac
if test -n "$pac_cc_sharedlibs" ; then break ; fi
done
if test -z "$pac_cc_sharedlibs" ; then pac_cc_sharedlibs=true ; fi
if test -z "$pac_clink_sharedlibs" ; then pac_clink_sharedlibs=true ; fi
ifelse($2,,CC_SHL=$pac_cc_sharedlibs,$2=$pac_cc_sharedlibs)
ifelse($3,,C_LINK_SHL=$pac_clink_sharedlibs,$3=$pac_clink_sharedlibs)
ifelse($4,,SHAREDLIB_TYPE=$pac_type_sharedlibs,$4=$pac_type_sharedlibs)
])
dnl This macro ensures that all of the necessary substitutions are
dnl made by any subdirectory configure (which may simply SUBST the
dnl necessary values rather than trying to determine them from scratch)
dnl This is a more robust (and, in the case of libtool, only
dnl managable) method.
AC_DEFUN([PAC_CC_SUBDIR_SHLIBS],[
AC_SUBST(CC_SHL)
AC_SUBST(C_LINK_SHL)
AC_SUBST(LIBTOOL)
AC_SUBST(ENABLE_SHLIB)
AC_SUBST(SHLIB_EXT)
if test "$ENABLE_SHLIB" = "libtool" ; then
if test -z "$LIBTOOL" ; then
AC_MSG_WARN([libtool selected for shared library support but LIBTOOL is not defined])
fi
# Libtool needs master_top_builddir
if test "X$master_top_builddir" = "X" ; then
AC_MSG_ERROR([Libtool requires master_top_builddir - check configure.ac sources])
fi
AC_SUBST(master_top_builddir)
fi
])
dnl PAC_CC_SHLIB_EXT - get the extension for shared libraries
dnl Set the variable SHLIB_EXT if it is other than unknown.
AC_DEFUN([PAC_CC_SHLIB_EXT],[
# Not all systems use .so as the extension for shared libraries (cygwin
# and OSX are two important examples). If we did not set the SHLIB_EXT,
# then try and determine it. We need this to properly implement
# clean steps that look for libfoo.$SHLIB_EXT .
if test "$SHLIB_EXT" = "unknown" ; then
osname=`uname -s`
case $osname in
*Darwin*|*darwin*) SHLIB_EXT=dylib
;;
*CYGWIN*|*cygwin*) SHLIB_EXT=dll
;;
*Linux*|*LINUX*|*SunOS*) SHLIB_EXT=so
;;
esac
fi
])
dnl PAC_COMPILER_SHLIB_FLAGS(compiler-var,output-file)
dnl
dnl Uses confdb/config.rpath to determine important linking flags and
dnl information. This is mainly intended to support the compiler wrapper
dnl scripts in MPICH ("mpicc" and friends) which cannot directly use libtool to
dnl handle linking. MPICH's compiler wrappers attempt to link executables with
dnl an rpath by default. The resulting variable assignment statements will be
dnl placed into "output-file", which is then suitable for AC_SUBST_FILE or
dnl sourcing in a shell script (including configure itself).
dnl
dnl This macro assumes that the basic tests associated with "compiler-var" have
dnl been run already, but does not AC_REQUIRE them in order to prevent problems
dnl with "expanded before required" when requiring the AC_PROG_{CC,F77,FC,CXX}
dnl macros.
dnl
dnl Example usage:
dnl
dnl ----8<----
dnl # compute flags for linking executables against shared libraries when using
dnl # the modern Fortran compiler ($FC).
dnl PAC_COMPILER_SHLIB_FLAGS([FC],[src/env/fc_shlib.conf])
dnl ----8<----
AC_DEFUN([PAC_COMPILER_SHLIB_FLAGS],[
AC_REQUIRE_AUX_FILE([config.rpath])
AC_REQUIRE([AC_CANONICAL_HOST])
# It appears that the libtool dynamic linking strategy on Darwin is this:
# 1. Link all shared libs with "-install_name /full/path/to/libfoo.dylib"
# 2. Don't do anything special when linking programs, since it seems that the
# darwin dynamic linker will always use the "install_name" field from the lib
# that was found at program link-time. (CONFIRMED) This is in opposition to
# the way that Linux does it, where specifying a "-rpath" argument at program
# link-time is important.
#
# There is an alternative darwin strategy for versions
# >= 10.5, see this: http://www.cmake.org/pipermail/cmake/2010-August/038970.html
# (goodell@ 2011-06-17)
AC_MSG_CHECKING([for shared library (esp. rpath) characteristics of $1])
# unfortunately, config.rpath expects the compiler in question is always CC and
# uses several other environment variables as input
PAC_PUSH_FLAG([CC])
PAC_PUSH_FLAG([GCC])
PAC_PUSH_FLAG([LD])
# these two don't currently get overridden, but we push/pop them for safety in
# case they do in the future
PAC_PUSH_FLAG([LDFLAGS])
PAC_PUSH_FLAG([with_gnu_ld])
# set the temporary override values (if any)
m4_case([$1],
[CC],
[:], dnl do nothing special for CC, values are already correct
[F77],
[CC="$$1"
GCC="$G77"
LD="$LD_F77"],
[FC],
[CC="$$1"
GCC="$GCC_FC"
LD="$LD_FC"],
[CXX],
[CC="$$1"
GCC="$GXX"
LD="$LD_CXX"],
[m4_fatal([unknown compiler argument "$1"])])
# ensure the values are available to the script
export CC
export GCC
export LDFLAGS
export LD
export with_gnu_ld
AS_IF([$ac_aux_dir/config.rpath "$host" > $2],[:],[AC_MSG_ERROR([unable to execute $ac_aux_dir/config.rpath])])
C_LINKPATH_SHL=""
AC_SUBST([C_LINKPATH_SHL])
rm -f conftest.out
# restore the old values
PAC_POP_FLAG([with_gnu_ld])
PAC_POP_FLAG([LD])
PAC_POP_FLAG([LDFLAGS])
PAC_POP_FLAG([GCC])
PAC_POP_FLAG([CC])
AC_MSG_RESULT([done (results in $2)])
])
+49
Ver Arquivo
@@ -0,0 +1,49 @@
dnl
dnl Definitions for using shared memory
dnl
dnl/*D
dnl PAC_ARG_SHARED_MEMORY - add --with-shared-memory=kind to configure
dnl
dnl Synopsis:
dnl PAC_ARG_SHARED_MEMORY
dnl
dnl Output effects:
dnl Adds '--with-shared-memory' to the command line. Checks for available
dnl shared memory functionality.
dnl
dnl Supported values of 'kind' include \:
dnl+ auto - default
dnl. mmap - use mmap and munmap
dnl- sysv - use sysv shared memory functions
dnl D*/
AC_DEFUN([PAC_ARG_SHARED_MEMORY],[
# check how to allocate shared memory
AC_ARG_WITH(shared-memory,
AC_HELP_STRING([--with-shared-memory[=auto|sysv|mmap]], [create shared memory using sysv or mmap (default is auto)]),,
with_shared_memory=auto)
if test "$with_shared_memory" = auto -o "$with_shared_memory" = mmap; then
found_mmap_funcs=yes
AC_CHECK_FUNCS(mmap munmap, , found_mmap_funcs=no)
if test "$found_mmap_funcs" = yes ; then
with_shared_memory=mmap
AC_DEFINE(USE_MMAP_SHM,1,[Define if we have sysv shared memory])
AC_MSG_NOTICE([Using a memory-mapped file for shared memory])
elif test "$with_shared_memory" = mmap ; then
AC_MSG_ERROR([cannot support shared memory: mmap() or munmap() not found])
fi
fi
if test "$with_shared_memory" = auto -o "$with_shared_memory" = sysv; then
found_sysv_shm_funcs=yes
AC_CHECK_FUNCS(shmget shmat shmctl shmdt, , found_sysv_shm_funcs=no)
if test "$found_sysv_shm_funcs" = yes ; then
with_shared_memory=sysv
AC_DEFINE(USE_SYSV_SHM,1,[Define if we have sysv shared memory])
AC_MSG_NOTICE([Using SYSV shared memory])
elif test "$with_shared_memory" = sysv ; then
AC_MSG_ERROR([cannot support shared memory: sysv shared memory functions functions not found])
fi
fi
])
+261
Ver Arquivo
@@ -0,0 +1,261 @@
dnl PAC_RESET_ALL_FLAGS - Reset precious flags to those set by the user
AC_DEFUN([PAC_RESET_ALL_FLAGS],[
if test "$FROM_MPICH" = "yes" ; then
CFLAGS="$USER_CFLAGS"
CPPFLAGS="$USER_CPPFLAGS"
CXXFLAGS="$USER_CXXFLAGS"
FFLAGS="$USER_FFLAGS"
FCFLAGS="$USER_FCFLAGS"
LDFLAGS="$USER_LDFLAGS"
LIBS="$USER_LIBS"
fi
])
dnl PAC_RESET_LINK_FLAGS - Reset precious link flags to those set by the user
AC_DEFUN([PAC_RESET_LINK_FLAGS],[
if test "$FROM_MPICH" = "yes" ; then
LDFLAGS="$USER_LDFLAGS"
LIBS="$USER_LIBS"
fi
])
dnl Sandbox configure with additional arguments
dnl Usage: PAC_CONFIG_SUBDIR_ARGS(subdir,configure-args,action-if-success,action-if-failure)
dnl
dnl The subconfigure argument list is created based on "ac_precious_vars"
dnl instead of explicitly use of well-known Makefile variables, like
dnl CC/CFLAGS/CPPFLAGS..., this generalization is effective as long as
dnl calling configure.ac declares the needed variables to be passed down
dnl to subconfigure as "precious" appropriately. The precious variable
dnl can be created in the following ways:
dnl 1) implicit declaration through use of autoconf macros, like
dnl AC_PROG_CC (declares CC/CFLAGS/CPPFLAGS/LIBS/LDFLAGS), or
dnl AC_PROG_F77 (declares F77/FFLAGS/FLIBS) ...
dnl which are in turns invoked by other subconfigure.
dnl When in doubt, check "ac_precious_var" in the calling configure.
dnl 2) explicit "precious" declaration through AC_ARG_VAR.
dnl Without correct "precious" declaration in the calling configure.ac,
dnl there would be variables not being included in the subconfigure
dnl argument list.
dnl
dnl Note: I suspect this DEFUN body is underquoted in places, but it does not
dnl seem to cause problems in practice yet. [goodell@ 2010-05-18]
AC_DEFUN([PAC_CONFIG_SUBDIR_ARGS],[
pac_dir="$1"
AC_MSG_NOTICE([===== configuring $1 =====])
pac_abs_srcdir=`(cd $srcdir && pwd)`
if test -f $pac_abs_srcdir/$1/setup ; then
AC_MSG_NOTICE([sourcing $pac_abs_srcdir/$1/setup])
. $pac_abs_srcdir/$1/setup
fi
# Adapted for MPICH from the autoconf-2.67 implementation of
# AC_CONFIG_SUBDIRS. Search for "MPICH note:" for relevant commentary and
# local modifications.
# Remove --cache-file, --srcdir, and --disable-option-checking arguments
# so they do not pile up. Otherwise relative paths (like --srcdir=.. from
# make distcheck) will be incorrect.
pac_sub_configure_args="$2"
pac_prev=
eval "set x $ac_configure_args"
shift
for pac_arg
do
if test -n "$pac_prev"; then
pac_prev=
continue
fi
case $pac_arg in
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
pac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
| --c=*)
;;
--config-cache | -C)
;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
pac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
pac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
;;
--disable-option-checking)
;;
*)
# MPICH note: this is a more robust version of the "precious
# variable" propagation code that was present in the previous
# incarnation of this macro
for pac_pvar in $ac_precious_vars ; do
# check if configure argument token contains the
# precious variable, i.e. "name_of_prec_var=".
if ( echo $pac_arg | grep "^$pac_pvar=" >/dev/null 2>&1 ) ; then
# check if current precious variable is set in env
eval pvar_set=\${$pac_pvar+set}
if test "$pvar_set" = "set" ; then
# Append 'name_of_prec_var=value_of_prec_var'
# to the subconfigure arguments list, where
# value_of_prec_var is fetched from the env.
# this also overrides any value set on the command line
eval pac_pval=\${$pac_pvar}
pac_arg="$pac_pvar=$pac_pval"
break
fi
fi
done
case $pac_arg in
*\'*) pac_arg=`AS_ECHO(["$pac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
esac
AS_VAR_APPEND([pac_sub_configure_args], [" '$pac_arg'"]) ;;
esac
done
# Always prepend --prefix to ensure using the same prefix
# in subdir configurations.
# MPICH note: see tt#983 for an example of why this is necessary
pac_arg="--prefix=$prefix"
case $pac_arg in
*\'*) pac_arg=`AS_ECHO(["$pac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
esac
pac_sub_configure_args="'$pac_arg' $pac_sub_configure_args"
# Pass --silent
if test "$silent" = yes; then
pac_sub_configure_args="--silent $pac_sub_configure_args"
fi
# Always prepend --disable-option-checking to silence warnings, since
# different subdirs can have different --enable and --with options.
pac_sub_configure_args="--disable-option-checking $pac_sub_configure_args"
pac_popdir=`pwd`
# Do not complain, so a configure script can configure whichever
# parts of a large source tree are present.
test -d "$srcdir/$pac_dir" || continue
# MPICH note: modified to remove the internal "_AS_*" macro usage, also
# msg is already printed at top
dnl _AS_ECHO_LOG([$pac_msg])
dnl _AS_ECHO([$pac_msg])
AS_MKDIR_P(["$pac_dir"])
# MPICH note: we leave this internal macro reference for now. We can clone
# the macro locally if this turns out to be non-portable across several autoconf
# versions. It sets the following variables: ac_builddir,
# ac_top_builddir_sub, ac_top_build_prefix, ac_srcdir, ac_top_srcdir,
# ac_abs_top_builddir, ac_abs_builddir, ac_abs_top_srcdir, ac_abs_srcdir
_AC_SRCDIRS(["$pac_dir"])
cd "$pac_dir"
# Check for guested configure; otherwise get Cygnus style configure.
if test -f "$ac_srcdir/configure.gnu"; then
pac_sub_configure=$ac_srcdir/configure.gnu
elif test -f "$ac_srcdir/configure"; then
pac_sub_configure=$ac_srcdir/configure
elif test -f "$ac_srcdir/configure.ac"; then
# This should be Cygnus configure.
pac_sub_configure=$ac_aux_dir/configure
else
AC_MSG_WARN([no configuration information is in $pac_dir])
pac_sub_configure=
fi
# The recursion is here.
if test -n "$pac_sub_configure"; then
# MPICH note: overriding the cache file on purpose to prevent strange
# issues resulting from inter-dir caching
dnl # Make the cache file name correct relative to the subdirectory.
dnl case $cache_file in
dnl [[\\/]]* | ?:[[\\/]]* ) pac_sub_cache_file=$cache_file ;;
dnl *) # Relative name.
dnl pac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
dnl esac
pac_sub_cache_file="/dev/null"
AC_MSG_NOTICE([running $SHELL $pac_sub_configure $pac_sub_configure_args --cache-file=$pac_sub_cache_file --srcdir=$ac_srcdir])
# The eval makes quoting arguments work.
# MPICH note: we want to execute the provided actions, not be silent
# or error out if the subconfigure succeeded/failed
dnl eval "\$SHELL \"\$pac_sub_configure\" $pac_sub_configure_args \
dnl --cache-file=\"\$pac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
dnl AC_MSG_ERROR([$pac_sub_configure failed for $pac_dir])
if eval "\$SHELL \"\$pac_sub_configure\" $pac_sub_configure_args \
--cache-file=\"\$pac_sub_cache_file\" --srcdir=\"\$ac_srcdir\""
then
# restore the current dir for the provided actions
cd "$pac_popdir"
$3
else
# restore the current dir for the provided actions
cd "$pac_popdir"
$4
fi
fi
cd "$pac_popdir"
AC_MSG_NOTICE([===== done with $1 configure =====])
# Check for any localdefs files. These may be created, so we
# look in the local directory first.
if test -f $1/localdefs ; then
AC_MSG_NOTICE([sourcing $1/localdefs])
. $1/localdefs
elif test -f $pac_abs_srcdir/$1/localdefs ; then
AC_MSG_NOTICE([sourcing $pac_abs_srcdir/$1/localdefs])
. $pac_abs_srcdir/$1/localdefs
fi
])
dnl Sandbox configure
dnl Usage: PAC_CONFIG_SUBDIR(subdir,action-if-success,action-if-failure)
AC_DEFUN([PAC_CONFIG_SUBDIR],[PAC_CONFIG_SUBDIR_ARGS([$1],[],[$2],[$3])])
dnl PAC_SUBCFG_EXPAND_SUFFIX_MACRO(MACRO_PREFIX,MACRO_PATH_SUFFIX)
dnl converts the path given by MACRO_PATH_SUFFIX (with '/' chars in it) to one
dnl with '_' chars in it and then appends that to MACRO_PREFIX with '_' in
dnl between. The resulting macro name is then expanded, but with informative
dnl "##" comments before and after the expansion.
dnl
dnl This is intended to be an internal helper macro for the PAC_SUBCFG
dnl implementation.
dnl
dnl XXX DJG FIXME: need to be able to deal with PREREQ macros that potentially
dnl aren't present while having safety for BODY macros when there are
dnl misspellings
AC_DEFUN([PAC_SUBCFG_EXPAND_PATH_SUFFIX_MACRO],[
dnl convert path separators into '_', the m4_translit is intentionally unquoted
m4_pushdef([subsys_uscore_name],[$1_]m4_translit([$2],[\/],[__]))dnl
m4_ifdef(m4_defn([subsys_uscore_name]),[],[m4_fatal([macro ]m4_defn([subsys_uscore_name])[ is undefined])])dnl
[##] begin expansion of m4_defn([subsys_uscore_name])
dnl call the computed routine name with the remaining args
m4_indir(m4_defn([subsys_uscore_name]),m4_shift($@))
dnl there is intentionally no "dnl" on the previous line to reduce the chance of
dnl a "fi## end expansion" bug when the BODY macro doesn't end in a newline
[##] end expansion of m4_defn([subsys_uscore_name])
])
dnl invokes the PAC_SUBCFG_BODY_foo macro for the "foo" subsys, when "foo" is
dnl passed as the only argument to this macro. The first arg may be the '/'
dnl path version instead of having underscores.
AC_DEFUN([PAC_SUBCFG_CONFIGURE_SUBSYS],[PAC_SUBCFG_EXPAND_PATH_SUFFIX_MACRO([PAC_SUBCFG_BODY],[$1])])
dnl invokes the PAC_SUBCFG_PREREQ_foo macro for the "foo" subsys, when "foo" is
dnl passed as the only argument to this macro. The first arg may be the '/'
dnl path version instead of having underscores.
AC_DEFUN([PAC_SUBCFG_DO_PREREQ],[PAC_SUBCFG_EXPAND_PATH_SUFFIX_MACRO([PAC_SUBCFG_PREREQ],[$1])])
dnl takes no arguments, expands to "foo_bar_baz" when invoked in a file named
dnl "foo/bar/baz/subconfigure.m4"
dnl
dnl This is useful for reducing copy-paste errors when defining PREREQ and BODY
dnl macros. If you tinker with this macro, watch the quoting carefully.
AC_DEFUN([PAC_SUBCFG_AUTO_SUFFIX],[m4_translit(m4_bpatsubst(m4_dquote(__file__),[/[^/]+.m4],[]),[/],[_])])
+216
Ver Arquivo
@@ -0,0 +1,216 @@
dnl Nesting safe macros for saving variables
dnl Usage: PAC_PUSH_FLAG(CFLAGS)
AC_DEFUN([PAC_PUSH_FLAG],[
if test -z "${pac_save_$1_nesting}" ; then
pac_save_$1_nesting=0
fi
eval pac_save_$1_${pac_save_$1_nesting}='"$$1"'
pac_save_$1_nesting=`expr ${pac_save_$1_nesting} + 1`
])
dnl Usage: PAC_POP_FLAG(CFLAGS)
AC_DEFUN([PAC_POP_FLAG],[
pac_save_$1_nesting=`expr ${pac_save_$1_nesting} - 1`
eval $1="\$pac_save_$1_${pac_save_$1_nesting}"
eval pac_save_$1_${pac_save_$1_nesting}=""
])
dnl Usage: PAC_PUSH_ALL_FLAGS
AC_DEFUN([PAC_PUSH_ALL_FLAGS],[
PAC_PUSH_FLAG(CFLAGS)
PAC_PUSH_FLAG(CPPFLAGS)
PAC_PUSH_FLAG(CXXFLAGS)
PAC_PUSH_FLAG(FFLAGS)
PAC_PUSH_FLAG(FCFLAGS)
PAC_PUSH_FLAG(LDFLAGS)
PAC_PUSH_FLAG(LIBS)
])
dnl Usage: PAC_POP_ALL_FLAGS
AC_DEFUN([PAC_POP_ALL_FLAGS],[
PAC_POP_FLAG(CFLAGS)
PAC_POP_FLAG(CPPFLAGS)
PAC_POP_FLAG(CXXFLAGS)
PAC_POP_FLAG(FFLAGS)
PAC_POP_FLAG(FCFLAGS)
PAC_POP_FLAG(LDFLAGS)
PAC_POP_FLAG(LIBS)
])
dnl PAC_PREFIX_FLAG - Save flag with a prefix
dnl Usage: PAC_PREFIX_FLAG(PREFIX, FLAG)
AC_DEFUN([PAC_PREFIX_FLAG],[
$1_$2=$$2
export $1_$2
AC_SUBST($1_$2)
])
dnl PAC_PREFIX_ALL_FLAGS - Save flags with a prefix
dnl Usage: PAC_PREFIX_ALL_FLAGS(PREFIX)
AC_DEFUN([PAC_PREFIX_ALL_FLAGS],[
PAC_PREFIX_FLAG($1, CFLAGS)
PAC_PREFIX_FLAG($1, CPPFLAGS)
PAC_PREFIX_FLAG($1, CXXFLAGS)
PAC_PREFIX_FLAG($1, FFLAGS)
PAC_PREFIX_FLAG($1, FCFLAGS)
PAC_PREFIX_FLAG($1, LDFLAGS)
PAC_PREFIX_FLAG($1, LIBS)
PAC_PREFIX_FLAG($1, EXTRA_LIBS)
])
dnl Usage: PAC_APPEND_FLAG([-02], [CFLAGS])
dnl appends the given argument to the specified shell variable unless the
dnl argument is already present in the variable
AC_DEFUN([PAC_APPEND_FLAG],[
AC_REQUIRE([AC_PROG_FGREP])
AS_IF(
[echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1],
[echo "$2(='$$2') contains '$1', not appending" >&AS_MESSAGE_LOG_FD],
[echo "$2(='$$2') does not contain '$1', appending" >&AS_MESSAGE_LOG_FD
$2="$$2 $1"]
)
])
dnl Usage: PAC_PREPEND_FLAG([-lpthread], [LIBS])
dnl Prepends the given argument to the specified shell variable unless the
dnl argument is already present in the variable.
dnl
dnl This is typically used for LIBS and similar variables because libraries
dnl should be added in reverse order.
AC_DEFUN([PAC_PREPEND_FLAG],[
AC_REQUIRE([AC_PROG_FGREP])
AS_IF(
[echo "$$2" | $FGREP -e "\<$1\>" >/dev/null 2>&1],
[echo "$2(='$$2') contains '$1', not prepending" >&AS_MESSAGE_LOG_FD],
[echo "$2(='$$2') does not contain '$1', prepending" >&AS_MESSAGE_LOG_FD
$2="$1 $$2"]
)
])
dnl PAC_MKDIRS(path)
dnl Create any missing directories in the path
AC_DEFUN([PAC_MKDIRS],[
# Build any intermediate directories
for dir in $1 ; do
PAC_PUSH_FLAG([IFS])
IFS="/"
tmp_curdir=""
for tmp_subdir in $dir ; do
tmp_curdir="${tmp_curdir}$tmp_subdir"
if test ! -d "$tmp_curdir" ; then mkdir "$tmp_curdir" ; fi
tmp_curdir="${tmp_curdir}/"
done
PAC_POP_FLAG([IFS])
done
])
# Find something to use for mkdir -p. Eventually, this will have a
# script for backup. As of autoconf-2.63, AC_PROG_MKDIR_P was broken;
# it was checking to see if it recognized the "version" of mkdir and
# was deciding based on that. This should always be a feature test.
AC_DEFUN([PAC_PROG_MKDIR_P],[
AC_CACHE_CHECK([whether mkdir -p works],
pac_cv_mkdir_p,[
pac_cv_mkdir_p=no
rm -rf .tmp
if mkdir -p .tmp/.foo 1>/dev/null 2>&1 ; then
if test -d .tmp/.foo ; then
pac_cv_mkdir_p=yes
fi
fi
rm -rf .tmp
])
if test "$pac_cv_mkdir_p" = "yes" ; then
MKDIR_P="mkdir -p"
export MKDIR_P
else
AC_MSG_WARN([mkdir -p does not work; the install step may fail])
fi
AC_SUBST(MKDIR_P)
])
dnl Test for a clean VPATH directory. Provide this command with the names
dnl of all of the generated files that might cause problems
dnl (Makefiles won't cause problems because there's no VPATH usage for them)
dnl
dnl Synopsis
dnl PAC_VPATH_CHECK([file-names],[directory-names])
dnl file-names should be files other than config.status and any header (e.g.,
dnl fooconf.h) file that should be removed. It is optional
AC_DEFUN([PAC_VPATH_CHECK],[
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest*
date >conftest$$
# If creating a file in the current directory does not show up in the srcdir
# then we're doing a VPATH build (or something is very wrong)
if test ! -s $srcdir/conftest$$ ; then
pac_dirtyfiles=""
pac_dirtydirs=""
pac_header=""
ifdef([AC_LIST_HEADER],[pac_header=AC_LIST_HEADER])
for file in config.status $pac_header $1 ; do
if test -f $srcdir/$file ; then
pac_dirtyfiles="$pac_dirtyfiles $file"
fi
done
ifelse($2,,,[
for dir in $2 ; do
if test -d $srcdir/$dir ; then
pac_dirtydirs="$pac_dirtydirs $dir"
fi
done
])
if test -n "$pac_dirtyfiles" -o -n "$pac_dirtydirs" ; then
# Create a nice message about what to remove
rmmsg=""
if test -n "$pac_dirtyfiles" ; then
rmmsg="files $pac_dirtyfiles"
fi
if test -n "$pac_dirtydirs" ; then
if test -n "$rmmsg" ; then
rmmsg="$rmmsg and directories $pac_dirtydirs"
else
rmmsg="directories $pac_dirtydirs"
fi
fi
if test -f $srcdir/Makefile ; then
AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been
configured. Run "make distclean" in $srcdir first and make sure that the
$rmmsg have been removed.])
else
AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been
configured. Remove the $rmmsg in $srcdir.])
fi
fi
fi
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -f conftest*
])
dnl PAC_CONF_HEX_TO_DEC(value,out_var)
dnl
dnl Converts the given hexadecimal integer constant to an integer constant and
dnl stores the result in the shell variable given by 'out_var'.
dnl
dnl I think that printf like this will be sufficiently portable, but I don't
dnl have any guarantee of it. If not, we can fall back to AS_VAR_ARITH
dnl and/or AC_COMPUTE_INT (the latter will probably be slow)
AC_DEFUN([PAC_CONV_HEX_TO_DEC],[AS_VAR_SET([$2],[`printf "%d" $1`])])
dnl PAC_GET_EXENAME(exe_name, out_exe_name)
dnl
dnl Prepends and appends program prefix and suffix as supplied by --program_prefix
dnl and --program-sufix
AC_DEFUN([PAC_GET_EXENAME],[
$2=$1
if test "$program_prefix" != "NONE" ; then
$2="${program_prefix}$$2"
fi
if test "$program_suffix" != "NONE" ; then
$2="$$2$program_suffix"
fi
])
+141
Ver Arquivo
@@ -0,0 +1,141 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_gcc_var_attribute.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_GCC_VAR_ATTRIBUTE(ATTRIBUTE)
#
# DESCRIPTION
#
# This macro checks if the compiler supports one of GCC's variable
# attributes; many other compilers also provide variable attributes with
# the same syntax. Compiler warnings are used to detect supported
# attributes as unsupported ones are ignored by default so quieting
# warnings when using this macro will yield false positives.
#
# The ATTRIBUTE parameter holds the name of the attribute to be checked.
#
# If ATTRIBUTE is supported define HAVE_VAR_ATTRIBUTE_<ATTRIBUTE>.
#
# The macro caches its result in the ax_cv_have_var_attribute_<attribute>
# variable.
#
# The macro currently supports the following variable attributes:
#
# aligned
# cleanup
# common
# nocommon
# deprecated
# mode
# packed
# tls_model
# unused
# used
# vector_size
# weak
# dllimport
# dllexport
# init_priority
#
# Unsupported variable attributes will be tested against a global integer
# variable and without any arguments given to the attribute itself; the
# result of this check might be wrong or meaningless so use with care.
#
# LICENSE
#
# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 5
AC_DEFUN([AX_GCC_VAR_ATTRIBUTE], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_var_attribute_$1])
AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([
m4_case([$1],
[aligned], [
int foo __attribute__(($1(32)));
],
[cleanup], [
int bar(int *t) { return *t; };
],
[common], [
int foo __attribute__(($1));
],
[nocommon], [
int foo __attribute__(($1));
],
[deprecated], [
int foo __attribute__(($1)) = 0;
],
[mode], [
long foo __attribute__(($1(word)));
],
[packed], [
struct bar {
int baz __attribute__(($1));
};
],
[tls_model], [
__thread int bar1 __attribute__(($1("global-dynamic")));
__thread int bar2 __attribute__(($1("local-dynamic")));
__thread int bar3 __attribute__(($1("initial-exec")));
__thread int bar4 __attribute__(($1("local-exec")));
],
[unused], [
int foo __attribute__(($1));
],
[used], [
int foo __attribute__(($1));
],
[vector_size], [
int foo __attribute__(($1(16)));
],
[weak], [
int foo __attribute__(($1));
],
[dllimport], [
int foo __attribute__(($1));
],
[dllexport], [
int foo __attribute__(($1));
],
[init_priority], [
struct bar { bar() {} ~bar() {} };
bar b __attribute__(($1(65535/2)));
],
[
m4_warn([syntax], [Unsupported attribute $1, the test may fail])
int foo __attribute__(($1));
]
)], [
m4_case([$1],
[cleanup], [
int foo __attribute__(($1(bar))) = 0;
foo = foo + 1;
],
[]
)])
],
dnl GCC doesn't exit with an error if an unknown attribute is
dnl provided but only outputs a warning, so accept the attribute
dnl only if no warning were issued.
[AS_IF([test -s conftest.err],
[AS_VAR_SET([ac_var], [no])],
[AS_VAR_SET([ac_var], [yes])])],
[AS_VAR_SET([ac_var], [no])])
])
AS_IF([test yes = AS_VAR_GET([ac_var])],
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_VAR_ATTRIBUTE_$1), 1,
[Define to 1 if the system has the `$1' variable attribute])], [])
AS_VAR_POPDEF([ac_var])
])
+219
Ver Arquivo
@@ -0,0 +1,219 @@
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_prefix_config_h.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
#
# DESCRIPTION
#
# This is a new variant from ac_prefix_config_ this one will use a
# lowercase-prefix if the config-define was starting with a
# lowercase-char, e.g. "#define const", "#define restrict", or "#define
# off_t", (and this one can live in another directory, e.g.
# testpkg/config.h therefore I decided to move the output-header to be the
# first arg)
#
# takes the usual config.h generated header file; looks for each of the
# generated "#define SOMEDEF" lines, and prefixes the defined name (ie.
# makes it "#define PREFIX_SOMEDEF". The result is written to the output
# config.header file. The PREFIX is converted to uppercase for the
# conversions.
#
# Defaults:
#
# OUTPUT-HEADER = $PACKAGE-config.h
# PREFIX = $PACKAGE
# ORIG-HEADER, from AM_CONFIG_HEADER(config.h)
#
# Your configure.ac script should contain both macros in this order, and
# unlike the earlier variations of this prefix-macro it is okay to place
# the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation.
#
# Example:
#
# AC_INIT(config.h.in) # config.h.in as created by "autoheader"
# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE
# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in
# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..
# AC_MEMORY_H # makes "#undef NEED_MEMORY_H"
# AC_C_CONST_H # makes "#undef const"
# AC_OUTPUT(Makefile) # creates the "config.h" now
# # and also mylib/_config.h
#
# if the argument to AX_PREFIX_CONFIG_H would have been omitted then the
# default outputfile would have been called simply "testpkg-config.h", but
# even under the name "mylib/_config.h" it contains prefix-defines like
#
# #ifndef TESTPKG_VERSION
# #define TESTPKG_VERSION "0.1.1"
# #endif
# #ifndef TESTPKG_NEED_MEMORY_H
# #define TESTPKG_NEED_MEMORY_H 1
# #endif
# #ifndef _testpkg_const
# #define _testpkg_const _const
# #endif
#
# and this "mylib/_config.h" can be installed along with other
# header-files, which is most convenient when creating a shared library
# (that has some headers) where some functionality is dependent on the
# OS-features detected at compile-time. No need to invent some
# "mylib-confdefs.h.in" manually. :-)
#
# Note that some AC_DEFINEs that end up in the config.h file are actually
# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T
# say that they "will define inline|const|off_t if the system does not do
# it by itself". You might want to clean up about these - consider an
# extra mylib/conf.h that reads something like:
#
# #include <mylib/_config.h>
# #ifndef _testpkg_const
# #define _testpkg_const const
# #endif
#
# and then start using _testpkg_const in the header files. That is also a
# good thing to differentiate whether some library-user has starting to
# take up with a different compiler, so perhaps it could read something
# like this:
#
# #ifdef _MSC_VER
# #include <mylib/_msvc.h>
# #else
# #include <mylib/_config.h>
# #endif
# #ifndef _testpkg_const
# #define _testpkg_const const
# #endif
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2008 Marten Svantesson
# Copyright (c) 2008 Gerald Point <Gerald.Point@labri.fr>
#
# 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, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl
AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl
AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl
AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl
AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl
AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl
AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl
m4_pushdef([_script],[conftest.prefix])dnl
m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
_PKG=`echo ifelse($2, , $PACKAGE, $2)`
_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
_INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'`
if test ".$_INP" = "."; then
for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
case "$ac_file" in
*.h) _INP=$ac_file ;;
*)
esac
test ".$_INP" != "." && break
done
fi
if test ".$_INP" = "."; then
case "$_OUT" in
*/*) _INP=`basename "$_OUT"`
;;
*-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`
;;
*) _INP=config.h
;;
esac
fi
if test -z "$_PKG" ; then
AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
else
if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
_INP="$srcdir/$_INP"
fi fi
AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
if test -f $_INP ; then
echo "s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script
echo "s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script
echo "s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script
echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script
echo "@%:@endif/" >>_script
echo "s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script
echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script
echo "@%:@endif/" >> _script
# now executing _script on _DEF input to create _OUT output file
echo "@%:@ifndef $_DEF" >$tmp/pconfig.h
echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
echo ' ' >>$tmp/pconfig.h
echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
sed -f _script $_INP >>$tmp/pconfig.h
echo ' ' >>$tmp/pconfig.h
echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h
echo "@%:@endif" >>$tmp/pconfig.h
if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then
AC_MSG_NOTICE([$_OUT is unchanged])
else
ac_dir=`AS_DIRNAME(["$_OUT"])`
AS_MKDIR_P(["$ac_dir"])
rm -f "$_OUT"
mv $tmp/pconfig.h "$_OUT"
fi
cp _script _configs.sed
else
AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
fi
rm -f conftest.*
fi
m4_popdef([_symbol])dnl
m4_popdef([_script])dnl
AS_VAR_POPDEF([_INP])dnl
AS_VAR_POPDEF([_UPP])dnl
AS_VAR_POPDEF([_LOW])dnl
AS_VAR_POPDEF([_PKG])dnl
AS_VAR_POPDEF([_DEF])dnl
AS_VAR_POPDEF([_OUT])dnl
],[PACKAGE="$PACKAGE"])])
dnl implementation note: a bug report (31.5.2005) from Marten Svantesson points
dnl out a problem where `echo "\1"` results in a Control-A. The unix standard
dnl http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html
dnl defines all backslash-sequences to be inherently non-portable asking
dnl for replacement mit printf. Some old systems had problems with that
dnl one either. However, the latest libtool (!) release does export an $ECHO
dnl (and $echo) that does the right thing - just one question is left: what
dnl was the first version to have it? Is it greater 2.58 ?
+91
Ver Arquivo
@@ -0,0 +1,91 @@
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_tls.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_TLS
#
# DESCRIPTION
#
# Provides a test for the compiler support of thread local storage (TLS)
# extensions. Defines TLS if it is found. Currently only knows about GCC
# and MSVC. I think SunPro uses the same as GCC, and Borland apparently
# supports either.
#
# LICENSE
#
# Copyright (c) 2008 Alan Woodland <ajw05@aber.ac.uk>
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_TLS], [
AC_MSG_CHECKING(for thread local storage specifier)
AC_CACHE_VAL(ac_cv_tls, [
ax_tls_keywords="_Thread_local __thread __declspec(thread) none"
for ax_tls_keyword in $ax_tls_keywords; do
case $ax_tls_keyword in
none) ac_cv_tls=none ; break ;;
*)
# MPICH modification: This was an AC_TRY_COMPILE before, but
# Darwin with non-standard compilers will accept __thread at
# compile time but fail to link due to an undefined
# "__emutls_get_address" symbol unless -lgcc_eh is added to the
# link line.
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([$ax_tls_keyword int bar = 5;],[++bar;])],
[ac_cv_tls=$ax_tls_keyword],
[ac_cv_tls=none])
# MPICH modification: Also test with the extern keyword.
# The intel compiler on Darwin (at least as of 15.0.1)
# seems to break with the above error when the extern
# keyword is specified in shared library builds.
PAC_PUSH_FLAG([LIBS])
PAC_APPEND_FLAG([-shared],[LIBS])
if test "$ac_cv_tls" != "none" ; then
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[
extern $ax_tls_keyword int bar;
$ax_tls_keyword int bar = 0;
],[++bar;])],
[ac_cv_tls=$ax_tls_keyword],
[ac_cv_tls=none])
fi
PAC_POP_FLAG([LIBS])
if test "$ac_cv_tls" != "none" ; then break ; fi
esac
done
])
if test "$ac_cv_tls" != "none"; then
AC_DEFINE_UNQUOTED([TLS_SPECIFIER], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
fi
AC_MSG_RESULT($ac_cv_tls)
])
Arquivo executável
+706
Ver Arquivo
@@ -0,0 +1,706 @@
#! /bin/sh
#
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2011 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# 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.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
;;
icc* | ifort*)
wl='-Wl,'
;;
lf95*)
wl='-Wl,'
;;
nagfor*)
wl='-Wl,-Wl,,'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
xl* | bgxl* | bgf* | mpixl* | *bgq-linux-xl* )
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-4]]*)
wl=
;;
*Sun\ F* | *Sun*Fortran*)
wl='-Wl,'
;;
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
newsos6)
;;
*nto* | *qnx*)
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
wl='-Qoption ld '
;;
*)
wl='-Wl,'
;;
esac
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
haiku*)
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
# use --enable-new-dtags for RUNPATH support, which is required for
# switching between ABI compatible libraries at runtime.
if test "$GCC" = yes; then
hardcode_libdir_flag_spec="${hardcode_libdir_flag_spec} ${wl}--enable-new-dtags"
else
case $cc_basename in ifort*)
hardcode_libdir_flag_spec="${hardcode_libdir_flag_spec} ${wl}--enable-new-dtags"
;;
esac
fi
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
case "$host_cpu" in
powerpc*)
library_names_spec='$libname$shrext' ;;
m68k)
library_names_spec='$libname.a' ;;
esac
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;;
gnu*)
library_names_spec='$libname$shrext'
;;
haiku*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
*nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
tpf*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
# MPICH modification: we don't prefix with acl_cv_ by default. This
# is causing problems in the stock version of config.rpath as well.
# LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF
+43
Ver Arquivo
@@ -0,0 +1,43 @@
# serial 5
dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_RANDOM_R],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
if test $ac_cv_header_random_h = no; then
HAVE_RANDOM_H=0
fi
AC_CHECK_TYPES([struct random_data],
[], [HAVE_STRUCT_RANDOM_DATA=0],
[[#include <stdlib.h>
#if HAVE_RANDOM_H
# include <random.h>
#endif
]])
dnl On AIX and OSF/1, these functions exist, but with different declarations.
dnl Override them all.
case "$host_os" in
aix* | osf*)
REPLACE_RANDOM_R=1
;;
*)
AC_CHECK_FUNCS([random_r])
if test $ac_cv_func_random_r = no; then
HAVE_RANDOM_R=0
fi
;;
esac
])
# Prerequisites of lib/random_r.c.
AC_DEFUN([gl_PREREQ_RANDOM_R], [
:
])
+119
Ver Arquivo
@@ -0,0 +1,119 @@
# stdlib_h.m4 serial 42
dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STDLIB_H],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
gl_NEXT_HEADERS([stdlib.h])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
#if HAVE_SYS_LOADAVG_H
# include <sys/loadavg.h>
#endif
#if HAVE_RANDOM_H
# include <random.h>
#endif
]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
posix_openpt ptsname ptsname_r random random_r realpath rpmatch
secure_getenv setenv setstate setstate_r srandom srandom_r
strtod strtoll strtoull unlockpt unsetenv])
])
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR_FOR_TESTS([$1])
])
AC_DEFUN([gl_STDLIB_H_DEFAULTS],
[
GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT])
GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL])
GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX])
GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG])
GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT])
GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT])
GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX])
GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC])
GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP])
GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS])
GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS])
GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT])
GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME])
GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R])
GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R])
GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM])
GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R])
GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH])
GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL])
GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL])
GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX])
GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT])
GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE__EXIT=1; AC_SUBST([HAVE__EXIT])
HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R])
HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM])
HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC])
REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
])