Skip to content

Commit e8b4a4c

Browse files
committed
wrappers: add support for opallibdir, opalincludedir
1 parent eeddb7a commit e8b4a4c

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

opal/tools/wrappers/opal_wrapper.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
12+
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
1414
* reserved.
1515
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
@@ -75,6 +75,8 @@ struct options_data_t {
7575
char *req_file;
7676
char *path_includedir;
7777
char *path_libdir;
78+
char *path_opalincludedir;
79+
char *path_opallibdir;
7880
};
7981

8082
static struct options_data_t *options_data = NULL;
@@ -124,6 +126,8 @@ options_data_init(struct options_data_t *data)
124126
data->req_file = NULL;
125127
data->path_includedir = NULL;
126128
data->path_libdir = NULL;
129+
data->path_opalincludedir = NULL;
130+
data->path_opallibdir = NULL;
127131
}
128132

129133
static void
@@ -150,6 +154,8 @@ options_data_free(struct options_data_t *data)
150154
if (NULL != data->req_file) free(data->req_file);
151155
if (NULL != data->path_includedir) free(data->path_includedir);
152156
if (NULL != data->path_libdir) free(data->path_libdir);
157+
if (NULL != data->path_opalincludedir) free(data->path_opalincludedir);
158+
if (NULL != data->path_opallibdir) free(data->path_opallibdir);
153159
}
154160

155161
static void
@@ -328,6 +334,30 @@ data_callback(const char *key, const char *value)
328334
opal_argv_append_nosize(&options_data[parse_options_idx].link_flags, line);
329335
free(line);
330336
}
337+
} else if (0 == strcmp(key, "opalincludedir")) {
338+
printf("EXPANDING!\n");
339+
if (NULL != value) {
340+
options_data[parse_options_idx].path_opalincludedir =
341+
opal_install_dirs_expand(value);
342+
if (0 != strcmp(options_data[parse_options_idx].path_opalincludedir, "/usr/include") ||
343+
0 == strncmp(options_data[parse_options_idx].language, "Fortran", strlen("Fortran"))) {
344+
char *line;
345+
asprintf(&line, OPAL_INCLUDE_FLAG"%s",
346+
options_data[parse_options_idx].path_opalincludedir);
347+
opal_argv_append_nosize(&options_data[parse_options_idx].preproc_flags, line);
348+
free(line);
349+
}
350+
}
351+
} else if (0 == strcmp(key, "opallibdir")) {
352+
if (NULL != value) options_data[parse_options_idx].path_opallibdir =
353+
opal_install_dirs_expand(value);
354+
if (0 != strcmp(options_data[parse_options_idx].path_opallibdir, "/usr/lib")) {
355+
char *line;
356+
asprintf(&line, OPAL_LIBDIR_FLAG"%s",
357+
options_data[parse_options_idx].path_opallibdir);
358+
opal_argv_append_nosize(&options_data[parse_options_idx].link_flags, line);
359+
free(line);
360+
}
331361
}
332362
}
333363

0 commit comments

Comments
 (0)