1
1

Update the CMake scripts, solve a few export symbols for Windows.

This commit was SVN r23976.
Этот коммит содержится в:
Shiqing Fan 2010-11-02 16:39:27 +00:00
родитель 9c15a30b75
Коммит 505efbaa27
6 изменённых файлов: 85 добавлений и 54 удалений

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

@ -94,6 +94,8 @@ INCLUDE (find_flex)
FIND_FLEX()
ADD_SUBDIRECTORY(opal)
# set up the libevent include dirs
INCLUDE_DIRECTORIES (${LIBEVENT_INCLUDE_DIRS})
ADD_SUBDIRECTORY(ompi)
ADD_SUBDIRECTORY(orte)

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

@ -7,58 +7,85 @@
# $HEADER$
#
MESSAGE(STATUS "configure libevent.")
# Only one libevent component should be used, selection is done by editing .windows in_use property.
# set up event include directories.
INCLUDE_DIRECTORIES ("${CURRENT_PATH}/libevent/compat"
"${CURRENT_PATH}/libevent/WIN32-Code/"
"${CURRENT_PATH}/libevent/include/"
"${CURRENT_PATH}/libevent"
"${PROJECT_BINARY_DIR}/mca/event/libevent207/libevent/include/")
FILE(STRINGS ${CURRENT_PATH}/.windows IN_USE REGEX "^in_use=")
IF(WIN32)
IF(IN_USE STREQUAL "0")
# generating config.h
# windows doesn't need this file, just make an empty one
FILE(WRITE ${PROJECT_BINARY_DIR}/mca/event/libevent207/libevent/include/config.h
" /* config.h. Generated automatically by CMake. */ ")
SET(RESULT FALSE)
SET(RESULT_SOURCE_FILES
${RESULT_SOURCE_FILES}
${CURRENT_PATH}/libevent207_component.c
${CURRENT_PATH}/libevent207_module.c
#system sources
${CURRENT_PATH}/libevent/win32select.c
${CURRENT_PATH}/libevent/evthread_win32.c
${CURRENT_PATH}/libevent/buffer_iocp.c
${CURRENT_PATH}/libevent/event_iocp.c
${CURRENT_PATH}/libevent/bufferevent_async.c
#core sources
${CURRENT_PATH}/libevent/event.c
${CURRENT_PATH}/libevent/evthread.c
${CURRENT_PATH}/libevent/buffer.c
${CURRENT_PATH}/libevent/bufferevent.c
${CURRENT_PATH}/libevent/bufferevent_sock.c
${CURRENT_PATH}/libevent/bufferevent_filter.c
${CURRENT_PATH}/libevent/bufferevent_pair.c
${CURRENT_PATH}/libevent/listener.c
${CURRENT_PATH}/libevent/bufferevent_ratelim.c
${CURRENT_PATH}/libevent/evmap.c
${CURRENT_PATH}/libevent/log.c
${CURRENT_PATH}/libevent/evutil.c
${CURRENT_PATH}/libevent/evutil_rand.c
${CURRENT_PATH}/libevent/strlcpy.c
${CURRENT_PATH}/libevent/signal.c
${CURRENT_PATH}/libevent/event_tagging.c
)
ELSE(IN_USE STREQUAL "0")
OMPI_DEF(OPAL_HAVE_WORKING_EVENTOPS 1
"Whether our event component has working event operations or not if not, then assumedly it only has working timers and signals)." 0 1)
IF(LIBEVENT_CONFIG_DONE)
MESSAGE(STATUS "multiple libevent selected, only one is configured.")
SET(RESULT FALSE)
ELSE(WIN32)
SET(RESULT_SOURCE_FILES
${RESULT_SOURCE_FILES}
)
ENDIF(WIN32)
ELSE(LIBEVENT_CONFIG_DONE)
SET(LIBEVENT_FOUND TRUE CACHE INTERNAL "allow only one event mca.")
SET(RESULT TRUE)
MESSAGE(STATUS "configure libevent.")
# set up event include directories.
INCLUDE_DIRECTORIES ("${CURRENT_PATH}/libevent/compat"
"${CURRENT_PATH}/libevent/WIN32-Code/"
"${CURRENT_PATH}/libevent/include/"
"${CURRENT_PATH}/libevent"
"${PROJECT_BINARY_DIR}/mca/event/libevent207/libevent/include/")
SET(LIBEVENT_INCLUDE_DIRS ${CURRENT_PATH}/libevent/compat;${CURRENT_PATH}/libevent/WIN32-Code/;${CURRENT_PATH}/libevent/include/;${CURRENT_PATH}/libevent;${PROJECT_BINARY_DIR}/mca/event/libevent207/libevent/include/
CACHE INTERNAL "the libevent dirs that have to be included on the top level.")
IF(WIN32)
# generating config.h
# windows doesn't need this file, just make an empty one
FILE(WRITE ${PROJECT_BINARY_DIR}/mca/event/libevent207/libevent/include/config.h
" /* config.h. Generated automatically by CMake. */ ")
SET(RESULT_SOURCE_FILES
${RESULT_SOURCE_FILES}
${CURRENT_PATH}/libevent207_component.c
${CURRENT_PATH}/libevent207_module.c
#system sources
${CURRENT_PATH}/libevent/win32select.c
${CURRENT_PATH}/libevent/evthread_win32.c
${CURRENT_PATH}/libevent/buffer_iocp.c
${CURRENT_PATH}/libevent/event_iocp.c
${CURRENT_PATH}/libevent/bufferevent_async.c
#core sources
${CURRENT_PATH}/libevent/event.c
${CURRENT_PATH}/libevent/evthread.c
${CURRENT_PATH}/libevent/buffer.c
${CURRENT_PATH}/libevent/bufferevent.c
${CURRENT_PATH}/libevent/bufferevent_sock.c
${CURRENT_PATH}/libevent/bufferevent_filter.c
${CURRENT_PATH}/libevent/bufferevent_pair.c
${CURRENT_PATH}/libevent/listener.c
${CURRENT_PATH}/libevent/bufferevent_ratelim.c
${CURRENT_PATH}/libevent/evmap.c
${CURRENT_PATH}/libevent/log.c
${CURRENT_PATH}/libevent/evutil.c
${CURRENT_PATH}/libevent/evutil_rand.c
${CURRENT_PATH}/libevent/strlcpy.c
${CURRENT_PATH}/libevent/signal.c
${CURRENT_PATH}/libevent/event_tagging.c
)
OMPI_DEF(OPAL_HAVE_WORKING_EVENTOPS 1
"Whether our event component has working event operations or not if not, then assumedly it only has working timers and signals)." 0 1)
OMPI_DEF(MCA_event_IMPLEMENTATION_HEADER "${CURRENT_PATH}/libevent207.h"
"Header to include for event implementation" 1 1)
ELSE(WIN32)
SET(RESULT_SOURCE_FILES
${RESULT_SOURCE_FILES}
)
ENDIF(WIN32)
SET(RESULT TRUE)
ENDIF(LIBEVENT_CONFIG_DONE)
ENDIF(IN_USE STREQUAL "0")

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

