summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2002-05-15 12:53:02 +0000
committerWerner Koch <wk@gnupg.org>2002-05-15 12:53:02 +0000
commita78ef7703ad978a96a5491716c47a427e55229f8 (patch)
tree1840b27711569bfccc881fb197aac56aa1a7f49d
parent2fbb4f3255e3e3d9318a231b607f746bfc5f9db1 (diff)
downloadlibgcrypt-a78ef7703ad978a96a5491716c47a427e55229f8.tar.gz
* config.links: Chnage the way the mpi modules are determined.
* Makefile.am: Revamped to better handle modules * configure.ac: Adjusted for new MPI module stuff.
-rw-r--r--COPYING6
-rw-r--r--ChangeLog4
-rw-r--r--INSTALL127
-rw-r--r--configure.ac88
-rw-r--r--mpi/ChangeLog5
-rw-r--r--mpi/Makefile.am176
-rw-r--r--mpi/config.links40
7 files changed, 320 insertions, 126 deletions
diff --git a/COPYING b/COPYING
index 60549be5..d60c31a9 100644
--- a/COPYING
+++ b/COPYING
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
+ Copyright (C) <year> <name of author>
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
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
diff --git a/ChangeLog b/ChangeLog
index 630fc0af..c55f39e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-05-15 Werner Koch <wk@gnupg.org>
+
+ * configure.ac: Adjusted for new MPI module stuff.
+
2002-05-14 Werner Koch <wk@gnupg.org>
Changed license to the LGPL.
diff --git a/INSTALL b/INSTALL
index b42a17ac..62ea076c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,3 +1,9 @@
+Copyright 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation,
+Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
Basic Installation
==================
@@ -8,20 +14,27 @@ various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
The simplest way to compile this package is:
@@ -55,14 +68,15 @@ Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for variables by setting
+them in the environment. You can do that on the command line like this:
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
@@ -75,11 +89,11 @@ directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
Installation Names
==================
@@ -122,22 +136,35 @@ you can use the `configure' options `--x-includes=DIR' and
Specifying the System Type
==========================
- There may be some features `configure' can not figure out
+ There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
+a message saying it cannot guess the host type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
CPU-COMPANY-SYSTEM
-See the file `config.sub' for the possible values of each field. If
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
- If you are building compiler tools for cross-compiling, you can also
+ If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the host
+platform (i.e., that on which the generated programs will eventually be
+run) with `--host=TYPE'. In this case, you should also specify the
+build platform with `--build=TYPE', because, in this case, it may not
+be possible to guess the build platform (it sometimes involves
+compiling and running simple test programs, and this can't be done if
+the compiler is a cross compiler).
Sharing Defaults
================
@@ -150,20 +177,44 @@ default values for variables like `CC', `cache_file', and `prefix'.
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
-Operation Controls
+Defining Variables
==================
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
`configure' recognizes the following options to control how it
operates.
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
-
`--help'
+`-h'
Print a summary of the options to `configure', and exit.
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
`--quiet'
`--silent'
`-q'
@@ -175,8 +226,6 @@ operates.
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
-`configure' also accepts some other, not widely useful, options.
diff --git a/configure.ac b/configure.ac
index 108cf657..3c7c5ba3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,26 +1,26 @@
-dnl Configure.ac script for Libgcrypt
-dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
-dnl
-dnl This file is part of Libgcrypt.
-dnl
-dnl Libgcrypt is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU Lesser general Public License as
-dnl published by the Free Software Foundation; either version 2.1 of
-dnl the License, or (at your option) any later version.
-dnl
-dnl Libgcrypt is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-dnl
-dnl (Process this file with autoconf to produce a configure script.)
+# Configure.ac script for Libgcrypt
+# Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+#
+# This file is part of Libgcrypt.
+#
+# Libgcrypt 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.
+#
+# Libgcrypt 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# (Process this file with autoconf to produce a configure script.)
AC_REVISION($Revision$)dnl
-AC_PREREQ(2.52)
+AC_PREREQ(2.53)
# Version numbers (Remember to change them just before a release)
# (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
# (Interfaces added: CURRENT++, AGE++, REVISION=0)
@@ -676,7 +676,7 @@ AC_MSG_CHECKING(for mpi assembler functions)
if test -f $srcdir/mpi/config.links ; then
. $srcdir/mpi/config.links
AC_CONFIG_LINKS("$mpi_ln_list")
- ac_cv_mpi_extra_asm_modules="$mpi_extra_modules"
+ ac_cv_mpi_mod_list="$mpi_mod_list"
ac_cv_mpi_sflags="$mpi_sflags"
ac_cv_mpi_config_done="yes"
AC_MSG_RESULT(done)
@@ -684,18 +684,44 @@ else
AC_MSG_RESULT(failed)
AC_MSG_ERROR([mpi/config.links missing!])
fi
-MPI_EXTRA_ASM_OBJS=""
-show_extraasm=""
-if test "$ac_cv_mpi_extra_asm_modules" != ""; then
-for i in $ac_cv_mpi_extra_asm_modules; do
- show_extraasm="$show_extraasm $i"
- MPI_EXTRA_ASM_OBJS="$MPI_EXTRA_ASM_OBJS $i.lo"
-done
+MPI_MOD_LIST_LO=""
+MPI_MOD_LIST_O=""
+if test "$ac_cv_mpi_mod_list" != ""; then
+ for i in $ac_cv_mpi_mod_list; do
+ MPI_MOD_LIST_LO="$MPI_MOD_LIST_LO $i.lo"
+ MPI_MOD_LIST_O="$MPI_MOD_LIST_O $i.o"
+ done
fi
-AC_SUBST(MPI_EXTRA_ASM_OBJS)
+AC_SUBST(MPI_MOD_LIST_LO)
+AC_SUBST(MPI_MOD_LIST_O)
MPI_SFLAGS="$ac_cv_mpi_sflags"
AC_SUBST(MPI_SFLAGS)
+# [not used anymore]
+## Set the condtionals for the assembler modules
+## Fixme: We should put this into acinclude and write a script
+## which can be run to update this list and the mpi/Makefile
+#AM_CONDITIONAL(MPI_MOD_ASM_MPIH_ADD1, test "$mpi_mod_asm_mpih_add1" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_MPIH_SUB1, test "$mpi_mod_asm_mpih_sub1" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL1, test "$mpi_mod_asm_mpih_mul1" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL2, test "$mpi_mod_asm_mpih_mul2" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL3, test "$mpi_mod_asm_mpih_mul3" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_MPIH_LSHIFT, test "$mpi_mod_asm_mpih_lshift" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_MPIH_RSHIFT, test "$mpi_mod_asm_mpih_rshift" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_UDIV, test "$mpi_mod_asm_udiv" = yes )
+#AM_CONDITIONAL(MPI_MOD_ASM_UDIV_QRNND, test "$mpi_mod_asm_udiv_qrnnd" = yes )
+## And the corresponding conditionals for C
+#AM_CONDITIONAL(MPI_MOD_C_MPIH_ADD1, test "$mpi_mod_c_mpih_add1" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_MPIH_SUB1, test "$mpi_mod_c_mpih_sub1" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL1, test "$mpi_mod_c_mpih_mul1" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL2, test "$mpi_mod_c_mpih_mul2" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL3, test "$mpi_mod_c_mpih_mul3" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_MPIH_LSHIFT, test "$mpi_mod_c_mpih_lshift" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_MPIH_RSHIFT, test "$mpi_mod_c_mpih_rshift" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_UDIV, test "$mpi_mod_c_udiv" = yes )
+#AM_CONDITIONAL(MPI_MOD_C_UDIV_QRNND, test "$mpi_mod_c_udiv_qrnnd" = yes )
+#
+
# Allow users to append something to the version string without
# flagging it as development version. The user version part is
@@ -792,5 +818,3 @@ if test -n "$warn"; then
echo "included. These parts are licensed under the GPL and thus the"
echo "use of this library has to comply with the conditions of the GPL"
fi
-
-
diff --git a/mpi/ChangeLog b/mpi/ChangeLog
index acac69a9..828f701a 100644
--- a/mpi/ChangeLog
+++ b/mpi/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-15 Werner Koch <wk@gnupg.org>
+
+ * config.links: Chnage the way the mpi modules are determined.
+ * Makefile.am: Revamped to better handle modules
+
2002-05-14 Werner Koch <wk@gnupg.org>
Changed license of all files to the LGPL.
diff --git a/mpi/Makefile.am b/mpi/Makefile.am
index b1f31131..36ee2f66 100644
--- a/mpi/Makefile.am
+++ b/mpi/Makefile.am
@@ -17,18 +17,136 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+# 1.5 leads to a combinatorial explosion due to all the conditionals
+# I was not able to build it with 64Megs - 1.6 fixes this.
+AUTOMAKE_OPTIONS = 1.6
+
INCLUDES = -I$(top_srcdir)/src
CFLAGS = @CFLAGS@ @MPI_OPT_FLAGS@
ASFLAGS = @MPI_SFLAGS@
+# We don't have .S sources listed, so automake does not autocreate these
+CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
+LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
+
+
EXTRA_DIST = config.links
DISTCLEANFILES = mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S \
mpih-lshift.S mpih-rshift.S mpih-sub1.S asm-syntax.h sysdep.h
# Note: we only use .S files so we should delete all left over .s
-# CLEANFILES = _*.s
-CLEANFILES = *.s
+CLEANFILES = _*.s
+
+# Beware: The following list is not a comment but grepped by
+# config.links to get the list of symlinked modules
+# Optional modules are marked with a 0 in the second column.
+#BEGIN_ASM_LIST
+# mpih-add1 C
+# mpih-sub1 C
+# mpih-mul1 C
+# mpih-mul2 C
+# mpih-mul3 C
+# mpih-lshift C
+# mpih-rshift C
+# udiv O
+# udiv-qrnnd O
+#END_ASM_LIST
+
+# Note: This function has not yet been implemented. There is only a dummy in
+# generic/
+# udiv-w-sdiv O
-#OMIT_DEPENDENCIES = types.h gcrypt.h
+# And we need to have conditionals for all modules because
+# we don't know whether they are .c or .S. Very ugly; I know.
+# Remember to define them all in configure.ac
+# if MPI_MOD_ASM_MPIH_ADD1
+# mpih_add1 = mpih-add1.S
+# else
+# if MPI_MOD_C_MPIH_ADD1
+# mpih_add1 = mpih-add1.c
+# else
+# mpih_add1 =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_MPIH_SUB1
+# mpih_sub1 = mpih-sub1.S
+# else
+# if MPI_MOD_C_MPIH_SUB1
+# mpih_sub1 = mpih-sub1.c
+# else
+# mpih_sub1 =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_MPIH_MUL1
+# mpih_mul1 = mpih-mul1.S
+# else
+# if MPI_MOD_C_MPIH_MUL1
+# mpih_mul1 = mpih-mul1.c
+# else
+# mpih_mul1 =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_MPIH_MUL2
+# mpih_mul2 = mpih-mul2.S
+# else
+# if MPI_MOD_C_MPIH_MUL2
+# mpih_mul2 = mpih-mul2.c
+# else
+# mpih_mul2 =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_MPIH_MUL3
+# mpih_mul3 = mpih-mul3.S
+# else
+# if MPI_MOD_C_MPIH_MUL3
+# mpih_mul3 = mpih-mul3.c
+# else
+# mpih_mul3 =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_MPIH_LSHIFT
+# mpih_lshift = mpih-lshift.S
+# else
+# if MPI_MOD_C_MPIH_LSHIFT
+# mpih_lshift = mpih-lshift.c
+# else
+# mpih_lshift =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_MPIH_RSHIFT
+# mpih_rshift = mpih-rshift.S
+# else
+# if MPI_MOD_C_MPIH_RSHIFT
+# mpih_rshift = mpih-rshift.c
+# else
+# mpih_rshift =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_UDIV
+# udiv = udiv.S
+# else
+# if MPI_MOD_C_UDIV
+# udiv = udiv.c
+# else
+# udiv =
+# endif
+# endif
+#
+# if MPI_MOD_ASM_UDIV_QRNND
+# udiv_qrnnd = udiv-qrnnd.S
+# else
+# if MPI_MOD_C_UDIV_QRNND
+# udiv_qrnnd = udiv-qrnnd.c
+# else
+# udiv_qrnnd =
+# endif
+# endif
noinst_LTLIBRARIES = libmpi.la
@@ -50,46 +168,18 @@ libmpi_la_SOURCES = longlong.h \
mpicoder.c \
mpih-div.c \
mpih-mul.c \
- mpiutil.c
+ mpiutil.c
-EXTRA_libmpi_la_SOURCES = \
- mpih-mul1.S \
- mpih-mul2.S \
- mpih-mul3.S \
- mpih-add1.S \
- mpih-sub1.S \
- mpih-lshift.S \
- mpih-rshift.S \
- udiv-qrnnd.S \
- udiv-w-sdiv.c \
- udiv.S
-
-
-# Note this objects are actually links, the sourcefiles are
-# distributed by special code in dist-hook
-common_asm_objects = \
- mpih-mul1.lo \
- mpih-mul2.lo \
- mpih-mul3.lo \
- mpih-add1.lo \
- mpih-sub1.lo \
- mpih-lshift.lo \
- mpih-rshift.lo
-
-libmpi_la_DEPENDENCIES = $(common_asm_objects) @MPI_EXTRA_ASM_OBJS@
-libmpi_la_LIBADD = $(common_asm_objects) @MPI_EXTRA_ASM_OBJS@
-
-# cancel the default rules used by libtool which do not really
-# work and add one to cpp .S files
-#.S.o:
-#
-#.S.lo:
+libmpi_la_LIBADD = @MPI_MOD_LIST_LO@
+libmpi_la_DEPENDENCIES = @MPI_MOD_LIST_LO@
-.S.s:
- $(CPP) $(INCLUDES) $(DEFS) $< | grep -v '^#' >$*.s
+# we need our own rules here to preprocess the .S files
+.S.o:
+ $(CPP) $(INCLUDES) $(DEFS) `test -f '$<' || echo '$(srcdir)/'`$< | grep -v '^#' > _$*.s
+ $(CCASCOMPILE) -c _$*.s
+ mv -f _$*.o $@
-# Hmmm, we should use this, so that OSes which do not distinguish
-# filename case still work. We have to see how libtool can handle this
-# $(CPP) $(INCLUDES) $(DEFS) $< | grep -v '^#' > _$*.s
-# $(COMPILE) -c _$*.s
-# mv -f _$*.o $*.o
+.S.lo:
+ $(CPP) $(INCLUDES) $(DEFS) `test -f '$<' || echo '$(srcdir)/'`$< | grep -v '^#' > _$*.s
+ $(LTCCASCOMPILE) -c _$*.s
+ mv -f _$*.lo $@
diff --git a/mpi/config.links b/mpi/config.links
index 1d8062ab..7a229cb0 100644
--- a/mpi/config.links
+++ b/mpi/config.links
@@ -22,11 +22,19 @@
# Note: this is called from the above directory.
-mpi_extra_modules=
mpi_sflags=
+mpi_extra_modules=
test -d ./mpi || mkdir ./mpi
+# We grep the list of modules from the Makefile so that
+# we don't need to maintain them here.
+mpi_standard_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ {
+ if( $3 != "O" ) print $2 }' $srcdir/mpi/Makefile.am`
+mpi_optional_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ {
+ if( $3 == "O" ) print $2 }' $srcdir/mpi/Makefile.am`
+
+
echo '/* created by config.links - do not edit */' >./mpi/asm-syntax.h
if test "$try_asm_modules" = "yes" ; then
@@ -269,25 +277,38 @@ EOF
fi
-# fixme: grep these modules from Makefile.in
-mpi_ln_modules="${mpi_extra_modules} mpih-add1 mpih-mul1 mpih-mul2 mpih-mul3 \
- mpih-lshift mpih-rshift mpih-sub1"
-
-mpi_ln_objects=
-mpi_ln_list=
+# Figure the required modules out
+mpi_required_modules=$mpi_standard_modules
+if test $mpi_extra_modules != ""; then
+ for fn in $mpi_extra_modules; do
+ for i in $mpi_optional_modules; do
+ if test "$fn" = "$i" ; then
+ mpi_required_modules="$mpi_required_modules $fn"
+ fi
+ done
+ done
+fi
# try to get file to link from the assembler subdirectory and
# if this fails get it from the generic subdirectory.
+mpi_ln_list=
+mpi_mod_list=
path="$path generic"
-for fn in $mpi_ln_modules ; do
- mpi_ln_objects="$mpi_ln_objects $fn.o"
+for fn in $mpi_required_modules ; do
+ fnu=`echo $fn | sed 's/-/_/g'`
+ eval mpi_mod_c_${fnu}=no
+ eval mpi_mod_asm_${fnu}=no
for dir in $path ; do
rm -f $srcdir/mpi/$fn.[Sc]
if test -f $srcdir/mpi/$dir/$fn.S ; then
mpi_ln_list="$mpi_ln_list mpi/$fn.S:mpi/$dir/$fn.S"
+ eval mpi_mod_asm_${fnu}=yes
+ mpi_mod_list="$mpi_mod_list $fn"
break;
elif test -f $srcdir/mpi/$dir/$fn.c ; then
mpi_ln_list="$mpi_ln_list mpi/$fn.c:mpi/$dir/$fn.c"
+ eval mpi_mod_c_${fnu}=yes
+ mpi_mod_list="$mpi_mod_list $fn"
break;
fi
done
@@ -302,3 +323,4 @@ for dir in $path ; do
break;
fi
done
+