2007-04-21 04:15:05 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
We (Ralph and Jeff) discovered that if the OPAL_DESTDIR environment
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.
2010-07-14 04:53:08 +04:00
|
|
|
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
|
|
|
|
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
2007-04-21 04:15:05 +04:00
|
|
|
* $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
|
|
|
|
*/
|
2009-08-20 15:42:18 +04:00
|
|
|
BEGIN_C_DECLS
|
2007-04-21 04:15:05 +04:00
|
|
|
|
2007-04-21 10:30:30 +04:00
|
|
|
OPAL_DECLSPEC int opal_installdirs_base_open(void);
|
|
|
|
OPAL_DECLSPEC int opal_installdirs_base_close(void);
|
2007-04-21 04:15:05 +04:00
|
|
|
|
We (Ralph and Jeff) discovered that if the OPAL_DESTDIR environment
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.
2010-07-14 04:53:08 +04:00
|
|
|
/* 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);
|
|
|
|
|
|
|
|
|
2007-04-21 04:15:05 +04:00
|
|
|
/*
|
|
|
|
* Globals
|
|
|
|
*/
|
|
|
|
OPAL_DECLSPEC extern opal_list_t opal_installdirs_components;
|
|
|
|
|
2009-08-20 15:42:18 +04:00
|
|
|
END_C_DECLS
|
2007-04-21 10:30:30 +04:00
|
|
|
|
2007-04-21 04:15:05 +04:00
|
|
|
#endif /* OPAL_BASE_INSTALLDIRS_H */
|