1
1

wrappers: add support for opallibdir, opalincludedir

Этот коммит содержится в:
Jeff Squyres 2015-10-12 15:18:31 -07:00
родитель eeddb7abc1
Коммит e8b4a4c800

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
@ -75,6 +75,8 @@ struct options_data_t {
char *req_file;
char *path_includedir;
char *path_libdir;
char *path_opalincludedir;
char *path_opallibdir;
};
static struct options_data_t *options_data = NULL;
@ -124,6 +126,8 @@ options_data_init(struct options_data_t *data)
data->req_file = NULL;
data->path_includedir = NULL;
data->path_libdir = NULL;
data->path_opalincludedir = NULL;
data->path_opallibdir = NULL;
}
static void
@ -150,6 +154,8 @@ options_data_free(struct options_data_t *data)
if (NULL != data->req_file) free(data->req_file);
if (NULL != data->path_includedir) free(data->path_includedir);
if (NULL != data->path_libdir) free(data->path_libdir);
if (NULL != data->path_opalincludedir) free(data->path_opalincludedir);
if (NULL != data->path_opallibdir) free(data->path_opallibdir);
}
static void
@ -328,6 +334,30 @@ data_callback(const char *key, const char *value)
opal_argv_append_nosize(&options_data[parse_options_idx].link_flags, line);
free(line);
}
} else if (0 == strcmp(key, "opalincludedir")) {
printf("EXPANDING!\n");
if (NULL != value) {
options_data[parse_options_idx].path_opalincludedir =
opal_install_dirs_expand(value);
if (0 != strcmp(options_data[parse_options_idx].path_opalincludedir, "/usr/include") ||
0 == strncmp(options_data[parse_options_idx].language, "Fortran", strlen("Fortran"))) {
char *line;
asprintf(&line, OPAL_INCLUDE_FLAG"%s",
options_data[parse_options_idx].path_opalincludedir);
opal_argv_append_nosize(&options_data[parse_options_idx].preproc_flags, line);
free(line);
}
}
} else if (0 == strcmp(key, "opallibdir")) {
if (NULL != value) options_data[parse_options_idx].path_opallibdir =
opal_install_dirs_expand(value);
if (0 != strcmp(options_data[parse_options_idx].path_opallibdir, "/usr/lib")) {
char *line;
asprintf(&line, OPAL_LIBDIR_FLAG"%s",
options_data[parse_options_idx].path_opallibdir);
opal_argv_append_nosize(&options_data[parse_options_idx].link_flags, line);
free(line);
}
}
}