9
9
* University of Stuttgart. All rights reserved.
10
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
11
* 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.
13
13
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
14
14
* reserved.
15
15
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
@@ -75,6 +75,8 @@ struct options_data_t {
75
75
char * req_file ;
76
76
char * path_includedir ;
77
77
char * path_libdir ;
78
+ char * path_opalincludedir ;
79
+ char * path_opallibdir ;
78
80
};
79
81
80
82
static struct options_data_t * options_data = NULL ;
@@ -124,6 +126,8 @@ options_data_init(struct options_data_t *data)
124
126
data -> req_file = NULL ;
125
127
data -> path_includedir = NULL ;
126
128
data -> path_libdir = NULL ;
129
+ data -> path_opalincludedir = NULL ;
130
+ data -> path_opallibdir = NULL ;
127
131
}
128
132
129
133
static void
@@ -150,6 +154,8 @@ options_data_free(struct options_data_t *data)
150
154
if (NULL != data -> req_file ) free (data -> req_file );
151
155
if (NULL != data -> path_includedir ) free (data -> path_includedir );
152
156
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 );
153
159
}
154
160
155
161
static void
@@ -328,6 +334,30 @@ data_callback(const char *key, const char *value)
328
334
opal_argv_append_nosize (& options_data [parse_options_idx ].link_flags , line );
329
335
free (line );
330
336
}
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
+ }
331
361
}
332
362
}
333
363
0 commit comments