dc7d30b0ed
variable was set, it was prefixed to ''all'' values in the wrapper compiler data text files. For example, if OPAL_DESTDIR was set to /tmp/bogus and a wrapper compiler data file contained the line: preprocessor_flags=-pthread The value would be exanded to: /tmp/bogus/-pthread Which is clearly wrong. After some back-and-forth with Ralph and Brian, Brian submitted this patch that fixes the problem. Now we handle three cases properly (assume that configure was invoked with --prefix=/opt/openmpi and no other directory specifications, and $OPAL_DESTDIR is set to /tmp/buildroot): 1. Individual directories, such as libdir. These need to be prepended with DESTDIR. I.e., return /tmp/buildroot/opt/openmpi/lib. 2. Compiler flags that have ${FIELD} values embedded in them. For example, consider if a wrapper compiler data file contains the line: preprocessor_flags=-DMYFLAG="${prefix}/share/randomthingy/" The value we should return is: -DMYFLAG="/tmp/buildroot/opt/openmpi/share/randomthingy/" 3. Compiler flags that do not have any ${FIELD} values. For example, consider if a wrapper compiler data file contains the line: preprocessor_flags=-pthread The value we should return is: -pthread Note, too, that this OPAL_DESTDIR futzing only needs to occur during opal_init(). By the time opal_init() has completed, all values should be substituted in that need substituting. Hence, we take an extra parameter (is_setup) to know whether we should do this futzing or not. This commit was SVN r23402.
44 строки
1.1 KiB
C
44 строки
1.1 KiB
C
/*
|
|
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
|
* reserved.
|
|
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*
|
|
*/
|
|
|
|
#ifndef OPAL_INSTALLDIRS_BASE_H
|
|
#define OPAL_INSTALLDIRS_BASE_H
|
|
|
|
#include "opal_config.h"
|
|
|
|
#include "opal/mca/installdirs/installdirs.h"
|
|
|
|
/*
|
|
* Global functions for MCA overall installdirs open and close
|
|
*/
|
|
BEGIN_C_DECLS
|
|
|
|
OPAL_DECLSPEC int opal_installdirs_base_open(void);
|
|
OPAL_DECLSPEC int opal_installdirs_base_close(void);
|
|
|
|
/* Just like opal_install_dirs_expand() (see installdirs.h), but will
|
|
also insert the value of the environment variable $OPAL_DESTDIR, if
|
|
it exists/is set. This function should *only* be used during the
|
|
setup routines of installdirs. */
|
|
char * opal_install_dirs_expand_setup(const char* input);
|
|
|
|
|
|
/*
|
|
* Globals
|
|
*/
|
|
OPAL_DECLSPEC extern opal_list_t opal_installdirs_components;
|
|
|
|
END_C_DECLS
|
|
|
|
#endif /* OPAL_BASE_INSTALLDIRS_H */
|