[Pvfs2-cvs] commit by aching in pvfs2-1/src/io/bmi/bmi_gm:
bmi-gm-addr-list.c bmi-gm-addr-list.h bmi-gm-addressing.h
bmi-gm.c module.mk.in
CVS commit program
cvs at parl.clemson.edu
Mon Jul 21 14:20:00 EDT 2008
Update of /projects/cvsroot/pvfs2-1/src/io/bmi/bmi_gm
In directory parlweb1:/tmp/cvs-serv19729/io/bmi/bmi_gm
Modified Files:
Tag: locking-branch
bmi-gm-addr-list.c bmi-gm-addr-list.h bmi-gm-addressing.h
bmi-gm.c module.mk.in
Log Message:
Reverse merged and ported to HEAD.
Index: bmi-gm-addr-list.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/bmi/bmi_gm/bmi-gm-addr-list.c,v
diff -p -u -r1.5 -r1.5.62.1
--- bmi-gm-addr-list.c 28 Sep 2004 14:03:57 -0000 1.5
+++ bmi-gm-addr-list.c 21 Jul 2008 18:20:00 -0000 1.5.62.1
@@ -21,7 +21,7 @@
* no return value
*/
void gm_addr_add(struct qlist_head *head,
- method_addr_p map)
+ bmi_method_addr_p map)
{
struct gm_addr *gm_addr_data = NULL;
gm_addr_data = map->method_data;
@@ -35,7 +35,7 @@ void gm_addr_add(struct qlist_head *head
*
* no return value
*/
-void gm_addr_del(method_addr_p map)
+void gm_addr_del(bmi_method_addr_p map)
{
struct gm_addr *gm_addr_data = NULL;
gm_addr_data = map->method_data;
@@ -50,9 +50,9 @@ void gm_addr_del(method_addr_p map)
*
* returns pointer to method address on success, NULL on failure
*/
-method_addr_p gm_addr_search(struct qlist_head * head,
- unsigned int node_id,
- unsigned int port_id)
+bmi_method_addr_p gm_addr_search(struct qlist_head * head,
+ unsigned int node_id,
+ unsigned int port_id)
{
struct qlist_head *tmp_entry = NULL;
struct gm_addr *gm_addr_data = NULL;
@@ -63,14 +63,14 @@ method_addr_p gm_addr_search(struct qlis
gm_addr_list);
if (gm_addr_data->node_id == node_id &&
gm_addr_data->port_id == port_id)
- {
- /* pointer magic :) we know that the method addr structure and
- * gm_addr structure are adjacent and contiguous.
- */
- return ((method_addr_p) ((unsigned long) gm_addr_data -
- (unsigned long) sizeof(struct
- method_addr)));
- }
+ {
+ /* pointer magic :) we know that the method addr structure and
+ * gm_addr structure are adjacent and contiguous.
+ */
+ return ((bmi_method_addr_p) ((unsigned long) gm_addr_data -
+ (unsigned long) sizeof(struct
+ bmi_method_addr)));
+ }
}
return (NULL);
}
Index: bmi-gm-addr-list.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/bmi/bmi_gm/bmi-gm-addr-list.h,v
diff -p -u -r1.6 -r1.6.62.1
--- bmi-gm-addr-list.h 28 Sep 2004 14:03:57 -0000 1.6
+++ bmi-gm-addr-list.h 21 Jul 2008 18:20:00 -0000 1.6.62.1
@@ -15,9 +15,9 @@
#define bmi_gm_errno_to_pvfs bmi_errno_to_pvfs
void gm_addr_add(struct qlist_head *head,
- method_addr_p map);
-void gm_addr_del(method_addr_p map);
-method_addr_p gm_addr_search(struct qlist_head *head,
+ bmi_method_addr_p map);
+void gm_addr_del(bmi_method_addr_p map);
+bmi_method_addr_p gm_addr_search(struct qlist_head *head,
unsigned int node_id,
unsigned int port_id);
Index: bmi-gm-addressing.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/bmi/bmi_gm/bmi-gm-addressing.h,v
diff -p -u -r1.8 -r1.8.62.1
--- bmi-gm-addressing.h 29 Sep 2004 19:16:04 -0000 1.8
+++ bmi-gm-addressing.h 21 Jul 2008 18:20:00 -0000 1.8.62.1
@@ -32,6 +32,7 @@ struct gm_addr
struct qlist_head gm_addr_list;
unsigned int node_id;
unsigned int port_id;
+ PVFS_BMI_addr_t bmi_addr;
op_list_p send_queue;
op_list_p handshake_queue;
};
Index: bmi-gm.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/bmi/bmi_gm/bmi-gm.c,v
diff -p -u -r1.82 -r1.82.14.1
--- bmi-gm.c 11 Sep 2006 20:22:02 -0000 1.82
+++ bmi-gm.c 21 Jul 2008 18:20:00 -0000 1.82.14.1
@@ -41,7 +41,7 @@ static unsigned int bmi_gm_reserved_port
#define PINT_CANCELLED_REND_RECLAIM_TIMEOUT (60*15)
/* function prototypes */
-int BMI_gm_initialize(method_addr_p listen_addr,
+int BMI_gm_initialize(bmi_method_addr_p listen_addr,
int method_id,
int init_flags);
int BMI_gm_finalize(void);
@@ -56,7 +56,7 @@ int BMI_gm_memfree(void *buffer,
enum bmi_op_type send_recv);
int BMI_gm_unexpected_free(void *buffer);
int BMI_gm_post_send(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *buffer,
bmi_size_t size,
enum bmi_buffer_type buffer_type,
@@ -64,7 +64,7 @@ int BMI_gm_post_send(bmi_op_id_t * id,
void *user_ptr,
bmi_context_id context_id);
int BMI_gm_post_send_list(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -74,7 +74,7 @@ int BMI_gm_post_send_list(bmi_op_id_t *
void *user_ptr,
bmi_context_id context_id);
int BMI_gm_post_sendunexpected_list(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -84,7 +84,7 @@ int BMI_gm_post_sendunexpected_list(bmi_
void *user_ptr,
bmi_context_id context_id);
int BMI_gm_post_sendunexpected(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *buffer,
bmi_size_t size,
enum bmi_buffer_type buffer_type,
@@ -92,7 +92,7 @@ int BMI_gm_post_sendunexpected(bmi_op_id
void *user_ptr,
bmi_context_id context_id);
int BMI_gm_post_recv(bmi_op_id_t * id,
- method_addr_p src,
+ bmi_method_addr_p src,
void *buffer,
bmi_size_t expected_size,
bmi_size_t * actual_size,
@@ -101,7 +101,7 @@ int BMI_gm_post_recv(bmi_op_id_t * id,
void *user_ptr,
bmi_context_id context_id);
int BMI_gm_post_recv_list(bmi_op_id_t * id,
- method_addr_p src,
+ bmi_method_addr_p src,
void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -137,9 +137,9 @@ int BMI_gm_testcontext(int incount,
bmi_context_id context_id);
int BMI_gm_testunexpected(int incount,
int *outcount,
- struct method_unexpected_info *info,
+ struct bmi_method_unexpected_info *info,
int max_idle_time_ms);
-method_addr_p BMI_gm_method_addr_lookup(const char *id_string);
+bmi_method_addr_p BMI_gm_method_addr_lookup(const char *id_string);
int BMI_gm_open_context(bmi_context_id context_id);
void BMI_gm_close_context(bmi_context_id context_id);
int BMI_gm_cancel(bmi_op_id_t id, bmi_context_id context_id);
@@ -148,35 +148,40 @@ int BMI_gm_get_unexp_maxsize(void);
char BMI_gm_method_name[] = "bmi_gm";
/* exported method interface */
-struct bmi_method_ops bmi_gm_ops = {
+const struct bmi_method_ops bmi_gm_ops = {
.method_name = BMI_gm_method_name,
- .BMI_meth_initialize = BMI_gm_initialize,
- .BMI_meth_finalize = BMI_gm_finalize,
- .BMI_meth_set_info = BMI_gm_set_info,
- .BMI_meth_get_info = BMI_gm_get_info,
- .BMI_meth_memalloc = BMI_gm_memalloc,
- .BMI_meth_memfree = BMI_gm_memfree,
- .BMI_meth_unexpected_free = BMI_gm_unexpected_free,
- .BMI_meth_post_send = BMI_gm_post_send,
- .BMI_meth_post_sendunexpected_list = BMI_gm_post_sendunexpected,
- .BMI_meth_post_recv = BMI_gm_post_recv,
- .BMI_meth_test = BMI_gm_test,
- .BMI_meth_testsome = BMI_gm_testsome,
- .BMI_meth_testcontext = BMI_gm_testcontext,
- .BMI_meth_testunexpected = BMI_gm_testunexpected,
- .BMI_meth_method_addr_lookup = BMI_gm_method_addr_lookup,
- .BMI_meth_post_send_list = BMI_gm_post_send_list,
- .BMI_meth_post_recv_list = BMI_gm_post_recv_list,
- .BMI_meth_post_sendunexpected_list = BMI_gm_post_sendunexpected_list,
- .BMI_meth_open_context = BMI_gm_open_context,
- .BMI_meth_close_context = BMI_gm_close_context,
- .BMI_meth_cancel = BMI_gm_cancel,
- .BMI_meth_rev_lookup_unexpected = NULL,
- .BMI_meth_query_addr_range = NULL,
+ .initialize = BMI_gm_initialize,
+ .finalize = BMI_gm_finalize,
+ .set_info = BMI_gm_set_info,
+ .get_info = BMI_gm_get_info,
+ .memalloc = BMI_gm_memalloc,
+ .memfree = BMI_gm_memfree,
+ .unexpected_free = BMI_gm_unexpected_free,
+ .post_send = BMI_gm_post_send,
+ .post_sendunexpected = BMI_gm_post_sendunexpected,
+ .post_recv = BMI_gm_post_recv,
+ .test = BMI_gm_test,
+ .testsome = BMI_gm_testsome,
+ .testcontext = BMI_gm_testcontext,
+ .testunexpected = BMI_gm_testunexpected,
+ .method_addr_lookup = BMI_gm_method_addr_lookup,
+ .post_send_list = BMI_gm_post_send_list,
+ .post_recv_list = BMI_gm_post_recv_list,
+ .post_sendunexpected_list = BMI_gm_post_sendunexpected_list,
+ .open_context = BMI_gm_open_context,
+ .close_context = BMI_gm_close_context,
+ .cancel = BMI_gm_cancel,
+ .rev_lookup_unexpected = NULL,
+ .query_addr_range = NULL,
};
/* module parameters */
-static method_params_st gm_method_params;
+static struct
+{
+ int method_flags;
+ int method_id;
+ bmi_method_addr_p listen_addr;
+} gm_method_params;
/* op_list_array indices */
enum
@@ -327,11 +332,11 @@ static struct bufferpool *io_pool = NULL
#endif /* ENABLE_GM_BUFPOOL */
/* internal utility functions */
-static method_addr_p alloc_gm_method_addr(void);
-static void dealloc_gm_method_addr(method_addr_p map);
+static bmi_method_addr_p alloc_gm_method_addr(void);
+static void dealloc_gm_method_addr(bmi_method_addr_p map);
static int gm_post_send_check_resource(struct method_op* mop);
static int gm_post_send_build_op(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *buffer,
bmi_size_t size,
bmi_msg_tag_t tag,
@@ -339,7 +344,7 @@ static int gm_post_send_build_op(bmi_op_
int buffer_status,
void *user_ptr, bmi_context_id context_id);
static int gm_post_send_build_op_list(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -371,11 +376,11 @@ static int ctrl_req_handler_rend(bmi_op_
unsigned int port_id);
static int immed_unexp_recv_handler(bmi_size_t size,
bmi_msg_tag_t msg_tag,
- method_addr_p map,
+ bmi_method_addr_p map,
void *buffer);
static int immed_recv_handler(bmi_size_t actual_size,
bmi_msg_tag_t msg_tag,
- method_addr_p map,
+ bmi_method_addr_p map,
void *buffer);
static void put_recv_handler(bmi_op_id_t ctrl_op_id);
static void ctrl_ack_callback(struct gm_port *port,
@@ -412,7 +417,7 @@ static int io_buffers_exhausted(void);
*
* returns 0 on success, -errno on failure
*/
-int BMI_gm_initialize(method_addr_p listen_addr,
+int BMI_gm_initialize(bmi_method_addr_p listen_addr,
int method_id,
int init_flags)
{
@@ -441,7 +446,7 @@ int BMI_gm_initialize(method_addr_p list
sizeof(struct ctrl_msg);
/* zero out our parameter structure and fill it in */
- memset(&gm_method_params, 0, sizeof(struct method_params));
+ memset(&gm_method_params, 0, sizeof(gm_method_params));
gm_method_params.method_id = method_id;
gm_method_params.method_flags = init_flags;
@@ -651,10 +656,10 @@ int BMI_gm_finalize(void)
*
* returns a pointer to method_addr on success, NULL on failure
*/
-method_addr_p BMI_gm_method_addr_lookup(const char *id_string)
+bmi_method_addr_p BMI_gm_method_addr_lookup(const char *id_string)
{
char *gm_string = NULL;
- method_addr_p new_addr = NULL;
+ bmi_method_addr_p new_addr = NULL;
struct gm_addr *gm_data = NULL;
char local_tag[] = "NULL";
char* delim = NULL;
@@ -703,7 +708,8 @@ method_addr_p BMI_gm_method_addr_lookup(
gen_mutex_lock(&interface_mutex);
if (strncmp(gm_string, local_tag, strlen(local_tag)) == 0)
{
- new_addr->local_addr = 1;
+ /* is a local address */
+ ;
}
else if(local_port != NULL)
{
@@ -712,7 +718,7 @@ method_addr_p BMI_gm_method_addr_lookup(
{
gossip_lerr("Error: gm_host_name_to_node_id() failure for: %s.\n",
gm_string);
- dealloc_method_addr(new_addr);
+ bmi_dealloc_method_addr(new_addr);
free(gm_string);
gen_mutex_unlock(&interface_mutex);
return (NULL);
@@ -893,7 +899,7 @@ int BMI_gm_get_info(int option,
* completion, -errno on failure
*/
int BMI_gm_post_send(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *buffer,
bmi_size_t size,
enum bmi_buffer_type buffer_type,
@@ -984,7 +990,7 @@ int BMI_gm_post_send(bmi_op_id_t * id,
* -errno on failure
*/
int BMI_gm_post_send_list(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -1087,7 +1093,7 @@ int BMI_gm_post_send_list(bmi_op_id_t *
* -errno on failure
*/
int BMI_gm_post_sendunexpected_list(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -1178,7 +1184,7 @@ int BMI_gm_post_sendunexpected_list(bmi_
* completion, -errno on failure
*/
int BMI_gm_post_sendunexpected(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *buffer,
bmi_size_t size,
enum bmi_buffer_type buffer_type,
@@ -1250,7 +1256,7 @@ int BMI_gm_post_sendunexpected(bmi_op_id
* completion, -errno on failure
*/
int BMI_gm_post_recv(bmi_op_id_t * id,
- method_addr_p src,
+ bmi_method_addr_p src,
void *buffer,
bmi_size_t expected_size,
bmi_size_t * actual_size,
@@ -1420,7 +1426,7 @@ int BMI_gm_post_recv(bmi_op_id_t * id,
* returns 0 on success, -errno on failure
*/
int BMI_gm_post_recv_list(bmi_op_id_t * id,
- method_addr_p src,
+ bmi_method_addr_p src,
void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -1640,7 +1646,7 @@ int BMI_gm_test(bmi_op_id_t id,
bmi_context_id context_id)
{
int ret = -1;
- method_op_p query_op = (method_op_p)id_gen_safe_lookup(id);
+ method_op_p query_op = (method_op_p)id_gen_fast_lookup(id);
struct gm_op *gm_op_data = query_op->method_data;
*outcount = 0;
@@ -1735,7 +1741,7 @@ int BMI_gm_testsome(int incount,
{
if(id_array[i])
{
- query_op = (method_op_p)id_gen_safe_lookup(id_array[i]);
+ query_op = (method_op_p)id_gen_fast_lookup(id_array[i]);
gm_op_data = query_op->method_data;
if(gm_op_data->complete)
{
@@ -1781,7 +1787,7 @@ int BMI_gm_testsome(int incount,
{
if(id_array[i])
{
- query_op = (method_op_p)id_gen_safe_lookup(id_array[i]);
+ query_op = (method_op_p)id_gen_fast_lookup(id_array[i]);
gm_op_data = query_op->method_data;
if(gm_op_data->complete)
{
@@ -1924,7 +1930,7 @@ int BMI_gm_testcontext(int incount,
*/
int BMI_gm_testunexpected(int incount,
int *outcount,
- struct method_unexpected_info *info,
+ struct bmi_method_unexpected_info *info,
int max_idle_time_ms)
{
int ret = -1;
@@ -2028,10 +2034,10 @@ void BMI_gm_close_context(bmi_context_id
*
* no return value
*/
-static void dealloc_gm_method_addr(method_addr_p map)
+static void dealloc_gm_method_addr(bmi_method_addr_p map)
{
- dealloc_method_addr(map);
+ bmi_dealloc_method_addr(map);
return;
}
@@ -2044,14 +2050,14 @@ static void dealloc_gm_method_addr(metho
*
* returns pointer to struct on success, NULL on failure
*/
-static method_addr_p alloc_gm_method_addr(void)
+static bmi_method_addr_p alloc_gm_method_addr(void)
{
- struct method_addr *my_method_addr = NULL;
+ struct bmi_method_addr *my_method_addr = NULL;
struct gm_addr *gm_data = NULL;
- my_method_addr = alloc_method_addr(gm_method_params.method_id, sizeof(struct
- gm_addr));
+ my_method_addr = bmi_alloc_method_addr(gm_method_params.method_id,
+ sizeof(struct gm_addr));
if (!my_method_addr)
{
return (NULL);
@@ -2078,7 +2084,7 @@ static method_op_p alloc_gm_method_op(vo
{
method_op_p my_method_op = NULL;
- my_method_op = alloc_method_op(sizeof(struct gm_op));
+ my_method_op = bmi_alloc_method_op(sizeof(struct gm_op));
/* note that we trust the alloc_method_addr() function to have zeroed
* out the structures for us already
@@ -2097,7 +2103,7 @@ static method_op_p alloc_gm_method_op(vo
*/
void dealloc_gm_method_op(method_op_p op_p)
{
- dealloc_method_op(op_p);
+ bmi_dealloc_method_op(op_p);
return;
}
@@ -2109,7 +2115,7 @@ void dealloc_gm_method_op(method_op_p op
* returns 0 on success, -errno on failure
*/
static int gm_post_send_build_op_list(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *const *buffer_list,
const bmi_size_t *size_list,
int list_count,
@@ -2162,7 +2168,7 @@ static int gm_post_send_build_op_list(bm
* returns 0 on success, -errno on failure
*/
static int gm_post_send_build_op(bmi_op_id_t * id,
- method_addr_p dest,
+ bmi_method_addr_p dest,
const void *buffer,
bmi_size_t size,
bmi_msg_tag_t tag,
@@ -2883,7 +2889,7 @@ void alarm_callback(void *context)
*/
static int immed_unexp_recv_handler(bmi_size_t size,
bmi_msg_tag_t msg_tag,
- method_addr_p map,
+ bmi_method_addr_p map,
void *buffer)
{
method_op_p new_method_op = NULL;
@@ -2920,7 +2926,7 @@ static int immed_unexp_recv_handler(bmi_
*/
static int immed_recv_handler(bmi_size_t actual_size,
bmi_msg_tag_t msg_tag,
- method_addr_p map,
+ bmi_method_addr_p map,
void *buffer)
{
method_op_p new_method_op = NULL;
@@ -2959,7 +2965,7 @@ static int recv_event_handler(gm_recv_ev
{
struct ctrl_msg ctrl_copy;
int ret = bmi_gm_errno_to_pvfs(-ENOSYS);
- method_addr_p map = NULL;
+ bmi_method_addr_p map = NULL;
struct op_list_search_key key;
void *tmp_buffer = NULL;
method_op_p query_op = NULL;
@@ -3141,11 +3147,11 @@ static int recv_event_handler(gm_recv_ev
gm_addr_data->node_id = gm_ntohs(poll_event->recv.sender_node_id);
gm_addr_data->port_id = gm_ntohc(poll_event->recv.sender_port_id);
/* let the bmi layer know about it */
- ret = bmi_method_addr_reg_callback(map);
- if (ret < 0)
+ gm_addr_data->bmi_addr = bmi_method_addr_reg_callback(map);
+ if (!gm_addr_data->bmi_addr)
{
dealloc_gm_method_addr(map);
- return (ret);
+ return (-BMI_ENOMEM);
}
/* keep up with it ourselves also */
gm_addr_add(&gm_addr_list, map);
@@ -3198,7 +3204,7 @@ static void put_recv_handler(bmi_op_id_t
int i;
/* find the matching operation */
- query_op = id_gen_safe_lookup(ctrl_op_id);
+ query_op = id_gen_fast_lookup(ctrl_op_id);
if(!query_op)
{
/* operation must have been cancelled; just return */
@@ -3316,7 +3322,7 @@ static void ctrl_ack_handler(bmi_op_id_t
*/
/* find the matching operation */
- query_op = id_gen_safe_lookup(ctrl_op_id);
+ query_op = id_gen_fast_lookup(ctrl_op_id);
if(!query_op)
{
@@ -3830,7 +3836,7 @@ static int ctrl_req_handler_rend(bmi_op_
unsigned int node_id,
unsigned int port_id)
{
- method_addr_p map = NULL;
+ bmi_method_addr_p map = NULL;
struct gm_addr *gm_addr_data = NULL;
struct gm_op *gm_op_data = NULL;
method_op_p active_method_op = NULL;
@@ -3953,7 +3959,7 @@ static int ctrl_req_handler_rend(bmi_op_
*/
int BMI_gm_cancel(bmi_op_id_t id, bmi_context_id context_id)
{
- method_op_p query_op = (method_op_p)id_gen_safe_lookup(id);
+ method_op_p query_op = (method_op_p)id_gen_fast_lookup(id);
method_op_p tmp_op;
struct gm_op *gm_op_data = query_op->method_data;
struct op_list_search_key key;
Index: module.mk.in
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/bmi/bmi_gm/module.mk.in,v
diff -p -u -r1.1 -r1.1.72.1
--- module.mk.in 12 May 2003 17:59:13 -0000 1.1
+++ module.mk.in 21 Jul 2008 18:20:00 -0000 1.1.72.1
@@ -1,14 +1,31 @@
-BUILD_GM = @BUILD_GM@
+#
+# Makefile stub for bmi_gm.
+#
+# Copyright (C) 2008 Pete Wyckoff <pw at osc.edu>
+#
+# See COPYING in top-level directory.
+#
-# only build GM module if configure detected GM
-ifdef BUILD_GM
- DIR := src/io/bmi/bmi_gm
- LIBSRC += \
- $(DIR)/bmi-gm-addr-list.c \
- $(DIR)/bmi-gm-bufferpool.c \
- $(DIR)/bmi-gm.c
- SERVERSRC += \
- $(DIR)/bmi-gm-addr-list.c \
- $(DIR)/bmi-gm-bufferpool.c \
- $(DIR)/bmi-gm.c
-endif
+# only do any of this if configure decided to use GM
+ifneq (,$(BUILD_GM))
+
+#
+# Local definitions.
+#
+DIR := src/io/bmi/bmi_gm
+cfiles := bmi-gm-addr-list.c bmi-gm-bufferpool.c bmi-gm.c
+
+#
+# Export these to the top Makefile to tell it what to build.
+#
+src := $(patsubst %,$(DIR)/%,$(cfiles))
+LIBSRC += $(src)
+SERVERSRC += $(src)
+
+#
+# Extra cflags for files in this directory.
+# TODO: later on we will want the ability to modify this at configure time
+#
+MODCFLAGS_$(DIR) := -I at GM_INCDIR@ -I at GM_INCDIR@/gm -DENABLE_GM_BUFPOOL
+
+endif # BUILD_GM
More information about the Pvfs2-cvs
mailing list