X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=libgomp%2Fconfigure.ac;h=84d250f0b19a237538ff2be3d9810a3c32e99adf;hb=84c2f4b068c5d221aea57334b38cdb78069b7dcf;hp=d6f960e383351d4c6d79ee3770178f09bc46a665;hpb=c663e301034033aa098dd63b3d141c8edb51c223;p=gcc.git diff --git a/libgomp/configure.ac b/libgomp/configure.ac index d6f960e3833..84d250f0b19 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script, like so: # aclocal -I ../config && autoconf && autoheader && automake -AC_PREREQ(2.59) +AC_PREREQ(2.64) AC_INIT([GNU OpenMP Runtime Library], 1.0,,[libgomp]) AC_CONFIG_HEADER(config.h) @@ -15,11 +15,19 @@ LIBGOMP_ENABLE(version-specific-runtime-libs, no, , permit yes|no) AC_MSG_RESULT($enable_version_specific_runtime_libs) -AC_MSG_CHECKING([for --enable-linux-futex]) -LIBGOMP_ENABLE(linux-futex, default, , - [Use the Linux futex system call], - permit yes|no|default) -AC_MSG_RESULT($enable_linux_futex) +# We would like our source tree to be readonly. However when releases or +# pre-releases are generated, the flex/bison generated files as well as the +# various formats of manuals need to be included along with the rest of the +# sources. Therefore we have --enable-generated-files-in-srcdir to do +# just that. +AC_MSG_CHECKING([for --enable-generated-files-in-srcdir]) +LIBGOMP_ENABLE(generated-files-in-srcdir, no, , + [put copies of generated files in source dir intended for creating source + tarballs for users without texinfo bison or flex.], + permit yes|no) +AC_MSG_RESULT($enable_generated_files_in_srcdir) +AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes) + # ------- # ------- @@ -50,11 +58,11 @@ target_alias=${target_alias-$host_alias} # we can do about that; they come from AC_INIT). # foreign: we don't follow the normal rules for GNU packages (no COPYING # file in the top srcdir, etc, etc), so stop complaining. -# no-dependencies: turns off auto dependency generation (just for now) +# no-dist: we don't want 'dist' and related rules. # -Wall: turns on all automake warnings... # -Wno-portability: ...except this one, since GNU make is required. # -Wno-override: ... and this one, since we do want this in testsuite. -AM_INIT_AUTOMAKE([1.9.0 foreign -Wall -Wno-portability -Wno-override]) +AM_INIT_AUTOMAKE([1.9.0 foreign no-dist -Wall -Wno-portability -Wno-override]) AM_ENABLE_MULTILIB(, ..) # Calculate toolexeclibdir @@ -96,7 +104,7 @@ AC_SUBST(toolexeclibdir) m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) m4_define([_AC_ARG_VAR_PRECIOUS],[]) AC_PROG_CC -m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) +m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) AC_SUBST(CFLAGS) @@ -117,19 +125,42 @@ AC_PATH_PROG(PERL, perl, perl-not-found-in-path-error) AC_PROG_MAKE_SET AC_PROG_INSTALL +# See if makeinfo has been installed and is modern enough +# that we can use it. +ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version], + [GNU texinfo.* \([0-9][0-9.]*\)], + [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*]) +AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes") + + # Configure libtool AM_PROG_LIBTOOL +ACX_LT_HOST_FLAGS AC_SUBST(enable_shared) AC_SUBST(enable_static) AM_MAINTAINER_MODE +# Create a spec file, so that compile/link tests don't fail +test -f libgfortran.spec || touch libgfortran.spec +FCFLAGS="$FCFLAGS -L." + # We need gfortran to compile parts of the library # We can't use AC_PROG_FC because it expects a fully working gfortran. #AC_PROG_FC(gfortran) -FC="$GFORTRAN" +case `echo $GFORTRAN` in + -* | no* ) + FC=no ;; + *) + set dummy $GFORTRAN; ac_word=$2 + if test -x "$ac_word"; then + FC="$GFORTRAN" + else + FC=no + fi ;; +esac AC_PROG_FC(gfortran) -FCFLAGS="$FCFLAGS -Wall" +FCFLAGS="$FCFLAGS -Wall -L../libgfortran" # For libtool versioning info, format is CURRENT:REVISION:AGE libtool_VERSION=1:0:0 @@ -138,27 +169,21 @@ AC_SUBST(libtool_VERSION) # Check header files. AC_STDC_HEADERS AC_HEADER_TIME -AC_CHECK_HEADERS(unistd.h semaphore.h sys/loadavg.h sys/time.h) +ACX_HEADER_STRING +AC_CHECK_HEADERS(unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h) GCC_HEADER_STDINT(gstdint.h) # Check to see if -pthread or -lpthread is needed. Prefer the former. # In case the pthread.h system header is not found, this test will fail. XPCFLAGS="" - -# Darwin doesn't need the -pthread option since threads are in libSystem +CFLAGS="$CFLAGS -pthread" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [#include void *g(void *d) { return NULL; }], [pthread_t t; pthread_create(&t,NULL,g,NULL);])], - [case $host in - *-darwin*) - ;; - default) - XPCFLAGS=" -Wc,-pthread" - ;; - esac], + [XPCFLAGS=" -Wc,-pthread"], [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -169,7 +194,7 @@ AC_LINK_IFELSE( [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) # Check for functions needed. -AC_CHECK_FUNCS(getloadavg clock_gettime) +AC_CHECK_FUNCS(getloadavg clock_gettime strtoull) # Check for broken semaphore implementation on darwin. # sem_init returns: sem_init error: Function not implemented. @@ -178,50 +203,29 @@ case "$host" in AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, Define if the POSIX Semaphores do not work on your system.) ;; - *-linux*) - case "$enable_linux_futex" in - default) - # If headers don't have gettid/futex syscalls definition, then - # default to no, otherwise there will be compile time failures. - # Otherwise, default to yes. If we don't detect we are - # compiled/linked against NPTL and not cross-compiling, check - # if programs are run by default against NPTL and if not, issue - # a warning. - enable_linux_futex=no - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - int lk;], - [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#ifndef _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif - #include - pthread_t th; void *status;], - [pthread_tryjoin_np (th, &status);])],[enable_linux_futex=yes], - [if test x$cross_compiling = xno; then - if getconf GNU_LIBPTHREAD_VERSION 2>/dev/null \ - | LC_ALL=C grep -i NPTL > /dev/null 2>/dev/null; then - AC_MSG_WARN([The kernel might not support futex or gettid syscalls. -If so, please configure with --disable-linux-futex]) - fi - fi - enable_linux_futex=yes])]) - ;; - yes) - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include - int lk;], - [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],[], - [AC_MSG_ERROR([SYS_gettid and SYS_futex required for --enable-linux-futex])]) - ;; - esac - ;; esac +GCC_LINUX_FUTEX(:) + +# Check for pthread_{,attr_}[sg]etaffinity_np. +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#define _GNU_SOURCE + #include ], + [cpu_set_t cpuset; + pthread_attr_t attr; + pthread_getaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset); + if (CPU_ISSET (0, &cpuset)) + CPU_SET (1, &cpuset); + else + CPU_ZERO (&cpuset); + pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset); + pthread_attr_init (&attr); + pthread_attr_getaffinity_np (&attr, sizeof (cpu_set_t), &cpuset); + pthread_attr_setaffinity_np (&attr, sizeof (cpu_set_t), &cpuset);])], + AC_DEFINE(HAVE_PTHREAD_AFFINITY_NP, 1, +[ Define if pthread_{,attr_}{g,s}etaffinity_np is supported.])) + # At least for glibc, clock_gettime is in librt. But don't pull that # in if it still doesn't give us the function we want. if test $ac_cv_func_clock_gettime = no; then @@ -234,12 +238,17 @@ fi # See if we support thread-local storage. GCC_CHECK_TLS -# See what sort of export controls are availible. +# See what sort of export controls are available. LIBGOMP_CHECK_ATTRIBUTE_VISIBILITY LIBGOMP_CHECK_ATTRIBUTE_DLLEXPORT LIBGOMP_CHECK_ATTRIBUTE_ALIAS LIBGOMP_ENABLE_SYMVERS +if test $enable_symvers = gnu; then + AC_DEFINE(LIBGOMP_GNU_SYMBOL_VERSIONING, 1, + [Define to 1 if GNU symbol versioning is used for libgomp.]) +fi + # Get target configury. . ${srcdir}/configure.tgt CFLAGS="$save_CFLAGS $XCFLAGS" @@ -265,7 +274,7 @@ else fi # Set up the set of libraries that we need to link against for libgomp. -# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp, +# Note that the GOMP_SELF_SPEC in gcc.c may force -pthread, # which will force linkage against -lpthread (or equivalent for the system). # That's not 100% ideal, but about the best we can do easily. if test $enable_shared = yes; then @@ -284,7 +293,7 @@ AM_CONDITIONAL([USE_FORTRAN], [test "$ac_cv_fc_compiler_gnu" = yes]) save_CFLAGS="$CFLAGS" for i in $config_path; do if test -f $srcdir/config/$i/omp-lock.h; then - CFLAGS="$CFLAGS -include $srcdir/config/$i/omp-lock.h" + CFLAGS="$CFLAGS -include confdefs.h -include $srcdir/config/$i/omp-lock.h" break fi done @@ -294,6 +303,11 @@ _AC_COMPUTE_INT([sizeof (omp_lock_t)], [OMP_LOCK_SIZE],, _AC_COMPUTE_INT([__alignof (omp_lock_t)], [OMP_LOCK_ALIGN]) _AC_COMPUTE_INT([sizeof (omp_nest_lock_t)], [OMP_NEST_LOCK_SIZE]) _AC_COMPUTE_INT([__alignof (omp_nest_lock_t)], [OMP_NEST_LOCK_ALIGN]) +_AC_COMPUTE_INT([sizeof (omp_lock_25_t)], [OMP_LOCK_25_SIZE],, + [AC_MSG_ERROR([unsupported system, cannot find sizeof (omp_lock_25_t)])]) +_AC_COMPUTE_INT([__alignof (omp_lock_25_t)], [OMP_LOCK_25_ALIGN]) +_AC_COMPUTE_INT([sizeof (omp_nest_lock_25_t)], [OMP_NEST_LOCK_25_SIZE]) +_AC_COMPUTE_INT([__alignof (omp_nest_lock_25_t)], [OMP_NEST_LOCK_25_ALIGN]) # If the lock fits in an integer, then arrange for Fortran to use that # integer. If it doesn't, then arrange for Fortran to use a pointer. @@ -308,6 +322,14 @@ fi if test $OMP_NEST_LOCK_SIZE -gt 8 || test $OMP_NEST_LOCK_ALIGN -gt $OMP_NEST_LOCK_SIZE; then OMP_NEST_LOCK_KIND=8 fi +OMP_LOCK_25_KIND=$OMP_LOCK_25_SIZE +OMP_NEST_LOCK_25_KIND=$OMP_NEST_LOCK_25_SIZE +if test $OMP_LOCK_25_SIZE -gt 8 || test $OMP_LOCK_25_ALIGN -gt $OMP_LOCK_25_SIZE; then + OMP_LOCK_25_KIND=8 +fi +if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then + OMP_NEST_LOCK_25_KIND=8 +fi AC_SUBST(OMP_LOCK_SIZE) AC_SUBST(OMP_LOCK_ALIGN) @@ -315,6 +337,12 @@ AC_SUBST(OMP_NEST_LOCK_SIZE) AC_SUBST(OMP_NEST_LOCK_ALIGN) AC_SUBST(OMP_LOCK_KIND) AC_SUBST(OMP_NEST_LOCK_KIND) +AC_SUBST(OMP_LOCK_25_SIZE) +AC_SUBST(OMP_LOCK_25_ALIGN) +AC_SUBST(OMP_NEST_LOCK_25_SIZE) +AC_SUBST(OMP_NEST_LOCK_25_ALIGN) +AC_SUBST(OMP_LOCK_25_KIND) +AC_SUBST(OMP_NEST_LOCK_25_KIND) CFLAGS="$save_CFLAGS" AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)