1
1
openmpi/opal/mca/common/ofacm/Makefile.am
Jeff Squyres 9334abc474 Makefile: fix problems with static linking
Avoid a problem with double-derefence of a variable macro name (i.e.,
a macro with part of its name from an AC_SUBST, such as
```$(foo@BAR@baz)```.

In what might be a bug in Automake 1.14.1, if you do a pattern like
this:

```makefile
lib_LTLIBRARIES = lib@A_PREFIX@a_lib.la
noinst_LTLIBRARIES = lib@A_PREFIX@a_noinst.la

lib@A_PREFIX@a_lib_la_SOURCES = a.c

lib@A_PREFIX@a_noinst_la_SOURCES = $(lib@A_PREFIX@a_lib_la_SOURCES)
```

Then in the resulting Makefile, the value of
```$(lib@A_PREFIX@a_lib_la_OBJECTS)``` will be *blank* (when it really
should be ```a.o```).

To workaround this potential bug, I've simply avoided doing
double-derefences like this, and effectively set the second
```_SOURCES``` line equal to ```a.c``` (just like the first
```_SOURCES``` line).

Fixes #250.
2014-10-24 16:27:54 -07:00

84 строки
2.2 KiB
Makefile

#
# Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
# Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AM_CPPFLAGS = $(common_ofacm_CPPFLAGS)
dist_opaldata_DATA = \
help-mpi-common-ofacm-base.txt \
help-mpi-common-ofacm-oob.txt
headers = \
base.h \
common_ofacm_oob.h \
common_ofacm_empty.h \
connect.h
sources = \
common_ofacm_base.c \
common_ofacm_oob.c \
common_ofacm_empty.c
# If we have XRC support, build XOOB connection module
if MCA_common_ofacm_have_xrc
sources += \
common_ofacm_xoob.c \
common_ofacm_xoob.h
endif
# See opal/mca/common/sm/Makefile.am for an explanation of the
# LTLIBRARIES values listed below.
lib_LTLIBRARIES =
noinst_LTLIBRARIES =
comp_inst = lib@OPAL_LIB_PREFIX@mca_common_ofacm.la
comp_noinst = lib@OPAL_LIB_PREFIX@mca_common_ofacm_noinst.la
if MCA_BUILD_opal_common_ofacm_DSO
lib_LTLIBRARIES += $(comp_inst)
else
noinst_LTLIBRARIES += $(comp_noinst)
endif
lib@OPAL_LIB_PREFIX@mca_common_ofacm_la_SOURCES = $(headers) $(sources)
lib@OPAL_LIB_PREFIX@mca_common_ofacm_la_CPPFLAGS = $(common_ofacm_CPPFLAGS)
lib@OPAL_LIB_PREFIX@mca_common_ofacm_la_LDFLAGS = \
-version-info $(libmca_common_ofacm_so_version) \
$(common_ofacm_LDFLAGS)
lib@OPAL_LIB_PREFIX@mca_common_ofacm_la_LIBADD = $(common_ofacm_LIBS)
lib@OPAL_LIB_PREFIX@mca_common_ofacm_noinst_la_SOURCES = $(headers) $(sources)
# Conditionally install the header files
if WANT_INSTALL_HEADERS
opaldir = $(opalincludedir)/opal/mca/common/ofacm
opal_HEADERS = $(headers)
else
opaldir = $(includedir)
endif
# See opal/mca/common/sm/Makefile.am for an explanation of the
# the *-local rules, below.
V=0
OMPI_V_LN_SCOMP = $(ompi__v_LN_SCOMP_$V)
ompi__v_LN_SCOMP_ = $(ompi__v_LN_SCOMP_$AM_DEFAULT_VERBOSITY)
ompi__v_LN_SCOMP_0 = @echo " LN_S " `basename $(comp_inst)`;
all-local:
$(OMPI_V_LN_SCOMP) if test -z "$(lib_LTLIBRARIES)"; then \
rm -f "$(comp_inst)"; \
$(LN_S) "$(comp_noinst)" "$(comp_inst)"; \
fi
clean-local:
if test -z "$(lib_LTLIBRARIES)"; then \
rm -f "$(comp_inst)"; \
fi