@ -9,5 +9,5 @@
#
not_single_shared_lib=1
in_use=1
required_check=opal_event_config

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

@ -321,7 +321,7 @@ int event_base_set(struct event_base *, struct event *);
registered.
@see event_loopexit(), event_base_loop()
*/
int event_base_loop(struct event_base *, int);
OPAL_DECLSPEC int event_base_loop(struct event_base *, int);
/**
Exit the event loop after the specified time (threadsafe variant).
@ -469,7 +469,7 @@ typedef void (*event_callback_fn)(evutil_socket_t, short, void *);
@see event_add(), event_del(), event_once()
*/
int event_assign(struct event *, struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
OPAL_DECLSPEC int event_assign(struct event *, struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
/**
Create and allocate a new event structure, ready to be added.
@ -523,7 +523,7 @@ int event_base_once(struct event_base *, evutil_socket_t, short, event_callback_
@return 0 if successful, or -1 if an error occurred
@see event_del(), event_set()
*/
int event_add(struct event *, const struct timeval *);
OPAL_DECLSPEC int event_add(struct event *, const struct timeval *);
/**
Remove an event from the set of monitored events.
@ -536,7 +536,7 @@ int event_add(struct event *, const struct timeval *);
@return 0 if successful, or -1 if an error occurred
@see event_add()
*/
int event_del(struct event *);
OPAL_DECLSPEC int event_del(struct event *);
/**

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

@ -42,7 +42,9 @@
#include <string.h>
#include <assert.h>
#include <time.h>
#ifndef WIN32
#include <stdbool.h>
#endif
#include "opal/class/opal_object.h"
#include "opal/threads/mutex.h"

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

@ -1121,7 +1121,7 @@ int orte_wait_event(opal_event_t **event, orte_trigger_event_t *trig,
trig->name = strdup(trigger_name);
/* create the event */
*event = OBJ_NEW(opal_event_t);
*event = (opal_event_t *) malloc(sizeof(opal_event_t));
/* setup the trigger and its associated lock */
OBJ_CONSTRUCT(trig, orte_trigger_event_t);