mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 08:20:32 +08:00
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
This commit is contained in:
parent
b8795eddf5
commit
03b8fe495d
@ -1,3 +1,16 @@
|
||||
2005-01-25 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
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.
|
||||
|
||||
2005-01-24 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
PR libgomp/25259
|
||||
|
@ -38,17 +38,6 @@ if USE_FORTRAN
|
||||
nodist_include_HEADERS += omp_lib.mod omp_lib_kinds.mod
|
||||
endif
|
||||
|
||||
omp.h: omp.h.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/omp.h.in omp.h
|
||||
omp_lib.h: omp_lib.h.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/omp_lib.h.in \
|
||||
omp_lib.h
|
||||
omp_lib.f90: omp_lib.f90.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/omp_lib.f90.in \
|
||||
omp_lib.f90
|
||||
libgomp_f.h: libgomp_f.h.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/libgomp_f.h.in \
|
||||
libgomp_f.h
|
||||
omp_lib_kinds.mod: omp_lib.mod
|
||||
:
|
||||
omp_lib.mod: omp_lib.f90
|
||||
|
@ -46,6 +46,8 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/../config.guess \
|
||||
$(srcdir)/../missing $(srcdir)/../mkinstalldirs \
|
||||
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/config.h.in $(srcdir)/libgomp.spec.in \
|
||||
$(srcdir)/libgomp_f.h.in $(srcdir)/omp.h.in \
|
||||
$(srcdir)/omp_lib.f90.in $(srcdir)/omp_lib.h.in \
|
||||
$(top_srcdir)/configure ChangeLog
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
@ -59,7 +61,8 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = libgomp.spec
|
||||
CONFIG_CLEAN_FILES = omp.h omp_lib.h omp_lib.f90 libgomp_f.h \
|
||||
libgomp.spec
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
@ -161,6 +164,12 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
OMP_LOCK_ALIGN = @OMP_LOCK_ALIGN@
|
||||
OMP_LOCK_KIND = @OMP_LOCK_KIND@
|
||||
OMP_LOCK_SIZE = @OMP_LOCK_SIZE@
|
||||
OMP_NEST_LOCK_ALIGN = @OMP_NEST_LOCK_ALIGN@
|
||||
OMP_NEST_LOCK_KIND = @OMP_NEST_LOCK_KIND@
|
||||
OMP_NEST_LOCK_SIZE = @OMP_NEST_LOCK_SIZE@
|
||||
OPT_LDFLAGS = @OPT_LDFLAGS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
@ -308,6 +317,14 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
omp.h: $(top_builddir)/config.status $(srcdir)/omp.h.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
omp_lib.h: $(top_builddir)/config.status $(srcdir)/omp_lib.h.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
omp_lib.f90: $(top_builddir)/config.status $(srcdir)/omp_lib.f90.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
libgomp_f.h: $(top_builddir)/config.status $(srcdir)/libgomp_f.h.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
libgomp.spec: $(top_builddir)/config.status $(srcdir)/libgomp.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
|
||||
@ -839,17 +856,6 @@ uninstall-info: uninstall-info-recursive
|
||||
uninstall-toolexeclibLTLIBRARIES
|
||||
|
||||
|
||||
omp.h: omp.h.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/omp.h.in omp.h
|
||||
omp_lib.h: omp_lib.h.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/omp_lib.h.in \
|
||||
omp_lib.h
|
||||
omp_lib.f90: omp_lib.f90.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/omp_lib.f90.in \
|
||||
omp_lib.f90
|
||||
libgomp_f.h: libgomp_f.h.in mkomp_h.pl
|
||||
$(PERL) -w $(srcdir)/mkomp_h.pl "$(COMPILE)" $(srcdir)/libgomp_f.h.in \
|
||||
libgomp_f.h
|
||||
omp_lib_kinds.mod: omp_lib.mod
|
||||
:
|
||||
omp_lib.mod: omp_lib.f90
|
||||
|
1359
libgomp/configure
vendored
1359
libgomp/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
@ -33,8 +33,8 @@
|
||||
|
||||
#include "libgomp.h"
|
||||
|
||||
#if (OMP_LOCK_SIZE == OMP_LOCK_KIND) \
|
||||
&& (OMP_LOCK_ALIGN <= OMP_LOCK_SIZE)
|
||||
#if (@OMP_LOCK_SIZE@ == @OMP_LOCK_KIND@) \
|
||||
&& (@OMP_LOCK_ALIGN@ <= @OMP_LOCK_SIZE@)
|
||||
# define OMP_LOCK_DIRECT
|
||||
typedef omp_lock_t *omp_lock_arg_t;
|
||||
# define omp_lock_arg(arg) (arg)
|
||||
@ -43,8 +43,8 @@ typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
|
||||
# define omp_lock_arg(arg) ((arg)->lock)
|
||||
# endif
|
||||
|
||||
#if (OMP_NEST_LOCK_SIZE == OMP_NEST_LOCK_KIND) \
|
||||
&& (OMP_NEST_LOCK_ALIGN <= OMP_NEST_LOCK_SIZE)
|
||||
#if (@OMP_NEST_LOCK_SIZE@ == @OMP_NEST_LOCK_KIND@) \
|
||||
&& (@OMP_NEST_LOCK_ALIGN@ <= @OMP_NEST_LOCK_SIZE@)
|
||||
# define OMP_NEST_LOCK_DIRECT
|
||||
typedef omp_nest_lock_t *omp_nest_lock_arg_t;
|
||||
# define omp_nest_lock_arg(arg) (arg)
|
||||
@ -56,12 +56,12 @@ typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
|
||||
static inline void
|
||||
omp_check_defines (void)
|
||||
{
|
||||
char test[(OMP_LOCK_SIZE != sizeof (omp_lock_t)
|
||||
|| OMP_LOCK_ALIGN != __alignof (omp_lock_t)
|
||||
|| OMP_NEST_LOCK_SIZE != sizeof (omp_nest_lock_t)
|
||||
|| OMP_NEST_LOCK_ALIGN != __alignof (omp_nest_lock_t)
|
||||
|| OMP_LOCK_KIND != sizeof (*(omp_lock_arg_t) 0)
|
||||
|| OMP_NEST_LOCK_KIND != sizeof (*(omp_nest_lock_arg_t) 0))
|
||||
char test[(@OMP_LOCK_SIZE@ != sizeof (omp_lock_t)
|
||||
|| @OMP_LOCK_ALIGN@ != __alignof (omp_lock_t)
|
||||
|| @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t)
|
||||
|| @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t)
|
||||
|| @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0)
|
||||
|| @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0))
|
||||
? -1 : 1] __attribute__ ((__unused__));
|
||||
}
|
||||
|
||||
|
@ -1,122 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
# Contributed by Richard Henderson <rth@redhat.com>.
|
||||
#
|
||||
# This file is part of the GNU OpenMP Library (libgomp).
|
||||
#
|
||||
# Libgomp is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Libgomp 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 Lesser General Public License for
|
||||
# more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with libgomp; see the file COPYING.LIB. If not, write to the
|
||||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
# MA 02110-1301, USA.
|
||||
#
|
||||
# As a special exception, if you link this library with other files, some
|
||||
# of which are compiled with GCC, to produce an executable, this library
|
||||
# does not by itself cause the resulting executable to be covered by the
|
||||
# GNU General Public License. This exception does not however invalidate
|
||||
# any other reasons why the executable file might be covered by the GNU
|
||||
# General Public License.
|
||||
|
||||
# This file fills in the blanks for omp.h.in, computing the size and
|
||||
# alignment of the lock types that we export. We do this to avoid
|
||||
# polluting the namespace with e.g. pthreads declarations.
|
||||
|
||||
$COMPILE = $ARGV[0];
|
||||
$INFILE = $ARGV[1];
|
||||
$OUTFILE = $ARGV[2];
|
||||
|
||||
$HEADER = "#include \"omp-lock.h\"\n";
|
||||
|
||||
# configure might put libtool specific options into $COMPILE.
|
||||
$COMPILE =~ s/ -Wc,/ /g;
|
||||
|
||||
# Close stderr in order to discard compiler errors. Which we expect apleanty.
|
||||
close STDERR;
|
||||
|
||||
# Return true if the boolean expression evaluates true at compile-time.
|
||||
sub compile_test {
|
||||
my $expr = shift;
|
||||
|
||||
open GCC, "|$COMPILE -fsyntax-only -xc -";
|
||||
print GCC $HEADER;
|
||||
print GCC "char test[($expr) ? 1 : -1];\n";
|
||||
return close GCC;
|
||||
}
|
||||
|
||||
# Return a number guaranteed to be larger than the integer epression.
|
||||
sub upper_bound {
|
||||
use integer;
|
||||
my $expr = shift;
|
||||
my $max = 9;
|
||||
|
||||
while (compile_test("($expr) >= $max")) {
|
||||
$max = $max * 2;
|
||||
}
|
||||
|
||||
return $max;
|
||||
}
|
||||
|
||||
# Return an exact number for the integer expression.
|
||||
sub binary_search {
|
||||
use integer;
|
||||
my $expr = shift;
|
||||
my $low = 1;
|
||||
my $high = upper_bound($expr);
|
||||
|
||||
while ($low < $high) {
|
||||
my $mid = ($high + $low + 1) / 2;
|
||||
if (compile_test("($expr) >= $mid")) {
|
||||
$low = $mid;
|
||||
} else {
|
||||
$high = $mid - 1;
|
||||
}
|
||||
}
|
||||
|
||||
return $low;
|
||||
}
|
||||
|
||||
# Apply OP to TYPE, where OP is either sizeof or __alignof.
|
||||
sub resolve {
|
||||
my $op = shift;
|
||||
my $type = shift;
|
||||
|
||||
return binary_search("$op($type)");
|
||||
}
|
||||
|
||||
# Find all the constants we need.
|
||||
$sizeof_omp_lock_t = resolve ("sizeof", "omp_lock_t");
|
||||
$alignof_omp_lock_t = resolve ("__alignof", "omp_lock_t");
|
||||
$sizeof_omp_nest_lock_t = resolve ("sizeof", "omp_nest_lock_t");
|
||||
$alignof_omp_nest_lock_t = resolve ("__alignof", "omp_nest_lock_t");
|
||||
$omp_lock_kind = $sizeof_omp_lock_t;
|
||||
$omp_nest_lock_kind = $sizeof_omp_nest_lock_t;
|
||||
if ($sizeof_omp_lock_t >= 8 || $alignof_omp_lock_t > $sizeof_omp_lock_t) {
|
||||
$omp_lock_kind = 8;
|
||||
}
|
||||
if ($sizeof_omp_nest_lock_t >= 8 || $alignof_omp_nest_lock_t > $sizeof_omp_nest_lock_t) {
|
||||
$omp_nest_lock_kind = 8;
|
||||
}
|
||||
|
||||
# Edit the input template into the output.
|
||||
open IN, "<", $INFILE;
|
||||
open OUT, ">", $OUTFILE;
|
||||
while (<IN>) {
|
||||
s/OMP_LOCK_SIZE/$sizeof_omp_lock_t/o;
|
||||
s/OMP_LOCK_ALIGN/$alignof_omp_lock_t/o;
|
||||
s/OMP_NEST_LOCK_SIZE/$sizeof_omp_nest_lock_t/o;
|
||||
s/OMP_NEST_LOCK_ALIGN/$alignof_omp_nest_lock_t/o;
|
||||
s/OMP_LOCK_KIND/$omp_lock_kind/o;
|
||||
s/OMP_NEST_LOCK_KIND/$omp_nest_lock_kind/o;
|
||||
print OUT;
|
||||
}
|
||||
|
||||
close OUT;
|
@ -36,12 +36,14 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char _x[OMP_LOCK_SIZE] __attribute__((__aligned__(OMP_LOCK_ALIGN)));
|
||||
unsigned char _x[@OMP_LOCK_SIZE@]
|
||||
__attribute__((__aligned__(@OMP_LOCK_ALIGN@)));
|
||||
} omp_lock_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char _x[OMP_NEST_LOCK_SIZE] __attribute__((__aligned__(OMP_NEST_LOCK_ALIGN)));
|
||||
unsigned char _x[@OMP_NEST_LOCK_SIZE@]
|
||||
__attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
|
||||
} omp_nest_lock_t;
|
||||
#endif
|
||||
|
||||
|
@ -28,8 +28,8 @@
|
||||
module omp_lib_kinds
|
||||
integer, parameter :: omp_integer_kind = 4
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_lock_kind = OMP_LOCK_KIND
|
||||
integer, parameter :: omp_nest_lock_kind = OMP_NEST_LOCK_KIND
|
||||
integer, parameter :: omp_lock_kind = @OMP_LOCK_KIND@
|
||||
integer, parameter :: omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@
|
||||
end module
|
||||
|
||||
module omp_lib
|
||||
|
@ -26,8 +26,8 @@
|
||||
! General Public License.
|
||||
|
||||
integer omp_lock_kind, omp_nest_lock_kind, openmp_version
|
||||
parameter (omp_lock_kind = OMP_LOCK_KIND)
|
||||
parameter (omp_nest_lock_kind = OMP_NEST_LOCK_KIND)
|
||||
parameter (omp_lock_kind = @OMP_LOCK_KIND@)
|
||||
parameter (omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@)
|
||||
parameter (openmp_version = 200505)
|
||||
|
||||
external omp_init_lock, omp_init_nest_lock
|
||||
|
@ -94,6 +94,12 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
OMP_LOCK_ALIGN = @OMP_LOCK_ALIGN@
|
||||
OMP_LOCK_KIND = @OMP_LOCK_KIND@
|
||||
OMP_LOCK_SIZE = @OMP_LOCK_SIZE@
|
||||
OMP_NEST_LOCK_ALIGN = @OMP_NEST_LOCK_ALIGN@
|
||||
OMP_NEST_LOCK_KIND = @OMP_NEST_LOCK_KIND@
|
||||
OMP_NEST_LOCK_SIZE = @OMP_NEST_LOCK_SIZE@
|
||||
OPT_LDFLAGS = @OPT_LDFLAGS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
Loading…
x
Reference in New Issue
Block a user