aboutsummaryrefslogtreecommitdiff
path: root/libgomp/configure.ac
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2006-01-25 19:17:57 +0000
committerRichard Henderson <rth@gcc.gnu.org>2006-01-25 11:17:57 -0800
commit03b8fe495d716c004f5491eb2347537f115ab2d8 (patch)
tree3ed40bb4cdbf2ad9a5a53d51d9e40585078f01cf /libgomp/configure.ac
parentb8795eddf5bebda36a22098be7b7810a7f6f2185 (diff)
downloadgcc-03b8fe495d716c004f5491eb2347537f115ab2d8.zip
gcc-03b8fe495d716c004f5491eb2347537f115ab2d8.tar.gz
gcc-03b8fe495d716c004f5491eb2347537f115ab2d8.tar.bz2
re PR libgomp/25884 (libgomp should not require perl to compile)
PR libgomp/25884 * Makefile.am (omp.h, omp_lib.h, omp_lib.f90, libgomp_f.h): Remove. * configure.ac (PERL): Don't set. (gstdint.h, omp.h, omp_lib.h, omp_lib.f90, libgomp_f.h): Create here. (OMP_LOCK_SIZE, OMP_LOCK_ALIGN, OMP_LOCK_KIND, OMP_NEST_LOCK_SIZE, OMP_NEST_LOCK_ALIGN, OMP_NEST_LOCK_KIND): New substitutions. * omp.h.in: Wrap the new configure substitutions with @ characters. * omp_lib.h.in, omp_lib.f90.in, libgomp_f.h.in: Likewise. * aclocal.m4, configure, Makefile.in: Regenerate. * mkomp_h.pl: Delete. From-SVN: r110220
Diffstat (limited to 'libgomp/configure.ac')
-rw-r--r--libgomp/configure.ac41
1 files changed, 41 insertions, 0 deletions
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index 5bdd37d..2ae6def 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -220,5 +220,46 @@ AC_SUBST(link_gomp)
AM_CONDITIONAL([USE_FORTRAN], [test "$ac_cv_fc_compiler_gnu" = yes])
+# ??? 2006-01-24: Paulo committed to asking autoconf folk to document
+# and export AC_COMPUTE_INT. If that happens, then we'll need to remove
+# the underscore here and update the PREREQ. If it doesn't, then we'll
+# need to copy this macro to our acinclude.m4.
+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"
+ break
+ fi
+done
+
+_AC_COMPUTE_INT([sizeof (omp_lock_t)], [OMP_LOCK_SIZE],,
+ [AC_MSG_ERROR([unsupported system, cannot find sizeof (omp_lock_t)])])
+_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])
+
+# 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.
+# Except that we don't have a way at present to multi-lib the installed
+# Fortran modules, so we assume 8 bytes for pointers, regardless of the
+# actual target.
+OMP_LOCK_KIND=$OMP_LOCK_SIZE
+OMP_NEST_LOCK_KIND=$OMP_NEST_LOCK_SIZE
+if test $OMP_LOCK_SIZE -gt 8 || test $OMP_LOCK_ALIGN -gt $OMP_LOCK_SIZE; then
+ OMP_LOCK_KIND=8
+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
+
+AC_SUBST(OMP_LOCK_SIZE)
+AC_SUBST(OMP_LOCK_ALIGN)
+AC_SUBST(OMP_NEST_LOCK_SIZE)
+AC_SUBST(OMP_NEST_LOCK_ALIGN)
+AC_SUBST(OMP_LOCK_KIND)
+AC_SUBST(OMP_NEST_LOCK_KIND)
+CFLAGS="$save_CFLAGS"
+
+AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
AC_OUTPUT